Copy link to clipboard
Copied
Hi there
I know LMS can handle this but I would like to be able to do it myself.
This is my goal.
To have a button that saves and closes the HTML5 module. I am publishing SCORM 2004.
When the user opens the module again, s/he must land on the same slide s/he saved the module.
This is what I have been trying, I attach this JS script to a button
SCORM2004_CallGetValue("cmi.suspend_data");
SCORM2004_CallCommit();
SCORM2004_CallTerminate();
I know something is missing so I would appreciate any thoughts.
Do I need to Set the suspend data or something?
Thanks in advance
B
PS How do I do so that I SetValue of the suspend data when revisiting the module?
Copy link to clipboard
Copied
For me all of this works just fine out of the box with Captivate UI functionality without the need for any manual SCORM calls via js. Just make sure you keep LMS Bookmarking turned on (leave 'Never Send Resume Data' unticked in the LMS Advanced Settings in Captivate).
Put a simple 'Exit' action on an Exit button (though actually for me just killing the Course Window works just as well). Completion/Success gets properly recorded by the LMS, and on re-lauch the learner can carry on where he/she left of last time.
Copy link to clipboard
Copied
Thanks for the input Gaanf. It does work well when I set the LMS bookmarking on.
It was quite ok for many many users until a very very important person took the module and somehow after closing the browser and relaunching the module s/he did not start from where s/he left.
Now, s/he wants to have a simple save and exit button.
I agree that a normal button with Exit command + LMS bookmarking ON should work but I would like to understand a bit more about the custom option.
I believe an Exit command executes SCORM2004_CallTerminate();
Copy link to clipboard
Copied
LMS's act slightly different, especially in SCORM_2004.
In 2004 the data should only be saved depending on the exit type, which needs to be set to "suspend" in order to save bookmarks and suspend_data.
If the user closes the browser not using the course exit button, unless there is an event listener for the browser closing, data should NOT be saved.
In your code you do not need to get suspend data as it does nothing. So just add this code at the top of yours and see how your LMS behaves.
SCORM2004_CallSetValue("adl.nav.request", "suspendAll");
SCORM2004_CallSetValue("cmi.exit", "suspend");
Copy link to clipboard
Copied
Thanks for that David
This is what I use for the button
SCORM2004_CallSetValue("adl.nav.request", "suspendAll");
SCORM2004_CallSetValue("cmi.exit", "suspend");
SCORM2004_CallCommit();
SCORM2004_CallTerminate();
When I relaunch the course it will NOT go to the slide where I left it.
Would you please explain what are the meanings of the two lines - especially the first one.
For the second one I know that Exit would take these three options
"time-out", "suspend", or "logout"
what is the difference?
Copy link to clipboard
Copied
Why make it simple when it can be done in a complicated way? Seems to be more and more the case. I also choose for the easy way....
Copy link to clipboard
Copied
I also did choose the easy option but apparently something went wrong in this particular case.
So I would like to get more understanding of the process
Copy link to clipboard
Copied
Forget the adl.nav.request one, that is from a course where I used that.
Most of the LMS's I've used with SCORM 2004 write all of the data to temporary tables in the database. When you set the cmi.exit to suspend, it moves all of the data to a permanent table since you are telling the LMS you are not done wit the SCO and the data should persist between sessions.
Captivate may be overriding any settings you make when the SCO is unloading, it hard to tell what the exact sequence is without looking at the debug window in the LMS to see what and when calls are being made.
Copy link to clipboard
Copied
Thanks again David. The explanation about the tables is REALLY helpful. It is simple but until you know it.. it is a mistery.
I can supply the logs but I just need a hand. Actually I have always had issues with the Debug window in our LMS - LMS 365 based on Sharepoint. Storyline debug window works fine but Captivate is blank. I am changing the value SHOW_DEBUG_ON_LAUNCH= to true in the scormdriver.js file. I get the popup window but it is blank...
Anyway, I managed to get the debugging in the console of the F12 dev tools by using this method expained here. Although it is for SCORM 1.2 it works for SCORM 2004
https://beeznest.com/blog/2014/11/26/tricks-to-debug-captivate-scorm-1-2-content/
I change this bit
function WriteToDebug(strInfo){
if(blnDebug){
var dtm=new Date();
var strLine;strLine=aryDebug.length+":"+dtm.toString()+" - "+strInfo;
aryDebug[aryDebug.length]=strLine;if(winDebug&&!winDebug.closed)
{
if(!window.firstMsg){window.firstMsg=true;}
else{winDebug.document.write("<div class='debugLog' style='background-color:"+getBackgroundColorForLogs()+";padding-bottom: 10px;font-family:monospace;word-wrap: break-word;'>"+strLine+"</div>\n");
}
}
return;
}
}
to what is proposed in the article
function WriteToDebug(strInfo){
var dtm=new Date();
var strLine;
strLine=aryDebug.length+”:”+dtm.toString()+” – “+strInfo;
aryDebug[aryDebug.length]=strLine;
console.log(strLine);
return;
}
Basically the debug is redirected to the Console.
I would like to be able to save the debug log. Considering that the last line is Terminate, the Console just closes, so there is no way I could manually save the log.
What would be an option to save the log? I tried document.write options etc. but does not work really.
Thanks in advance
Bobby
PS. BTW, I found this excellent explanation about exit suspend, timeout etc