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


ActivePresentation.SlideShowWindow.View.Next


Download 1.37 Mb.
Pdf ko'rish
bet90/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   86   87   88   89   90   91   92   93   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

ActivePresentation.SlideShowWindow.View.Next
from the
WrongAnswer
pro cedure. This will stop the presentation from go ing to the next
question after a wrong answer, but it will count every click on the wrong an swer
as well as the click on the right an swer. For example, if you use the questions
from Fig ure 7.1 (page 93) and click on Abraham Lincoln (the wrong an swer for
question 1), then George Washington (the right answer for question 1), then 2
(the right an swer for question 2), your score will be two out of three be cause you
got the first ques tion wrong once then right once, and you got the second
question right once.
If you want to count only the first try, in the above ex ample you would want
a score of one out of two. That is because you got the first question wrong on the
first try, and you got the second ques tion right on the first try. This re quires no
changes to your slides, in cluding which but tons are tied to which pro cedures. It
only re quires the following code; changes from the code in Fig ure 7.1 are
marked with comments (
‘ADDED
for ad ditions and
‘DELETED
for the line that is
deleted):
Dim numCorrect As In 
teger
Dim numIncorrect As In 
teger
Dim userName As String
Dim qAnswered As Boolean 'ADDED
Sub GetStarted()
Ini 
tial 
ize
YourName
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Ini 
tial 
ize()
numCorrect = 0
numIncorrect = 0
qAnswered = False 'ADDED
End Sub
Sub YourName()
userName = InputBox(prompt:="Type your name")
End Sub
Try Again: An swer Un til It’s Right 95



Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   86   87   88   89   90   91   92   93   ...   191




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