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


Download 1.37 Mb.
Pdf ko'rish
bet156/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   152   153   154   155   156   157   158   159   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

numIncorrect = 0
), just like in
any example that keeps score. Be cause we are asked to re peat a question un til it
is cor rect, we need
qAnswered
to be de clared
Dim qAnswered
at the be ginning
of the module and in itialized in the 
Ini 
tial 
ize
pro ce dure (
qAnswered =
False
). Fi nally,
RightAnswer
and 
WrongAnswer
need to ad just the score if
the question has been answered:
Choose Ques tions Randomly from a Pool 149


Sub RightAnswer()
If qAnswered = False Then
numCorrect = numCorrect + 1
End If
qAnswered = False
DoingWell
vis 
ited(ActivePresentation.SlideShowWindow.View.Slide.SlideIndex) _
= True
numRead = numRead + 1
RandomNext
End Sub
Sub WrongAnswer()
If qAnswered = False Then
numIncorrect = numIncorrect + 1
End If
qAnswered = True
DoingPoorly
End Sub
These are all the same changes that we made when we wanted to keep score in
Chapter 7. You should be able to add short-answer questions by using the same
Ques 
tion
pro cedures for each question that you used in Chapter 7.
You now have a powerful tool for ran domly selecting slides. Note that
these ex amples used quizzes, but if you un derstand this code, you can do some-
thing very similar to create a random story that picks ran dom slides to go to next.
The heart of this is
RandomNext
as well as the line:
visited(ActivePresentation.SlideShowWindow.View.Slide.SlideIndex) = True
Together, these will pick a random slide to go to next and mark that you have
gone to that slide.

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   152   153   154   155   156   157   158   159   ...   191




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