Scenario 1

During the design of the content, project requirements allow for the learner to exit the SCO and return at a later time. All data from a previous session will be retained and available, including data collected during an activity that the learner only partially completed.

Using the data model element, Suspend Data, make it possible for the learner to enter and exit the SCO, without losing any data from previous sessions.

function saveOtherData()
{
   // Set suspend data to important data that cannot be persisted using
   // any other data model element. This data is only recognizable by this
   // SCO. Upon rentry, this data will be parsed and used appropriately to
   // reinitialize the state of the SCO.

   SetValue ( "cmi. ", "F4:exit=Q2:reenter=P5M" );
}

Click after completing the code.