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


Question3 (or whatever num ber you use) pro cedure, and when the user clicks on the but ton, the InputBox


Download 1.37 Mb.
Pdf ko'rish
bet97/191
Sana08.05.2023
Hajmi1.37 Mb.
#1442581
1   ...   93   94   95   96   97   98   99   100   ...   191
Bog'liq
2.2. Powerful PowerPoint For Educators

Question3
(or whatever num ber you use) pro cedure, and when the user clicks
on the but ton, the
InputBox
will pop up ask ing for an an swer. The fig ure shows
a but ton with the words “Click to an swer,” but your but ton can con tain the ques-
tion it self, the word “Question,” a question mark, or whatever else you like (as
long as the user knows to press the but ton to get and/or answer the question).
Figure 7.3. Short-An swer Ques tion Slide
Note that this pro cedure was set up to work with the previous ex ample in
which stu dents can answer questions over and over again. To have it work with
any other examples, change the calls to 
RightAnswer3
and 
WrongAnswer3
to
RightAnswer
and 
WrongAnswer
.
Do Spelling and Spac ing Count?
Now we have a short-answer question, but even peo ple who live in Mary land
have trouble spelling “Annapolis.” If spelling is important in your test, then leave the
Question3
pro cedure alone. However, you might be tol erant of several mistakes that
your stu dents might make, so you might want to be more lenient. You might want to
ig nore ex tra spaces, ig nore cap i tal iza tion, and ac cept al ter na tive spell ings.
Spaces before and after the an swer can be han dled eas ily with the
Trim
com -
mand. In sert the following line af ter the
InputBox
state ment:
answer = Trim(an 
swer)
100 Quizzes and Tests


This will take the an swer that was typed, remove any spaces at the beginning or
end, and put the result (without the extra spaces) back into the
an 
swer
vari able.
Trim
will turn “ Annapolis ” into “Annapolis.” This will not elim inate any
spaces in the middle, so “Ann apolis” will re main “Ann apolis.” If for some rea-
son you only want to remove the spaces be fore the an swer or after the an swer,
use

Download 1.37 Mb.

Do'stlaringiz bilan baham:
1   ...   93   94   95   96   97   98   99   100   ...   191




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