change the function getScore() to detect when score is 100%
if(score=100){topMarks()}
and do what you like with the function
function topMarks(score){
alert("You have scored "+score)
// open a new window
// or
// display some text
}
function getScore(form) {
var score = 0;
var currElt;
var currSelection;
for (i=0; i<numQues; i++) {
currElt = i*numChoi;
for (j=0; j<numChoi; j++) {
currSelection = form.elements[currElt + j];
if (currSelection.checked) {
if (currSelection.value == answers[i]) {
score++;
break;
}
}
}
}
score = Math.round(score/numQues*100);
if(score=100){topMarks(score)}
form.percentage.value = score + "%";
var correctAnswers = "";
for (i=1; i<=numQues; i++) {
correctAnswers += i + ". " + answers[i-1] + "\r\n";
}
form.solutions.value = correctAnswers;
}
// -->
"Hogan" <jh******@hotmail.com> wrote in message
news:bo*************@ID-185826.news.uni-berlin.de...
I need a simple quiz script and have found one at this url
http://www.mompswebdesign.com/jscript/quiz_creator.html which I can adapt
for my own needs. There is one thing I need help on though, I want that if
the score = 100% that either a new page opens or a url link / message is
displayed in the correct answers text area . Any takers?