Click to See Complete Forum and Search --> : how to increment score and show alert?


tecdoc5
06-21-2003, 09:41 AM
got all my code working but this one section that i need to calculate my score and show feedback when wrong button pushed, can someone please help???

function CheckAns(question, answer) {
var CorrectNum=0;
yourAns[question]=answer;
for(i=1;i<=10;i++){
if(answer==Ans[question]) {
alert("Correct"); score++;
}
else {
alert(explainAnswer[question]);
}
}
alert(CorrectNum="\n\nYour total score is : "+score+" out

of 10.\n");

Greelmo
06-21-2003, 12:10 PM
You're requesting variables which do not exist. Also, you didn't post enough code, so i can't see what values you sent to the defined function variables.

tecdoc5
06-21-2003, 12:33 PM
Greelmo, if i pm you my whole code can u look at it and give me some help? this is a project due today and there are 60 other people trying to do the same thing.

tecdoc5
06-21-2003, 12:44 PM
anyone ??
i would really appreciate help from someone who knows this stuff.