I was hoping I could find an email address in one of your URL's. I was wrong
Doing Interactive Math in a PowerPoint Show
Let's say we want to calculate the area of a rectangle.Open a blank slide. Click on View, then Toolbars, then Control Toolbox to bring up the Toolbox. Click on the Text Box control and draw a box on the slide. Create two more Text boxes next to the first. Right click on the first box and choose Properties. Set the following - EnterKeyBehavior to True, Multiline to True, WordWrap to True and Font to your desire. Also give the box a name such as Length. Close the Property Sheet. Repeat for the other two boxes naming them Width and Answer.
From the Control Toolbox, click on the Command Button control and create a button below the three boxes. Create another next to it.
Right click on the first Command Button and choose Properties. Click on the Caption box and name it Calculate. Name the other Clear.
Right click the first Command Button and click View Code. Type the following:
Dim L as single
Dim W as single
Dim A as single
L = Length
W = Width
A = L*W
Answer = A
Right click the other Command Button and click View Code. Type the following:
Length = " "
Width = " "
Answer = " "
Try the boxes in Slide Show.
To Create A PowerPoint Quiz:
First slide as your Intro and a command button on the bottom.
Second slide has four text boxes.
Third slide has one text box and a command button.
Slides four and five are optional. I placed them there so they can see the correct answers.
In PowerPoint, do ALT+F11 to open the VBA window. Click on Insert then Module to create a new module and copy and paste the following code:
In the GENERAL - DECLARATIONS area type:
Const NOOFQS = 3
Const UD_CODE_1 = 111
Const UD_CODE_2 = 8226
Public QNo As Integer
Public Exitflag As Boolean
Public Qs() As String
Public Choices() As String
Public Ans() As Integer
Public counter As Integer
Public UserAns() As Integer
Sub BeginQuiz()
'
' Macro created 4/26/02
'
Dim ctr As Integer
ReDim Qs(NOOFQS)
ReDim Ans(NOOFQS)
ReDim UserAns(NOOFQS)
ReDim Choices(NOOFQS, 3)
Qs(0) = "1) What does Narcissistic mean?"
Qs(1) = "2) What does Confidant mean?"
Qs(2) = "3) Black Pearl is a nick name for?"
For ctr = 0 To NOOFQS - 1
UserAns(ctr) = 0
Next ctr
Choices(0, 0) = "Very Sleepy"
Choices(0, 1) = "Indecisive"
Choices(0, 2) = "Very Vain"
Choices(1, 0) = "Excessive pride"
Choices(1, 1) = "Trusted friend"
Choices(1, 2) = "Secret"
Choices(2, 0) = "Pele"
Choices(2, 1) = "Mohammed Ali"
Choices(2, 2) = "George Foreman"
Ans(0) = 3
Ans(1) = 2
Ans(2) = 1
QNo = 1
counter = 1
Call AssignValues
With SlideShowWindows(1)
.View.GotoSlide (.Presentation.Slides(2).SlideIndex)
End With
End Sub
Sub AssignValues()
SetBulletUnicode 2, UD_CODE_1
SetBulletUnicode 3, UD_CODE_1
SetBulletUnicode 4, UD_CODE_1
Select Case UserAns(QNo - 1)
Case 1
SetBulletUnicode 2, UD_CODE_2
Case 2
SetBulletUnicode 3, UD_CODE_2
Case 3
SetBulletUnicode 4, UD_CODE_2
End Select
With SlideShowWindows(1).Presentation.Slides(2)
.Shapes(1).TextFrame.TextRange.Text = Qs(QNo - 1)
.Shapes(2).TextFrame.TextRange.Text = Choices(QNo - 1, 0)
.Shapes(3).TextFrame.TextRange.Text = Choices(QNo - 1, 1)
.Shapes(4).TextFrame.TextRange.Text = Choices(QNo - 1, 2)
End With
End Sub
Sub SetBulletUnicode(ShapeName As Integer, Code As Integer)
With SlideShowWindows(1).Presentation.Slides(2) _
.Shapes(ShapeName).TextFrame.TextRange.ParagraphFormat.Bullet
.UseTextFont = msoTrue
.Character = Code
End With
End Sub
Sub ButtonChoice1()
UserAns(QNo - 1) = 1
AssignValues
End Sub
Sub ButtonChoice2()
UserAns(QNo - 1) = 2
AssignValues
End Sub
Sub ButtonChoice3()
UserAns(QNo - 1) = 3
AssignValues
End Sub
Sub NextSlide()
If QNo < NOOFQS Then
QNo = QNo + 1
SlideShowWindows(1).Presentation.Slides(2).Shapes(1) _
.TextFrame.TextRange.Text = Qs(QNo - 1)
AssignValues
Else
Call StopQuiz
End If
DoEvents
End Sub
Sub PreviousSlide()
Static X As Integer
If QNo > 1 Then
QNo = QNo - 1
AssignValues
End If
End Sub
Sub NextAns()
If (counter) = NOOFQS Then
With SlideShowWindows(1)
.View.GotoSlide (.Presentation.Slides(5).SlideIndex)
Exit Sub
End With
End If
With SlideShowWindows(1).Presentation.Slides(4)
.Shapes(1).TextFrame.TextRange.Text = Qs(counter)
.Shapes(2).TextFrame.TextRange.Text = Choices(counter, Ans(counter) - 1)
End With
With SlideShowWindows(1)
.View.GotoSlide (.Presentation.Slides(4).SlideIndex)
End With
counter = counter + 1
End Sub
Sub StopQuiz(Optional EndType As Boolean = False)
Dim ScoreCard As Integer
Dim ctr As Integer
Exitflag = True
With SlideShowWindows(1)
For ctr = 0 To NOOFQS - 1
If Ans(ctr) = UserAns(ctr) Then ScoreCard = ScoreCard + 1
Next ctr
If EndType = False Then
.Presentation.Slides(3).Shapes(1) _
.TextFrame.TextRange.Text = "Your Score is: " _
& ScoreCard & " correct out of " & NOOFQS
Else
.Presentation.Slides(3).Shapes(1) _
.TextFrame.TextRange.Text = "Sorry! You Chickened " _
& "out!" & vbCrLf & "Your Score is: " & ScoreCard & _
" correct out of " & NOOFQS
End If
.View.GotoSlide (.Presentation.Slides(3).SlideIndex)
End With
End Sub
Slide One will then have a command button that calls BeginQuiz().
If you want me to email you any of these powerpoint presentations, and I have one that "hops" around slides, email me at fneily@hotmail.com
Neil