Scenario 3 continued

Your Code:
function validate(answer, correctAnswer){
// store the learner´s answer
SetValue ("cmi.interactions.2.
", answer);
//check to see if user's answer is correct
if( answer == correctAnswer ){
SetValue("cmi.interactions.2.
", "
");
}
else{
SetValue ("cmi.interactions.2.
", "
");
}
}
Code Example:
function validate(answer, correctAnswer){
// store the learner´s answer
SetValue ("cmi.interactions.2.learner_response", answer);
//check to see if user's answer is correct
if( answer == correctAnswer ){
SetValue("cmi.interactions.2.result", "correct");
}
else{
SetValue ("cmi.interactions.2.result", "incorrect");
}
}