home *** CD-ROM | disk | FTP | other *** search
- function buildQuestionsArray4()
- {
- stripWhitespaceDoublePass(quizDoc4);
- var quizNode = quizDoc4.firstChild;
- var i = 0;
- while(i < quizNode.childNodes.length)
- {
- var thisQuestion = quizNode.childNodes[i];
- var choicesArray = new Array();
- var j = 0;
- while(j < thisQuestion.childNodes.length)
- {
- var thisChoice = thisQuestion.childNodes[j];
- choicesArray[j] = thisChoice.firstChild.nodeValue;
- j++;
- }
- questionsArray[i] = new Question(parseInt(thisQuestion.attributes.answer),thisQuestion.attributes.text,choicesArray);
- i++;
- }
- questionsArray.shuffle();
- loadMsg = "";
- makeQuestion(currentQuestion);
- }
- function answer(choice)
- {
- userAnswers.push(choice);
- MeAnswer = userAnswers.length;
- if(userAnswers[MeAnswer - 1] == questionsArray[currentQuestion].correctAnswer)
- {
- totalCorrect++;
- }
- if(currentQuestion + 1 == 5)
- {
- questionClip.removeMovieClip();
- gotoAndStop("echoes");
- }
- else
- {
- makeQuestion(++currentQuestion);
- }
- }
- stop();
- var currentQuestion = 0;
- var quizDoc4 = new XML();
- quizDoc4.onLoad = buildQuestionsArray4;
- quizDoc4.load("quiz/quiz4.xml");
-