Only allowing 'not attempted' when CMI has not been initialized

This commit is contained in:
Jonathan Putney
2021-04-19 15:50:35 -04:00
parent 6d1eabc3fc
commit 1a5d8d3241
6 changed files with 32 additions and 10 deletions

View File

@@ -400,8 +400,14 @@ class CMICore extends BaseCMI {
* @param {string} lesson_status
*/
set lesson_status(lesson_status) {
if (check12ValidFormat(lesson_status, scorm12_regex.CMIStatus2)) {
this.#lesson_status = lesson_status;
if (this.initialized) {
if (check12ValidFormat(lesson_status, scorm12_regex.CMIStatus)) {
this.#lesson_status = lesson_status;
}
} else {
if (check12ValidFormat(lesson_status, scorm12_regex.CMIStatus2)) {
this.#lesson_status = lesson_status;
}
}
}