The problem is lmsetvalue no save value if it's equal to inital/default value. This problem occur when the course save the scorm values (LMSCommit function) some times in the course learning. In scorm run-time enviroment book Version 1.2 there are no restrictions to call lmscommit function some times in the course, then the error you can reproduce with this steps.
Steps to reproduce the problem with a scorm 1.2 course:
1.- Init course and recover default values, in lesson_location there are default value 3
2.- Go to lesson 5.
3.- LMSSetValue lesson_location 5
4.- LMSCommit. Then moodle check: if 5 not equals to 3 then save into database lesson_location to 5 else no save, in this case save to DataBase
5.- Go to lesson 3
6.- LMSSetValue lesson_location 3
7.- LMSCommit. Then moodle check: if 3 not equals to 3 then save into database lesson_location to 3 else no save, in this case NO save to DataBase
In this moments if you leave the course and enter in it anothertwelve, then you will have lesson_location to 3 but the last save value is 5 and it's incorrect because you leave the course in lesson 3.
This check and problem is in line 544 of mod/scorm/datamodels/scorm_12.js.php
if (eval('datamodel["'+elementmodel+'"].defaultvalue') != data[property] || eval('typeof(datamodel["'+elementmodel+'"].defaultvalue)') != typeof(data[property]) ) {
There are some scorm data models must saved forever, as cmi.core.lesson_location, cmi.core.lesson_status, cmi.core.score.raw, cmi.core.score.min, cmi.core.score.max, cmi.core.session_time
- duplicates
-
MDL-21761 Data missing in SCORM datamodel elements under some circumstances
-
- Closed
-