To extend the answer a bit, normally cmi.suspend_data
allows the content to store answers in a string format. This can be delimited simply, or be a native JavaScript Object/Array that gets stringified by JSON. You have options more or less for how you could save structured data if you need it.
In order to resume @Rycochet is correct you would need to suspend. But this also means you need to give them some option for setting "Done" or "Finish" or they may become perpetually in progress.
What's the difference between a cmi.exit
type of 'suspend' vs 'normal'
If the Content is left in 'suspend' it would appear like it was in-progress. I've seen other LMS systems extend a "Done" button outside of the SCO but this is normally a custom addition.
When the student exits normally, the LMS would create a new attempt (clean) if the LMS allows for re-tries. Or the LMS may only launch the content in review mode. Review (cmi.mode
) typically does not allow for further changes to the student attempt to occur.
At the same time the cmi.entry
state will change to 'resume' vs. 'ab-initio' - latin for 'the beginning'. Some LMS's just respond '' which is why I always check to see if their is suspend_data to tell if I've been here before more reliably.
This all greatly depends if the SCO supports review, and suspend. If not you have to build that out so it can put the pages back the way the student left them. Populating answers fields, and other interaction types.
Also don't forget to commit after running any of the commands so it submits the data to the LMS.
What the modes mean
A cmi.mode
of 'normal' means the LMS will accept changes to the student attempt. 'review' means you are taking a look at a prior attempt, but will be unable to make further changes. Of course the LMS may ignore the specification on this. The LMS was not specifically called out to record or display prior attempts so this feature is typically left to the LMS to manage.
Lastly 'browse' will similarly give you the ability to look at the content you are not assigned. This does not typically persist any of the data you enter.
Hopefully that helps explaining why the modes are important. Please note, not all content does a great job of conveying to the student that "I am not recording you" which leads to angry students when they lose their data. As a content designer/developer its important to take these steps since people associate SCORM with being the problem vs. the actual implementation of the presentation.
To recap -
cmi.mode
lets you know if you can persist your data (commonly)
cmi.entry
lets you know if its the beginning or a resume
cmi.suspend_data
lets you know if you have data from a prior session to populate (I find it more reliable than cmi.entry in the wild)
cmi.location
lets you bookmark a page the student was on
cmi.exit
will specify if the student is ending or suspending the attempt.