Created
January 21, 2016 12:05
-
-
Save ConnorMcF/0554c003de67a00d3ea2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim sCorrect | |
sCorrect = 0 | |
Dim sWrong | |
sWrong = 0 | |
Dim dName | |
Sub promptName() | |
name = InputBox(prompt:="What is your name?") | |
End Sub | |
Sub correctAnswer() | |
MsgBox ("Correct answer.") | |
ActivePresentation.SlideShowWindow.View.Next | |
sCorrect = sCorrect + 1 | |
End Sub | |
Sub incorrectAnswer() | |
MsgBox ("That's not the right answer!") | |
ActivePresentation.SlideShowWindow.View.Next | |
sWrong = sWrong + 1 | |
End Sub | |
Sub finish() | |
Dim slCorrect ' Localise the variables here | |
Dim slWrong | |
If (sCorrect = 1) Then | |
slCorrect = sCorrect + " question" | |
Else | |
slCorrect = sCorrect + " questions" | |
End If | |
If (sWrong = 1) Then | |
slWrong = sWrong + " question" | |
Else | |
slWrong = sWrong + " questions" | |
End If | |
MsgBox ("You got " + slCorrect + " right and " + slWrong + " wrong") | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment