Scenario 5

You are programming a simulation that teaches learners how to use a fire extinguisher. The learner has to complete the following steps, each of which is worth 1 point, but with different weights:

It will be best for this type of scenario to update the scores after each question has been answered.

7. Help complete the following code to set the raw and scaled scores:

function updateScores( weight, answer, correctAnswer ){

//get current values for raw and scaled scores that are stored in the LMS
var rawScore = GetValue ("cmi. . ");
var scaledScore = GetValue ("cmi. . ");

if( answer == correctAnswer){ rawScore++;
scaledScore += weight * 1;

//update the raw score
( "cmi. . ", );

//update the scaled score
SetValue ( "cmi. . ", scaledScore );
}

//if the learner gets the question wrong, there is no change to either score
}

Click Submit after you complete the code.