Skip to content

Commit 8861f5f

Browse files
author
fcrt
committed
update quizzes and screenshots
1 parent 6abd3d7 commit 8861f5f

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

images/screenshotplayer1.png

3.54 KB
Loading

images/screenshotplayer2.png

1.25 KB
Loading

quizcreator

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ while True:
7474
question = editorValues['question']
7575
correct_answer = editorValues['correct_answer']
7676
wrong_answers = editorValues['wrong_answers'].split(',')
77-
newquestion = QuizQuestion(question, correct_answer, wrong_answers, int(editorValues['time_given']))
77+
try:
78+
time_given = int(editorValues['time_given'])
79+
except ValueError:
80+
time_given = 10
81+
newquestion = QuizQuestion(question, correct_answer, wrong_answers, time_given)
7882
questionList.append(newquestion)
7983
questionEditorWindow.close()
8084
mainWindow["quizquestionentry"].update(questionList)
@@ -92,7 +96,7 @@ while True:
9296

9397
if event == 'Open':
9498
try:
95-
filename = sg.popup_get_file("Open quiz", initial_folder="quizzes", no_window=True)
99+
filename = sg.popup_get_file("Open quiz", initial_folder="quizzes",no_window=True)
96100
with open(filename, 'r') as file:
97101
quizDicts = json.load(file)
98102
questionList = []

quizzes/elements.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"title": "Elements!", "listOfQuestions": [{"question": "What is the symbol for Iron?", "correctAnswer": "Fe", "wrongAnswers": ["FE", "Ir", "In"], "timeout": 10}, {"question": "What is the symbol for Tungsten?", "correctAnswer": "W", "wrongAnswers": ["Tu", "Tn", "Ta"], "timeout": 10}, {"question": "What does Mg stand for?", "correctAnswer": "Magnesium", "wrongAnswers": ["Manganese", "Mendelevium", "Moscovium"], "timeout": 10}, {"question": "Which two groups are in the S group?", "correctAnswer": "1 & 2", "wrongAnswers": ["6 & 7", "5 & 6", "7 & 8", " All of them!"], "timeout": 15}, {"question": "Which element has an atomic number of 118?", "correctAnswer": "Organesson", "wrongAnswers": ["Hydrogen", "Tenissine", "Francium"], "timeout": 10}, {"question": "What is the group number for Iodine?", "correctAnswer": "Group 7", "wrongAnswers": ["Group 1", "Group 8", "Group 17"], "timeout": 10}, {"question": "How many electrons does hydrogen have?", "correctAnswer": "1", "wrongAnswers": ["2", "3", "4", "5", "6", "7", "8"], "timeout": 10}], "time given": ""}

0 commit comments

Comments
 (0)