• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Assessment (Percentage Issue)

Explorer ,
Mar 06, 2012 Mar 06, 2012

Copy link to clipboard

Copied

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>

TOPICS
ActionScript

Views

588

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 06, 2012 Mar 06, 2012

Copy link to clipboard

Copied

LATEST

Where are you adding the score after a single assestment is complete..

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines