Hey everyone
I have a quiz application that when the user clicks on the answer it marks it either correct or wrong and proceeds immediatley to the next question.
I want the user to be able to cycle back and forth through the questions before submitting there answers just like a paper test. The user should be able to go back and check thier work before submitting…how would I go about that
function QuizItem(question)
{
this.question=question;
this.answers=new Array();
this.numOfAnswers=0;
this.correctAnswer=0;
this.image='';
this.getQuestion=function()
{
return this.question;
}
this.addAnswer=function(answer, isCorrectAnswer)
{
this.answers[this.numOfAnswers]=answer;
if (isCorrectAnswer)
this.correctAnswer=this.numOfAnswers;
this.numOfAnswers++;
}
this.getAnswer=function(answerNumberToGet)
{
return this.answers[answerNumberToGet];
}
this.getCorrectAnswerNumber=function()
{
return this.correctAnswer;
}
this.checkAnswerNumber=function(userAnswerNumber)
{
if (userAnswerNumber==this.getCorrectAnswerNumber())
gotoAndPlay("Correct");
else
{
wrongQuestion=this.question
gotoAndPlay("Wrong");
}
}
this.getNumOfAnswers=function()
{
return this.answers.length;
}
}