Skip to main content

Class: LernkitScorm12Adapter

Defined in: adapters/scorm12.ts:60

The core Tracker contract. Implementations must be idempotent on terminate() and safe to call from any lifecycle event (unload, visibility change).

Implements

Constructors

Constructor

new LernkitScorm12Adapter(runtime?): LernkitScorm12Adapter

Defined in: adapters/scorm12.ts:75

Parameters

runtime?

LernkitScorm12Runtime

Inject a runtime for tests; otherwise the adapter reads window.LernkitScorm12. If neither is available the adapter throws on init().

Returns

LernkitScorm12Adapter

Accessors

state

Get Signature

get state(): TrackerState

Defined in: adapters/scorm12.ts:174

Read-only snapshot of the tracker's current understanding of lesson state.

Returns

TrackerState

Read-only snapshot of the tracker's current understanding of lesson state.

Implementation of

Tracker.state

Methods

complete()

complete(): Promise<void>

Defined in: adapters/scorm12.ts:144

Mark the lesson complete — translated per standard (lesson_status, completion_status, etc.).

Returns

Promise<void>

Implementation of

Tracker.complete


fail()

fail(): Promise<void>

Defined in: adapters/scorm12.ts:158

Terminal-fail.

Returns

Promise<void>

Implementation of

Tracker.fail


init()

init(): Promise<boolean>

Defined in: adapters/scorm12.ts:86

Establish an LMS connection (or a no-op for unlaunched contexts). Returns true on success.

Returns

Promise<boolean>

Implementation of

Tracker.init


pass()

pass(): Promise<void>

Defined in: adapters/scorm12.ts:151

Terminal-pass. complete() is still required separately unless the adapter fuses them.

Returns

Promise<void>

Implementation of

Tracker.pass


recordInteraction()

recordInteraction(_interaction): Promise<void>

Defined in: adapters/scorm12.ts:127

Parameters

_interaction

InteractionResult

Returns

Promise<void>

Implementation of

Tracker.recordInteraction


setBookmark()

setBookmark(bookmark): Promise<void>

Defined in: adapters/scorm12.ts:111

Opaque resume location. SCORM 1.2 caps this at ~4 KB; the adapter enforces that cap.

Parameters

bookmark

string

Returns

Promise<void>

Implementation of

Tracker.setBookmark


setProgress()

setProgress(progress): Promise<void>

Defined in: adapters/scorm12.ts:98

Progress is a scaled value in [0, 1].

Parameters

progress

number

Returns

Promise<void>

Implementation of

Tracker.setProgress


setScore()

setScore(score): Promise<void>

Defined in: adapters/scorm12.ts:134

Parameters

score

Score

Returns

Promise<void>

Implementation of

Tracker.setScore


terminate()

terminate(): Promise<void>

Defined in: adapters/scorm12.ts:165

Flush buffered state and close the LMS API connection. Idempotent.

Returns

Promise<void>

Implementation of

Tracker.terminate