Powerful PowerPoint for Educators: Using Visual Basic for Applications to Make PowerPoint Interactive


Download 1.37 Mb.
Pdf ko'rish
bet94/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   90   91   92   93   94   95   96   97   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

ing well, " & userName)
End Sub
Sub WrongAnswer1() 'ADDED to re 
place WrongAnswer
If q1Answered = False Then
numIncorrect = numIncorrect + 1
End If
q1Answered = True
DoingPoorly
End Sub
Sub WrongAnswer2() 'Same as WrongAnswer1 with 1 changed to 2
If q2Answered = False Then
numIncorrect = numIncorrect + 1
End If
q2Answered = True
DoingPoorly
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 most significant ad ditions are the new variables
q1Answered
and
q2Answered
and the spe cial right and wrong answer pro cedures for each ques-
tion. The vari ables keep track of which ques tions have already been answered.
q1Answered
is 
True
if question 1 has been answered, and it is
False
if ques-
tion 1 has not been an swered.
q2Answered
is 
True
if question 2 has been an-
swered, and it is 
False
if question 2 has not been an swered. If you have more
than two ques tions, you need a
q3Answered
,
q4Answered
, etc.; that is, you
98 Quizzes and Tests


need one variable for each question. These vari ables are declared at the begin-
ning with the 
Dim
statements:
Dim q1Answered As Boolean
Dim q2Answered As Boolean
Then, in
Ini 

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   90   91   92   93   94   95   96   97   ...   191




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling