Finalizing changes to initial data load

This commit is contained in:
Jonathan Putney
2020-07-30 18:05:11 -04:00
parent c341d3f70f
commit 22408c2c0e
6 changed files with 11 additions and 9 deletions

View File

@@ -550,7 +550,8 @@ export default class BaseAPI {
} else if (!this._checkObjectHasProperty(refObject, attribute)) {
this.throwSCORMError(invalidErrorCode, invalidErrorMessage);
} else {
if (this.stringMatches(CMIElement, '\\.correct_responses\\.\\d+')) {
if (this.isInitialized() &&
this.stringMatches(CMIElement, '\\.correct_responses\\.\\d+')) {
this.validateCorrectResponse(CMIElement, value);
}

View File

@@ -395,7 +395,8 @@ export class CMI extends BaseCMI {
* @param {string} session_time
*/
set session_time(session_time) {
if (check2004ValidFormat(session_time, scorm2004_regex.CMITimespan)) {
if (this.initialized &&
check2004ValidFormat(session_time, scorm2004_regex.CMITimespan)) {
this.#session_time = session_time;
}
}