X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/ab001bc37c0f8ee0bb92b8762f5151b5b93f6ccc..aeed223c57f453d068216f86941b7de963190536:/librarian/pyhtml.py diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index bb835ae..d3314cc 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -94,7 +94,8 @@ class EduModule(Xmill): 'uporzadkuj': Uporzadkuj, 'luki': Luki, 'zastap': Zastap, - 'przyporzadkuj': Przyporzadkuj + 'przyporzadkuj': Przyporzadkuj, + 'prawdafalsz': PrawdaFalsz } typ = element.attrib['typ'] @@ -186,8 +187,9 @@ class Wybor(Excercise): self.piece_counter += 1 no = self.piece_counter eid = "q%(qc)d_%(no)d" % locals() + aname = element.attrib.get('nazwa', None) return u""" -
  • +
  • " @@ -251,11 +253,24 @@ class Przyporzadkuj(Excercise): if self.options['subject']: return '
  • ' % element.attrib, '
  • ' elif self.options['predicate']: + print etree.tostring(element, encoding=unicode) return '
  • ' % element.attrib, '
  • ' else: return super(Przyporzadkuj, self).handle_punkt(element) +class PrawdaFalsz(Excercise): + def handle_punkt(self, element): + if 'rozw' in element.attrib: + return u'''
  • + + Prawda + Fałsz + ''' % {'prawda': 'true', 'falsz': 'false'}[element.attrib['rozw']], '
  • ' + else: + return super(PrawdaFalsz, self).handle_punkt(element) + + def transform(wldoc, stylesheet='edumed', options=None, flags=None): """Transforms the WL document to XHTML.