Scenario 3

This example shows that if the learner only accesses the introduction content, then the SCO is determined not attempted, and if the animation is viewed, then the SCO is determined incomplete. It is not until the summary content is accessed that the SCO is determined completed.
5. Complete the code below that would be used to check what part of the SCO the learner completed and set the appropriate status:

// currentSection - string. It holds the name of the section the learner
// is currently viewing
// animationFinished - boolean. It’s default value is set to false. It is
// set to true when the animation finishes playing
function setStatus( currentSection, animationFinished)
{
if( currentSection == "introduction" )
{
SetValue( "cmi.completion_status", "" );
}
else if( currentSection == "animation" && !animiationFinished )
{
SetValue( "cmi.", "" );
}
else if( currentSection == "summary" || animationFinished )
{
SetValue( "cmi.", "" );
}
}
Click Submit after you complete the code.