PC Review


Reply
Thread Tools Rate Thread

Adding and Counting through multiple slides

 
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      22nd Sep 2005
Hi to All.

I am trying to create a "test" at the end of a presentation. I need to be
able to count the number of questions answered and the number of correct
answers. The last slide will be a presentation of a certificate with the
user's name and their results to be printed.

The two things that are not working are the counting of the variable and
placing the results into a textbox on the last slide as soon as the slide is
presented. The format is Scenario 1, 2 slides choosing an answer, Scenario
2, 2 slides of choosing an answer, Scenario 3, 2 slides choosing an answer,
then Four Scenarios each followed by one slide choosing an answer. The
choices are in an OptionButton Group unique for each slide.
First, I must tell you I am using PowerPoint 2000 for this.
The variables I have declared are:
Public Answer As String
Public Count, PercentCorrect As Integer

From reading some of the posts here and PPT Help, I think I will have to
change the variable Count to something else. However, when I run the script,
the variable will change between the first two slides but reset on each slide
after that.

The code I use to increase count is

Count = Count +1
PercentCorrect = PercentCorrect + 1 (0 for incorrect answers)

Thanks to all for any and all help.
 
Reply With Quote
 
 
 
 
Bill Dilworth
Guest
Posts: n/a
 
      22nd Sep 2005
As a general rule, it is a good idea to avoid programming keywords. While I
did not have any issue with a small routine I whipped up that used the
variable name Count, it is possible. Try changing the Count variable to
intAnswerCnt (make sure you use whole word replace). It may help.

Possible also is that the variable is being changed by something in the code
that you forgot about.

Why are you declaring the variables as Public? It may be possible that you
are running into a conflict with another routine.


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
yahoo2@ Please read the PowerPoint
yahoo. FAQ pages. They answer most
com of our questions.
www.pptfaq.com
..
..
"Chris" <(E-Mail Removed)> wrote in message
news:2A128DDB-AC67-475B-B13D-(E-Mail Removed)...
> Hi to All.
>
> I am trying to create a "test" at the end of a presentation. I need to be
> able to count the number of questions answered and the number of correct
> answers. The last slide will be a presentation of a certificate with the
> user's name and their results to be printed.
>
> The two things that are not working are the counting of the variable and
> placing the results into a textbox on the last slide as soon as the slide
> is
> presented. The format is Scenario 1, 2 slides choosing an answer,
> Scenario
> 2, 2 slides of choosing an answer, Scenario 3, 2 slides choosing an
> answer,
> then Four Scenarios each followed by one slide choosing an answer. The
> choices are in an OptionButton Group unique for each slide.
> First, I must tell you I am using PowerPoint 2000 for this.
> The variables I have declared are:
> Public Answer As String
> Public Count, PercentCorrect As Integer
>
> From reading some of the posts here and PPT Help, I think I will have to
> change the variable Count to something else. However, when I run the
> script,
> the variable will change between the first two slides but reset on each
> slide
> after that.
>
> The code I use to increase count is
>
> Count = Count +1
> PercentCorrect = PercentCorrect + 1 (0 for incorrect answers)
>
> Thanks to all for any and all help.



 
Reply With Quote
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      22nd Sep 2005
Bill:

You are absolutely right about avoiding programming keywords. As soon as I
saw it was, I knew it had to be changed. I used the Public statement because
the VBA Help states :
"Variables declared using the Public statement are available to all
procedures in all modules in all applications unless Option Private Module is
in effect; in which case, the variables are public only within the project in
which they reside."

I tried changing the variable name and still get the reset at each slide and
the last slide has the variables empty. The code for each slide, with the
only difference being which answer is set to True is:
Private Sub Slide18_Click()
intAnswerCnt = 0 'Resets intAnswerCnt to zero for beginning of test
PercentCorrect = 0 'Resets PercentCorrect to zero for beginning of test

If Title = True Then
intAnswerCnt = intAnswerCnt + 1 'Increases the question count by one
PercentCorrect = PercentCorrect + 1 'Increases the correct answer
count by one
Msg = "Correct! The correct Short Title is RIID Operator" 'Displays
the message
Response = MsgBox(Msg, vbInformation + vbOKOnly, "Correct Answer")
'Title of the message box
Response = MsgBox(PercentCorrect & ":" & intAnswerCnt,
vbInformation, "Numbers") 'Test Box to track variable values
SlideShowWindows(1).View.Next 'Moves to the next slide
Else
intAnswerCnt = intAnswerCnt + 1 'Increases the question count by one
Msg = "Incorrect. The Short Title is RIID Operator not RIID"
'Displays the message
Response = MsgBox(Msg, vbExclamation + vbOKOnly, "Incorrect Answer")
'Title of the message box
Response = MsgBox(PercentCorrect & ":" & intAnswerCnt,
vbInformation, "Numbers") 'Test Box to track numbers
SlideShowWindows(1).View.Next 'Moves to the next slide
End If 'End Block If Statement

End Sub


"Bill Dilworth" wrote:

> As a general rule, it is a good idea to avoid programming keywords. While I
> did not have any issue with a small routine I whipped up that used the
> variable name Count, it is possible. Try changing the Count variable to
> intAnswerCnt (make sure you use whole word replace). It may help.
>
> Possible also is that the variable is being changed by something in the code
> that you forgot about.
>
> Why are you declaring the variables as Public? It may be possible that you
> are running into a conflict with another routine.
>
>
> --
> Bill Dilworth
> A proud member of the Microsoft PPT MVP Team
> Users helping fellow users.
> billdilworth.mvps.org
> -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
> yahoo2@ Please read the PowerPoint
> yahoo. FAQ pages. They answer most
> com of our questions.
> www.pptfaq.com
> ..
> ..
> "Chris" <(E-Mail Removed)> wrote in message
> news:2A128DDB-AC67-475B-B13D-(E-Mail Removed)...
> > Hi to All.
> >
> > I am trying to create a "test" at the end of a presentation. I need to be
> > able to count the number of questions answered and the number of correct
> > answers. The last slide will be a presentation of a certificate with the
> > user's name and their results to be printed.
> >
> > The two things that are not working are the counting of the variable and
> > placing the results into a textbox on the last slide as soon as the slide
> > is
> > presented. The format is Scenario 1, 2 slides choosing an answer,
> > Scenario
> > 2, 2 slides of choosing an answer, Scenario 3, 2 slides choosing an
> > answer,
> > then Four Scenarios each followed by one slide choosing an answer. The
> > choices are in an OptionButton Group unique for each slide.
> > First, I must tell you I am using PowerPoint 2000 for this.
> > The variables I have declared are:
> > Public Answer As String
> > Public Count, PercentCorrect As Integer
> >
> > From reading some of the posts here and PPT Help, I think I will have to
> > change the variable Count to something else. However, when I run the
> > script,
> > the variable will change between the first two slides but reset on each
> > slide
> > after that.
> >
> > The code I use to increase count is
> >
> > Count = Count +1
> > PercentCorrect = PercentCorrect + 1 (0 for incorrect answers)
> >
> > Thanks to all for any and all help.

>
>
>

 
Reply With Quote
 
David M. Marcovitz
Guest
Posts: n/a
 
      22nd Sep 2005
Chris,

I have examples of exactly what you are trying to do on my site. Check
out Example 7.9 on my site:

http://www.loyola.edu/education/PowerfulPowerPoint/

Click on "Examples by Chapter" and "Chapter 7." The example doesn't use
Option buttons but could easily be modified to do so.

--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?Q2hyaXM=?=" <(E-Mail Removed)> wrote in
news:2A128DDB-AC67-475B-B13D-(E-Mail Removed):

> Hi to All.
>
> I am trying to create a "test" at the end of a presentation. I need
> to be able to count the number of questions answered and the number of
> correct answers. The last slide will be a presentation of a
> certificate with the user's name and their results to be printed.
>
> The two things that are not working are the counting of the variable
> and placing the results into a textbox on the last slide as soon as
> the slide is presented. The format is Scenario 1, 2 slides choosing
> an answer, Scenario 2, 2 slides of choosing an answer, Scenario 3, 2
> slides choosing an answer, then Four Scenarios each followed by one
> slide choosing an answer. The choices are in an OptionButton Group
> unique for each slide. First, I must tell you I am using PowerPoint
> 2000 for this. The variables I have declared are:
> Public Answer As String
> Public Count, PercentCorrect As Integer
>
> From reading some of the posts here and PPT Help, I think I will have
> to change the variable Count to something else. However, when I run
> the script, the variable will change between the first two slides but
> reset on each slide after that.
>
> The code I use to increase count is
>
> Count = Count +1
> PercentCorrect = PercentCorrect + 1 (0 for incorrect answers)
>
> Thanks to all for any and all help.


 
Reply With Quote
 
=?Utf-8?B?Q2hyaXM=?=
Guest
Posts: n/a
 
      22nd Sep 2005
David:

This post was helpful but not for the reasons you would think. The problem
was WHERE I was putting my code. Instead of creating a module, I was
attempting to do it through PowerPoint Objects. Once I moved everything to a
Module, it started counting and once I eliminated the double counting, it
started counting correctly!

Your example did help me with the presentation controls, results page, and
using action buttons.

Thank You,

"David M. Marcovitz" wrote:

> Chris,
>
> I have examples of exactly what you are trying to do on my site. Check
> out Example 7.9 on my site:
>
> http://www.loyola.edu/education/PowerfulPowerPoint/
>
> Click on "Examples by Chapter" and "Chapter 7." The example doesn't use
> Option buttons but could easily be modified to do so.
>
> --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?Q2hyaXM=?=" <(E-Mail Removed)> wrote in
> news:2A128DDB-AC67-475B-B13D-(E-Mail Removed):
>
> > Hi to All.
> >
> > I am trying to create a "test" at the end of a presentation. I need
> > to be able to count the number of questions answered and the number of
> > correct answers. The last slide will be a presentation of a
> > certificate with the user's name and their results to be printed.
> >
> > The two things that are not working are the counting of the variable
> > and placing the results into a textbox on the last slide as soon as
> > the slide is presented. The format is Scenario 1, 2 slides choosing
> > an answer, Scenario 2, 2 slides of choosing an answer, Scenario 3, 2
> > slides choosing an answer, then Four Scenarios each followed by one
> > slide choosing an answer. The choices are in an OptionButton Group
> > unique for each slide. First, I must tell you I am using PowerPoint
> > 2000 for this. The variables I have declared are:
> > Public Answer As String
> > Public Count, PercentCorrect As Integer
> >
> > From reading some of the posts here and PPT Help, I think I will have
> > to change the variable Count to something else. However, when I run
> > the script, the variable will change between the first two slides but
> > reset on each slide after that.
> >
> > The code I use to increase count is
> >
> > Count = Count +1
> > PercentCorrect = PercentCorrect + 1 (0 for incorrect answers)
> >
> > Thanks to all for any and all help.

>
>

 
Reply With Quote
 
David M. Marcovitz
Guest
Posts: n/a
 
      22nd Sep 2005
Great. I'm glad I could help. I am not a big fan of the control toolbox,
largely because it is not cross-platform compatible. It also forces use
of multiple modules, which, as you have seen, can get confusing. I
thought I had some examples on my site that use the control toolbox, but
I couldn't find any, so if you get yours working the way you want, I
wouldn't mind if you would send it to me so I can post it on my site
(under "Examples from Real People").
--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?Q2hyaXM=?=" <(E-Mail Removed)> wrote in
news:07D49FC6-BD41-4D34-BCA3-(E-Mail Removed):

> David:
>
> This post was helpful but not for the reasons you would think. The
> problem was WHERE I was putting my code. Instead of creating a
> module, I was attempting to do it through PowerPoint Objects. Once I
> moved everything to a Module, it started counting and once I
> eliminated the double counting, it started counting correctly!
>
> Your example did help me with the presentation controls, results page,
> and using action buttons.
>
> Thank You,
>
> "David M. Marcovitz" wrote:
>
>> Chris,
>>
>> I have examples of exactly what you are trying to do on my site.
>> Check out Example 7.9 on my site:
>>
>> http://www.loyola.edu/education/PowerfulPowerPoint/
>>
>> Click on "Examples by Chapter" and "Chapter 7." The example doesn't
>> use Option buttons but could easily be modified to do so.
>>
>> --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?Q2hyaXM=?=" <(E-Mail Removed)> wrote in
>> news:2A128DDB-AC67-475B-B13D-(E-Mail Removed):
>>
>> > Hi to All.
>> >
>> > I am trying to create a "test" at the end of a presentation. I
>> > need to be able to count the number of questions answered and the
>> > number of correct answers. The last slide will be a presentation
>> > of a certificate with the user's name and their results to be
>> > printed.
>> >
>> > The two things that are not working are the counting of the
>> > variable and placing the results into a textbox on the last slide
>> > as soon as the slide is presented. The format is Scenario 1, 2
>> > slides choosing an answer, Scenario 2, 2 slides of choosing an
>> > answer, Scenario 3, 2 slides choosing an answer, then Four
>> > Scenarios each followed by one slide choosing an answer. The
>> > choices are in an OptionButton Group unique for each slide. First,
>> > I must tell you I am using PowerPoint 2000 for this. The variables
>> > I have declared are: Public Answer As String
>> > Public Count, PercentCorrect As Integer
>> >
>> > From reading some of the posts here and PPT Help, I think I will
>> > have to change the variable Count to something else. However, when
>> > I run the script, the variable will change between the first two
>> > slides but reset on each slide after that.
>> >
>> > The code I use to increase count is
>> >
>> > Count = Count +1
>> > PercentCorrect = PercentCorrect + 1 (0 for incorrect answers)
>> >
>> > Thanks to all for any and all help.

>>
>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining slides with multiple master slides using VBS =?Utf-8?B?QnJhbmRvbg==?= Microsoft Powerpoint 0 30th Dec 2005 06:29 PM
Powerpoint-Adding Slides to presentation with Multiple Slide Maste =?Utf-8?B?QnJhbmRvbg==?= Microsoft Powerpoint 0 22nd Dec 2005 10:05 PM
Powerpoint:mac X Adding multiple master slides =?Utf-8?B?QW15?= Microsoft Powerpoint 4 28th Sep 2005 02:36 PM
adding text to multiple slides ponderguy Microsoft Powerpoint 2 1st Apr 2005 05:43 AM
adding multiple pictures into individual slides without inserting. =?Utf-8?B?bGtyaW5nbGU=?= Microsoft Powerpoint 2 16th Nov 2004 05:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 AM.