Scenario 2

In this scenario, the project requirements indicate that the learner should be allowed a maximum time of 15 minutes to complete an activity. During the learner attempt, the learner is allowed as many learner sessions as needed to complete the activity, but only 15 minutes of total time in the SCO. If the learner exhausts the allotted time, then the learner will not be permitted to continue and will be exited from the SCO.

var maxTimeAllowed = GetValue ( "cmi." );

if (currentTimeSpan >= maxTimeAllowed)
{
   // The learner has exceeded the maximum time alloted
   // for the learner attempt, exit the SCO
   exitSCO();
}

Click after you complete the code.