fixes the empty answer problem mentioned by David

This commit is contained in:
waldek 2021-05-24 16:49:17 +02:00
parent 88f35d85e5
commit 14322caf3e
1 changed files with 2 additions and 0 deletions

View File

@ -68,6 +68,8 @@ class Question(object):
"""needs quite some work""" """needs quite some work"""
if not isinstance(answers, list): if not isinstance(answers, list):
raise TypeError raise TypeError
if len(answers) == 0:
return False
right_answers = list(self._answers) # need a copy so we don't change for future questions right_answers = list(self._answers) # need a copy so we don't change for future questions
for answer in answers: for answer in answers:
try: try: