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");
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");