scorm-again 3.1.4 → 3.1.5
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/esm/scorm-again.js +1080 -187
- 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 +14 -3
- 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 +1080 -187
- 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 +1406 -410
- package/dist/scorm-again.js.map +1 -1
- package/dist/scorm-again.min.js +1 -1
- package/dist/scorm12.js +54 -14
- package/dist/scorm12.js.map +1 -1
- package/dist/scorm12.min.js +1 -1
- package/dist/scorm2004.js +1401 -405
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/types/Scorm2004API.d.ts +11 -0
- package/dist/types/cmi/scorm2004/sequencing/activity.d.ts +47 -5
- package/dist/types/cmi/scorm2004/sequencing/handlers/rte_data_transfer.d.ts +1 -0
- package/dist/types/cmi/scorm2004/sequencing/objectives/global_objective_synchronizer.d.ts +17 -1
- package/dist/types/cmi/scorm2004/sequencing/sequencing_rules.d.ts +6 -1
- package/dist/types/cmi/scorm2004/sequencing/traversal/flow_traversal_service.d.ts +5 -2
- package/dist/types/constants/regex.d.ts +1 -0
- package/dist/types/types/api_types.d.ts +12 -0
- package/dist/types/types/sequencing_types.d.ts +7 -0
- package/dist/types/utilities/core.d.ts +4 -1
- package/package.json +1 -1
|
@@ -33,6 +33,15 @@ declare class Scorm2004API extends BaseAPI {
|
|
|
33
33
|
GetDiagnostic: (CMIErrorCode: string | number) => string;
|
|
34
34
|
reset(settings?: Settings): void;
|
|
35
35
|
private applyCurrentActivityLaunchData;
|
|
36
|
+
private applyDeliveredActivityLaunchData;
|
|
37
|
+
private applyActivityLaunchData;
|
|
38
|
+
private applyCurrentActivityObjectiveData;
|
|
39
|
+
private seedCurrentActivityObjectives;
|
|
40
|
+
private seedObjectiveReadMapValues;
|
|
41
|
+
private applyObjectiveReadStateToCMI;
|
|
42
|
+
private getSeedableObjectiveId;
|
|
43
|
+
private findOrSeedCMIObjective;
|
|
44
|
+
private getActivityObjectiveSuccessStatus;
|
|
36
45
|
get version(): string;
|
|
37
46
|
get globalObjectives(): CMIObjectivesObject[];
|
|
38
47
|
set _globalObjectives(objectives: CMIObjectivesObject[]);
|
|
@@ -48,6 +57,7 @@ declare class Scorm2004API extends BaseAPI {
|
|
|
48
57
|
lmsGetErrorString(CMIErrorCode: string | number): string;
|
|
49
58
|
lmsGetDiagnostic(CMIErrorCode: string | number): string;
|
|
50
59
|
setCMIValue(CMIElement: string, value: any): string;
|
|
60
|
+
private currentActivityAllowsGlobalObjectiveWrites;
|
|
51
61
|
getChildElement(CMIElement: string, value: any, foundFirstIndex: boolean): BaseCMI | null;
|
|
52
62
|
validateCorrectResponse(CMIElement: string, value: any): void;
|
|
53
63
|
private _peekCMIValue;
|
|
@@ -64,6 +74,7 @@ declare class Scorm2004API extends BaseAPI {
|
|
|
64
74
|
private configureSequencingControls;
|
|
65
75
|
private configureRollupRules;
|
|
66
76
|
private initializeSequencingService;
|
|
77
|
+
private buildSequencingEventListeners;
|
|
67
78
|
getSequencingService(): SequencingService | null;
|
|
68
79
|
setSequencingEventListeners(listeners: SequencingEventListeners): void;
|
|
69
80
|
updateSequencingConfiguration(config: SequencingConfiguration): void;
|
|
@@ -34,6 +34,12 @@ export interface ActivityObjectiveState {
|
|
|
34
34
|
satisfiedStatus: boolean;
|
|
35
35
|
measureStatus: boolean;
|
|
36
36
|
normalizedMeasure: number;
|
|
37
|
+
rawScore: string;
|
|
38
|
+
rawScoreKnown: boolean;
|
|
39
|
+
minScore: string;
|
|
40
|
+
minScoreKnown: boolean;
|
|
41
|
+
maxScore: string;
|
|
42
|
+
maxScoreKnown: boolean;
|
|
37
43
|
progressMeasure: number;
|
|
38
44
|
progressMeasureStatus: boolean;
|
|
39
45
|
completionStatus: CompletionStatus;
|
|
@@ -41,6 +47,18 @@ export interface ActivityObjectiveState {
|
|
|
41
47
|
minNormalizedMeasure?: number | null;
|
|
42
48
|
progressStatus: boolean;
|
|
43
49
|
}
|
|
50
|
+
export interface ActivityObjectiveScoreState {
|
|
51
|
+
rawScore?: string;
|
|
52
|
+
minScore?: string;
|
|
53
|
+
maxScore?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ActivityObjectiveReadState extends ActivityObjectiveScoreState {
|
|
56
|
+
satisfiedStatus?: boolean;
|
|
57
|
+
normalizedMeasure?: number;
|
|
58
|
+
progressMeasure?: number;
|
|
59
|
+
completionStatus?: CompletionStatus;
|
|
60
|
+
}
|
|
61
|
+
export type ActivityObjectiveDirtyProperty = "satisfiedStatus" | "normalizedMeasure" | "completionStatus" | "progressMeasure" | "rawScore" | "minScore" | "maxScore";
|
|
44
62
|
export type RollupConsiderationRequirement = "always" | "ifAttempted" | "ifNotSkipped" | "ifNotSuspended";
|
|
45
63
|
export interface RollupConsiderationsConfig {
|
|
46
64
|
requiredForSatisfied: RollupConsiderationRequirement;
|
|
@@ -68,6 +86,12 @@ export declare class ActivityObjective {
|
|
|
68
86
|
private _satisfiedStatusKnown;
|
|
69
87
|
private _measureStatus;
|
|
70
88
|
private _normalizedMeasure;
|
|
89
|
+
private _rawScore;
|
|
90
|
+
private _rawScoreKnown;
|
|
91
|
+
private _minScore;
|
|
92
|
+
private _minScoreKnown;
|
|
93
|
+
private _maxScore;
|
|
94
|
+
private _maxScoreKnown;
|
|
71
95
|
private _progressMeasure;
|
|
72
96
|
private _progressMeasureStatus;
|
|
73
97
|
private _completionStatus;
|
|
@@ -76,6 +100,9 @@ export declare class ActivityObjective {
|
|
|
76
100
|
private _normalizedMeasureDirty;
|
|
77
101
|
private _completionStatusDirty;
|
|
78
102
|
private _progressMeasureDirty;
|
|
103
|
+
private _rawScoreDirty;
|
|
104
|
+
private _minScoreDirty;
|
|
105
|
+
private _maxScoreDirty;
|
|
79
106
|
constructor(id: string, options?: ActivityObjectiveOptions);
|
|
80
107
|
get id(): string;
|
|
81
108
|
get description(): string | null;
|
|
@@ -95,6 +122,18 @@ export declare class ActivityObjective {
|
|
|
95
122
|
set measureStatus(value: boolean);
|
|
96
123
|
get normalizedMeasure(): number;
|
|
97
124
|
set normalizedMeasure(value: number);
|
|
125
|
+
get rawScore(): string;
|
|
126
|
+
set rawScore(value: string);
|
|
127
|
+
get rawScoreKnown(): boolean;
|
|
128
|
+
set rawScoreKnown(value: boolean);
|
|
129
|
+
get minScore(): string;
|
|
130
|
+
set minScore(value: string);
|
|
131
|
+
get minScoreKnown(): boolean;
|
|
132
|
+
set minScoreKnown(value: boolean);
|
|
133
|
+
get maxScore(): string;
|
|
134
|
+
set maxScore(value: string);
|
|
135
|
+
get maxScoreKnown(): boolean;
|
|
136
|
+
set maxScoreKnown(value: boolean);
|
|
98
137
|
get progressMeasure(): number;
|
|
99
138
|
set progressMeasure(value: number);
|
|
100
139
|
get progressMeasureStatus(): boolean;
|
|
@@ -103,10 +142,12 @@ export declare class ActivityObjective {
|
|
|
103
142
|
set completionStatus(value: CompletionStatus);
|
|
104
143
|
get progressStatus(): boolean;
|
|
105
144
|
set progressStatus(value: boolean);
|
|
106
|
-
isDirty(property:
|
|
107
|
-
clearDirty(property:
|
|
145
|
+
isDirty(property: ActivityObjectiveDirtyProperty): boolean;
|
|
146
|
+
clearDirty(property: ActivityObjectiveDirtyProperty): void;
|
|
108
147
|
clearAllDirty(): void;
|
|
109
148
|
initializeFromCMI(satisfiedStatus: boolean, normalizedMeasure: number, measureStatus: boolean): void;
|
|
149
|
+
initializeScoreFromCMI(score: ActivityObjectiveScoreState): void;
|
|
150
|
+
applyReadMappedState(state: ActivityObjectiveReadState): void;
|
|
110
151
|
resetState(): void;
|
|
111
152
|
updateFromActivity(activity: Activity): void;
|
|
112
153
|
applyToActivity(activity: Activity): void;
|
|
@@ -321,10 +362,10 @@ export declare class Activity extends BaseCMI {
|
|
|
321
362
|
} | null;
|
|
322
363
|
getAllObjectives(): ActivityObjective[];
|
|
323
364
|
private updatePrimaryObjectiveFromActivity;
|
|
324
|
-
isObjectiveDirty(property:
|
|
325
|
-
clearObjectiveDirty(property:
|
|
365
|
+
isObjectiveDirty(property: "satisfiedStatus" | "normalizedMeasure" | "measureStatus"): boolean;
|
|
366
|
+
clearObjectiveDirty(property: "satisfiedStatus" | "normalizedMeasure" | "measureStatus"): void;
|
|
326
367
|
clearAllObjectiveDirty(): void;
|
|
327
|
-
setPrimaryObjectiveState(satisfiedStatus: boolean, measureStatus: boolean, normalizedMeasure: number, progressMeasure: number, progressMeasureStatus: boolean, completionStatus: CompletionStatus): void;
|
|
368
|
+
setPrimaryObjectiveState(satisfiedStatus: boolean, measureStatus: boolean, normalizedMeasure: number, progressMeasure: number, progressMeasureStatus: boolean, completionStatus: CompletionStatus, objectiveProgressStatus?: boolean): void;
|
|
328
369
|
getObjectiveStateSnapshot(): {
|
|
329
370
|
primary: ActivityObjectiveState | null;
|
|
330
371
|
objectives: ActivityObjectiveState[];
|
|
@@ -333,6 +374,7 @@ export declare class Activity extends BaseCMI {
|
|
|
333
374
|
primary: ActivityObjectiveState | null;
|
|
334
375
|
objectives: ActivityObjectiveState[];
|
|
335
376
|
}): void;
|
|
377
|
+
private applyObjectiveScoreSnapshot;
|
|
336
378
|
getAvailableChildren(): Activity[];
|
|
337
379
|
setProcessedChildren(processedChildren: Activity[]): void;
|
|
338
380
|
resetProcessedChildren(): void;
|
|
@@ -43,5 +43,6 @@ export declare class RteDataTransferService {
|
|
|
43
43
|
transferPrimaryObjective(activity: Activity, cmiData: CMIDataForTransfer): void;
|
|
44
44
|
transferNonPrimaryObjectives(activity: Activity, cmiData: CMIDataForTransfer): void;
|
|
45
45
|
normalizeScore(score: ScoreData): number | null;
|
|
46
|
+
private getObjectiveScoreState;
|
|
46
47
|
}
|
|
47
48
|
//# sourceMappingURL=rte_data_transfer.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Activity, ActivityObjective, ObjectiveMapInfo } from "../activity";
|
|
1
|
+
import { Activity, ActivityObjective, ActivityObjectiveReadState, ObjectiveMapInfo } from "../activity";
|
|
2
2
|
import { CompletionStatus } from "../../../../constants/enums";
|
|
3
3
|
export type EventCallback = (eventType: string, data?: unknown) => void;
|
|
4
4
|
export interface GlobalObjective {
|
|
@@ -7,6 +7,12 @@ export interface GlobalObjective {
|
|
|
7
7
|
satisfiedStatusKnown: boolean;
|
|
8
8
|
normalizedMeasure: number;
|
|
9
9
|
normalizedMeasureKnown: boolean;
|
|
10
|
+
rawScore: string;
|
|
11
|
+
rawScoreKnown: boolean;
|
|
12
|
+
minScore: string;
|
|
13
|
+
minScoreKnown: boolean;
|
|
14
|
+
maxScore: string;
|
|
15
|
+
maxScoreKnown: boolean;
|
|
10
16
|
progressMeasure: number;
|
|
11
17
|
progressMeasureKnown: boolean;
|
|
12
18
|
completionStatus: CompletionStatus;
|
|
@@ -27,6 +33,12 @@ export interface LocalObjectiveState {
|
|
|
27
33
|
satisfiedStatus: boolean;
|
|
28
34
|
measureStatus: boolean;
|
|
29
35
|
normalizedMeasure: number;
|
|
36
|
+
rawScore: string;
|
|
37
|
+
rawScoreKnown: boolean;
|
|
38
|
+
minScore: string;
|
|
39
|
+
minScoreKnown: boolean;
|
|
40
|
+
maxScore: string;
|
|
41
|
+
maxScoreKnown: boolean;
|
|
30
42
|
progressMeasure: number;
|
|
31
43
|
progressMeasureStatus: boolean;
|
|
32
44
|
completionStatus: CompletionStatus;
|
|
@@ -41,8 +53,12 @@ export declare class GlobalObjectiveSynchronizer {
|
|
|
41
53
|
syncGlobalObjectivesReadPhase(activity: Activity, globalObjectives: Map<string, GlobalObjective>): void;
|
|
42
54
|
synchronizeGlobalObjectives(activity: Activity, globalObjectives: Map<string, GlobalObjective>): void;
|
|
43
55
|
syncObjectiveState(activity: Activity, objective: ActivityObjective, mapInfo: ObjectiveMapInfo, globalObjective: GlobalObjective): void;
|
|
56
|
+
static getGlobalObjectiveReadState(activity: Activity, objective: ActivityObjective, mapInfo: ObjectiveMapInfo, globalObjective: GlobalObjective): ActivityObjectiveReadState;
|
|
57
|
+
private applyGlobalObjectiveReadState;
|
|
44
58
|
ensureGlobalObjectiveEntry(globalObjectives: Map<string, GlobalObjective>, targetId: string, objective: ActivityObjective): GlobalObjective;
|
|
45
59
|
createDefaultMapInfo(objective: ActivityObjective): ObjectiveMapInfo;
|
|
60
|
+
private hasKnownSatisfiedStatus;
|
|
61
|
+
private canWriteGlobalObjectives;
|
|
46
62
|
getLocalObjectiveState(activity: Activity, objective: ActivityObjective, isPrimary: boolean): LocalObjectiveState;
|
|
47
63
|
updateActivityAttemptData(activity: Activity, globalObjective: GlobalObjective, objective: ActivityObjective): void;
|
|
48
64
|
}
|
|
@@ -36,6 +36,11 @@ export declare enum RuleActionType {
|
|
|
36
36
|
PREVIOUS = "previous",
|
|
37
37
|
EXIT = "exit"
|
|
38
38
|
}
|
|
39
|
+
export type RuleConditionEvaluation = boolean | "unknown";
|
|
40
|
+
export declare function kleeneNot(value: RuleConditionEvaluation): RuleConditionEvaluation;
|
|
41
|
+
export declare function kleeneAnd(values: RuleConditionEvaluation[]): RuleConditionEvaluation;
|
|
42
|
+
export declare function kleeneOr(values: RuleConditionEvaluation[]): RuleConditionEvaluation;
|
|
43
|
+
export declare function combineRuleConditionResults(values: RuleConditionEvaluation[], conditionCombination: string | RuleConditionOperator): RuleConditionEvaluation;
|
|
39
44
|
export declare class RuleCondition extends BaseCMI {
|
|
40
45
|
private _condition;
|
|
41
46
|
private _operator;
|
|
@@ -56,7 +61,7 @@ export declare class RuleCondition extends BaseCMI {
|
|
|
56
61
|
get referencedObjective(): string | null;
|
|
57
62
|
set referencedObjective(objectiveId: string | null);
|
|
58
63
|
private resolveReferencedObjective;
|
|
59
|
-
evaluate(activity: Activity):
|
|
64
|
+
evaluate(activity: Activity): RuleConditionEvaluation;
|
|
60
65
|
private evaluateTimeLimitExceeded;
|
|
61
66
|
private evaluateOutsideAvailableTimeRange;
|
|
62
67
|
private parseISO8601Duration;
|
|
@@ -6,16 +6,19 @@ export interface FlowTreeTraversalResult {
|
|
|
6
6
|
activity: Activity | null;
|
|
7
7
|
endSequencingSession: boolean;
|
|
8
8
|
exception?: string;
|
|
9
|
+
direction?: FlowSubprocessMode;
|
|
10
|
+
forwardOnlyCluster?: Activity;
|
|
9
11
|
}
|
|
10
12
|
export declare class FlowTraversalService {
|
|
11
13
|
private activityTree;
|
|
12
14
|
private ruleEngine;
|
|
13
15
|
constructor(activityTree: ActivityTree, ruleEngine: RuleEvaluationEngine);
|
|
14
16
|
flowSubprocess(fromActivity: Activity, direction: FlowSubprocessMode): FlowSubprocessResult;
|
|
15
|
-
flowTreeTraversalSubprocess(fromActivity: Activity, direction: FlowSubprocessMode, skipChildren?: boolean): FlowTreeTraversalResult;
|
|
17
|
+
flowTreeTraversalSubprocess(fromActivity: Activity, direction: FlowSubprocessMode, skipChildren?: boolean, forwardTraversalBoundary?: Activity | null): FlowTreeTraversalResult;
|
|
16
18
|
private traverseForward;
|
|
17
19
|
private traverseBackward;
|
|
18
|
-
private
|
|
20
|
+
private getBackwardTraversalEntry;
|
|
21
|
+
private isDescendantOfOrSelf;
|
|
19
22
|
flowActivityTraversalSubprocess(activity: Activity, _direction: boolean, considerChildren: boolean, mode: FlowSubprocessMode): Activity | null;
|
|
20
23
|
checkActivityProcess(activity: Activity): boolean;
|
|
21
24
|
ensureSelectionAndRandomization(activity: Activity): void;
|
|
@@ -175,6 +175,12 @@ export type GlobalObjectiveMapEntry = {
|
|
|
175
175
|
satisfiedStatusKnown?: boolean;
|
|
176
176
|
normalizedMeasure?: number;
|
|
177
177
|
normalizedMeasureKnown?: boolean;
|
|
178
|
+
rawScore?: string;
|
|
179
|
+
rawScoreKnown?: boolean;
|
|
180
|
+
minScore?: string;
|
|
181
|
+
minScoreKnown?: boolean;
|
|
182
|
+
maxScore?: string;
|
|
183
|
+
maxScoreKnown?: boolean;
|
|
178
184
|
progressMeasure?: number;
|
|
179
185
|
progressMeasureKnown?: boolean;
|
|
180
186
|
completionStatus?: string;
|
|
@@ -187,6 +193,12 @@ export type GlobalObjectiveMapEntry = {
|
|
|
187
193
|
writeProgressMeasure?: boolean;
|
|
188
194
|
readCompletionStatus?: boolean;
|
|
189
195
|
writeCompletionStatus?: boolean;
|
|
196
|
+
readRawScore?: boolean;
|
|
197
|
+
writeRawScore?: boolean;
|
|
198
|
+
readMinScore?: boolean;
|
|
199
|
+
writeMinScore?: boolean;
|
|
200
|
+
readMaxScore?: boolean;
|
|
201
|
+
writeMaxScore?: boolean;
|
|
190
202
|
lastUpdated?: string;
|
|
191
203
|
};
|
|
192
204
|
//# sourceMappingURL=api_types.d.ts.map
|
|
@@ -22,6 +22,11 @@ export type CompletionThresholdSettings = {
|
|
|
22
22
|
minProgressMeasure?: number;
|
|
23
23
|
progressWeight?: number;
|
|
24
24
|
};
|
|
25
|
+
export type DeliveryControlsSettings = {
|
|
26
|
+
tracked?: boolean;
|
|
27
|
+
completionSetByContent?: boolean;
|
|
28
|
+
objectiveSetByContent?: boolean;
|
|
29
|
+
};
|
|
25
30
|
export type ActivitySettings = {
|
|
26
31
|
id: string;
|
|
27
32
|
title: string;
|
|
@@ -43,6 +48,7 @@ export type ActivitySettings = {
|
|
|
43
48
|
objectives?: ObjectiveSettings[];
|
|
44
49
|
sequencingRules?: SequencingRulesSettings;
|
|
45
50
|
sequencingControls?: SequencingControlsSettings;
|
|
51
|
+
deliveryControls?: DeliveryControlsSettings;
|
|
46
52
|
rollupRules?: RollupRulesSettings;
|
|
47
53
|
rollupConsiderations?: AdlRollupConsiderationsSettings;
|
|
48
54
|
completionThreshold?: CompletionThresholdSettings;
|
|
@@ -115,6 +121,7 @@ export type SequencingControlsSettings = {
|
|
|
115
121
|
reorderChildren?: boolean;
|
|
116
122
|
completionSetByContent?: boolean;
|
|
117
123
|
objectiveSetByContent?: boolean;
|
|
124
|
+
tracked?: boolean;
|
|
118
125
|
};
|
|
119
126
|
export type SelectionRandomizationStateSettings = {
|
|
120
127
|
childOrder?: string[];
|
|
@@ -15,7 +15,10 @@ export declare function unflatten(data: StringKeyMap): object;
|
|
|
15
15
|
export declare function countDecimals(num: number): number;
|
|
16
16
|
export declare function formatMessage(functionName: string, message: string, CMIElement?: string): string;
|
|
17
17
|
export declare function stringMatches(str: string | null | undefined, tester: string): boolean;
|
|
18
|
-
export declare function memoize<T extends (...args: any[]) => any>(fn: T, keyFn?: (...args: Parameters<T>) => string
|
|
18
|
+
export declare function memoize<T extends (...args: any[]) => any>(fn: T, keyFn?: (...args: Parameters<T>) => string, options?: {
|
|
19
|
+
maxEntries?: number;
|
|
20
|
+
maxKeyLength?: number;
|
|
21
|
+
}): T;
|
|
19
22
|
export type ParsedNavigationRequest = {
|
|
20
23
|
command: string;
|
|
21
24
|
targetActivityId: string | null;
|