From: Marcin Koziej Date: Wed, 9 Jan 2013 09:45:21 +0000 (+0100) Subject: add if missing X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/ba8c5f53b309b7ee2d993397e24640615777ab16 add if missing --- diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index bd3bbce..909217a 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -142,11 +142,11 @@ class Excercise(EduModule): self.question_counter = 0 self.piece_counter = 0 - return u""" + pre = u"""
-""" % element.attrib, \ -u""" +""" % element.attrib + post = u"""
@@ -155,8 +155,16 @@ u"""
""" + # Add a single tag if it's not there + if not element.xpath(".//pytanie"): + qpre, qpost = self.handle_pytanie(element) + pre = pre + qpre + post = qpost + post + return pre, post def handle_pytanie(self, element): + """This will handle element, when there is no + """ self.question_counter += 1 self.piece_counter = 0 solution = element.attrib.get('rozw', None) @@ -189,7 +197,6 @@ class Uporzadkuj(Excercise): def handle_cwiczenie(self, element): pre, post = super(Uporzadkuj, self).handle_cwiczenie(element) order_items = element.xpath(".//punkt/@rozw") - import pdb if order_items == []: pdb.set_trace() return pre + u"""
""" % \