Sub RightAnswer()
If qAnswered = False Then 'ADDED
numCorrect = numCorrect + 1
End If 'ADDED
qAnswered = False 'ADDED
DoingWell
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub DoingWell()
MsgBox ("You are do
ing well, " & userName)
End Sub
Sub WrongAnswer()
If qAnswered = False Then 'ADDED
numIncorrect = numIncorrect + 1
End If 'ADDED
qAnswered = True 'ADDED
DoingPoorly
'DELETED ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub DoingPoorly()
MsgBox ("Try to do better next time, " & userName)
End Sub
Sub Feed
back()
MsgBox ("You got " & numCorrect & " out of " _
& numCorrect + numIncorrect & ", " & userName)
End Sub
The heart of this pro cedure is the variable
qAnswered
. It keeps track of
whether or not the current question has been answered yet. If it is
False
, the ques-
tion has not yet been an swered; if it is
True
, the question has been answered.
A small amount of code is added to the
Dim
sec tion to declare
qAnswered
so that all the pro cedures know about it. It also must be in itialized to
False
in
the
Initialize
pro cedure so it is
False
when you get to the first question. Fi -
nally,
RightAnswer
and
WrongAnswer
must check and ad just the value of
qAnswered
.
RightAnswer
and
WrongAnswer
check to see if the question has not been
answered yet
If
(
qAnswered = False) Then
and only add one to
Do'stlaringiz bilan baham: |