In this PowerPoint Quiz Module, we will be designing our...Read More
In this Interactive PowerPoint Quiz Game Module, we shall be adding a time limit counter countdown in the corner of each question slide which will show the progress of the time.
As soon as the time limit is up, the student is redirected to their result slide report card.
This brings excitement to the quiz game and allows the students to be more engaged and focused in their task of answering the questions prepared by the teacher in the PowerPoint Quiz Show which has a timer countdown, can calculate the number of correct and wrong answer, generate a report card and also a certificate!
Global QuizCompleted As Boolean
As soon as the time limit is up, you are redirected to the result slide.
However, the redirection takes place even if you have completed answering all the questions in the PPT Quiz Game, so we add a Global Boolean whose value would affect codes in Module1 and SlideLayout24 and that becomes a factor on whether the user has to be redirected or not.
If QuizCompleted = False, only then will you be redirected to the report card slide of the PPT Quiz Game.
We can give the boolean the value of True if the student has already completed the quiz, thus preventing the unwanted redirection in PowerPoint.
We can easily make a countdown timer without making unnecessary animations. We just need the above VBA Macro which can generate a countdown timer across multiple slides in PowerPoint. Just embed that in your Quiz Slides and you are good to go.
You can customise the format of the countdown by changing the “hh:mm:ss” accordingly.
For having only seconds: “ss”
For having minutes and seconds: “nn:ss” (yes, use nn, NOT mm)
Global QuizCompleted As Boolean Sub timelimit() Dim time As Date time = Now() Dim count As Integer count = 30 time = DateAdd("s", count, time) Do Until time < Now() DoEvents For i = 3 To 8 'change as per your question slide numbers' ActivePresentation.Slides(i).Shapes("countdown").TextFrame.TextRange = Format((time - Now()), "hh:mm:ss") Next i If time < Now() And QuizCompleted = False Then MsgBox "Time Up!" ActivePresentation.SlideShowWindow.View.GotoSlide (9) End If Loop End Sub