+ return '<span class="zastap question-piece" data-solution="%(rozw)s">' % element.attrib, '</span>'
+
+
+class Przyporzadkuj(Excercise):
+ def handle_lista(self, lista):
+ print "in lista %s %s" % (lista.attrib, self.options)
+ if 'nazwa' in lista.attrib:
+ attrs = {
+ 'data-name': lista.attrib['nazwa'],
+ 'class': 'predicate'
+ }
+ self.options = {'predicate': True}
+ elif 'cel' in lista.attrib:
+ attrs = {
+ 'data-target': lista.attrib['cel'],
+ 'class': 'subject'
+ }
+ self.options = {'subject': True}
+ else:
+ attrs = {}
+ return super(Przyporzadkuj, self).handle_lista(lista, attrs)
+
+
+ def handle_punkt(self, element):
+ print "in punkt %s %s" % (element.attrib, self.options)
+
+ if self.options['subject']:
+ return '<li data-solution="%(rozw)s" class="question-piece draggable multiple">' % element.attrib, '</li>'
+ elif self.options['predicate']:
+ return '<li data-predicate="%(nazwa)s">' % element.attrib, '<ul class="subjects droppable"><li>Placeholder</li></ul></li>'
+ else:
+ return super(Przyporzadkuj, self).handle_punkt(element)