Make get_question() a bit more interesting
authorW. Trevor King <wking@tremily.us>
Tue, 5 Feb 2013 14:07:18 +0000 (09:07 -0500)
committerW. Trevor King <wking@tremily.us>
Tue, 5 Feb 2013 14:07:59 +0000 (09:07 -0500)
quizzer/ui/__init__.py

index afb07266db8b837120715b60d164f2985afd85b1..eb8682d7220a52dc1178880bb62922868c649b19 100644 (file)
@@ -10,7 +10,8 @@ class UserInterface (object):
         raise NotImplementedError()
 
     def get_question(self):
-        return self.quiz[0]
+        remaining = [q for q in self.quiz if q not in self.answers]
+        return remaining[0]
 
     def process_answer(self, question, answer):
         if question not in self.answers: