Skip to content

Instantly share code, notes, and snippets.

@ConnorMcF
Created January 21, 2016 12:05
Show Gist options
  • Save ConnorMcF/0554c003de67a00d3ea2 to your computer and use it in GitHub Desktop.
Save ConnorMcF/0554c003de67a00d3ea2 to your computer and use it in GitHub Desktop.
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