Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
1 to 4 of 4
if(course.lesson_status == "passed" || course.lesson_status == "completed"){
console("You have already completed this course.");
//Disconnect from the LMS.
scorm.disconnect();
}<imsss:deliveryControls completionSetByContent="true" objectiveSetByContent="true"/>
//Set course variables
course.lesson_status = scorm.get("cmi.completion_status");
//If course has already been completed
if(course.lesson_status == "completed"){
console("You have already completed this course.");
//Disconnect from the LMS.
scorm.disconnect();
} else {
//Set course status to incomplete
success = scorm.set("cmi.completion_status", "incomplete");
If the SCO set the cmi.exit to "", then this indicates that the exit state is undetermined and the learner attempt on the SCO ended. A subsequent learner attempt on the SCO will involve a new set of run-time data.
Data Model Element Implementation Requirements:
- Data Type: state (browse, normal, review) [1]
- Value Space: The IEEE defines three state values. SCORM binds these state values to the following restricted vocabulary tokens:
- “browse”: The SCO is presented without the intent of recording any information about the current learner session [1].
- “normal”: The SCO is presented with the intent of recording information about the current learner session [1]. This is the default value if no mechanism is in place to identify the mode.
- “review”: The SCO has previously recorded information about the learner attempt and is presented without the intent of updating this information with data from the current learner session [1].
LMS Behavior Requirements:
- This data model element is mandatory and shall be implemented by the LMS as read-only.
- There is currently no mechanism in place to determine the mode of a SCO. This is currently left to the implementation of an LMS. If the LMS wants to provide a way of previewing (or browsing) a content organization or a way of reviewing a content organization, then this is one mechanism for initializing the cmi.mode in which the content (SCO) in the content organization should be viewed. The “normal” mode shall be the default mode for all SCOs.
Now when i open the SCO in normal mode, it saves the completion_status sucessfully. Then i quit the activity and try it again, then moodle asks me (with a checkbox) if i want to re attempt the activity, if you check this, all data previously saved will be deleted, and i'll get an "unknown" value for completion_status.
If my SCO was setup with only one attempt, there will be no checkbox for a new attempt, obviously. But the interesting part is when i try to enter once more to the activity in normal mode, if the status is completed and there are no attempts left (like in this case), SCORM won't let you connect; It always returned me false to scorm.connect() on the SCORM console, and if i can't connect i can't get the cmi.completion_status, maybe i can tweak the code so it takes this in consideration.

1 to 4 of 4