Previous Thread:   "Set profiles first" - persistent error message

9/29/2005 12:22:03 AM    Quiz
Hi,  
  
I have looked around for quiz and found some very good ones, for example one  
  
from Shyam Pillai (the file pptQuiz.ppt), but I want it a little bit  
  
different.  
  
Those I have found use VBA and have the questions in the code. Is it  
  
possible to have all the questions/answers on the last slide(s) and use VBA  
  
to pick up the questions/answers? In that way users can type in their  
  
questions/answers themself instead of changing the VBA-code.  
  
/ Ulf



9/29/2005 6:11:55 AM    Re: Quiz
I have a simple 10 Question Review sample file that does not require any  
  
changing of the code (as long as this file is linked to).  You can download  
  
(bottom download) it at:  
  
http://www.pttinc.com/cbt_development.html  
  
--  
  
Bill Foley  
  
www.pttinc.com  
  
Microsoft PowerPoint MVP  
  
Microsoft Office Specialist Master Instructor  
  
"Ulf Nilsson" <UlfNilsson@discussions.microsoft.com> wrote in message  
  
news:8E60635C-88CC-4FF6-8341-FCC5321804C4@microsoft.com...  
  
one  
  
VBA

9/29/2005 1:03:49 PM    Re: Quiz
Hi Ulf,  
  
To extend Shyam Pillai's pptQuiz (http://skp.mvps.org/ppt00031.htm),  
  
you can do the following. After you do this, all of the questions and  
  
answers will be picked up from the slides instead of the code.  
  
Using the code I have given, the questions and answers will need to be  
  
stored in a specific format:  
  
- create a blank slide for each question  
  
- make the slide hidden  
  
- add a text box to the slide (this must be the only thing on the  
  
slide, excluding any items on the master slide)  
  
- in the text box, type a question followed by the 3 possible answers,  
  
using a separate line for each of these  
  
- select the line with the correct answer and make that line bold  
  
Repeat this for each question that you want to use.  
  
Now for the code changes. Edit the VBA and do these things:  
  
1.  
  
So that we can have a flexible number of questions, change this line:  
  
Const NOOFQS = 3  
  
to:  
  
Dim NOOFQS As Integer  
  
2.  
  
In "Sub BeginQuiz()"  
  
replace everything from  
  
ReDim Qs(NOOFQS)  
  
to (and including)  
  
Ans(2) = 1  
  
with this single statement (to call a function that I'll give in a  
  
moment):  
  
GetValues  
  
3.  
  
The Choices array needs to have it's dimensions swapped over so that  
  
we can use "ReDim Preserve" to extend the array, so replace:  
  
.Shapes("Choice1").TextFrame.TextRange.Text = Choices(QNo - 1,  
  
0)  
  
.Shapes("Choice2").TextFrame.TextRange.Text = Choices(QNo - 1,  
  
1)  
  
.Shapes("Choice3").TextFrame.TextRange.Text = Choices(QNo - 1,  
  
2)  
  
With:  
  
.Shapes("Choice1").TextFrame.TextRange.Text = Choices(0, QNo -  
  
1)  
  
.Shapes("Choice2").TextFrame.TextRange.Text = Choices(1, QNo -  
  
1)  
  
.Shapes("Choice3").TextFrame.TextRange.Text = Choices(2, QNo -  
  
1)  
  
and replace:  
  
AnsList = AnsList & Qs(X) & vbTab & " Answer:" & Choices(X,  
  
Ans(X)) & vbCrLf  
  
with:  
  
AnsList = AnsList & Qs(X) & vbTab & " Answer:" & Choices(Ans(X),  
  
X) & vbCrLf  
  
4.  
  
Finally, you will need to add the code to read the questions and  
  
answers from the slides.  
  
If I post the code here, it will get distorted with line breaks, so  
  
instead I've put in in my blog, where you'll be able to copy'n'paste  
  
it: http://timhards.com/2005/09/29/powerpoint-quiz/  
  
I hope this helps you,  
  
--  
  
Tim Hards  
  
http://timhards.com/  
  
Chief Software Architect  
  
Perspector - 3D Business Graphics for PowerPoint  
  
http://perspector.com/  
  
On Thu, 29 Sep 2005 00:22:03 -0700, "Ulf Nilsson"  
  
<UlfNilsson@discussions.microsoft.com> wrote:

9/30/2005 11:12:53 AM    Re: Quiz
I have several examples on my Web site. Many of them do not require any  
  
change in the VBA code. However, I do not have any examples on my site  
  
that generate the slides from a text file or another slide. That wouldn't  
  
be too hard to do, however. If you look at Example 7.9 on my site, you  
  
can see how you can create a slide and buttons with VBA (even buttons  
  
that run VBA procedures). It wouldn't be too difficult to use that same  
  
technique to read the information that needs to go onto a slide from a  
  
slide.  
  
--David  
  
--  
  
David M. Marcovitz  
  
Microsoft PowerPoint MVP  
  
Director of Graduate Programs in Educational Technology  
  
Loyola College in Maryland  
  
Author of _Powerful PowerPoint for Educators_  
  
http://www.loyola.edu/education/PowerfulPowerPoint/  
  
"=?Utf-8?B?VWxmIE5pbHNzb24=?=" <UlfNilsson@discussions.microsoft.com>  
  
wrote in news:8E60635C-88CC-4FF6-8341-FCC5321804C4@microsoft.com: