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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RefObject, ResultObject } from "../types/api_types";
|
|
2
|
+
import { BaseCMI } from "../cmi/common/base_cmi";
|
|
3
|
+
|
|
4
|
+
export interface IBaseAPI {
|
|
5
|
+
cmi: BaseCMI;
|
|
6
|
+
startingData?: RefObject;
|
|
7
|
+
|
|
8
|
+
initialize(
|
|
9
|
+
callbackName: string,
|
|
10
|
+
initializeMessage?: string,
|
|
11
|
+
terminationMessage?: string,
|
|
12
|
+
): string;
|
|
13
|
+
lmsInitialize(): string;
|
|
14
|
+
lmsFinish(): string;
|
|
15
|
+
lmsGetValue(CMIElement: string): string;
|
|
16
|
+
lmsSetValue(CMIElement: string, value: any): string;
|
|
17
|
+
lmsCommit(): string;
|
|
18
|
+
lmsGetLastError(): string;
|
|
19
|
+
lmsGetErrorString(CMIErrorCode: string | number): string;
|
|
20
|
+
lmsGetDiagnostic(CMIErrorCode: string | number): string;
|
|
21
|
+
storeData(_calculateTotalTime: boolean): Promise<ResultObject>;
|
|
22
|
+
renderCommitCMI(_terminateCommit: boolean): RefObject | Array<any>;
|
|
23
|
+
getLmsErrorMessageDetails(
|
|
24
|
+
_errorNumber: string | number,
|
|
25
|
+
_detail?: boolean,
|
|
26
|
+
): string;
|
|
27
|
+
getCMIValue(_CMIElement: string): string;
|
|
28
|
+
setCMIValue(_CMIElement: string, _value: any): string;
|
|
29
|
+
validateCorrectResponse(_CMIElement: string, _value: any): void;
|
|
30
|
+
getChildElement(
|
|
31
|
+
_CMIElement: string,
|
|
32
|
+
_value: any,
|
|
33
|
+
_foundFirstIndex: boolean,
|
|
34
|
+
): BaseCMI | null;
|
|
35
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type Settings = {
|
|
2
|
+
autocommit?: boolean;
|
|
3
|
+
autocommitSeconds?: number;
|
|
4
|
+
asyncCommit?: boolean;
|
|
5
|
+
sendFullCommit?: boolean;
|
|
6
|
+
lmsCommitUrl?: boolean | string;
|
|
7
|
+
dataCommitFormat?: string;
|
|
8
|
+
commitRequestDataType?: string;
|
|
9
|
+
autoProgress?: boolean;
|
|
10
|
+
logLevel?: number;
|
|
11
|
+
selfReportSessionTime?: boolean;
|
|
12
|
+
alwaysSendTotalTime?: boolean;
|
|
13
|
+
strict_errors?: boolean;
|
|
14
|
+
xhrHeaders?: RefObject;
|
|
15
|
+
xhrWithCredentials?: boolean;
|
|
16
|
+
responseHandler?: (response: Response) => Promise<ResultObject>;
|
|
17
|
+
requestHandler?: (commitObject: any) => any;
|
|
18
|
+
onLogMessage?: (messageLevel: number, logMessage: string) => void;
|
|
19
|
+
scoItemIds?: string[];
|
|
20
|
+
scoItemIdValidator?: false | ((scoItemId: string) => boolean);
|
|
21
|
+
mastery_override?: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type RefObject = {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ResultObject = {
|
|
29
|
+
result: string;
|
|
30
|
+
errorCode: number;
|
|
31
|
+
navRequest?: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debounce function to delay the execution of a given function.
|
|
3
|
+
*
|
|
4
|
+
* @param func - The function to debounce.
|
|
5
|
+
* @param wait - The number of milliseconds to delay.
|
|
6
|
+
* @param immediate - If `true`, the function will be triggered on the leading edge instead of the trailing.
|
|
7
|
+
* @returns A debounced version of the provided function.
|
|
8
|
+
*/
|
|
9
|
+
export function debounce<T extends (...args: any[]) => void>(
|
|
10
|
+
func: T,
|
|
11
|
+
wait: number,
|
|
12
|
+
immediate = false,
|
|
13
|
+
): (...args: Parameters<T>) => void {
|
|
14
|
+
let timeout: ReturnType<typeof setTimeout> | null;
|
|
15
|
+
|
|
16
|
+
return function (this: any, ...args: Parameters<T>) {
|
|
17
|
+
const context = this;
|
|
18
|
+
|
|
19
|
+
const later = () => {
|
|
20
|
+
timeout = null;
|
|
21
|
+
if (!immediate) func.apply(context, args);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const callNow = immediate && !timeout;
|
|
25
|
+
|
|
26
|
+
if (timeout) clearTimeout(timeout);
|
|
27
|
+
timeout = setTimeout(later, wait);
|
|
28
|
+
|
|
29
|
+
if (callNow) func.apply(context, args);
|
|
30
|
+
};
|
|
31
|
+
}
|
package/src/utilities.ts
CHANGED
|
@@ -280,3 +280,59 @@ export function countDecimals(num: number): number {
|
|
|
280
280
|
const parts = num.toString().split(".")[1];
|
|
281
281
|
return parts.length || 0;
|
|
282
282
|
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Formats the SCORM messages for easy reading
|
|
286
|
+
*
|
|
287
|
+
* @param {string} functionName
|
|
288
|
+
* @param {string} message
|
|
289
|
+
* @param {string} CMIElement
|
|
290
|
+
* @return {string}
|
|
291
|
+
*/
|
|
292
|
+
export function formatMessage(
|
|
293
|
+
functionName: string,
|
|
294
|
+
message: string,
|
|
295
|
+
CMIElement?: string,
|
|
296
|
+
): string {
|
|
297
|
+
const baseLength = 20;
|
|
298
|
+
let messageString = "";
|
|
299
|
+
|
|
300
|
+
messageString += functionName;
|
|
301
|
+
|
|
302
|
+
let fillChars = baseLength - messageString.length;
|
|
303
|
+
|
|
304
|
+
for (let i = 0; i < fillChars; i++) {
|
|
305
|
+
messageString += " ";
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
messageString += ": ";
|
|
309
|
+
|
|
310
|
+
if (CMIElement) {
|
|
311
|
+
const CMIElementBaseLength = 70;
|
|
312
|
+
|
|
313
|
+
messageString += CMIElement;
|
|
314
|
+
|
|
315
|
+
fillChars = CMIElementBaseLength - messageString.length;
|
|
316
|
+
|
|
317
|
+
for (let j = 0; j < fillChars; j++) {
|
|
318
|
+
messageString += " ";
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (message) {
|
|
323
|
+
messageString += message;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
return messageString;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Checks to see if {str} contains {tester}
|
|
331
|
+
*
|
|
332
|
+
* @param {string} str String to check against
|
|
333
|
+
* @param {string} tester String to check for
|
|
334
|
+
* @return {boolean}
|
|
335
|
+
*/
|
|
336
|
+
export function stringMatches(str: string, tester: string): boolean {
|
|
337
|
+
return str?.match(tester) !== null;
|
|
338
|
+
}
|
package/test/AICC.spec.ts
CHANGED
|
@@ -8,7 +8,7 @@ const scorm12_error_codes = ErrorCodes.scorm12;
|
|
|
8
8
|
|
|
9
9
|
const api = () => {
|
|
10
10
|
const API = new AICC();
|
|
11
|
-
API.apiLogLevel =
|
|
11
|
+
API.apiLogLevel = 1;
|
|
12
12
|
return API;
|
|
13
13
|
};
|
|
14
14
|
const apiInitialized = () => {
|
|
@@ -256,6 +256,16 @@ describe("AICC API Tests", () => {
|
|
|
256
256
|
fieldName: "cmi.student_data.tries.0.score.max",
|
|
257
257
|
valueToTest: "100",
|
|
258
258
|
});
|
|
259
|
+
h.checkLMSSetValue({
|
|
260
|
+
api: apiInitialized(),
|
|
261
|
+
fieldName: "cmi.student_data.attempt_records.0.score.max",
|
|
262
|
+
valueToTest: "100",
|
|
263
|
+
});
|
|
264
|
+
h.checkLMSSetValue({
|
|
265
|
+
api: apiInitialized(),
|
|
266
|
+
fieldName: "cmi.paths.0.location_id",
|
|
267
|
+
valueToTest: "xyz",
|
|
268
|
+
});
|
|
259
269
|
});
|
|
260
270
|
});
|
|
261
271
|
|
package/test/Scorm12API.spec.ts
CHANGED
|
@@ -6,18 +6,21 @@ import ErrorCodes from "../src/constants/error_codes";
|
|
|
6
6
|
import { scorm12Values } from "./field_values";
|
|
7
7
|
import * as sinon from "sinon";
|
|
8
8
|
import Pretender from "fetch-pretender";
|
|
9
|
-
import { RefObject, Settings
|
|
9
|
+
import { RefObject, Settings } from "../src/types/api_types";
|
|
10
|
+
import { DefaultSettings } from "../src/constants/default_settings";
|
|
10
11
|
|
|
11
12
|
const scorm12_error_codes = ErrorCodes.scorm12;
|
|
12
13
|
|
|
13
14
|
let clock: sinon.SinonFakeTimers;
|
|
14
|
-
const api = (settings?: Settings) => {
|
|
15
|
+
const api = (settings?: Settings, startingData: RefObject = {}) => {
|
|
15
16
|
const API = new Scorm12API(settings);
|
|
16
17
|
API.apiLogLevel = 5;
|
|
18
|
+
API.startingData = startingData;
|
|
17
19
|
return API;
|
|
18
20
|
};
|
|
19
|
-
const apiInitialized = (settings?: Settings) => {
|
|
21
|
+
const apiInitialized = (settings?: Settings, startingData: RefObject = {}) => {
|
|
20
22
|
const API = api(settings);
|
|
23
|
+
API.loadFromJSON(startingData ? startingData : {}, "");
|
|
21
24
|
API.lmsInitialize();
|
|
22
25
|
return API;
|
|
23
26
|
};
|
|
@@ -323,14 +326,16 @@ describe("SCORM 1.2 API Tests", () => {
|
|
|
323
326
|
});
|
|
324
327
|
|
|
325
328
|
describe("replaceWithAnotherScormAPI()", () => {
|
|
326
|
-
|
|
327
|
-
|
|
329
|
+
it("should replace the current API with another API", () => {
|
|
330
|
+
const firstAPI = api();
|
|
331
|
+
const secondAPI = api();
|
|
328
332
|
|
|
329
|
-
|
|
330
|
-
|
|
333
|
+
firstAPI.cmi.core.student_id = "student_1";
|
|
334
|
+
secondAPI.cmi.core.student_id = "student_2";
|
|
331
335
|
|
|
332
|
-
|
|
333
|
-
|
|
336
|
+
firstAPI.replaceWithAnotherScormAPI(secondAPI);
|
|
337
|
+
expect(firstAPI.cmi.core.student_id).toEqual("student_2");
|
|
338
|
+
});
|
|
334
339
|
});
|
|
335
340
|
|
|
336
341
|
describe("renderCommitCMI()", () => {
|
|
@@ -577,4 +582,252 @@ describe("SCORM 1.2 API Tests", () => {
|
|
|
577
582
|
expect(callback.called).toBe(true);
|
|
578
583
|
});
|
|
579
584
|
});
|
|
585
|
+
|
|
586
|
+
describe("Test issues from users", () => {
|
|
587
|
+
it("Should be able to load the JSON data from issue #587", () => {
|
|
588
|
+
const scorm12api = api({
|
|
589
|
+
...DefaultSettings,
|
|
590
|
+
autocommit: false,
|
|
591
|
+
lmsCommitUrl: "/scorm12",
|
|
592
|
+
dataCommitFormat: "flattened",
|
|
593
|
+
logLevel: 1,
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
scorm12api.loadFromFlattenedJSON(
|
|
597
|
+
{
|
|
598
|
+
"cmi.comments": "",
|
|
599
|
+
"cmi.comments_from_lms": "",
|
|
600
|
+
"cmi.core.credit": "",
|
|
601
|
+
"cmi.core.entry": "",
|
|
602
|
+
"cmi.core.exit": "",
|
|
603
|
+
"cmi.core.lesson_location": "topic-nOmtUy",
|
|
604
|
+
"cmi.core.lesson_mode": "normal",
|
|
605
|
+
"cmi.core.lesson_status": "completed",
|
|
606
|
+
"cmi.core.score.max": "100",
|
|
607
|
+
"cmi.core.score.min": "",
|
|
608
|
+
"cmi.core.score.raw": "",
|
|
609
|
+
"cmi.core.session_time": "00:03:50",
|
|
610
|
+
"cmi.core.student_id": "student1",
|
|
611
|
+
"cmi.core.student_name": "Student 1",
|
|
612
|
+
"cmi.core.total_time": "00:03:50",
|
|
613
|
+
"cmi.interactions": {},
|
|
614
|
+
"cmi.launch_data": "",
|
|
615
|
+
"cmi.objectives.0.id": "topic-aMMlFF",
|
|
616
|
+
"cmi.objectives.0.score.max": "100",
|
|
617
|
+
"cmi.objectives.0.score.min": "",
|
|
618
|
+
"cmi.objectives.0.score.raw": "",
|
|
619
|
+
"cmi.objectives.0.status": "completed",
|
|
620
|
+
"cmi.objectives.1.id": "topic-6ReD72",
|
|
621
|
+
"cmi.objectives.1.score.max": "100",
|
|
622
|
+
"cmi.objectives.1.score.min": "",
|
|
623
|
+
"cmi.objectives.1.score.raw": "",
|
|
624
|
+
"cmi.objectives.1.status": "completed",
|
|
625
|
+
"cmi.objectives.10.id": "topic-MllWvr",
|
|
626
|
+
"cmi.objectives.10.score.max": "100",
|
|
627
|
+
"cmi.objectives.10.score.min": "",
|
|
628
|
+
"cmi.objectives.10.score.raw": "",
|
|
629
|
+
"cmi.objectives.10.status": "completed",
|
|
630
|
+
"cmi.objectives.11.id": "topic-m0dnP3",
|
|
631
|
+
"cmi.objectives.11.score.max": "100",
|
|
632
|
+
"cmi.objectives.11.score.min": "",
|
|
633
|
+
"cmi.objectives.11.score.raw": "",
|
|
634
|
+
"cmi.objectives.11.status": "completed",
|
|
635
|
+
"cmi.objectives.12.id": "topic-so4hKC",
|
|
636
|
+
"cmi.objectives.12.score.max": "100",
|
|
637
|
+
"cmi.objectives.12.score.min": "",
|
|
638
|
+
"cmi.objectives.12.score.raw": "",
|
|
639
|
+
"cmi.objectives.12.status": "completed",
|
|
640
|
+
"cmi.objectives.13.id": "topic-S9p8FE",
|
|
641
|
+
"cmi.objectives.13.score.max": "100",
|
|
642
|
+
"cmi.objectives.13.score.min": "",
|
|
643
|
+
"cmi.objectives.13.score.raw": "",
|
|
644
|
+
"cmi.objectives.13.status": "completed",
|
|
645
|
+
"cmi.objectives.14.id": "topic-E97B5s",
|
|
646
|
+
"cmi.objectives.14.score.max": "100",
|
|
647
|
+
"cmi.objectives.14.score.min": "",
|
|
648
|
+
"cmi.objectives.14.score.raw": "",
|
|
649
|
+
"cmi.objectives.14.status": "completed",
|
|
650
|
+
"cmi.objectives.15.id": "topic-TTyEf0",
|
|
651
|
+
"cmi.objectives.15.score.max": "100",
|
|
652
|
+
"cmi.objectives.15.score.min": "",
|
|
653
|
+
"cmi.objectives.15.score.raw": "",
|
|
654
|
+
"cmi.objectives.15.status": "completed",
|
|
655
|
+
"cmi.objectives.16.id": "topic-Bk8ZLK",
|
|
656
|
+
"cmi.objectives.16.score.max": "100",
|
|
657
|
+
"cmi.objectives.16.score.min": "",
|
|
658
|
+
"cmi.objectives.16.score.raw": "",
|
|
659
|
+
"cmi.objectives.16.status": "completed",
|
|
660
|
+
"cmi.objectives.17.id": "topic-5rxzyV",
|
|
661
|
+
"cmi.objectives.17.score.max": "100",
|
|
662
|
+
"cmi.objectives.17.score.min": "",
|
|
663
|
+
"cmi.objectives.17.score.raw": "",
|
|
664
|
+
"cmi.objectives.17.status": "completed",
|
|
665
|
+
"cmi.objectives.18.id": "topic-Q3rjln",
|
|
666
|
+
"cmi.objectives.18.score.max": "100",
|
|
667
|
+
"cmi.objectives.18.score.min": "",
|
|
668
|
+
"cmi.objectives.18.score.raw": "",
|
|
669
|
+
"cmi.objectives.18.status": "completed",
|
|
670
|
+
"cmi.objectives.19.id": "topic-eIbwi4",
|
|
671
|
+
"cmi.objectives.19.score.max": "100",
|
|
672
|
+
"cmi.objectives.19.score.min": "",
|
|
673
|
+
"cmi.objectives.19.score.raw": "",
|
|
674
|
+
"cmi.objectives.19.status": "completed",
|
|
675
|
+
"cmi.objectives.2.id": "topic-sfvmuO",
|
|
676
|
+
"cmi.objectives.2.score.max": "100",
|
|
677
|
+
"cmi.objectives.2.score.min": "",
|
|
678
|
+
"cmi.objectives.2.score.raw": "",
|
|
679
|
+
"cmi.objectives.2.status": "completed",
|
|
680
|
+
"cmi.objectives.20.id": "topic-AzAspy",
|
|
681
|
+
"cmi.objectives.20.score.max": "100",
|
|
682
|
+
"cmi.objectives.20.score.min": "",
|
|
683
|
+
"cmi.objectives.20.score.raw": "",
|
|
684
|
+
"cmi.objectives.20.status": "completed",
|
|
685
|
+
"cmi.objectives.21.id": "topic-ehMV4A",
|
|
686
|
+
"cmi.objectives.21.score.max": "100",
|
|
687
|
+
"cmi.objectives.21.score.min": "",
|
|
688
|
+
"cmi.objectives.21.score.raw": "",
|
|
689
|
+
"cmi.objectives.21.status": "completed",
|
|
690
|
+
"cmi.objectives.22.id": "topic-U52hDp",
|
|
691
|
+
"cmi.objectives.22.score.max": "100",
|
|
692
|
+
"cmi.objectives.22.score.min": "",
|
|
693
|
+
"cmi.objectives.22.score.raw": "",
|
|
694
|
+
"cmi.objectives.22.status": "completed",
|
|
695
|
+
"cmi.objectives.23.id": "topic-mmAPuC",
|
|
696
|
+
"cmi.objectives.23.score.max": "100",
|
|
697
|
+
"cmi.objectives.23.score.min": "",
|
|
698
|
+
"cmi.objectives.23.score.raw": "",
|
|
699
|
+
"cmi.objectives.23.status": "completed",
|
|
700
|
+
"cmi.objectives.24.id": "topic-UyqqeN",
|
|
701
|
+
"cmi.objectives.24.score.max": "100",
|
|
702
|
+
"cmi.objectives.24.score.min": "",
|
|
703
|
+
"cmi.objectives.24.score.raw": "",
|
|
704
|
+
"cmi.objectives.24.status": "completed",
|
|
705
|
+
"cmi.objectives.25.id": "topic-UIALBn",
|
|
706
|
+
"cmi.objectives.25.score.max": "100",
|
|
707
|
+
"cmi.objectives.25.score.min": "",
|
|
708
|
+
"cmi.objectives.25.score.raw": "",
|
|
709
|
+
"cmi.objectives.25.status": "completed",
|
|
710
|
+
"cmi.objectives.26.id": "topic-oLGCQE",
|
|
711
|
+
"cmi.objectives.26.score.max": "100",
|
|
712
|
+
"cmi.objectives.26.score.min": "",
|
|
713
|
+
"cmi.objectives.26.score.raw": "",
|
|
714
|
+
"cmi.objectives.26.status": "completed",
|
|
715
|
+
"cmi.objectives.27.id": "topic-JhRmY0",
|
|
716
|
+
"cmi.objectives.27.score.max": "100",
|
|
717
|
+
"cmi.objectives.27.score.min": "",
|
|
718
|
+
"cmi.objectives.27.score.raw": "",
|
|
719
|
+
"cmi.objectives.27.status": "completed",
|
|
720
|
+
"cmi.objectives.28.id": "topic-677fLH",
|
|
721
|
+
"cmi.objectives.28.score.max": "100",
|
|
722
|
+
"cmi.objectives.28.score.min": "",
|
|
723
|
+
"cmi.objectives.28.score.raw": "",
|
|
724
|
+
"cmi.objectives.28.status": "completed",
|
|
725
|
+
"cmi.objectives.29.id": "topic-rKvnIL",
|
|
726
|
+
"cmi.objectives.29.score.max": "100",
|
|
727
|
+
"cmi.objectives.29.score.min": "",
|
|
728
|
+
"cmi.objectives.29.score.raw": "",
|
|
729
|
+
"cmi.objectives.29.status": "completed",
|
|
730
|
+
"cmi.objectives.3.id": "topic-IObzTr",
|
|
731
|
+
"cmi.objectives.3.score.max": "100",
|
|
732
|
+
"cmi.objectives.3.score.min": "",
|
|
733
|
+
"cmi.objectives.3.score.raw": "",
|
|
734
|
+
"cmi.objectives.3.status": "completed",
|
|
735
|
+
"cmi.objectives.30.id": "topic-Vjd6mO",
|
|
736
|
+
"cmi.objectives.30.score.max": "100",
|
|
737
|
+
"cmi.objectives.30.score.min": "",
|
|
738
|
+
"cmi.objectives.30.score.raw": "",
|
|
739
|
+
"cmi.objectives.30.status": "completed",
|
|
740
|
+
"cmi.objectives.31.id": "topic-jUsEtX",
|
|
741
|
+
"cmi.objectives.31.score.max": "100",
|
|
742
|
+
"cmi.objectives.31.score.min": "",
|
|
743
|
+
"cmi.objectives.31.score.raw": "",
|
|
744
|
+
"cmi.objectives.31.status": "completed",
|
|
745
|
+
"cmi.objectives.32.id": "topic-SvCWWr",
|
|
746
|
+
"cmi.objectives.32.score.max": "100",
|
|
747
|
+
"cmi.objectives.32.score.min": "",
|
|
748
|
+
"cmi.objectives.32.score.raw": "",
|
|
749
|
+
"cmi.objectives.32.status": "completed",
|
|
750
|
+
"cmi.objectives.33.id": "topic-knRFfG",
|
|
751
|
+
"cmi.objectives.33.score.max": "100",
|
|
752
|
+
"cmi.objectives.33.score.min": "",
|
|
753
|
+
"cmi.objectives.33.score.raw": "",
|
|
754
|
+
"cmi.objectives.33.status": "completed",
|
|
755
|
+
"cmi.objectives.34.id": "topic-wlFwhf",
|
|
756
|
+
"cmi.objectives.34.score.max": "100",
|
|
757
|
+
"cmi.objectives.34.score.min": "",
|
|
758
|
+
"cmi.objectives.34.score.raw": "",
|
|
759
|
+
"cmi.objectives.34.status": "completed",
|
|
760
|
+
"cmi.objectives.35.id": "topic-3b86fq",
|
|
761
|
+
"cmi.objectives.35.score.max": "100",
|
|
762
|
+
"cmi.objectives.35.score.min": "",
|
|
763
|
+
"cmi.objectives.35.score.raw": "",
|
|
764
|
+
"cmi.objectives.35.status": "completed",
|
|
765
|
+
"cmi.objectives.36.id": "topic-ZjIFKf",
|
|
766
|
+
"cmi.objectives.36.score.max": "100",
|
|
767
|
+
"cmi.objectives.36.score.min": "",
|
|
768
|
+
"cmi.objectives.36.score.raw": "",
|
|
769
|
+
"cmi.objectives.36.status": "completed",
|
|
770
|
+
"cmi.objectives.37.id": "topic-A9spZz",
|
|
771
|
+
"cmi.objectives.37.score.max": "100",
|
|
772
|
+
"cmi.objectives.37.score.min": "",
|
|
773
|
+
"cmi.objectives.37.score.raw": "",
|
|
774
|
+
"cmi.objectives.37.status": "completed",
|
|
775
|
+
"cmi.objectives.38.id": "topic-nOmtUy",
|
|
776
|
+
"cmi.objectives.38.score.max": "100",
|
|
777
|
+
"cmi.objectives.38.score.min": "",
|
|
778
|
+
"cmi.objectives.38.score.raw": "",
|
|
779
|
+
"cmi.objectives.38.status": "completed",
|
|
780
|
+
"cmi.objectives.39.id": "topic-jxtabl",
|
|
781
|
+
"cmi.objectives.39.score.max": "100",
|
|
782
|
+
"cmi.objectives.39.score.min": "",
|
|
783
|
+
"cmi.objectives.39.score.raw": "",
|
|
784
|
+
"cmi.objectives.39.status": "completed",
|
|
785
|
+
"cmi.objectives.4.id": "topic-Bq3O5v",
|
|
786
|
+
"cmi.objectives.4.score.max": "100",
|
|
787
|
+
"cmi.objectives.4.score.min": "",
|
|
788
|
+
"cmi.objectives.4.score.raw": "",
|
|
789
|
+
"cmi.objectives.4.status": "completed",
|
|
790
|
+
"cmi.objectives.5.id": "topic-HmnDxg",
|
|
791
|
+
"cmi.objectives.5.score.max": "100",
|
|
792
|
+
"cmi.objectives.5.score.min": "",
|
|
793
|
+
"cmi.objectives.5.score.raw": "",
|
|
794
|
+
"cmi.objectives.5.status": "completed",
|
|
795
|
+
"cmi.objectives.6.id": "topic-4YswmY",
|
|
796
|
+
"cmi.objectives.6.score.max": "100",
|
|
797
|
+
"cmi.objectives.6.score.min": "",
|
|
798
|
+
"cmi.objectives.6.score.raw": "",
|
|
799
|
+
"cmi.objectives.6.status": "completed",
|
|
800
|
+
"cmi.objectives.7.id": "topic-LuAS5e",
|
|
801
|
+
"cmi.objectives.7.score.max": "100",
|
|
802
|
+
"cmi.objectives.7.score.min": "",
|
|
803
|
+
"cmi.objectives.7.score.raw": "",
|
|
804
|
+
"cmi.objectives.7.status": "completed",
|
|
805
|
+
"cmi.objectives.8.id": "topic-K6ECXa",
|
|
806
|
+
"cmi.objectives.8.score.max": "100",
|
|
807
|
+
"cmi.objectives.8.score.min": "",
|
|
808
|
+
"cmi.objectives.8.score.raw": "",
|
|
809
|
+
"cmi.objectives.8.status": "completed",
|
|
810
|
+
"cmi.objectives.9.id": "topic-2lpxvN",
|
|
811
|
+
"cmi.objectives.9.score.max": "100",
|
|
812
|
+
"cmi.objectives.9.score.min": "",
|
|
813
|
+
"cmi.objectives.9.score.raw": "",
|
|
814
|
+
"cmi.objectives.9.status": "completed",
|
|
815
|
+
"cmi.student_data.mastery_score": "",
|
|
816
|
+
"cmi.student_data.max_time_allowed": "",
|
|
817
|
+
"cmi.student_data.time_limit_action": "",
|
|
818
|
+
"cmi.student_preference.audio": "",
|
|
819
|
+
"cmi.student_preference.language": "",
|
|
820
|
+
"cmi.student_preference.speed": "",
|
|
821
|
+
"cmi.student_preference.text": "",
|
|
822
|
+
"cmi.suspend_data": "",
|
|
823
|
+
},
|
|
824
|
+
"",
|
|
825
|
+
);
|
|
826
|
+
scorm12api.lmsInitialize();
|
|
827
|
+
|
|
828
|
+
expect(scorm12api.getCMIValue("cmi.objectives.10.id")).toEqual(
|
|
829
|
+
"topic-MllWvr",
|
|
830
|
+
);
|
|
831
|
+
});
|
|
832
|
+
});
|
|
580
833
|
});
|