How to Create Advanced Quiz Game in PowerPoint using VBA Coding

🚀 Report Card, Print Certificate, Timer, Shuffle Questions, and Connect with Excel!

This Multiple-Choice Quiz Game will change how you view PowerPoint. This tutorial includes step-by-step instructions and provides free template downloads. 

Calculate Points Scored: +10 for correct answers and -5 for wrong answers.
Generate Report Cards: Number of correct/wrong/skipped answers, percentage and points.
Print Certificate as PDF: Get the user’s name and occupation, and print a customised certificate.
Countdown Timer: Embed a time limit for the overall quiz game or for singular questions.
Shuffle Questions & Answers: Randomly mix the questions and the multiple-choice answers.
Conditional Grades: Show grades (A to F) to students on the basis of their percentage.
Connect With Excel: Import questions and answers from an Excel Sheet, and export the student’s report card in Excel along with the time taken per question.

Most of the above-listed features work only in Windows. However, you can view our tutorial: PowerPoint Quiz Game in macOS which calculates scores and has a time limit per question.

How to make Quiz Game in VBA PowerPoint - How to Create Advanced Quiz Game in PowerPoint

1. Points Scored

Before we begin, make sure to enable your Developer Tab in your Microsoft PowerPoint Application. This will allow us to type Visual Basic Application (VBA) code, insert ActiveX Components and create these interactive features.

Use the Label ActiveX Component. It is similar to a shape that contains text or numbers. We can change the number within the shape when the correct or wrong answer shape is clicked during slide show mode.

In this tutorial, the Label is placed in a slide master and named Points. We increase it by 10 every time a correct answer is clicked, and decrease it by 5 when an incorrect answer is clicked. A message box pop-up is shown indicating whether the answer was correct or wrong.

				
					Sub Correct()
Points.Caption = (Points.Caption) + 10
Output = MsgBox("Your answer is correct, well done!", vbOKOnly, "Correct Answer")
ActivePresentation.SlideShowWindow.View.Next
End Sub

Sub Incorrect()
Points.Caption = (Points.Caption) - 5
Output = MsgBox("Your answer is wrong.", vbOKOnly, "Wrong Answer")
ActivePresentation.SlideShowWindow.View.Next
End Sub

Sub Reset()
Points.Caption = 0
ActivePresentation.SlideShowWindow.View.Exit
End Sub 
				
			

The above sub-routines are run based on when the correct answer, wrong answer or the reset button are pressed respectively. It changes the Caption (text) of our Label (Points ActiveX Shape).

2. Report Card

PPT QUiz game with score points and reportcard and grade - How to Create Advanced Quiz Game in PowerPoint

Earlier, we had one Label (Points ActiveX Shape) that stored the points scored by the user in our PowerPoint Quiz Game. Now, we shall duplicate the Label in order to keep count of the number of correct/wrong/skipped answers, percentage secured and points scored.

The names of the new Labels are CA, WA, PQ, TQ, Percentages. The value within it can be incremented or calculated. For example, CA is incremented by 1 on the click of a correct answer; Percentages is calculated by CA*100/TQ.

				
					Sub Correct()
Points.Caption = (Points.Caption) + 10
CA.Caption = (CA.Caption) + 1
Output = MsgBox("Your Answer is correct, well done!", vbOKOnly, "Correct Answer")
ActivePresentation.SlideShowWindow.View.Next
End Sub

Sub Wrong()
Points.Caption = (Points.Caption) - 5
WA.Caption = (WA.Caption) + 1
Output = MsgBox("Your Answer is wrong.", vbOKOnly, "Incorrect Answer")
ActivePresentation.SlideShowWindow.View.Next
End Sub

Sub ResetAllCaptions()
CA.Caption = 0
WA.Caption = 0
PQ.Caption = 0
TQ.Caption = 0
Percentage.Caption = 0
Points.Caption = 0
End Sub

Sub Reset()
ResetAllCaptions
ActivePresentation.SlideShowWindow.View.Exit
End Sub

Sub Retry()
ResetAllCaptions
ActivePresentation.SlideShowWindow.View.GotoSlide (1)
End Sub

Sub ShowResult()
TQ.Caption = 6 'change accordingly as
PQ.Caption = Int((TQ.Caption) - (CA.Caption) - (WA.Caption))
Percentage.Caption = (CA.Caption) * 100 / (TQ.Caption)
ActivePresentation.SlideShowWindow.View.Next
End Sub 
				
			

🎯 In this tutorial