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

6
dist/scorm-again.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "scorm-again",
"version": "1.3.3",
"version": "1.3.4",
"description": "A modern SCORM JavaScript run-time library for AICC, SCORM 1.2, and SCORM 2004",
"main": "dist/scorm-again.min.js",
"directories": {

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;
}
}