robertaidy
Technical User
Hi I am new to the site and Flash 8. I have a problem with some script, using the "if" statement. I am using one of the Quiz templates and have entered a new Dynamic text field onto the results page to show text saying either pass or fail. the pass mark is 70%. My script so far is:
var tally:Number = (QuizTrack.total_correct + QuizTrack.total_wrong);
var score_temp:Number =((QuizTrack.total_correct/tally*100));
var results_txt:String = "";
var score:Boolean = true;
score = (score_temp >=70);
//trace (tally);
//trace (score_temp);
//trace (score);
if (score = true) {
results_txt = "Congratulations you have PASSED, Your Level Password is:- QWERTY1";
} else {
results_txt = "Sorry - You Failed - Please Try Again";
}
Currently the field will only show the true statement irrespective of the pass mark.
Can anybody help me?
var tally:Number = (QuizTrack.total_correct + QuizTrack.total_wrong);
var score_temp:Number =((QuizTrack.total_correct/tally*100));
var results_txt:String = "";
var score:Boolean = true;
score = (score_temp >=70);
//trace (tally);
//trace (score_temp);
//trace (score);
if (score = true) {
results_txt = "Congratulations you have PASSED, Your Level Password is:- QWERTY1";
} else {
results_txt = "Sorry - You Failed - Please Try Again";
}
Currently the field will only show the true statement irrespective of the pass mark.
Can anybody help me?