Override Captivate's SCORM output onUnload with JS?
Using Captivate 2017 and publishing as HTML5.
I'm trying to replace Captivate's built in SCORM bookmarking using custom JS calls to set and commit information: SCORM_CallLMSSetValue("cmi.core.lesson_location", window.cpAPIInterface.getVariableValue('highestTopic')) [highestTopic is an integer)
on certain slides, and this works wonderfully as long as the user closes the activity using the Exit button on the slide after the quiz results, which includes the following JS:
SCORM_SetBookmark("");
SCORM_objAPI.LMSSetValue("cmi.core.exit", "logout");
SCORM_CallLMSCommit();
SCORM_objAPI.LMSFinish('');
However, if the user closes the window using the parent window's controls, Captivate performs its own calls that overwrite my information (the custom cmi.core.lesson_location data) onUnload of the window. It overwrites my integer information with a string of the slide name that was showing at the time the window was closed.
Is there any way to override or disable this so that my information is preserved? I've tried digging through the JS created by Captivate on publishing the SCO, but I have had no success in finding the correct line of code where this is happening. If I add my own onUnload to the body of the index_scorm page, set and commit my data, then terminate the SCORM connection, will that override Captivate's onUnload, or will theirs beat mine to the punch?
