Simple quiz help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jhirschey
    New Member
    • May 2007
    • 2

    Simple quiz help

    Hello, I am a first grade teacher and a beginner when it comes to actionscript. I am attempting to make a sight word game where the student starts off with 0 points and attempts to identify a sight word based upon an oral prompt. I have three buttons for each question and have one as the correct response. On the correct button I put the following action:

    on (release) {
    if (first == 1) {
    first = 0;
    result += 1;
    }
    gotoAndPlay (3);
    }


    On the incorrect buttons I am putting the following:
    on (release) {
    first = 0;
    gotoAndPlay (3);

    }


    At the end I used a dynamic text box to display the following:
    stop ();
    finalresult = int((result/6)*100);
    if (finalresult<50 ) {
    comment6 = "You got only "+finalresu lt+" % "+"of the answers right. Let's study hard and get a higher score next time!";
    } else if ((finalresult>8 0) && (finalresult<70 )) {
    comment6 = "You got "+finalresu lt+" % "+" of the answers right. Not bad, but still improvable. Read, read, and read some more!.";
    } else if (finalresult>99 )&& (finalresult<80 )) {
    comment6 = "You got amazing "+finalresu lt+" % "+"of the answers right. You are on your way to perfection!.";
    } else if (finalresult=10 0) {
    comment6 = "You got amazing "+finalresu lt+" % "+"of the answers right. Perfect score! You are on your way to being an excellent reader!";
    }


    Yet, when I test the movie it always comes up as 0% no matter how many I answer correct. I would greatly appreciate any hints or tips to get it working.
  • sandyw
    New Member
    • Mar 2007
    • 122

    #2
    You need to place a counter for each question.
    So if you have 10 question, the counter would start at one.
    for every correct answer the counter would add one to it and so on down the line until all the answer are done.
    Then come the if and then statement
    if you got this many correct then good job
    if you go this many correct then you're doing ok
    if you got this many better study some more...

    If you need more help I will try to help you, but I have several Java project to complete by this thurs.

    red

    Comment

    • Motoma
      Recognized Expert Specialist
      • Jan 2007
      • 3236

      #3
      Is result defined at the global scope? Try using trace statements at each point in the program to print out the value of result and see if it matches what you think it should be.

      Comment

      • jhirschey
        New Member
        • May 2007
        • 2

        #4
        As I had mentioned earlier I am a beginner at all of the scripting so it I would have to say no I didn't put a global trace on it. If it helps, the source for it can be found here:
        http://mcs.k12.ny.us/pages/jhirschey/files/List 1.fla

        Thank you so very much for all the help!

        Comment

        Working...