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


Download 1.37 Mb.
Pdf ko'rish
bet100/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   96   97   98   99   100   101   102   103   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

PrintablePage
to cre ate the slide with
the re sults,
PrintResults
to print the results on the printer, and
StartAgain
to de lete the results slide and go back to the beginning.
2.
We will add variables to keep track of which an swers were se lected
first. For this example, we will use the three questions from the previ-
ous example so we will have three variables:
answer1
,
answer2
,
and
answer3
. These variables will be used to print the students’ an -
swers on the print able page.
102 Quizzes and Tests


Here is the com plete code (new lines and procedures are in dicated by the
com ment
‘ADDED
):
Dim numCorrect As In 
teger
Dim numIncorrect As In 
teger
Dim userName As String
Dim q1Answered As Boolean
Dim q2Answered As Boolean
Dim q3Answered As Boolean
Dim answer1 As String 'ADDED
Dim answer2 As String 'ADDED
Dim answer3 As String 'ADDED
Dim printableSlideNum As Long 'ADDED
Sub GetStarted()
Ini 
tial 
ize
YourName
ActivePresentation.SlideShowWindow.View.Next
End Sub
Sub Ini 
tial 
ize()
numCorrect = 0
numIncorrect = 0
q1Answered = False
q2Answered = False
q3Answered = False
printableSlideNum = ActivePresentation.Slides.Count + 1 'ADDED
End Sub
Sub YourName()
userName = InputBox(Prompt:="Type your name")
End Sub
Sub DoingWell()
MsgBox ("You are do 
ing well, " & userName)

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   96   97   98   99   100   101   102   103   ...   191




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