Merge branch 'master' of git.someserver.de:seopardy
This commit is contained in:
commit
c771f24ff6
|
@ -69,6 +69,12 @@ class Questions(object):
|
||||||
if any([x not in q.keys() for x in ["Question", "Answer", "Type"]]):
|
if any([x not in q.keys() for x in ["Question", "Answer", "Type"]]):
|
||||||
raise QuestionException("Question %d from section %d (%s) is missing one of the keywords Question, Answer or Type" % (j, i, sec["Section"]))
|
raise QuestionException("Question %d from section %d (%s) is missing one of the keywords Question, Answer or Type" % (j, i, sec["Section"]))
|
||||||
|
|
||||||
|
# check wether the question is a string (else we'll get display errors)
|
||||||
|
if type(q["Question"]) != str:
|
||||||
|
raise QuestionException("Question %d from section %d (%s) needs to have a string as question (put the Question in \"\")" % (j, i, sec["Section"]))
|
||||||
|
print(type(q["Question"]))
|
||||||
|
|
||||||
|
|
||||||
# check for keys we do not know
|
# check for keys we do not know
|
||||||
for key in q.keys():
|
for key in q.keys():
|
||||||
if key not in self.QUESTION_KEYS:
|
if key not in self.QUESTION_KEYS:
|
||||||
|
|
Loading…
Reference in New Issue