LMSCommit() is NOT called imediately after LMSSetValue()

LMSCommit() is NOT called imediately after LMSSetValue()

by Smriti Pandey -
Number of replies: 2

Observed a weird thing with SCORM activity data not saved and thus not tracked.

Auto-commit is set to Yes.

Documentation says the LMSCommit() will be called as soon as LMSSetValue() is called if auto-commit is set.

This used to work before. Not sure if thats the browser version which is causing this issue. I tried with Chrome, Firefox, edge. But nothing works.


It takes 60 seconds after the last LMSSetValue() is called to trigger LMSCommit(). 


The same SCORM package is working fine in SCORM cloud.


Is there any setting which is missed?


If everything is fine, then why does that work in SCORM cloud but not in moodle.

Here is the moodle log.See the time difference between last LMSSetValue() and LMSCommit(). Its 50 seconds.



Average of ratings: -
In reply to Smriti Pandey

Re: LMSCommit() is NOT called imediately after LMSSetValue()

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
auto-commit is really for "broken" packages and is something implemented outside the official SCORM specification. In an ideal world, your SCORM package should be doing this properly.

It's probably clearer in the moodledocs page than it is in the help tooltip:
https://docs.moodle.org/en/SCORM_settings#Compatibility_settings

as per the above docs, when you turn auto-commit on, Moodle will trigger a Commit() on it's own 60 seconds after the values are set by your scorm, unless the package runs it's own commit before then.
In reply to Dan Marsden

Re: LMSCommit() is NOT called imediately after LMSSetValue()

by Smriti Pandey -
Ok thanks for info.

Getting "General Exception" on clicking "Exit Activity" when launched module in same window.
I can't run LMSGetDiagnostic() explicitly.

The following is the log which shows errorcode -101 and diagnostic as 101 as well:
Tue, 27 Apr 2021 12:56:37 GMT: LMSSetValue("cmi.suspend_data", "C1A%24nP1A%24nP1A%24nP0A%24nP0A%24nP0A%24nPIKBradboyd31BALDavidsNed31BAJDnD_ScoreBAJNextCheckBAIPaypal31BAKTotalscoreBCOUSgovernment31BAQcpQuizHandledAllBA$_#-#_$") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSSetValue("cmi.core.session_time", "0000:00:04.25") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: Commit("", "") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSCommit("AJAXResult", "false") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSCommit("result", "false") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSCommit("errorCode", "101") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSGetErrorString("101", "General exception") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSGetDiagnostic("101", "101") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSGetValue("cmi.core.lesson_status") - incomplete => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSSetValue("cmi.core.session_time", "0000:00:04.32") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSSetValue("cmi.core.exit", "suspend") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: Commit("", "") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSCommit("AJAXResult", "false") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSCommit("result", "false") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSCommit("errorCode", "101") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSGetErrorString("101", "General exception") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSGetDiagnostic("101", "101") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:37 GMT: LMSFinish("AJAXResult", "false") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:38 GMT: LMSFinish("result", "false") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:38 GMT: LMSFinish("", "") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:38 GMT: LMSGetErrorString("101", "General exception") => 0 scoid = 635
Tue, 27 Apr 2021 12:56:38 GMT: LMSGetDiagnostic("101", "101") => 0 scoid = 635


What can be the issue?