scorm-again 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/stale.yml +14 -0
- package/.run/{Mocha Unit Tests.run.xml → Mocha Unit Tests (watch).run.xml } +1 -1
- package/.run/Template Mocha.run.xml +17 -0
- package/README.md +171 -72
- package/dist/aicc.js +1441 -1140
- package/dist/aicc.js.map +1 -1
- package/dist/aicc.min.js +1 -1
- package/dist/aicc.min.js.map +1 -1
- package/dist/scorm-again.js +2703 -2212
- package/dist/scorm-again.js.map +1 -1
- package/dist/scorm-again.min.js +1 -1
- package/dist/scorm-again.min.js.map +1 -1
- package/dist/scorm12.js +1069 -852
- package/dist/scorm12.js.map +1 -1
- package/dist/scorm12.min.js +1 -1
- package/dist/scorm12.min.js.map +1 -1
- package/dist/scorm2004.js +1861 -1571
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/package.json +10 -6
- package/src/AICC.ts +15 -17
- package/src/BaseAPI.ts +268 -417
- package/src/Scorm12API.ts +65 -38
- package/src/Scorm2004API.ts +151 -117
- package/src/cmi/aicc/attempts.ts +94 -0
- package/src/cmi/aicc/cmi.ts +100 -0
- package/src/cmi/aicc/core.ts +360 -0
- package/src/cmi/aicc/evaluation.ts +157 -0
- package/src/cmi/aicc/paths.ts +180 -0
- package/src/cmi/aicc/student_data.ts +86 -0
- package/src/cmi/aicc/student_demographics.ts +367 -0
- package/src/cmi/aicc/student_preferences.ts +176 -0
- package/src/cmi/aicc/tries.ts +116 -0
- package/src/cmi/aicc/validation.ts +25 -0
- package/src/cmi/common/array.ts +77 -0
- package/src/cmi/common/base_cmi.ts +46 -0
- package/src/cmi/common/score.ts +203 -0
- package/src/cmi/common/validation.ts +60 -0
- package/src/cmi/scorm12/cmi.ts +224 -0
- package/src/cmi/scorm12/interactions.ts +368 -0
- package/src/cmi/scorm12/nav.ts +54 -0
- package/src/cmi/scorm12/objectives.ts +112 -0
- package/src/cmi/scorm12/student_data.ts +130 -0
- package/src/cmi/scorm12/student_preference.ts +158 -0
- package/src/cmi/scorm12/validation.ts +48 -0
- package/src/cmi/scorm2004/adl.ts +272 -0
- package/src/cmi/scorm2004/cmi.ts +599 -0
- package/src/cmi/scorm2004/comments.ts +163 -0
- package/src/cmi/scorm2004/interactions.ts +466 -0
- package/src/cmi/scorm2004/learner_preference.ts +152 -0
- package/src/cmi/scorm2004/objectives.ts +212 -0
- package/src/cmi/scorm2004/score.ts +78 -0
- package/src/cmi/scorm2004/validation.ts +42 -0
- package/src/constants/default_settings.ts +81 -0
- package/src/constants/enums.ts +5 -0
- package/src/constants/regex.ts +2 -2
- package/src/constants/response_constants.ts +2 -0
- package/src/exceptions.ts +22 -1
- package/src/helpers/scheduled_commit.ts +42 -0
- package/src/interfaces/IBaseAPI.ts +35 -0
- package/src/types/api_types.ts +32 -0
- package/src/utilities/debounce.ts +31 -0
- package/src/utilities.ts +56 -0
- package/test/AICC.spec.ts +11 -1
- package/test/Scorm12API.spec.ts +262 -9
- package/test/Scorm2004API.spec.ts +488 -2
- package/test/cmi/aicc_cmi.spec.ts +188 -11
- package/test/cmi/scorm12_cmi.spec.ts +5 -5
- package/test/cmi/scorm2004_cmi.spec.ts +8 -8
- package/test/cmi_helpers.ts +1 -1
- package/test/types/api_types.spec.ts +126 -0
- package/test/utilities/debounce.spec.ts +56 -0
- package/src/cmi/aicc_cmi.ts +0 -1248
- package/src/cmi/common.ts +0 -411
- package/src/cmi/scorm12_cmi.ts +0 -1426
- package/src/cmi/scorm2004_cmi.ts +0 -1874
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scorm-again",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A modern SCORM JavaScript run-time library for AICC, SCORM 1.2, and SCORM 2004",
|
|
5
5
|
"main": "dist/scorm-again.min.js",
|
|
6
6
|
"type": "module",
|
|
@@ -31,13 +31,14 @@
|
|
|
31
31
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
32
32
|
"@types/eslint__js": "^8.42.3",
|
|
33
33
|
"@types/expect": "^24.3.0",
|
|
34
|
-
"@types/mocha": "^10.0.
|
|
34
|
+
"@types/mocha": "^10.0.9",
|
|
35
35
|
"@types/sinon": "^17.0.3",
|
|
36
36
|
"babel-eslint": "^11.0.0-beta.2",
|
|
37
37
|
"babel-loader": "^9.2.1",
|
|
38
38
|
"babelify": "^10.0.0",
|
|
39
39
|
"browserify": "^17.0.1",
|
|
40
40
|
"c8": "^10.1.2",
|
|
41
|
+
"c8-as-nyc": "^1.1.11",
|
|
41
42
|
"eslint": "^9.12.0",
|
|
42
43
|
"eslint-formatter-junit": "^8.40.0",
|
|
43
44
|
"eslint-plugin-import": "^2.31.0",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"eslint-webpack-plugin": "^4.2.0",
|
|
46
47
|
"expect": "^29.7.0",
|
|
47
48
|
"fetch-pretender": "https://github.com/jcputney/fetch-pretender#master",
|
|
48
|
-
"globals": "^15.
|
|
49
|
+
"globals": "^15.11.0",
|
|
49
50
|
"jsdoc": "^4.0.3",
|
|
50
51
|
"jsdoc-babel": "^0.5.0",
|
|
51
52
|
"minimist": "^1.2.8",
|
|
@@ -58,8 +59,8 @@
|
|
|
58
59
|
"terser-webpack-plugin": "^5.3.10",
|
|
59
60
|
"ts-loader": "^9.5.1",
|
|
60
61
|
"tsx": "^4.19.1",
|
|
61
|
-
"typescript": "^5.6.
|
|
62
|
-
"typescript-eslint": "^8.8.
|
|
62
|
+
"typescript": "^5.6.3",
|
|
63
|
+
"typescript-eslint": "^8.8.1",
|
|
63
64
|
"webpack": "^5.91.0",
|
|
64
65
|
"webpack-cli": "^5.1.4"
|
|
65
66
|
},
|
|
@@ -94,7 +95,10 @@
|
|
|
94
95
|
"src/**/*.ts"
|
|
95
96
|
],
|
|
96
97
|
"exclude": [
|
|
97
|
-
"test/**/*.*"
|
|
98
|
+
"test/**/*.*",
|
|
99
|
+
"src/exports/*.*",
|
|
100
|
+
"src/interfaces/*.*",
|
|
101
|
+
"src/types/*.*"
|
|
98
102
|
],
|
|
99
103
|
"extension": [
|
|
100
104
|
".ts"
|
package/src/AICC.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import Scorm12API from "./Scorm12API";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "./cmi/
|
|
8
|
-
import { NAV } from "./cmi/
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { CMI } from "./cmi/aicc/cmi";
|
|
3
|
+
|
|
4
|
+
import { BaseCMI } from "./cmi/common/base_cmi";
|
|
5
|
+
import { CMITriesObject } from "./cmi/aicc/tries";
|
|
6
|
+
import { CMIAttemptRecordsObject } from "./cmi/aicc/attempts";
|
|
7
|
+
import { CMIEvaluationCommentsObject } from "./cmi/aicc/evaluation";
|
|
8
|
+
import { NAV } from "./cmi/scorm12/nav";
|
|
9
|
+
import { CMIPathsObject } from "./cmi/aicc/paths";
|
|
10
|
+
import { Settings } from "./types/api_types";
|
|
11
|
+
import { stringMatches } from "./utilities";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* The AICC API class
|
|
@@ -40,21 +41,18 @@ export default class AICC extends Scorm12API {
|
|
|
40
41
|
let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);
|
|
41
42
|
|
|
42
43
|
if (!newChild) {
|
|
43
|
-
if (
|
|
44
|
-
this.stringMatches(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")
|
|
45
|
-
) {
|
|
44
|
+
if (stringMatches(CMIElement, "cmi\\.evaluation\\.comments\\.\\d+")) {
|
|
46
45
|
newChild = new CMIEvaluationCommentsObject();
|
|
47
46
|
} else if (
|
|
48
|
-
|
|
47
|
+
stringMatches(CMIElement, "cmi\\.student_data\\.tries\\.\\d+")
|
|
49
48
|
) {
|
|
50
49
|
newChild = new CMITriesObject();
|
|
51
50
|
} else if (
|
|
52
|
-
|
|
53
|
-
CMIElement,
|
|
54
|
-
"cmi\\.student_data\\.attempt_records\\.\\d+",
|
|
55
|
-
)
|
|
51
|
+
stringMatches(CMIElement, "cmi\\.student_data\\.attempt_records\\.\\d+")
|
|
56
52
|
) {
|
|
57
53
|
newChild = new CMIAttemptRecordsObject();
|
|
54
|
+
} else if (stringMatches(CMIElement, "cmi\\.paths\\.\\d+")) {
|
|
55
|
+
newChild = new CMIPathsObject();
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
|