From ab001bc37c0f8ee0bb92b8762f5151b5b93f6ccc Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Wed, 9 Jan 2013 17:17:31 +0100 Subject: [PATCH] excercises almost done with checking --- librarian/pyhtml.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index 621340e..bb835ae 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -137,6 +137,9 @@ class Excercise(EduModule): 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 @@ -173,7 +176,7 @@ class Excercise(EduModule): return '
' %\ (self.question_counter, solution_s), \ - "
" + "" class Wybor(Excercise): @@ -205,7 +208,7 @@ Overrides the returned content default handle_pytanie return u"""
""" % \ (','.join(order_items), self.question_counter), \ u"""
""" - + def handle_punkt(self, element): return """
  • """ \ % element.attrib,\ @@ -217,7 +220,6 @@ class Luki(Excercise): return '' % element.text - class Zastap(Excercise): def handle_zastap(self, element): return '' % element.attrib, '' @@ -240,22 +242,20 @@ class Przyporzadkuj(Excercise): self.options = {'subject': True} else: attrs = {} - return super(Przyporzadkuj, self).handle_lista(lista, attrs) - + pre, post = super(Przyporzadkuj, self).handle_lista(lista, attrs) + return pre, post + '
    ' def handle_punkt(self, element): print "in punkt %s %s" % (element.attrib, self.options) if self.options['subject']: - return '
  • ' % element.attrib, '
  • ' + return '
  • ' % element.attrib, '
  • ' elif self.options['predicate']: - return '
  • ' % element.attrib, '
  • ' + return '
  • ' % element.attrib, '
  • ' else: return super(Przyporzadkuj, self).handle_punkt(element) - - def transform(wldoc, stylesheet='edumed', options=None, flags=None): """Transforms the WL document to XHTML. @@ -263,7 +263,6 @@ def transform(wldoc, stylesheet='edumed', options=None, flags=None): otherwise returns True if file has been written,False if it hasn't. File won't be written if it has no content. """ - edumod = EduModule(options) # from pdb import set_trace; set_trace() html = edumod.generate(wldoc.edoc.getroot()) -- 2.20.1