PowerPoint Quiz Game with Multiple Correct Answers

Here is a PowerPoint VBA Tutorial to learn how to make a Quiz Game in PowerPoint that has Multiple Correct Answers. There are questions that can have more than one correct answer, for example:

  1. Choose all numbers greater than x.
  2. Select the nations that belong in Asia.
  3. Who amongst the following isn’t a President of the United States 

We shall be using an ActiveX Element Check Box in PowerPoint to create this Quiz Game. At the end, we shall also be having a Report Card that states the number of correct and wrong answers.

Dim CB1 As Object, CB2 As Object, CB3 As Object, CB4 As Object

Sub DeclareCheckBox()
Dim CS As Slide
Set CS = ActivePresentation.SlideShowWindow.View.Slide

Set CB1 = CS.Shapes("CheckBox1").OLEFormat.Object
Set CB2 = CS.Shapes("CheckBox2").OLEFormat.Object
Set CB3 = CS.Shapes("CheckBox3").OLEFormat.Object
Set CB4 = CS.Shapes("CheckBox4").OLEFormat.Object
End Sub

Sub Correct()
MsgBox "This is the correct answer! Good job!", vbInformation
Slide6.CA.Caption = (Slide6.CA.Caption) + 1
ActivePresentation.SlideShowWindow.View.Next
End Sub

Sub Wrong()
MsgBox "Hey! This is the wrong answer!", vbCritical
Slide6.WA.Caption = (Slide6.WA.Caption) + 1
ActivePresentation.SlideShowWindow.View.Next
End Sub 
Sub StartGame()
ActivePresentation.SlideShowWindow.View.Next

For i = 2 To 5
Dim CS As Slide
Set CS = ActivePresentation.Slides(i)

Set CB1 = CS.Shapes("CheckBox1").OLEFormat.Object
Set CB2 = CS.Shapes("CheckBox2").OLEFormat.Object
Set CB3 = CS.Shapes("CheckBox3").OLEFormat.Object
Set CB4 = CS.Shapes("CheckBox4").OLEFormat.Object

CB1.Value = False
CB2.Value = False
CB3.Value = False
CB4.Value = False
Next i

Slide6.CA.Caption = 0
Slide6.WA.Caption = 0
End Sub

 

The following code snippet is to be used when the correct answer options are 3rd and 4th only. You can utilise this template and make multiple such sub-routines for your PowerPoint Quiz Game!

Sub CBCorrect34()
DeclareCheckBox
If CB1.Value = False And CB2.Value = False And CB3.Value = True And CB4.Value = True Then Correct Else Wrong
End Sub