Scenario 2 continued

Your Code:

function validate(answer, correctAnswer){
  // store the learner´s answer
   SetValue ("cmi.interactions.1. ", answer);

  //check to see if user's answer is correct
  if( answer == correctAnswer ){
     SetValue("cmi.interactions.1. ", " ");
  }
  else{
     SetValue ("cmi.interactions.1. ", " ");
  }
}
Code Example:

function validate(answer, correctAnswer){
  // store the learner´s answer
   SetValue ("cmi.interactions.1. learner_response", answer);

  //check to see if user's answer is correct
  if( answer == correctAnswer ){
     SetValue("cmi.interactions.1. result", "correct");
  }
  else{
     SetValue ("cmi.interactions.1. result", "incorrect");
  }
}