Forum Discussion
How to set the LMS status to Completed or Failed
Hi Lakshmi,
No worries. My solution above assumed publish to SCORM 1.2 and I totally forgot that you were trying to set the course "Completed" after both tries are failed. In your file, now I see you even have variable to track the number of your attempts. I'm attaching my testing story file with variable "Attempts" initially set to 1 and adding 1 to it when the "Retry" button is clicked after the first attempt is failed. After the second attempt is failed the "Retry" button is replaced with the "Exit course" button. And this all takes place on the Failure layer. I'm also setting the "Execute JavaScript" trigger when the timeline starts on this layer (Failure) if the number of attempts "Attempts" is greater or equal to 2. Code to execute:
SCORM2004_CallSetValue('cmi.completion_status', 'completed');
SCORM2004_CallSetValue('cmi.success_status', 'failed');
Publishing:
1. SCORM2004, 4th edition
2. LMS Reporting: Passed/Incomplete
3. Tracking Options: When the learner completes a quiz
Basically, Passed/Incomplete option would keep throwing the incomplete status as long as the quiz is not passed, with the success status being set to status unknown, then to status passed if the quiz is passed. In the code above we say "set my status to "completed" anyway but only after I fail on both attempts". If you pass the quiz on your first or second attempt the course will be completed as well and the success status passed updated by default.
Check my file and make all necessary adjustments in your project. It's not a lot. Keep in mind that this has been successfully tested in the ScormCloud. Session video recording available.