scorm-again 3.1.4 → 3.2.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/README.md +3 -1
- package/dist/cross-frame-api.js +6 -13
- package/dist/cross-frame-api.js.map +1 -1
- package/dist/cross-frame-api.min.js +1 -1
- package/dist/cross-frame-lms.js +2 -6
- package/dist/cross-frame-lms.js.map +1 -1
- package/dist/esm/scorm-again.js +1128 -198
- 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 +60 -13
- 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 +1128 -198
- 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 +2088 -1465
- package/dist/scorm-again.js.map +1 -1
- package/dist/scorm-again.min.js +1 -1
- package/dist/scorm12.js +347 -420
- package/dist/scorm12.js.map +1 -1
- package/dist/scorm12.min.js +1 -1
- package/dist/scorm2004.js +1983 -1301
- package/dist/scorm2004.js.map +1 -1
- package/dist/scorm2004.min.js +1 -1
- package/dist/types/BaseAPI.d.ts +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/interfaces/services.d.ts +1 -1
- package/dist/types/services/AsynchronousHttpService.d.ts +1 -0
- package/dist/types/services/ErrorHandlingService.d.ts +4 -4
- package/dist/types/services/SynchronousHttpService.d.ts +1 -0
- package/dist/types/types/api_types.d.ts +16 -0
- package/dist/types/types/sequencing_types.d.ts +7 -0
- package/dist/types/utilities/core.d.ts +6 -1
- package/package.json +4 -4
package/dist/types/BaseAPI.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export default abstract class BaseAPI implements IBaseAPI {
|
|
|
73
73
|
off(listenerName: string, callback: ScormEventCallback): void;
|
|
74
74
|
clear(listenerName: string): void;
|
|
75
75
|
processListeners(functionName: string, CMIElement?: string, value?: any, context?: CommitEventContext): void;
|
|
76
|
-
throwSCORMError(CMIElement: string | undefined, errorNumber: number | undefined, message?: string): void;
|
|
76
|
+
throwSCORMError(CMIElement: string | undefined, errorNumber: number | undefined, message?: string, messageLevel?: LogLevel): void;
|
|
77
77
|
clearSCORMError(success: string): void;
|
|
78
78
|
loadFromFlattenedJSON(json: StringKeyMap, CMIElement?: string): void;
|
|
79
79
|
getFlattenedCMI(): StringKeyMap;
|
|
@@ -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;
|
|
@@ -34,7 +34,7 @@ export interface IErrorHandlingService {
|
|
|
34
34
|
get lastErrorCode(): string;
|
|
35
35
|
set lastErrorCode(errorCode: string);
|
|
36
36
|
get lastDiagnostic(): string;
|
|
37
|
-
throwSCORMError(CMIElement: string | undefined, errorNumber: number, message?: string): void;
|
|
37
|
+
throwSCORMError(CMIElement: string | undefined, errorNumber: number, message?: string, messageLevel?: LogLevel): void;
|
|
38
38
|
clearSCORMError(success: string): void;
|
|
39
39
|
handleValueAccessException(CMIElement: string, e: ValidationError | Error | unknown, returnValue: string): string;
|
|
40
40
|
get errorCodes(): ErrorCode;
|
|
@@ -13,6 +13,7 @@ export declare class AsynchronousHttpService implements IHttpService {
|
|
|
13
13
|
private _prepareRequestBody;
|
|
14
14
|
private performFetch;
|
|
15
15
|
private performBeacon;
|
|
16
|
+
private _warnIfBeaconContentTypeUnsafe;
|
|
16
17
|
private transformResponse;
|
|
17
18
|
private _isSuccessResponse;
|
|
18
19
|
updateSettings(settings: InternalSettings): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LogLevelEnum } from "../constants/enums";
|
|
2
1
|
import { ErrorCode } from "../constants/error_codes";
|
|
3
2
|
import { ValidationError } from "../exceptions";
|
|
4
3
|
import { IErrorHandlingService, ILoggingService } from "../interfaces/services";
|
|
4
|
+
import { LogLevel } from "../types/api_types";
|
|
5
5
|
export declare class ErrorHandlingService implements IErrorHandlingService {
|
|
6
6
|
private _lastErrorCode;
|
|
7
7
|
private _lastDiagnostic;
|
|
@@ -9,14 +9,14 @@ export declare class ErrorHandlingService implements IErrorHandlingService {
|
|
|
9
9
|
private readonly _apiLog;
|
|
10
10
|
private readonly _getLmsErrorMessageDetails;
|
|
11
11
|
private readonly _loggingService;
|
|
12
|
-
constructor(errorCodes: ErrorCode, apiLog: (functionName: string, message: string, logLevel?:
|
|
12
|
+
constructor(errorCodes: ErrorCode, apiLog: (functionName: string, message: string, logLevel?: LogLevel, CMIElement?: string) => void, getLmsErrorMessageDetails: (errorCode: number, detail: boolean) => string, loggingService?: ILoggingService);
|
|
13
13
|
get lastErrorCode(): string;
|
|
14
14
|
set lastErrorCode(errorCode: string);
|
|
15
15
|
get lastDiagnostic(): string;
|
|
16
|
-
throwSCORMError(CMIElement: string, errorNumber: number, message?: string): void;
|
|
16
|
+
throwSCORMError(CMIElement: string | undefined, errorNumber: number, message?: string, messageLevel?: LogLevel): void;
|
|
17
17
|
clearSCORMError(success: string): void;
|
|
18
18
|
handleValueAccessException(CMIElement: string, e: Error | ValidationError | unknown, returnValue: string): string;
|
|
19
19
|
get errorCodes(): ErrorCode;
|
|
20
20
|
}
|
|
21
|
-
export declare function createErrorHandlingService(errorCodes: ErrorCode, apiLog: (functionName: string, message: string, logLevel?:
|
|
21
|
+
export declare function createErrorHandlingService(errorCodes: ErrorCode, apiLog: (functionName: string, message: string, logLevel?: LogLevel, CMIElement?: string) => void, getLmsErrorMessageDetails: (errorCode: number, detail: boolean) => string, loggingService?: ILoggingService): ErrorHandlingService;
|
|
22
22
|
//# sourceMappingURL=ErrorHandlingService.d.ts.map
|
|
@@ -8,6 +8,7 @@ export declare class SynchronousHttpService implements IHttpService {
|
|
|
8
8
|
constructor(settings: InternalSettings, error_codes: ErrorCode);
|
|
9
9
|
processHttpRequest(url: string, params: CommitObject | StringKeyMap | Array<any>, immediate: boolean | undefined, _apiLog: (functionName: string, message: any, messageLevel: number, CMIElement?: string) => void, _processListeners: (functionName: string, CMIElement?: string, value?: any) => void, metadata?: CommitMetadata, _onRequestComplete?: () => void): ResultObject;
|
|
10
10
|
private _handleImmediateRequest;
|
|
11
|
+
private _warnIfBeaconContentTypeUnsafe;
|
|
11
12
|
private _performSyncXHR;
|
|
12
13
|
private _prepareRequestBody;
|
|
13
14
|
updateSettings(settings: InternalSettings): void;
|
|
@@ -27,6 +27,7 @@ export type Settings = {
|
|
|
27
27
|
commitRequestDataType?: string | undefined;
|
|
28
28
|
autoProgress?: boolean | undefined;
|
|
29
29
|
logLevel?: LogLevel | undefined;
|
|
30
|
+
uninitializedGetLogLevel?: LogLevel | undefined;
|
|
30
31
|
selfReportSessionTime?: boolean | undefined;
|
|
31
32
|
alwaysSendTotalTime?: boolean | undefined;
|
|
32
33
|
strict_errors?: boolean | undefined;
|
|
@@ -37,6 +38,7 @@ export type Settings = {
|
|
|
37
38
|
xhrResponseHandler?: ((xhr: XMLHttpRequest) => ResultObject) | undefined;
|
|
38
39
|
requestHandler?: ((commitObject: unknown, metadata?: CommitMetadata) => unknown) | undefined;
|
|
39
40
|
terminateCommitParam?: string | undefined;
|
|
41
|
+
terminationCommitContentType?: string | undefined;
|
|
40
42
|
terminateCommitPayloadField?: string | undefined;
|
|
41
43
|
includeCommitSequence?: boolean | undefined;
|
|
42
44
|
onLogMessage?: ((messageLevel: LogLevel, logMessage: string) => void) | undefined;
|
|
@@ -72,6 +74,7 @@ export type InternalSettings = {
|
|
|
72
74
|
commitRequestDataType: string;
|
|
73
75
|
autoProgress: boolean;
|
|
74
76
|
logLevel: LogLevel;
|
|
77
|
+
uninitializedGetLogLevel: LogLevel;
|
|
75
78
|
selfReportSessionTime: boolean;
|
|
76
79
|
renderCommonCommitFields: boolean;
|
|
77
80
|
autoCompleteLessonStatus: boolean;
|
|
@@ -84,6 +87,7 @@ export type InternalSettings = {
|
|
|
84
87
|
xhrResponseHandler: (xhr: XMLHttpRequest) => ResultObject;
|
|
85
88
|
requestHandler: (commitObject: unknown, metadata?: CommitMetadata) => unknown;
|
|
86
89
|
terminateCommitParam?: string | undefined;
|
|
90
|
+
terminationCommitContentType: string;
|
|
87
91
|
terminateCommitPayloadField?: string | undefined;
|
|
88
92
|
includeCommitSequence?: boolean | undefined;
|
|
89
93
|
onLogMessage?: ((messageLevel: LogLevel, logMessage: string) => void) | undefined;
|
|
@@ -175,6 +179,12 @@ export type GlobalObjectiveMapEntry = {
|
|
|
175
179
|
satisfiedStatusKnown?: boolean;
|
|
176
180
|
normalizedMeasure?: number;
|
|
177
181
|
normalizedMeasureKnown?: boolean;
|
|
182
|
+
rawScore?: string;
|
|
183
|
+
rawScoreKnown?: boolean;
|
|
184
|
+
minScore?: string;
|
|
185
|
+
minScoreKnown?: boolean;
|
|
186
|
+
maxScore?: string;
|
|
187
|
+
maxScoreKnown?: boolean;
|
|
178
188
|
progressMeasure?: number;
|
|
179
189
|
progressMeasureKnown?: boolean;
|
|
180
190
|
completionStatus?: string;
|
|
@@ -187,6 +197,12 @@ export type GlobalObjectiveMapEntry = {
|
|
|
187
197
|
writeProgressMeasure?: boolean;
|
|
188
198
|
readCompletionStatus?: boolean;
|
|
189
199
|
writeCompletionStatus?: boolean;
|
|
200
|
+
readRawScore?: boolean;
|
|
201
|
+
writeRawScore?: boolean;
|
|
202
|
+
readMinScore?: boolean;
|
|
203
|
+
writeMinScore?: boolean;
|
|
204
|
+
readMaxScore?: boolean;
|
|
205
|
+
writeMaxScore?: boolean;
|
|
190
206
|
lastUpdated?: string;
|
|
191
207
|
};
|
|
192
208
|
//# 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[];
|
|
@@ -3,6 +3,8 @@ export declare const SECONDS_PER_MINUTE = 60;
|
|
|
3
3
|
export declare const SECONDS_PER_HOUR: number;
|
|
4
4
|
export declare const SECONDS_PER_DAY: number;
|
|
5
5
|
export type StringKeyMap = Record<string, unknown>;
|
|
6
|
+
export declare function isCorsSafelistedContentType(contentType: string): boolean;
|
|
7
|
+
export declare function isCrossOriginUrl(url: string): boolean;
|
|
6
8
|
export declare const getSecondsAsHHMMSS: (totalSeconds: number | null) => string;
|
|
7
9
|
export declare const getSecondsAsISODuration: (seconds: number | null) => string;
|
|
8
10
|
export declare const getTimeAsSeconds: (timeString: string | number | boolean | null, timeRegex: RegExp | string) => number;
|
|
@@ -15,7 +17,10 @@ export declare function unflatten(data: StringKeyMap): object;
|
|
|
15
17
|
export declare function countDecimals(num: number): number;
|
|
16
18
|
export declare function formatMessage(functionName: string, message: string, CMIElement?: string): string;
|
|
17
19
|
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
|
|
20
|
+
export declare function memoize<T extends (...args: any[]) => any>(fn: T, keyFn?: (...args: Parameters<T>) => string, options?: {
|
|
21
|
+
maxEntries?: number;
|
|
22
|
+
maxKeyLength?: number;
|
|
23
|
+
}): T;
|
|
19
24
|
export type ParsedNavigationRequest = {
|
|
20
25
|
command: string;
|
|
21
26
|
targetActivityId: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scorm-again",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "A modern SCORM JavaScript run-time library for SCORM 1.2 and SCORM 2004",
|
|
5
5
|
"main": "dist/scorm-again.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"es-check": "^9.6.4",
|
|
106
106
|
"esbuild": "0.28.1",
|
|
107
107
|
"eslint": "10.7.0",
|
|
108
|
-
"eslint-plugin-jsdoc": "63.0
|
|
108
|
+
"eslint-plugin-jsdoc": "63.2.0",
|
|
109
109
|
"express": "^5.2.1",
|
|
110
110
|
"extract-zip": "2.0.1",
|
|
111
111
|
"fast-check": "4.9.0",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"monocart-coverage-reports": "^2.12.12",
|
|
116
116
|
"monocart-reporter": "^2.12.2",
|
|
117
117
|
"playwright": "1.61.1",
|
|
118
|
-
"prettier": "3.9.
|
|
118
|
+
"prettier": "3.9.6",
|
|
119
119
|
"rollup": "4.62.2",
|
|
120
120
|
"rollup-plugin-esbuild": "6.2.1",
|
|
121
121
|
"rollup-plugin-swc3": "^0.12.1",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"tsx": "4.23.1",
|
|
126
126
|
"typescript": "6.0.3",
|
|
127
127
|
"typescript-eslint": "8.64.0",
|
|
128
|
-
"vite": "8.1.
|
|
128
|
+
"vite": "8.1.5",
|
|
129
129
|
"vitest": "4.1.10"
|
|
130
130
|
},
|
|
131
131
|
"engines": {
|