%(counter)d.
+
%(counter)d.
%(opis)s
%(wskazowki)s
@@ -99,28 +76,81 @@ class EduModule(Xmill):
handle_opis = ifoption(activity=False)(tag('div', 'description'))
handle_wskazowki = ifoption(activity=False)(tag('div', ('hints', 'teacher')))
-
+
@ifoption(activity=False)
@tagged('div', 'materials')
def handle_pomoce(self, _):
return "Pomoce: ", ""
-
+
def handle_czas(self, *_):
return
def handle_forma(self, *_):
return
-
+
+ def handle_cwiczenie(self, element):
+ excercise_handlers = {
+ 'wybor': Wybor,
+ 'uporzadkuj': Uporzadkuj,
+ 'luki': Luki,
+ 'zastap': Zastap,
+ 'przyporzadkuj': Przyporzadkuj,
+ 'prawdafalsz': PrawdaFalsz
+ }
+
+ typ = element.attrib['typ']
+ handler = excercise_handlers[typ](self.options)
+ return handler.generate(element)
+
+ # Lists
+ def handle_lista(self, element, attrs={}):
+ ltype = element.attrib.get('typ', 'punkt')
+ if ltype == 'slowniczek':
+ self.options = {'slowniczek': True}
+ return '
', '
'
+### robie teraz punkty wyboru
+ listtag = {'num': 'ol',
+ 'punkt': 'ul',
+ 'alfa': 'ul',
+ 'czytelnia': 'ul'}[ltype]
+
+ classes = attrs.get('class', '')
+ if classes: del attrs['class']
+
+ attrs_s = ' '.join(['%s="%s"' % kv for kv in attrs.items()])
+ if attrs_s: attrs_s = ' ' + attrs_s
+
+ return '<%s class="lista %s %s"%s>' % (listtag, ltype, classes, attrs_s), '%s>' % listtag
+
+ def handle_punkt(self, element):
+ if self.options['slowniczek']:
+ return '
', '
'
+ else:
+ return '
', ''
+
+ def handle_rdf__RDF(self, _):
+ # ustal w opcjach rzeczy :D
+ return
+
+
+class Excercise(EduModule):
+ def __init__(self, *args, **kw):
+ self.question_counter = 0
+ super(Excercise, self).__init__(*args, **kw)
+
+ def handle_rozw_kom(self, element):
+ return None
+
def handle_cwiczenie(self, element):
self.options = {'excercise': element.attrib['typ']}
self.question_counter = 0
self.piece_counter = 0
- return u"""
+ pre = u"""