Skip navigation
Captain_Uppercut
Currently Being Moderated

Multiple Choice Quiz Score

May 5, 2012 2:02 AM

Tags: #cs5 #flash_cs5 #actions

Hi all,

 

This is my first post here so, apologies if I break any unwritten rules, or say anything ridiculous, please bare with me.

 

So, I have created a multiple choice quiz using Flash CS5 as part of my multimedia project and wanted to know how (or if) I can incorporate a score system to the existing quiz.

 

I created the quiz using the timeline and layers. So for every question there are three layers;

 

Layer 1 - Question w/ four possible answers (only one is correct)

Layer 2 - Correct answer

Layer 3 - Incorrect answer

 

I am using buttons to navigate through the timeline.

 

What I would like to achieve is, at the end of the quiz, a score to be generated based on the questions they got right.

 

I hope I have included everything necessary.

 

Thanks for reading and the possible help.

 
Replies
  • Currently Being Moderated
    May 5, 2012 6:05 AM   in reply to Captain_Uppercut

    Create an actions layer that extends the full length of the timeline and in frame 1 create a score variable.  As you go along with the quiz, add/subtract value to that variable for right/wrong answers.  As long as that layer extends to the end, that variable is accessible to be changed, and at the end will equal whatever value it has accrued.

     
    |
    Mark as:
  • Currently Being Moderated
    May 5, 2012 10:22 AM   in reply to Captain_Uppercut

    That code will only have a chance of working if you are publishing for AS2.  In the first frame you want to declare the variable... there should be no need for any _root (AS2) reference...

     

    1st frame:   var total:Number = 0;

     

    subsequent frames....  total += 1   or    total -= 1 // add 1 or subtract 1

     

    note: total += 1  is the same as:  total = total + 1    (similar for -= )

     
    |
    Mark as:
  • Currently Being Moderated
    May 5, 2012 3:06 PM   in reply to Captain_Uppercut

    Create a textfield, give it an instance name, and assign the score to it as its text property...

     

    yourTextField.text = String(score);

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points