On a quick look, I see an extra space between Number and Wrong in the Start procedure.
You might check out my site for several working examples.
http://www.PowerfulPowerPoint.com/
Go to Examples By Chapter and Chapter 8 for several quiz examples.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
Can anyone help me to write a Visual Basic Code for Multiple Choice quiz, where I can check the final score.
I have used the YouTube help , but somehow the codes give error when running in PP2016.
I used the following code:
Sub QUIZ101()
Dim UserName As String
Dim numberCorrect As Integer
Dim numberWrong As Integer
Sub YourName( )
UserName = InputBox(Prompt, "Type Your Name!")
MsgBox "Welcome to PM4S Math Quiz" + UserName, vbApplicationModal, "QUIZ101"
End Sub
Sub Correct( )
MsgBox "Well Done! That's Correct" + UserName, vbApplicationModal, "QUIZ101"
numberCorrect = numberCorrect + 1
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Wrong( )
MsgBox "Sorry, That's Incorrect" + UserName, vbApplicationModal, "QUIZ101"
numberWrong = numberWrong + 1
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Start( )
numberCorrect = 0
Number Wrong = 0
YourName
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Results( )
MsgBox ("You Got numberCorrect & 'out of " & numberCorrect + numberWrong & ", " & UserName), vbApplicationModal, "QUIZ101"
End Sub
Thanks a million
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
On a quick look, I see an extra space between Number and Wrong in the Start procedure.
You might check out my site for several working examples.
http://www.PowerfulPowerPoint.com/
Go to Examples By Chapter and Chapter 8 for several quiz examples.
MsgBox ("You Got numberCorrect & 'out of " & numberCorrect + numberWrong & ", " & UserName), vbApplicationModal, "QUIZ101"
should be
MsgBox ("You Got " & numberCorrect & " out of " & numberCorrect + numberWrong & ", " & UserName), vbApplicationModal, "QUIZ101"
Also, before running the code, try compiling it.
Thank you very much for suggestion.
Will try he suggestion.
VK
Thanks a million David.
I will definitely look at the link you suggested.
Will keep you posted of the progress I make.
I am trying to build Math Quizzes for teachers to use as they finish teaching etc. and
students to see their own understanding.
Thanks once again
VK
On a quick look, I see an extra space between Number and Wrong in the Start procedure.
You might check out my site for several working examples.
http://www.PowerfulPowerPoint.com/
Go to Examples By Chapter and Chapter 8 for several quiz examples.
Hi David,
Hi I got this VBA & PPT sorted out OK.
I am looking now at the possibility of:
a) adding percent score card
b) ability to print the result with the students name.
w.r.t. b) any input will be appreciated.
Thanks
VKS1946