Fixes #3290: Support for Przyporzadkuj with short items.
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Wed, 26 Feb 2014 14:11:17 +0000 (15:11 +0100)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Wed, 26 Feb 2014 14:11:17 +0000 (15:11 +0100)
librarian/pyhtml.py

index f6dfdf5..9264c15 100644 (file)
@@ -564,6 +564,8 @@ class Przyporzadkuj(Exercise):
                 'data-target': lista.attrib['cel'],
                 'class': 'subject'
             }
+            if lista.attrib.get('krotkie'):
+                self.options = {'short': True}
             self.options = {'subject': True}
         else:
             attrs = {}
@@ -576,7 +578,10 @@ class Przyporzadkuj(Exercise):
             if self.options['handles']:
                 return '<li><span data-solution="%s" data-no="%s" class="question-piece draggable handle add-li">%s</span>' % (element.attrib.get('rozw', ''), self.piece_counter, self.piece_counter), '</li>'
             else:
-                return '<li data-solution="%s" data-no="%s" class="question-piece draggable">' % (element.attrib.get('rozw', ''), self.piece_counter), '</li>'
+                extra_class = ""
+                if self.options['short']:
+                    extra_class += ' short'
+                return '<li data-solution="%s" data-no="%s" class="question-piece draggable%s">' % (element.attrib.get('rozw', ''), self.piece_counter, extra_class), '</li>'
 
         elif self.options['predicate']:
             if self.options['min']: