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


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

q1Answered
,
q2Answered
, . . . ) to see if the ques tions have been an swered
and will up date the variables and the score appropriately.
Here is the com plete VBA code for this ex ample. Comments have been
used to in dicate changes from the previous ex ample:
Dim numCorrect As In 
teger
Dim numIncorrect As In 
teger
Dim userName As String
Dim q1Answered As Boolean 'ADDED to re 
place qAnswered
Dim q2Answered As Boolean 'ADDED to re 
place qAnswered
Sub GetStarted()
Ini 
tialize
YourName
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Ini 
tial 
ize()
numCorrect = 0
numIncorrect = 0
q1Answered = False 'ADDED to re 
place qAnswered
q2Answered = False 'ADDED to re 
place qAnswered
End Sub
Try Again and Again: An swer Again Af ter It’s Right 97


Sub YourName()
userName = InputBox(prompt:="Type your name")
End Sub
Sub RightAnswer1() 'ADDED to re 
place RightAnswer
If q1Answered = False Then
numCorrect = numCorrect + 1
End If
q1Answered = True 'Do not re 
set q1Answered to FALSE
DoingWell
'DELETED ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub RightAnswer2() 'Same as RightAnswer1 with 1 changed to 2
If q2Answered = False Then
numCorrect = numCorrect + 1
End If
q2Answered = True
DoingWell
End Sub
Sub DoingWell()
MsgBox ("You are do 

Download 1.37 Mb.

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




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