0 Replies Latest reply on Jun 14, 2006 7:03 AM by Jadeivy

    XML-Based Tracking Function...

    Jadeivy

      My question is, while I track correct and incorrect responses AND report these at the end of the quiz, what would be the best method to track specific questions so that I cna offer the quiz taker a review of incorrect responses. The review would represent the question, show the incorrect response and below it, the correct response.

      My simple XML is currently (per question item):

      <item>
      <question>Question Here?</question>
      <answer correct="y">Answer One</answer>
      <answer>Answer Two</answer>
      <answer>Answer Three</answer>
      <answer>Answer Four</answer>
      </item>

      I'm thinking I could go along these lines (per question item):

      <item>
      <questionID>1</questionID>
      <question>First Question Here?</question>
      <answer correct="y">Answer One</answer>
      <answer>Answer Two</answer>
      <answer>Answer Three</answer>
      <answer>Answer Four</answer>
      <hint>Hint Text Here</hint>
      <answerReason>Reason for Answer Here</answerReason>
      <sectionID>3</sectionID>
      </item>


      In this case:

      'questionID' would be a unique identifier towards what question was incorrectly answered.

      'hint' would be used in a situation where I might give the user a second chance to answer the question correctly.
      The 'hint' would display on the first incorrect answer choice.

      'answerReason' would display the reason the correct answer is correct. An explanation (short) that would display in the quiz review section.

      'sectionID' would display the Section that the particular question came from within the lesson so the user could have a reference point back to where the info originally came from.



      Just not sure how to correctly implement this review feature.

      My QuizItem function is below:

      function QuizItem(question) {
      this.question = question;
      this.answers = new Array();
      this.numOfAnswers = 0;
      this.correctAnswer = 0;
      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 {
      gotoAndPlay("Wrong");
      }
      };
      this.getNumOfAnswers = function() {
      return this.answers.length;
      };
      }