Browse Source

Merge branch 'master' of git.someserver.de:seopardy

Sebastian Lohff 5 years ago
parent
commit
c771f24ff6
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      question.py

+ 6
- 0
question.py View File

@@ -69,6 +69,12 @@ class Questions(object):
69 69
 				if any([x not in q.keys() for x in ["Question", "Answer", "Type"]]):
70 70
 					raise QuestionException("Question %d from section %d (%s) is missing one of the keywords Question, Answer or Type" % (j, i, sec["Section"]))
71 71
 
72
+				# check wether the question is a string (else we'll get display errors)
73
+				if type(q["Question"]) != str:
74
+					raise QuestionException("Question %d from section %d (%s) needs to have a string as question (put the Question in \"\")" % (j, i, sec["Section"]))
75
+					print(type(q["Question"]))
76
+
77
+
72 78
 				# check for keys we do not know
73 79
 				for key in q.keys():
74 80
 					if key not in self.QUESTION_KEYS:

Loading…
Cancel
Save