We use cookies to provide you with a better experience. If you continue to use this site, we'll assume you're happy with this. Alternatively, click here to find out how to manage these cookies

hide cookie message
Contact Forum Editor

Send an email to our Forum Editor:


PLEASE NOTE: Your name is used only to let the Forum Editor know who sent the message. Both your name and email address will not be used for any other purpose.

Tech Helproom


It's free to register, to post a question or to start / join a discussion


 

Powerpoint Quiz - Visual Basic Programming


Howard's Way

Likes # 0

I have produce a number of interactive quizs in Powerpoint 2003 using Visual basic to do a number of function then giving the user a score out of a 100% at the end. What I want to do now is split the quiz into sub sections / topics and give a score for each one. Is this possible or is this a bridge too far with Powerpoint. Below is my current basic script

Public NumberCorrect As Integer Dim userName 'Public variables retain their value so they can be added to each time a macro is run. Sub Initialise() 'Sets the score to zero so it’s not added to the previous user’s total, and goes to the first question. NumberCorrect = 0 ActivePresentation.SlideShowWindow.View.Next End Sub Sub Correct() 'Adds one to the total correct and moves to the next slide NumberCorrect = NumberCorrect + 1 End Sub Sub Wrong() 'Takes away one to the total correct and moves to the next slide NumberCorrect = NumberCorrect - 1 End Sub Sub Display() 'Shows the result in a pop-up message box with some explanatory text percent = ((NumberCorrect / 91) * 100) percent = Round(percent, 0) MsgBox (userName & " got " & percent & " % correct") ActivePresentation.SlideShowWindow.View.Next End Sub Sub YourName() Dim done As Boolean done = False ActivePresentation.SlideShowWindow.View.Next While Not done userName = InputBox(prompt:="Type your name", _ Title:="Input Name") If userName = "" Then done = False Else done = True End If Wend ActivePresentation.SlideShowWindow.View.Next End Sub

Like this post

Reply to this topic

This thread has been locked.



IDG UK Sites

8 cheapest 4G smartphones in the UK 2014: Best budget 4G phones

IDG UK Sites

Apple MacBook Air lab tests and benchmarks: 11-inch & 13-inch, 256GB, 2014 Mac laptops tested

IDG UK Sites

How to prank people using Google Glass

IDG UK Sites

Brian Cox to step into will.i.am's shoes with IBC keynote