Consulting

Results 1 to 4 of 4

Thread: PPT Quiz help

  1. #1
    VBAX Newbie
    Joined
    Aug 2014
    Posts
    2
    Location

    Post PPT Quiz help

    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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Why are you doing this in PowerPoint, it would be so much simpler in Excel?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Aug 2014
    Posts
    2
    Location
    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

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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").
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •