1 Reply Latest reply: Sep 13, 2012 7:35 PM by Darshan Rane RSS

    Assessment (Percentage Issue)

    graphias Community Member

      I have created an assessment in Flash. There are 5 questions in the assessment. Overall there are 7 Pages.

      p0 - The intro page.

      p1 to p5 - Has the assessment questions

      p6 - Has the result

       

      Problem - Even after getting all the answers correct, I get the maximum percentage as 80% instead of 100%.

      ------------------------------------------------------------------------------------------ -----------------------------------------------------------------------------------

      p0 - Introduction to the assessment.

       

      Action:

      import flash.external.*

      var assessmentScore:Number;

      var tmpstr:Number = 25;

      var assessmentTry:Number;

       

       

      this.controller.setNextButtonState(false);

      var completed = ExternalInterface.call("getCompletionStatus");

      var score = ExternalInterface.call("getpvrScore",pvrscore);

      var attempts = int(ExternalInterface.call("getattemp",attemp));

      if (completed) {

                          assessmentScore = score;

                          assessmentTry = attempts;

                          //this.gotoAndStop("p6");

                          //var cp = this.controller.currentPage;

                          this.controller.goToPage(6);

                }

      else{

                assessmentTry = attempts;

                assessmentScore = 0;

      }

       

       

      if(score == null){

                assessmentScore = 0;

      }

       

      stop();

      ------------------------------------------------------------------------------------------ -----------------------------------------------------------------------------------

       

      p1,p2,p3,p4,p5

       

      Has the assessment questions Single Select and Multiple Select

       

      ------------------------------------------------------------------------------------------ -----------------------------------------------------------------------------------

       

      p6 - Results Page

       

      Action:

      import flash.external.*

       

      if(!completed){

      assessmentTry++;

      ExternalInterface.call("recieveTextFromFlash", assessmentScore, assessmentTry);

      }

       

      this.controller.setNextButtonState(false);

      stop();

      ------------------------------------------------------------------------------------------ -----------------------------------------------

       

      HTML FILE:

       

      Following is the .js script in the HTML File where the .swf is called from

       

       

      <script language="javascript">

                          function getController(){

                                  if(window.opener){

                                      return window.opener.parent.frames.LEVController;

                                          }else{

                                                return parent.parent.frames.LEVController;

                                          }

                              }

       

       

      var lessonStat = getController().getLessonStatus();

      var lessonScore = 0;

      lessonScore = getController().getLessonScore();

      var attempts = 0;

      attempts = Number(getController().getElementFromSuspendData("quiz_att"));

       

       

      function getCompletionStatus(){

                if(lessonStat){

                          return true;

                }else{

                          return false;

                }

      }

       

       

      function getpvrScore(pvrscore){

                return lessonScore;

      }

       

       

      function getattemp(attemp){

                return attempts;

      }

       

       

      function recieveTextFromFlash(aScore,atm) {

                          //alert("aScore: " + aScore +" atm: " + atm);

                          getController().setLessonScore(aScore);

                          getController().addToSuspendData("quiz_att", atm);

                          if(aScore >= 80 || atm >= 3){

                          getController().setLessonStatus(true);

                          }

       

      }

      </script>