From: Marcin Koziej Date: Mon, 11 Feb 2013 16:35:22 +0000 (+0100) Subject: fix checking whether wybor is single/multiple X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/b25d910280f7c8573560bbe9ca2718332c438ec3 fix checking whether wybor is single/multiple --- diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index 88331a9..424e10c 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -292,14 +292,14 @@ class Wybor(Exercise): pre, post = super(Wybor, self).handle_cwiczenie(element) is_single_choice = True pytania = element.xpath(".//pytanie") - if not pytania: + if not pytania: pytania = [element] for p in pytania: solutions = re.split(r"[, ]+", p.attrib['rozw']) if len(solutions) != 1: is_single_choice = False break - choices = element.xpath(".//*[@nazwa]") + choices = p.xpath(".//*[@nazwa]") uniq = set() for n in choices: uniq.add(n.attrib['nazwa']) if len(choices) != len(uniq):