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
+1 -8
View File
@@ -726,21 +726,14 @@ var BaseAPI = /*#__PURE__*/function () {
_createClass(BaseAPI, [{ _createClass(BaseAPI, [{
key: "initialize", key: "initialize",
value: function initialize(callbackName, initializeMessage, terminationMessage) { 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) { if (this.selfReportSessionTime) {
this.cmi.setStartTime(); this.cmi.setStartTime();
} }
this.currentState = global_constants.STATE_INITIALIZED; this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0; this.lastErrorCode = 0;
returnValue = global_constants.SCORM_TRUE; var returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName); this.processListeners(callbackName);
}
this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO); this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO);
this.clearSCORMError(returnValue); this.clearSCORMError(returnValue);
return returnValue; return returnValue;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -8
View File
@@ -726,21 +726,14 @@ var BaseAPI = /*#__PURE__*/function () {
_createClass(BaseAPI, [{ _createClass(BaseAPI, [{
key: "initialize", key: "initialize",
value: function initialize(callbackName, initializeMessage, terminationMessage) { 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) { if (this.selfReportSessionTime) {
this.cmi.setStartTime(); this.cmi.setStartTime();
} }
this.currentState = global_constants.STATE_INITIALIZED; this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0; this.lastErrorCode = 0;
returnValue = global_constants.SCORM_TRUE; var returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName); this.processListeners(callbackName);
}
this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO); this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO);
this.clearSCORMError(returnValue); this.clearSCORMError(returnValue);
return returnValue; return returnValue;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -8
View File
@@ -601,21 +601,14 @@ var BaseAPI = /*#__PURE__*/function () {
_createClass(BaseAPI, [{ _createClass(BaseAPI, [{
key: "initialize", key: "initialize",
value: function initialize(callbackName, initializeMessage, terminationMessage) { 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) { if (this.selfReportSessionTime) {
this.cmi.setStartTime(); this.cmi.setStartTime();
} }
this.currentState = global_constants.STATE_INITIALIZED; this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0; this.lastErrorCode = 0;
returnValue = global_constants.SCORM_TRUE; var returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName); this.processListeners(callbackName);
}
this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO); this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO);
this.clearSCORMError(returnValue); this.clearSCORMError(returnValue);
return returnValue; return returnValue;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -8
View File
@@ -601,21 +601,14 @@ var BaseAPI = /*#__PURE__*/function () {
_createClass(BaseAPI, [{ _createClass(BaseAPI, [{
key: "initialize", key: "initialize",
value: function initialize(callbackName, initializeMessage, terminationMessage) { 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) { if (this.selfReportSessionTime) {
this.cmi.setStartTime(); this.cmi.setStartTime();
} }
this.currentState = global_constants.STATE_INITIALIZED; this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0; this.lastErrorCode = 0;
returnValue = global_constants.SCORM_TRUE; var returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName); this.processListeners(callbackName);
}
this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO); this.apiLog(callbackName, null, 'returned: ' + returnValue, global_constants.LOG_LEVEL_INFO);
this.clearSCORMError(returnValue); this.clearSCORMError(returnValue);
return returnValue; return returnValue;
+1 -1
View File
File diff suppressed because one or more lines are too long
+6 -6
View File
File diff suppressed because one or more lines are too long
+1 -7
View File
@@ -111,20 +111,14 @@ export default class BaseAPI {
callbackName: String, callbackName: String,
initializeMessage?: String, initializeMessage?: String,
terminationMessage?: String) { terminationMessage?: String) {
let returnValue = global_constants.SCORM_FALSE;
if (this.isTerminated()) {
this.throwSCORMError(this.#error_codes.TERMINATED, terminationMessage);
} else {
if (this.selfReportSessionTime) { if (this.selfReportSessionTime) {
this.cmi.setStartTime(); this.cmi.setStartTime();
} }
this.currentState = global_constants.STATE_INITIALIZED; this.currentState = global_constants.STATE_INITIALIZED;
this.lastErrorCode = 0; this.lastErrorCode = 0;
returnValue = global_constants.SCORM_TRUE; let returnValue = global_constants.SCORM_TRUE;
this.processListeners(callbackName); this.processListeners(callbackName);
}
this.apiLog(callbackName, null, 'returned: ' + returnValue, this.apiLog(callbackName, null, 'returned: ' + returnValue,
global_constants.LOG_LEVEL_INFO); global_constants.LOG_LEVEL_INFO);