Log in

View Full Version : PPT Quiz help



acecv8
08-18-2014, 01:13 AM
Hi Guys,

I'm in the process of making a power point exam and I've got the majority of things working but would like to be able to do two more things to really finish off the project.

1. at the end of the quiz i have project tally up the results on a new slide and tell me how many questions i get correct and the percentage, also i have it showing me all the questions with what answer was selected.
what i want to be able to do is either have only the incorrect question number and answer showing, or have it so the Q's and A's show but have red or green txt stating the answer was wrong or correct.
Is this possible to do in the code i'm using as it's using an array?



Sub PrintablePage() 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 " & fName & " " & lName
printableSlide.Shapes(2).TextFrame.TextRange.Text = _
"Your Answers That Were Incorrect" & 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 & ". Which is " & 100 * numCorrect / (numIncorrect + numCorrect) & "%." & 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
SaveToExcel 'ADDED
End Sub




2. The next thing i would like to be able to do is if the user doesn't pass their test and when they push the "StartAgain" button that it tally's up how many times they've re done the test so i can populate it in the xlsx file where i'm saving the results?

thank you in advanced

Bob Phillips
08-18-2014, 02:08 AM
Why are you doing this in PowerPoint, it would be so much simpler in Excel?

acecv8
08-18-2014, 02:13 AM
It's in power point as i thought it would be neater to have the study questions then the exam all in one instead of having two packages and separate files

Bob Phillips
08-18-2014, 04:41 AM
Don't understand that answer, but the sort of thing I have seen and created in Excel is to have a list of questions, then the answers on a hidden sheet. When they input the answer, you have a formula that checks against the answer and sasy whether it is correct or not. Tallying the score is a simple matter of COUNTIF(rng,"Correct").