Dim numCorrect As Integer Dim numIncorrect As Integer Dim userName As String Dim qAnswered() As Boolean Dim answer() As String 'Array to store answers Dim numQuestions As Long Dim printableSlideNum As Long Sub GetStarted() Initialize YourName ActivePresentation.SlideShowWindow.View.Next End Sub Sub Initialize() Dim i As Long numCorrect = 0 numIncorrect = 0 printableSlideNum = ActivePresentation.Slides.Count + 1 numQuestions = ActivePresentation.Slides.Count - 2 ReDim qAnswered(numQuestions) ReDim answer(numQuestions) For i = 1 To numQuestions qAnswered(i) = False Next i End Sub Sub YourName() userName = InputBox(Prompt:="Type your name") End Sub Sub DoingWell() MsgBox ("You are doing well, " & userName) End Sub Sub DoingPoorly() MsgBox ("Try to do better next time, " & userName) End Sub Sub RightAnswerButton(answerButton As Shape) Dim thisQuestionNum As Long thisQuestionNum = _ ActivePresentation.SlideShowWindow.View.Slide.SlideIndex - 1 If qAnswered(thisQuestionNum) = False Then 'only update the answer the first time answer(thisQuestionNum) = answerButton.TextFrame.TextRange.Text End If RightAnswer End Sub Sub WrongAnswerButton(answerButton As Shape) Dim thisQuestionNum As Long thisQuestionNum = _ ActivePresentation.SlideShowWindow.View.Slide.SlideIndex - 1 If qAnswered(thisQuestionNum) = False Then 'only update the answer the first time answer(thisQuestionNum) = answerButton.TextFrame.TextRange.Text End If WrongAnswer End Sub Sub RightAnswer() Dim thisQuestionNum As Long thisQuestionNum = _ ActivePresentation.SlideShowWindow.View.Slide.SlideIndex - 1 If qAnswered(thisQuestionNum) = False Then numCorrect = numCorrect + 1 End If qAnswered(thisQuestionNum) = True DoingWell ActivePresentation.SlideShowWindow.View.Next End Sub Sub WrongAnswer() Dim thisQuestionNum As Long thisQuestionNum = _ ActivePresentation.SlideShowWindow.View.Slide.SlideIndex - 1 If qAnswered(thisQuestionNum) = False Then numIncorrect = numIncorrect + 1 End If qAnswered(thisQuestionNum) = True DoingPoorly End Sub Sub Question3() Dim theAnswer As String Dim thisQuestionNum As Long thisQuestionNum = _ ActivePresentation.SlideShowWindow.View.Slide.SlideIndex - 1 'Change the text here and the answer checking theAnswer = InputBox(Prompt:="What is the capital of Maryland?", _ Title:="Question " & thisQuestionNum) If qAnswered(thisQuestionNum) = False Then 'ADDED answer(thisQuestionNum) = theAnswer 'ADDED End If 'ADDED theAnswer = Trim(theAnswer) theAnswer = LCase(theAnswer) 'Besides the text of the question, only change this part If theAnswer = "annapolis" Then RightAnswer Else WrongAnswer End If End Sub Sub PrintablePage() 'ADDED Dim printableSlide As Slide Dim homeButton As Shape Dim printButton As Shape Set printableSlide = _ ActivePresentation.Slides.Add(Index:=printableSlideNum, _ Layout:=ppLayoutText) printableSlide.Shapes(1).TextFrame.TextRange.Text = _ "Results for " & userName printableSlide.Shapes(2).TextFrame.TextRange.Text = _ "Your Answers" & Chr$(13) For i = 1 To numQuestions printableSlide.Shapes(2).TextFrame.TextRange.Text = _ printableSlide.Shapes(2).TextFrame.TextRange.Text & _ "Question " & i & ": " & answer(i) & Chr$(13) Next i printableSlide.Shapes(2).TextFrame.TextRange.Text = _ printableSlide.Shapes(2).TextFrame.TextRange.Text & _ "You got " & numCorrect & " out of " & _ numCorrect + numIncorrect & "." & Chr$(13) & _ "Press the Print Results button to print your answers." printableSlide.Shapes(2).TextFrame.TextRange.Font.Size = 9 Set homeButton = _ ActivePresentation.Slides(printableSlideNum).Shapes.AddShape _ (msoShapeActionButtonCustom, 0, 0, 150, 50) homeButton.TextFrame.TextRange.Text = "Start Again" homeButton.ActionSettings(ppMouseClick).Action = ppActionRunMacro homeButton.ActionSettings(ppMouseClick).Run = "StartAgain" Set printButton = _ ActivePresentation.Slides(printableSlideNum).Shapes.AddShape _ (msoShapeActionButtonCustom, 200, 0, 150, 50) printButton.TextFrame.TextRange.Text = "Print Results" printButton.ActionSettings(ppMouseClick).Action = ppActionRunMacro printButton.ActionSettings(ppMouseClick).Run = "PrintResults" ActivePresentation.SlideShowWindow.View.Next ActivePresentation.Saved = True End Sub Sub PrintResults() 'ADDED ActivePresentation.PrintOptions.OutputType = ppPrintOutputSlides ActivePresentation.PrintOut From:=printableSlideNum, _ To:=printableSlideNum End Sub Sub StartAgain() 'ADDED ActivePresentation.SlideShowWindow.View.GotoSlide (1) ActivePresentation.Slides(printableSlideNum).Delete ActivePresentation.Saved = True End Sub