scorm-again 2.6.1 → 2.6.3
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/dist/aicc.js +167 -165
- package/dist/aicc.js.map +1 -1
- package/dist/aicc.min.js +1 -1
- package/dist/aicc.min.js.map +1 -1
- package/dist/esm/aicc.js +167 -165
- package/dist/esm/aicc.js.map +1 -1
- package/dist/esm/aicc.min.js +1 -1
- package/dist/esm/aicc.min.js.map +1 -1
- package/dist/esm/scorm-again.js +189 -180
- package/dist/esm/scorm-again.js.map +1 -1
- package/dist/esm/scorm-again.min.js +1 -1
- package/dist/esm/scorm-again.min.js.map +1 -1
- package/dist/esm/scorm12.js +167 -165
- package/dist/esm/scorm12.js.map +1 -1
- package/dist/esm/scorm12.min.js +1 -1
- package/dist/esm/scorm12.min.js.map +1 -1
- package/dist/esm/scorm2004.js +61 -51
- package/dist/esm/scorm2004.js.map +1 -1
- package/dist/esm/scorm2004.min.js +1 -1
- package/dist/esm/scorm2004.min.js.map +1 -1
- package/dist/scorm-again.js +189 -180
- 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 +167 -165
- 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 +61 -51
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/scorm2004.min.js.map +1 -1
- package/dist/types/AICC.d.ts +13 -0
- package/dist/types/BaseAPI.d.ts +71 -0
- package/dist/types/Scorm12API.d.ts +39 -0
- package/dist/types/Scorm2004API.d.ts +52 -0
- package/dist/types/ScormAgain.d.ts +4 -0
- package/dist/types/cmi/aicc/attempts.d.ts +19 -0
- package/dist/types/cmi/aicc/cmi.d.ts +34 -0
- package/dist/types/cmi/aicc/core.d.ts +57 -0
- package/dist/types/cmi/aicc/evaluation.d.ts +33 -0
- package/dist/types/cmi/aicc/paths.d.ts +35 -0
- package/dist/types/cmi/aicc/student_data.d.ts +20 -0
- package/dist/types/cmi/aicc/student_demographics.d.ts +61 -0
- package/dist/types/cmi/aicc/student_preferences.d.ts +34 -0
- package/dist/types/cmi/aicc/tries.d.ts +23 -0
- package/dist/types/cmi/aicc/validation.d.ts +1 -0
- package/dist/types/cmi/common/array.d.ts +19 -0
- package/dist/types/cmi/common/base_cmi.d.ts +13 -0
- package/dist/types/cmi/common/score.d.ts +38 -0
- package/dist/types/cmi/common/validation.d.ts +3 -0
- package/dist/types/cmi/scorm12/cmi.d.ts +45 -0
- package/dist/types/cmi/scorm12/interactions.d.ts +64 -0
- package/dist/types/cmi/scorm12/nav.d.ts +11 -0
- package/dist/types/cmi/scorm12/objectives.d.ts +22 -0
- package/dist/types/cmi/scorm12/student_data.d.ts +22 -0
- package/dist/types/cmi/scorm12/student_preference.d.ts +26 -0
- package/dist/types/cmi/scorm12/validation.d.ts +2 -0
- package/dist/types/cmi/scorm2004/adl.d.ts +71 -0
- package/dist/types/cmi/scorm2004/cmi.d.ts +103 -0
- package/dist/types/cmi/scorm2004/comments.d.ts +27 -0
- package/dist/types/cmi/scorm2004/interactions.d.ts +68 -0
- package/dist/types/cmi/scorm2004/learner_preference.d.ts +26 -0
- package/dist/types/cmi/scorm2004/objectives.d.ts +38 -0
- package/dist/types/cmi/scorm2004/score.d.ts +14 -0
- package/dist/types/cmi/scorm2004/validation.d.ts +2 -0
- package/dist/types/constants/api_constants.d.ts +49 -0
- package/dist/types/constants/default_settings.d.ts +2 -0
- package/dist/types/constants/enums.d.ts +23 -0
- package/dist/types/constants/error_codes.d.ts +6 -0
- package/dist/types/constants/language_constants.d.ts +2 -0
- package/dist/types/constants/regex.d.ts +82 -0
- package/dist/types/constants/response_constants.d.ts +16 -0
- package/dist/types/exceptions/aicc_exceptions.d.ts +4 -0
- package/dist/types/exceptions/scorm12_exceptions.d.ts +4 -0
- package/dist/types/exceptions/scorm2004_exceptions.d.ts +4 -0
- package/dist/types/exceptions.d.ts +18 -0
- package/dist/types/helpers/scheduled_commit.d.ts +10 -0
- package/dist/types/interfaces/IBaseAPI.d.ts +22 -0
- package/dist/types/types/api_types.d.ts +73 -0
- package/dist/types/utilities.d.ts +19 -0
- package/index.d.ts +24 -3
- package/package.json +3 -2
- package/src/BaseAPI.ts +26 -18
- package/src/Scorm12API.ts +1 -3
- package/src/Scorm2004API.ts +14 -10
- package/src/constants/default_settings.ts +2 -2
- package/src/constants/regex.ts +8 -1
- package/src/types/api_types.ts +27 -2
- package/test/AICC.spec.ts +2 -2
- package/test/Scorm12API.spec.ts +3 -3
- package/test/Scorm2004API.spec.ts +20 -20
- package/tsconfig.json +19 -6
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Scorm12API } from "./Scorm12API";
|
|
2
|
+
import { CMI } from "./cmi/aicc/cmi";
|
|
3
|
+
import { BaseCMI } from "./cmi/common/base_cmi";
|
|
4
|
+
import { NAV } from "./cmi/scorm12/nav";
|
|
5
|
+
import { Settings } from "./types/api_types";
|
|
6
|
+
declare class AICCImpl extends Scorm12API {
|
|
7
|
+
constructor(settings?: Settings);
|
|
8
|
+
cmi: CMI;
|
|
9
|
+
nav: NAV;
|
|
10
|
+
getChildElement(CMIElement: string, value: any, foundFirstIndex: boolean): BaseCMI | null;
|
|
11
|
+
replaceWithAnotherScormAPI(newAPI: AICCImpl): void;
|
|
12
|
+
}
|
|
13
|
+
export { AICCImpl as AICC };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ErrorCode } from "./constants/error_codes";
|
|
2
|
+
import { BaseCMI } from "./cmi/common/base_cmi";
|
|
3
|
+
import { CommitObject, InternalSettings, LogLevel, RefObject, ResultObject, Settings } from "./types/api_types";
|
|
4
|
+
import { IBaseAPI } from "./interfaces/IBaseAPI";
|
|
5
|
+
export default abstract class BaseAPI implements IBaseAPI {
|
|
6
|
+
private _timeout?;
|
|
7
|
+
private readonly _error_codes;
|
|
8
|
+
private _settings;
|
|
9
|
+
protected constructor(error_codes: ErrorCode, settings?: Settings);
|
|
10
|
+
abstract cmi: BaseCMI;
|
|
11
|
+
startingData?: RefObject;
|
|
12
|
+
currentState: number;
|
|
13
|
+
lastErrorCode: string;
|
|
14
|
+
listenerArray: any[];
|
|
15
|
+
apiLogLevel: LogLevel;
|
|
16
|
+
selfReportSessionTime: boolean;
|
|
17
|
+
abstract reset(settings?: Settings): void;
|
|
18
|
+
commonReset(settings?: Settings): void;
|
|
19
|
+
initialize(callbackName: string, initializeMessage?: string, terminationMessage?: string): string;
|
|
20
|
+
abstract lmsInitialize(): string;
|
|
21
|
+
abstract lmsFinish(): string;
|
|
22
|
+
abstract lmsGetValue(CMIElement: string): string;
|
|
23
|
+
abstract lmsSetValue(CMIElement: string, value: any): string;
|
|
24
|
+
abstract lmsCommit(): string;
|
|
25
|
+
abstract lmsGetLastError(): string;
|
|
26
|
+
abstract lmsGetErrorString(CMIErrorCode: string | number): string;
|
|
27
|
+
abstract lmsGetDiagnostic(CMIErrorCode: string | number): string;
|
|
28
|
+
abstract validateCorrectResponse(_CMIElement: string, _value: any): void;
|
|
29
|
+
abstract getChildElement(_CMIElement: string, _value: any, _foundFirstIndex: boolean): BaseCMI | null;
|
|
30
|
+
abstract storeData(_calculateTotalTime: boolean): Promise<ResultObject>;
|
|
31
|
+
abstract renderCommitCMI(_terminateCommit: boolean): RefObject | Array<any>;
|
|
32
|
+
abstract renderCommitObject(_terminateCommit: boolean): CommitObject;
|
|
33
|
+
apiLog(functionName: string, logMessage: string, messageLevel: LogLevel, CMIElement?: string): void;
|
|
34
|
+
get error_codes(): ErrorCode;
|
|
35
|
+
get settings(): InternalSettings;
|
|
36
|
+
set settings(settings: Settings);
|
|
37
|
+
terminate(callbackName: string, checkTerminated: boolean): Promise<string>;
|
|
38
|
+
getValue(callbackName: string, checkTerminated: boolean, CMIElement: string): string;
|
|
39
|
+
setValue(callbackName: string, commitCallback: string, checkTerminated: boolean, CMIElement: string, value: any): string;
|
|
40
|
+
commit(callbackName: string, checkTerminated?: boolean): Promise<string>;
|
|
41
|
+
getLastError(callbackName: string): string;
|
|
42
|
+
getErrorString(callbackName: string, CMIErrorCode: string | number): string;
|
|
43
|
+
getDiagnostic(callbackName: string, CMIErrorCode: string | number): string;
|
|
44
|
+
checkState(checkTerminated: boolean, beforeInitError: number, afterTermError: number): boolean;
|
|
45
|
+
getLmsErrorMessageDetails(_errorNumber: string | number, _detail?: boolean): string;
|
|
46
|
+
getCMIValue(_CMIElement: string): string;
|
|
47
|
+
setCMIValue(_CMIElement: string, _value: any): string;
|
|
48
|
+
_commonSetCMIValue(methodName: string, scorm2004: boolean, CMIElement: string, value: any): string;
|
|
49
|
+
_commonGetCMIValue(methodName: string, scorm2004: boolean, CMIElement: string): any;
|
|
50
|
+
isInitialized(): boolean;
|
|
51
|
+
isNotInitialized(): boolean;
|
|
52
|
+
isTerminated(): boolean;
|
|
53
|
+
on(listenerName: string, callback: Function): void;
|
|
54
|
+
off(listenerName: string, callback: Function): void;
|
|
55
|
+
clear(listenerName: string): void;
|
|
56
|
+
processListeners(functionName: string, CMIElement?: string, value?: any): void;
|
|
57
|
+
throwSCORMError(errorNumber: number, message?: string): void;
|
|
58
|
+
clearSCORMError(success: string): void;
|
|
59
|
+
loadFromFlattenedJSON(json: RefObject, CMIElement?: string): void;
|
|
60
|
+
loadFromJSON(json: RefObject, CMIElement?: string): void;
|
|
61
|
+
renderCMIToJSONString(): string;
|
|
62
|
+
renderCMIToJSONObject(): object;
|
|
63
|
+
processHttpRequest(url: string, params: CommitObject | RefObject | Array<any>, immediate?: boolean): Promise<ResultObject>;
|
|
64
|
+
scheduleCommit(when: number, callback: string): void;
|
|
65
|
+
clearScheduledCommit(): void;
|
|
66
|
+
private _checkObjectHasProperty;
|
|
67
|
+
private handleValueAccessException;
|
|
68
|
+
protected getCommitObject(terminateCommit: boolean): CommitObject | RefObject | Array<any>;
|
|
69
|
+
private performFetch;
|
|
70
|
+
private transformResponse;
|
|
71
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CMI } from "./cmi/scorm12/cmi";
|
|
2
|
+
import { BaseCMI } from "./cmi/common/base_cmi";
|
|
3
|
+
import { NAV } from "./cmi/scorm12/nav";
|
|
4
|
+
import { CommitObject, ResultObject, Settings } from "./types/api_types";
|
|
5
|
+
import BaseAPI from "./BaseAPI";
|
|
6
|
+
declare class Scorm12Impl extends BaseAPI {
|
|
7
|
+
constructor(settings?: Settings);
|
|
8
|
+
statusSetByModule: boolean;
|
|
9
|
+
cmi: CMI;
|
|
10
|
+
nav: NAV;
|
|
11
|
+
LMSInitialize: () => string;
|
|
12
|
+
LMSFinish: () => string;
|
|
13
|
+
LMSGetValue: (CMIElement: string) => string;
|
|
14
|
+
LMSSetValue: (CMIElement: string, value: any) => string;
|
|
15
|
+
LMSCommit: () => string;
|
|
16
|
+
LMSGetLastError: () => string;
|
|
17
|
+
LMSGetErrorString: (CMIErrorCode: string) => string;
|
|
18
|
+
LMSGetDiagnostic: (CMIErrorCode: string) => string;
|
|
19
|
+
reset(settings?: Settings): void;
|
|
20
|
+
lmsInitialize(): string;
|
|
21
|
+
lmsFinish(): string;
|
|
22
|
+
internalFinish(): Promise<string>;
|
|
23
|
+
lmsGetValue(CMIElement: string): string;
|
|
24
|
+
lmsSetValue(CMIElement: string, value: any): string;
|
|
25
|
+
lmsCommit(): string;
|
|
26
|
+
lmsGetLastError(): string;
|
|
27
|
+
lmsGetErrorString(CMIErrorCode: string): string;
|
|
28
|
+
lmsGetDiagnostic(CMIErrorCode: string): string;
|
|
29
|
+
setCMIValue(CMIElement: string, value: any): string;
|
|
30
|
+
getCMIValue(CMIElement: string): any;
|
|
31
|
+
getChildElement(CMIElement: string, _value: any, foundFirstIndex: boolean): BaseCMI | null;
|
|
32
|
+
validateCorrectResponse(_CMIElement: string, _value: any): void;
|
|
33
|
+
getLmsErrorMessageDetails(errorNumber: number | string, detail: boolean): string;
|
|
34
|
+
replaceWithAnotherScormAPI(newAPI: Scorm12Impl): void;
|
|
35
|
+
renderCommitCMI(terminateCommit: boolean): object | Array<any>;
|
|
36
|
+
renderCommitObject(terminateCommit: boolean): CommitObject;
|
|
37
|
+
storeData(terminateCommit: boolean): Promise<ResultObject>;
|
|
38
|
+
}
|
|
39
|
+
export { Scorm12Impl as Scorm12API };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import BaseAPI from "./BaseAPI";
|
|
2
|
+
import { CMI } from "./cmi/scorm2004/cmi";
|
|
3
|
+
import { ResponseType } from "./constants/response_constants";
|
|
4
|
+
import { CMIArray } from "./cmi/common/array";
|
|
5
|
+
import { BaseCMI } from "./cmi/common/base_cmi";
|
|
6
|
+
import { CMIInteractionsObject } from "./cmi/scorm2004/interactions";
|
|
7
|
+
import { CMIObjectivesObject } from "./cmi/scorm2004/objectives";
|
|
8
|
+
import { ADL } from "./cmi/scorm2004/adl";
|
|
9
|
+
import { CommitObject, ResultObject, Settings } from "./types/api_types";
|
|
10
|
+
declare class Scorm2004Impl extends BaseAPI {
|
|
11
|
+
private _version;
|
|
12
|
+
private _globalObjectives;
|
|
13
|
+
constructor(settings?: Settings);
|
|
14
|
+
cmi: CMI;
|
|
15
|
+
adl: ADL;
|
|
16
|
+
Initialize: () => string;
|
|
17
|
+
Terminate: () => string;
|
|
18
|
+
GetValue: (CMIElement: string) => string;
|
|
19
|
+
SetValue: (CMIElement: string, value: any) => string;
|
|
20
|
+
Commit: () => string;
|
|
21
|
+
GetLastError: () => string;
|
|
22
|
+
GetErrorString: (CMIErrorCode: string | number) => string;
|
|
23
|
+
GetDiagnostic: (CMIErrorCode: string | number) => string;
|
|
24
|
+
reset(settings?: Settings): void;
|
|
25
|
+
get version(): string;
|
|
26
|
+
get globalObjectives(): CMIObjectivesObject[];
|
|
27
|
+
lmsInitialize(): string;
|
|
28
|
+
lmsFinish(): string;
|
|
29
|
+
internalFinish(): Promise<string>;
|
|
30
|
+
lmsGetValue(CMIElement: string): string;
|
|
31
|
+
lmsSetValue(CMIElement: string, value: any): string;
|
|
32
|
+
lmsCommit(): string;
|
|
33
|
+
lmsGetLastError(): string;
|
|
34
|
+
lmsGetErrorString(CMIErrorCode: string | number): string;
|
|
35
|
+
lmsGetDiagnostic(CMIErrorCode: string | number): string;
|
|
36
|
+
setCMIValue(CMIElement: string, value: any): string;
|
|
37
|
+
getChildElement(CMIElement: string, value: any, foundFirstIndex: boolean): BaseCMI | null;
|
|
38
|
+
private createCorrectResponsesObject;
|
|
39
|
+
checkValidResponseType(response_type: ResponseType, value: any, interaction_type: string): void;
|
|
40
|
+
checkDuplicateChoiceResponse(interaction: CMIInteractionsObject, value: any): void;
|
|
41
|
+
validateCorrectResponse(CMIElement: string, value: any): void;
|
|
42
|
+
getCMIValue(CMIElement: string): any;
|
|
43
|
+
getLmsErrorMessageDetails(errorNumber: string | number, detail: boolean): string;
|
|
44
|
+
checkDuplicatedPattern(correct_response: CMIArray, current_index: number, value: any): boolean;
|
|
45
|
+
checkCorrectResponseValue(interaction_type: string, nodes: Array<any>, value: any): void;
|
|
46
|
+
removeCorrectResponsePrefixes(node: string): any;
|
|
47
|
+
replaceWithAnotherScormAPI(newAPI: Scorm2004Impl): void;
|
|
48
|
+
renderCommitCMI(terminateCommit: boolean): object | Array<any>;
|
|
49
|
+
renderCommitObject(terminateCommit: boolean): CommitObject;
|
|
50
|
+
storeData(terminateCommit: boolean): Promise<ResultObject>;
|
|
51
|
+
}
|
|
52
|
+
export { Scorm2004Impl as Scorm2004API };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseCMI } from "../common/base_cmi";
|
|
2
|
+
import { CMIScore } from "../common/score";
|
|
3
|
+
import { CMIArray } from "../common/array";
|
|
4
|
+
export declare class CMIAttemptRecords extends CMIArray {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export declare class CMIAttemptRecordsObject extends BaseCMI {
|
|
8
|
+
private _lesson_status;
|
|
9
|
+
constructor();
|
|
10
|
+
score: CMIScore;
|
|
11
|
+
initialize(): void;
|
|
12
|
+
reset(): void;
|
|
13
|
+
get lesson_status(): string;
|
|
14
|
+
set lesson_status(lesson_status: string);
|
|
15
|
+
toJSON(): {
|
|
16
|
+
lesson_status: string;
|
|
17
|
+
score: CMIScore;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as Scorm12CMI from "../scorm12/cmi";
|
|
2
|
+
import { CMIEvaluation } from "./evaluation";
|
|
3
|
+
import { AICCStudentPreferences } from "./student_preferences";
|
|
4
|
+
import { CMIStudentDemographics } from "./student_demographics";
|
|
5
|
+
import { AICCCMIStudentData } from "./student_data";
|
|
6
|
+
import { CMIPaths } from "./paths";
|
|
7
|
+
import { CMICore } from "./core";
|
|
8
|
+
import { CMIObjectives } from "../scorm12/objectives";
|
|
9
|
+
import { CMIStudentData } from "../scorm12/student_data";
|
|
10
|
+
import { CMIStudentPreference } from "../scorm12/student_preference";
|
|
11
|
+
import { CMIInteractions } from "../scorm12/interactions";
|
|
12
|
+
export declare class CMI extends Scorm12CMI.CMI {
|
|
13
|
+
constructor(initialized?: boolean);
|
|
14
|
+
student_data: AICCCMIStudentData;
|
|
15
|
+
student_preference: AICCStudentPreferences;
|
|
16
|
+
student_demographics: CMIStudentDemographics;
|
|
17
|
+
evaluation: CMIEvaluation;
|
|
18
|
+
paths: CMIPaths;
|
|
19
|
+
initialize(): void;
|
|
20
|
+
toJSON(): {
|
|
21
|
+
suspend_data: string;
|
|
22
|
+
launch_data: string;
|
|
23
|
+
comments: string;
|
|
24
|
+
comments_from_lms: string;
|
|
25
|
+
core: CMICore;
|
|
26
|
+
objectives: CMIObjectives;
|
|
27
|
+
student_data: CMIStudentData;
|
|
28
|
+
student_preference: CMIStudentPreference;
|
|
29
|
+
student_demographics: CMIStudentDemographics;
|
|
30
|
+
interactions: CMIInteractions;
|
|
31
|
+
evaluation: CMIEvaluation;
|
|
32
|
+
paths: CMIPaths;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { BaseCMI } from "../common/base_cmi";
|
|
2
|
+
import { CMIScore } from "../common/score";
|
|
3
|
+
export declare class CMICore extends BaseCMI {
|
|
4
|
+
constructor();
|
|
5
|
+
readonly score: CMIScore;
|
|
6
|
+
initialize(): void;
|
|
7
|
+
private __children;
|
|
8
|
+
private _student_id;
|
|
9
|
+
private _student_name;
|
|
10
|
+
private _lesson_location;
|
|
11
|
+
private _credit;
|
|
12
|
+
private _lesson_status;
|
|
13
|
+
private _entry;
|
|
14
|
+
private _total_time;
|
|
15
|
+
private _lesson_mode;
|
|
16
|
+
private _exit;
|
|
17
|
+
private _session_time;
|
|
18
|
+
private _suspend_data;
|
|
19
|
+
reset(): void;
|
|
20
|
+
get _children(): string;
|
|
21
|
+
set _children(_children: string);
|
|
22
|
+
get student_id(): string;
|
|
23
|
+
set student_id(student_id: string);
|
|
24
|
+
get student_name(): string;
|
|
25
|
+
set student_name(student_name: string);
|
|
26
|
+
get lesson_location(): string;
|
|
27
|
+
set lesson_location(lesson_location: string);
|
|
28
|
+
get credit(): string;
|
|
29
|
+
set credit(credit: string);
|
|
30
|
+
get lesson_status(): string;
|
|
31
|
+
set lesson_status(lesson_status: string);
|
|
32
|
+
get entry(): string;
|
|
33
|
+
set entry(entry: string);
|
|
34
|
+
get total_time(): string;
|
|
35
|
+
set total_time(total_time: string);
|
|
36
|
+
get lesson_mode(): string;
|
|
37
|
+
set lesson_mode(lesson_mode: string);
|
|
38
|
+
get exit(): string;
|
|
39
|
+
set exit(exit: string);
|
|
40
|
+
get session_time(): string;
|
|
41
|
+
set session_time(session_time: string);
|
|
42
|
+
get suspend_data(): string;
|
|
43
|
+
set suspend_data(suspend_data: string);
|
|
44
|
+
getCurrentTotalTime(start_time: number | undefined): string;
|
|
45
|
+
toJSON(): {
|
|
46
|
+
student_name: string;
|
|
47
|
+
entry: string;
|
|
48
|
+
exit: string;
|
|
49
|
+
score: CMIScore;
|
|
50
|
+
student_id: string;
|
|
51
|
+
lesson_mode: string;
|
|
52
|
+
lesson_location: string;
|
|
53
|
+
lesson_status: string;
|
|
54
|
+
credit: string;
|
|
55
|
+
session_time: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CMIArray } from "../common/array";
|
|
2
|
+
import { BaseCMI } from "../common/base_cmi";
|
|
3
|
+
export declare class CMIEvaluation extends BaseCMI {
|
|
4
|
+
constructor();
|
|
5
|
+
comments: CMIEvaluationComments;
|
|
6
|
+
initialize(): void;
|
|
7
|
+
reset(): void;
|
|
8
|
+
toJSON(): {
|
|
9
|
+
comments: CMIEvaluationComments;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare class CMIEvaluationComments extends CMIArray {
|
|
13
|
+
constructor();
|
|
14
|
+
}
|
|
15
|
+
export declare class CMIEvaluationCommentsObject extends BaseCMI {
|
|
16
|
+
private _content;
|
|
17
|
+
private _location;
|
|
18
|
+
private _time;
|
|
19
|
+
constructor();
|
|
20
|
+
reset(): void;
|
|
21
|
+
get content(): string;
|
|
22
|
+
set content(content: string);
|
|
23
|
+
get location(): string;
|
|
24
|
+
set location(location: string);
|
|
25
|
+
get time(): string;
|
|
26
|
+
set time(time: string);
|
|
27
|
+
toJSON(): {
|
|
28
|
+
content: string;
|
|
29
|
+
location: string;
|
|
30
|
+
time: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BaseCMI } from "../common/base_cmi";
|
|
2
|
+
import { CMIArray } from "../common/array";
|
|
3
|
+
export declare class CMIPaths extends CMIArray {
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
6
|
+
export declare class CMIPathsObject extends BaseCMI {
|
|
7
|
+
private _location_id;
|
|
8
|
+
private _date;
|
|
9
|
+
private _time;
|
|
10
|
+
private _status;
|
|
11
|
+
private _why_left;
|
|
12
|
+
private _time_in_element;
|
|
13
|
+
constructor();
|
|
14
|
+
reset(): void;
|
|
15
|
+
get location_id(): string;
|
|
16
|
+
set location_id(location_id: string);
|
|
17
|
+
get date(): string;
|
|
18
|
+
set date(date: string);
|
|
19
|
+
get time(): string;
|
|
20
|
+
set time(time: string);
|
|
21
|
+
get status(): string;
|
|
22
|
+
set status(status: string);
|
|
23
|
+
get why_left(): string;
|
|
24
|
+
set why_left(why_left: string);
|
|
25
|
+
get time_in_element(): string;
|
|
26
|
+
set time_in_element(time_in_element: string);
|
|
27
|
+
toJSON(): {
|
|
28
|
+
location_id: string;
|
|
29
|
+
date: string;
|
|
30
|
+
time: string;
|
|
31
|
+
status: string;
|
|
32
|
+
why_left: string;
|
|
33
|
+
time_in_element: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CMITries } from "./tries";
|
|
2
|
+
import { CMIStudentData } from "../scorm12/student_data";
|
|
3
|
+
import { CMIAttemptRecords } from "./attempts";
|
|
4
|
+
export declare class AICCCMIStudentData extends CMIStudentData {
|
|
5
|
+
constructor();
|
|
6
|
+
tries: CMITries;
|
|
7
|
+
attempt_records: CMIAttemptRecords;
|
|
8
|
+
initialize(): void;
|
|
9
|
+
reset(): void;
|
|
10
|
+
private _tries_during_lesson;
|
|
11
|
+
get tries_during_lesson(): string;
|
|
12
|
+
set tries_during_lesson(tries_during_lesson: string);
|
|
13
|
+
toJSON(): {
|
|
14
|
+
mastery_score: string;
|
|
15
|
+
max_time_allowed: string;
|
|
16
|
+
time_limit_action: string;
|
|
17
|
+
tries: CMITries;
|
|
18
|
+
attempt_records: CMIAttemptRecords;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { BaseCMI } from "../common/base_cmi";
|
|
2
|
+
export declare class CMIStudentDemographics extends BaseCMI {
|
|
3
|
+
private __children;
|
|
4
|
+
private _city;
|
|
5
|
+
private _class;
|
|
6
|
+
private _company;
|
|
7
|
+
private _country;
|
|
8
|
+
private _experience;
|
|
9
|
+
private _familiar_name;
|
|
10
|
+
private _instructor_name;
|
|
11
|
+
private _title;
|
|
12
|
+
private _native_language;
|
|
13
|
+
private _state;
|
|
14
|
+
private _street_address;
|
|
15
|
+
private _telephone;
|
|
16
|
+
private _years_experience;
|
|
17
|
+
constructor();
|
|
18
|
+
reset(): void;
|
|
19
|
+
get _children(): string;
|
|
20
|
+
get city(): string;
|
|
21
|
+
set city(city: string);
|
|
22
|
+
get class(): string;
|
|
23
|
+
set class(clazz: string);
|
|
24
|
+
get company(): string;
|
|
25
|
+
set company(company: string);
|
|
26
|
+
get country(): string;
|
|
27
|
+
set country(country: string);
|
|
28
|
+
get experience(): string;
|
|
29
|
+
set experience(experience: string);
|
|
30
|
+
get familiar_name(): string;
|
|
31
|
+
set familiar_name(familiar_name: string);
|
|
32
|
+
get instructor_name(): string;
|
|
33
|
+
set instructor_name(instructor_name: string);
|
|
34
|
+
get title(): string;
|
|
35
|
+
set title(title: string);
|
|
36
|
+
get native_language(): string;
|
|
37
|
+
set native_language(native_language: string);
|
|
38
|
+
get state(): string;
|
|
39
|
+
set state(state: string);
|
|
40
|
+
get street_address(): string;
|
|
41
|
+
set street_address(street_address: string);
|
|
42
|
+
get telephone(): string;
|
|
43
|
+
set telephone(telephone: string);
|
|
44
|
+
get years_experience(): string;
|
|
45
|
+
set years_experience(years_experience: string);
|
|
46
|
+
toJSON(): {
|
|
47
|
+
city: string;
|
|
48
|
+
class: string;
|
|
49
|
+
company: string;
|
|
50
|
+
country: string;
|
|
51
|
+
experience: string;
|
|
52
|
+
familiar_name: string;
|
|
53
|
+
instructor_name: string;
|
|
54
|
+
title: string;
|
|
55
|
+
native_language: string;
|
|
56
|
+
state: string;
|
|
57
|
+
street_address: string;
|
|
58
|
+
telephone: string;
|
|
59
|
+
years_experience: string;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CMIArray } from "../common/array";
|
|
2
|
+
import { CMIStudentPreference } from "../scorm12/student_preference";
|
|
3
|
+
export declare class AICCStudentPreferences extends CMIStudentPreference {
|
|
4
|
+
constructor();
|
|
5
|
+
windows: CMIArray;
|
|
6
|
+
initialize(): void;
|
|
7
|
+
private _lesson_type;
|
|
8
|
+
private _text_color;
|
|
9
|
+
private _text_location;
|
|
10
|
+
private _text_size;
|
|
11
|
+
private _video;
|
|
12
|
+
get lesson_type(): string;
|
|
13
|
+
set lesson_type(lesson_type: string);
|
|
14
|
+
get text_color(): string;
|
|
15
|
+
set text_color(text_color: string);
|
|
16
|
+
get text_location(): string;
|
|
17
|
+
set text_location(text_location: string);
|
|
18
|
+
get text_size(): string;
|
|
19
|
+
set text_size(text_size: string);
|
|
20
|
+
get video(): string;
|
|
21
|
+
set video(video: string);
|
|
22
|
+
toJSON(): {
|
|
23
|
+
audio: string;
|
|
24
|
+
language: string;
|
|
25
|
+
lesson_type: string;
|
|
26
|
+
speed: string;
|
|
27
|
+
text: string;
|
|
28
|
+
text_color: string;
|
|
29
|
+
text_location: string;
|
|
30
|
+
text_size: string;
|
|
31
|
+
video: string;
|
|
32
|
+
windows: CMIArray;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CMIArray } from "../common/array";
|
|
2
|
+
import { BaseCMI } from "../common/base_cmi";
|
|
3
|
+
import { CMIScore } from "../common/score";
|
|
4
|
+
export declare class CMITries extends CMIArray {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export declare class CMITriesObject extends BaseCMI {
|
|
8
|
+
private _status;
|
|
9
|
+
private _time;
|
|
10
|
+
constructor();
|
|
11
|
+
score: CMIScore;
|
|
12
|
+
initialize(): void;
|
|
13
|
+
reset(): void;
|
|
14
|
+
get status(): string;
|
|
15
|
+
set status(status: string);
|
|
16
|
+
get time(): string;
|
|
17
|
+
set time(time: string);
|
|
18
|
+
toJSON(): {
|
|
19
|
+
status: string;
|
|
20
|
+
time: string;
|
|
21
|
+
score: CMIScore;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function checkAICCValidFormat(value: string, regexPattern: string, allowEmptyString?: boolean): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseCMI } from "./base_cmi";
|
|
2
|
+
import { BaseScormValidationError } from "../../exceptions";
|
|
3
|
+
export declare class CMIArray extends BaseCMI {
|
|
4
|
+
private readonly _errorCode;
|
|
5
|
+
private readonly _errorClass;
|
|
6
|
+
private readonly __children;
|
|
7
|
+
childArray: any[];
|
|
8
|
+
constructor(params: {
|
|
9
|
+
children: string;
|
|
10
|
+
errorCode?: number;
|
|
11
|
+
errorClass?: typeof BaseScormValidationError;
|
|
12
|
+
});
|
|
13
|
+
reset(wipe?: boolean): void;
|
|
14
|
+
get _children(): string;
|
|
15
|
+
set _children(_children: string);
|
|
16
|
+
get _count(): number;
|
|
17
|
+
set _count(_count: number);
|
|
18
|
+
toJSON(): object;
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare abstract class BaseCMI {
|
|
2
|
+
jsonString?: boolean | undefined;
|
|
3
|
+
protected _initialized: boolean;
|
|
4
|
+
private _start_time;
|
|
5
|
+
get initialized(): boolean;
|
|
6
|
+
get start_time(): number | undefined;
|
|
7
|
+
initialize(): void;
|
|
8
|
+
setStartTime(): void;
|
|
9
|
+
abstract reset(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare abstract class BaseRootCMI extends BaseCMI {
|
|
12
|
+
abstract getCurrentTotalTime(): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BaseCMI } from "./base_cmi";
|
|
2
|
+
import { BaseScormValidationError } from "../../exceptions";
|
|
3
|
+
export declare class CMIScore extends BaseCMI {
|
|
4
|
+
private readonly __children;
|
|
5
|
+
private readonly __score_range;
|
|
6
|
+
private readonly __invalid_error_code;
|
|
7
|
+
private readonly __invalid_type_code;
|
|
8
|
+
private readonly __invalid_range_code;
|
|
9
|
+
private readonly __decimal_regex;
|
|
10
|
+
private readonly __error_class;
|
|
11
|
+
protected _raw: string;
|
|
12
|
+
protected _min: string;
|
|
13
|
+
protected _max: string;
|
|
14
|
+
constructor(params: {
|
|
15
|
+
score_children?: string;
|
|
16
|
+
score_range?: string;
|
|
17
|
+
max?: string;
|
|
18
|
+
invalidErrorCode?: number;
|
|
19
|
+
invalidTypeCode?: number;
|
|
20
|
+
invalidRangeCode?: number;
|
|
21
|
+
decimalRegex?: string;
|
|
22
|
+
errorClass: typeof BaseScormValidationError;
|
|
23
|
+
});
|
|
24
|
+
reset(): void;
|
|
25
|
+
get _children(): string;
|
|
26
|
+
set _children(_children: string);
|
|
27
|
+
get raw(): string;
|
|
28
|
+
set raw(raw: string);
|
|
29
|
+
get min(): string;
|
|
30
|
+
set min(min: string);
|
|
31
|
+
get max(): string;
|
|
32
|
+
set max(max: string);
|
|
33
|
+
toJSON(): {
|
|
34
|
+
min: string;
|
|
35
|
+
max: string;
|
|
36
|
+
raw: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BaseScormValidationError } from "../../exceptions";
|
|
2
|
+
export declare function checkValidFormat(value: string, regexPattern: string, errorCode: number, errorClass: typeof BaseScormValidationError, allowEmptyString?: boolean): boolean;
|
|
3
|
+
export declare function checkValidRange(value: any, rangePattern: string, errorCode: number, errorClass: typeof BaseScormValidationError): boolean;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BaseRootCMI } from "../common/base_cmi";
|
|
2
|
+
import { CMICore } from "../aicc/core";
|
|
3
|
+
import { CMIObjectives } from "./objectives";
|
|
4
|
+
import { CMIStudentData } from "./student_data";
|
|
5
|
+
import { CMIStudentPreference } from "./student_preference";
|
|
6
|
+
import { CMIInteractions } from "./interactions";
|
|
7
|
+
export declare class CMI extends BaseRootCMI {
|
|
8
|
+
private readonly __children;
|
|
9
|
+
private __version;
|
|
10
|
+
private _launch_data;
|
|
11
|
+
private _comments;
|
|
12
|
+
private _comments_from_lms;
|
|
13
|
+
constructor(cmi_children?: string, student_data?: CMIStudentData, initialized?: boolean);
|
|
14
|
+
core: CMICore;
|
|
15
|
+
objectives: CMIObjectives;
|
|
16
|
+
student_data: CMIStudentData;
|
|
17
|
+
student_preference: CMIStudentPreference;
|
|
18
|
+
interactions: CMIInteractions;
|
|
19
|
+
reset(): void;
|
|
20
|
+
initialize(): void;
|
|
21
|
+
toJSON(): {
|
|
22
|
+
suspend_data: string;
|
|
23
|
+
launch_data: string;
|
|
24
|
+
comments: string;
|
|
25
|
+
comments_from_lms: string;
|
|
26
|
+
core: CMICore;
|
|
27
|
+
objectives: CMIObjectives;
|
|
28
|
+
student_data: CMIStudentData;
|
|
29
|
+
student_preference: CMIStudentPreference;
|
|
30
|
+
interactions: CMIInteractions;
|
|
31
|
+
};
|
|
32
|
+
get _version(): string;
|
|
33
|
+
set _version(_version: string);
|
|
34
|
+
get _children(): string;
|
|
35
|
+
set _children(_children: string);
|
|
36
|
+
get suspend_data(): string;
|
|
37
|
+
set suspend_data(suspend_data: string);
|
|
38
|
+
get launch_data(): string;
|
|
39
|
+
set launch_data(launch_data: string);
|
|
40
|
+
get comments(): string;
|
|
41
|
+
set comments(comments: string);
|
|
42
|
+
get comments_from_lms(): string;
|
|
43
|
+
set comments_from_lms(comments_from_lms: string);
|
|
44
|
+
getCurrentTotalTime(): string;
|
|
45
|
+
}
|