fix scorm iqpf with double initialize

This commit is contained in:
2024-09-30 15:31:45 -04:00
parent b9d58c33e7
commit 3a8ff2db5a
13 changed files with 44 additions and 78 deletions

19
dist/aicc.js vendored
View File

@@ -726,21 +726,14 @@ var BaseAPI = /*#__PURE__*/function () {
_createClass(BaseAPI, [{
key: "initialize",
value: function initialize(callbackName, initializeMessage, terminationMessage) {
var returnValue = global_constants.SCORM_FALSE;
if (this.isTerminated()) {
this.throwSCORMError(_classPrivateFieldGet(this, _error_codes).TERMINATED, terminationMessage);
} else {
if (this.selfReportSessionTime) {
this.cmi.setStartTime();
}
this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0;
returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
if (this.selfReportSessionTime) {
this.cmi.setStartTime();
}
this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0;
var returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO);
this.clearSCORMError(returnValue);
return returnValue;

2
dist/aicc.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/aicc.min.js vendored

File diff suppressed because one or more lines are too long

19
dist/scorm-again.js vendored
View File

@@ -726,21 +726,14 @@ var BaseAPI = /*#__PURE__*/function () {
_createClass(BaseAPI, [{
key: "initialize",
value: function initialize(callbackName, initializeMessage, terminationMessage) {
var returnValue = global_constants.SCORM_FALSE;
if (this.isTerminated()) {
this.throwSCORMError(_classPrivateFieldGet(this, _error_codes).TERMINATED, terminationMessage);
} else {
if (this.selfReportSessionTime) {
this.cmi.setStartTime();
}
this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0;
returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
if (this.selfReportSessionTime) {
this.cmi.setStartTime();
}
this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0;
var returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO);
this.clearSCORMError(returnValue);
return returnValue;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

19
dist/scorm12.js vendored
View File

@@ -601,21 +601,14 @@ var BaseAPI = /*#__PURE__*/function () {
_createClass(BaseAPI, [{
key: "initialize",
value: function initialize(callbackName, initializeMessage, terminationMessage) {
var returnValue = global_constants.SCORM_FALSE;
if (this.isTerminated()) {
this.throwSCORMError(_classPrivateFieldGet(this, _error_codes).TERMINATED, terminationMessage);
} else {
if (this.selfReportSessionTime) {
this.cmi.setStartTime();
}
this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0;
returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
if (this.selfReportSessionTime) {
this.cmi.setStartTime();
}
this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0;
var returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO);
this.clearSCORMError(returnValue);
return returnValue;

2
dist/scorm12.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/scorm12.min.js vendored

File diff suppressed because one or more lines are too long

19
dist/scorm2004.js vendored
View File

@@ -601,21 +601,14 @@ var BaseAPI = /*#__PURE__*/function () {
_createClass(BaseAPI, [{
key: "initialize",
value: function initialize(callbackName, initializeMessage, terminationMessage) {
var returnValue = global_constants.SCORM_FALSE;
if (this.isTerminated()) {
this.throwSCORMError(_classPrivateFieldGet(this, _error_codes).TERMINATED, terminationMessage);
} else {
if (this.selfReportSessionTime) {
this.cmi.setStartTime();
}
this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0;
returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
if (this.selfReportSessionTime) {
this.cmi.setStartTime();
}
this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0;
var returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO);
this.clearSCORMError(returnValue);
return returnValue;

File diff suppressed because one or more lines are too long

12
dist/scorm2004.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -111,21 +111,15 @@ export default class BaseAPI {
callbackName: String,
initializeMessage?: String,
terminationMessage?: String) {
let returnValue = global_constants.SCORM_FALSE;
if (this.isTerminated()) {
this.throwSCORMError(this.#error_codes.TERMINATED, terminationMessage);
} else {
if (this.selfReportSessionTime) {
this.cmi.setStartTime();
}
this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0;
returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
if (this.selfReportSessionTime) {
this.cmi.setStartTime();
}
this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0;
let returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName);
this.apiLog(callbackName, null, 'returned: ' + returnValue,
global_constants.LOG_LEVEL_INFO);
this.clearSCORMError(returnValue);