I want to make a quiz (5 questions) in which a timer (50 seconds) is running. The quiz should end either when the time is up or the user answers all questions.
I am pretty new to the coding world, but I already made the quiz (in German) with if
, elif
, else
. So, the only thing is that I have no idea how to make the timer and make it skip other questions if the user is too slow.
It is hard to answer without seeing your code. But if you set up a timer:
As the user answers the quiz you can store his answers in a dict_of_answers = {}
. By adding it dict_of_answers[question_number] = answer
.
At the end of the timer you can call the function that loads the result of the quiz by checking what is the current answers you have in dict_of_answers