Skip navigation
Currently Being Moderated

Assessment (Percentage Issue)

Mar 6, 2012 12:59 AM

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>

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

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