3 Replies Latest reply on Aug 4, 2014 3:29 PM by Rezu

    Quiz result not showing up in Edge

    The shizzolator

      Hi there Edgers

       

      Really hoping someone can help me out with this problem. I've used Redesigns code(Seen Below) to design a quiz in Animate.

       

      I have two problems, when the first question is answered, it skips to the 3rd question instead of the 2nd. I am not sure why this is as I have have checked for overlapping buttons, there are none and it does not occur on any other questions, only the first. Second problem is the quiz reult is not showing up at the end, I have the "grade" and "result" divs in my timeline but when they are reached they do not change to display the quiz results.

       

      Help would be much appeciated

       

      i = 0;

      sym.$("btn4","btn24","btn34","btn44","btn54","btn64","btn74").click(function(){

                i++;

                sym.play("s" + i);

                if (i==1){

                          q1 = 10;

                          //sym.$("question1").html(q1);

                }

                if (i==2){

                          q2 = 10;

                          //sym.$("question2").html(q2);

                }

                if (i==3){

                          q3 = 10;

                          //sym.$("question3").html(q3);

                }

                if (i==4){

                          q4 = 15;

                          //sym.$("question4").html(q4);

                }

                if (i==5){

                          q5 = 15;

                          //sym.$("question5").html(q5);

                }

                if (i==6){

                          q6 = 20;

                          //sym.$("question6").html(q6);

                }

                if (i==7){

                          q7 = 20;

                          //sym.$("question7").html(q7);

                }

                var FinalScoreHolder = q1 + q2 + q3 + q4 + q5 +q6 +q7;

                if (i=7){

                          //var FinalScoreHolder = q1 + q2 + q3;

                          sym.$("grade").html("You scored "+FinalScoreHolder+"%");

                          if (FinalScoreHolder >= 90) {

       

       

                          // play the timeline from the given position (ms or label)

                          sym.play("pass");

       

       

                          } else {

       

       

                          // play the timeline from the given position (ms or label)

                          sym.play("fail");

                          }

                }

      });

       

       

       

      As a side note, this quiz appears at the end of a 8 section mulitmedia learning environment. The code obove is the only code present in the "creationcomplete" window, the rest is done in the timeline.

       

      George

        • 1. Re: Quiz result not showing up in Edge
          TimJaramillo Level 4

          Hi there, this might be a scope issue- since you're declaring 'i' outside of your click function.

           

          Try using:

           

          sym.i = 0;

           

          instead of:

           

          i = 0;

           

           

          Then go through your whole 'if' statement list, and replace 'i' with 'sym.i'.

          1 person found this helpful
          • 2. Re: Quiz result not showing up in Edge
            resdesign Adobe Community Professional & MVP

            In you if statement you need to change  the if statement from i=7 to i==7;  when you compare you need the double equal sign.

             

            var FinalScoreHolder = q1 + q2 + q3 + q4 + q5 +q6 +q7;

                      if (i==7){

                                //var FinalScoreHolder = q1 + q2 + q3;

                                sym.$("grade").html("You scored "+FinalScoreHolder+"%");

                                if (FinalScoreHolder >= 90) {

                                // play the timeline from the given position (ms or label)

                                sym.play("pass");

                                } else {

                                // play the timeline from the given position (ms or label)

                                sym.play("fail");

                                }

                      }

            1 person found this helpful
            • 3. Re: Quiz result not showing up in Edge
              Rezu Level 1

              Do you have a working example of this?

               

              Thanks