From b25d910280f7c8573560bbe9ca2718332c438ec3 Mon Sep 17 00:00:00 2001 From: Marcin Koziej Date: Mon, 11 Feb 2013 17:35:22 +0100 Subject: [PATCH 1/1] fix checking whether wybor is single/multiple --- librarian/pyhtml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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): -- 2.20.1