PDA

View Full Version : VBA quiz code with multiple quizzes in one presentation



amelirina
05-19-2015, 08:31 AM
Hi everyone,

I am new to coding in ppt and I only managed to write a simple code which works fine. The problem is that we have short quizzes after each section of our powerpoint presentation and the code shows results for all undertaken questions rather than results for each quiz. That is, it does not start to calculate correct answers from zero. it is too confusing for learners. I am not sure how to "divide" quizzes and results but I hope you can help me with that. The code I use is below. Thank you!



Sub Results()
MsgBox "You got " & numberCorrect & " correct answers out of " & numberCorrect + numberWrong & ".", , "Quiz Results"
ActivePresentation.SlideShowWindow.View.Next
End Sub

John Wilson
05-19-2015, 08:47 AM
You probably just need a reset score button that runs this code

Sub Resetall
numberCorrect=0
numberWrong=0
End Sub

amelirina
05-20-2015, 04:14 AM
Thanks, John.

It worked!

Irina