@intellectif/lk-core 0.4.0 → 0.5.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/dist/{chunk-QOAORTA4.cjs → chunk-4JR3UXX6.cjs} +51 -2
- package/dist/chunk-4JR3UXX6.cjs.map +1 -0
- package/dist/{chunk-A6JXV5GP.js → chunk-DUQVGLQ3.js} +56 -57
- package/dist/chunk-DUQVGLQ3.js.map +1 -0
- package/dist/chunk-FCM5VJBS.cjs +187 -0
- package/dist/chunk-FCM5VJBS.cjs.map +1 -0
- package/dist/chunk-LSHDNA2T.js +187 -0
- package/dist/chunk-LSHDNA2T.js.map +1 -0
- package/dist/{chunk-5GJJHGY5.js → chunk-NUCEUU4P.js} +50 -1
- package/dist/chunk-NUCEUU4P.js.map +1 -0
- package/dist/{chunk-RUZ52Q7A.cjs → chunk-R7PDJBRX.cjs} +19 -4
- package/dist/chunk-R7PDJBRX.cjs.map +1 -0
- package/dist/{chunk-5ZAW76F3.cjs → chunk-SM5HUGYU.cjs} +59 -60
- package/dist/chunk-SM5HUGYU.cjs.map +1 -0
- package/dist/{chunk-APDLWLYD.js → chunk-WV5WQ3SZ.js} +19 -4
- package/dist/chunk-WV5WQ3SZ.js.map +1 -0
- package/dist/index-BKyZrd94.d.cts +732 -0
- package/dist/index-CLmXzBhB.d.ts +732 -0
- package/dist/index.cjs +192 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +133 -3
- package/dist/index.d.ts +133 -3
- package/dist/index.js +189 -12
- package/dist/index.js.map +1 -1
- package/dist/schemas.cjs +17 -4
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +3 -460
- package/dist/schemas.d.ts +3 -460
- package/dist/schemas.js +16 -3
- package/dist/scoring.cjs +3 -4
- package/dist/scoring.cjs.map +1 -1
- package/dist/scoring.d.cts +9 -1
- package/dist/scoring.d.ts +9 -1
- package/dist/scoring.js +2 -3
- package/dist/xapi.cjs +5 -3
- package/dist/xapi.cjs.map +1 -1
- package/dist/xapi.d.cts +18 -1
- package/dist/xapi.d.ts +18 -1
- package/dist/xapi.js +6 -4
- package/package.json +3 -2
- package/dist/chunk-3YAVDV5F.js +0 -47
- package/dist/chunk-3YAVDV5F.js.map +0 -1
- package/dist/chunk-55O4M45K.js +0 -57
- package/dist/chunk-55O4M45K.js.map +0 -1
- package/dist/chunk-5GJJHGY5.js.map +0 -1
- package/dist/chunk-5ZAW76F3.cjs.map +0 -1
- package/dist/chunk-A6JXV5GP.js.map +0 -1
- package/dist/chunk-APDLWLYD.js.map +0 -1
- package/dist/chunk-PIMX4B4D.cjs +0 -47
- package/dist/chunk-PIMX4B4D.cjs.map +0 -1
- package/dist/chunk-QOAORTA4.cjs.map +0 -1
- package/dist/chunk-RUZ52Q7A.cjs.map +0 -1
- package/dist/chunk-YNTYWHZI.cjs +0 -57
- package/dist/chunk-YNTYWHZI.cjs.map +0 -1
package/dist/schemas.d.ts
CHANGED
|
@@ -1,460 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Optional authored "overall feedback" shown after submission, selected by
|
|
6
|
-
* whether the learner passed (h5p-style overall feedback). Both fields are
|
|
7
|
-
* optional; non-empty when present.
|
|
8
|
-
*/
|
|
9
|
-
declare const FeedbackSchema: z.ZodObject<{
|
|
10
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
11
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
12
|
-
}, z.core.$loose>;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Zod schema for a `TextMatchPolicy` — the opt-in matching tolerances a blank
|
|
16
|
-
* may declare. Every default reproduces the v1 trim + case-fold semantics.
|
|
17
|
-
*/
|
|
18
|
-
declare const TextMatchPolicySchema: z.ZodObject<{
|
|
19
|
-
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
-
trim: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
-
normalize: z.ZodOptional<z.ZodEnum<{
|
|
22
|
-
none: "none";
|
|
23
|
-
NFC: "NFC";
|
|
24
|
-
NFKC: "NFKC";
|
|
25
|
-
}>>;
|
|
26
|
-
foldDiacritics: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
-
collapseInnerWhitespace: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
-
ignorePunctuation: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
-
levenshtein: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
31
|
-
}, z.core.$loose>;
|
|
32
|
-
/**
|
|
33
|
-
* Zod schema for a single fill-in-the-blank slot configuration. Loose:
|
|
34
|
-
* unknown keys are preserved through validation. Accepted answers must
|
|
35
|
-
* contain non-whitespace characters — a whitespace-only accepted answer
|
|
36
|
-
* normalizes to the empty string and would mark an empty response correct.
|
|
37
|
-
*/
|
|
38
|
-
declare const BlankConfigSchema: z.ZodObject<{
|
|
39
|
-
id: z.ZodString;
|
|
40
|
-
acceptedAnswers: z.ZodArray<z.ZodString>;
|
|
41
|
-
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
-
trimWhitespace: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
-
match: z.ZodOptional<z.ZodObject<{
|
|
44
|
-
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
-
trim: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
-
normalize: z.ZodOptional<z.ZodEnum<{
|
|
47
|
-
none: "none";
|
|
48
|
-
NFC: "NFC";
|
|
49
|
-
NFKC: "NFKC";
|
|
50
|
-
}>>;
|
|
51
|
-
foldDiacritics: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
-
collapseInnerWhitespace: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
-
ignorePunctuation: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
-
levenshtein: z.ZodOptional<z.ZodNumber>;
|
|
55
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
56
|
-
}, z.core.$loose>>;
|
|
57
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
58
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
59
|
-
}, z.core.$loose>;
|
|
60
|
-
/**
|
|
61
|
-
* Zod schema validating the full Fill-in-the-Blanks activity data contract.
|
|
62
|
-
* Loose at every level: unknown keys are preserved, never stripped (B7).
|
|
63
|
-
*
|
|
64
|
-
* The refinement enforces a true one-to-one correspondence between `{{id}}`
|
|
65
|
-
* placeholders and `blanks[].id`: every blank id appears EXACTLY ONCE in the
|
|
66
|
-
* passage and exactly once in `blanks[]`. (The previous set-based check let
|
|
67
|
-
* duplicate placeholders and duplicate blank configs through, corrupting the
|
|
68
|
-
* partial-score denominator and per-item details.)
|
|
69
|
-
*/
|
|
70
|
-
declare const FillInTheBlanksDataSchema: z.ZodObject<{
|
|
71
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
72
|
-
type: z.ZodLiteral<"fill-in-the-blanks">;
|
|
73
|
-
id: z.ZodString;
|
|
74
|
-
title: z.ZodString;
|
|
75
|
-
passage: z.ZodString;
|
|
76
|
-
passageHtml: z.ZodOptional<z.ZodString>;
|
|
77
|
-
blanks: z.ZodArray<z.ZodObject<{
|
|
78
|
-
id: z.ZodString;
|
|
79
|
-
acceptedAnswers: z.ZodArray<z.ZodString>;
|
|
80
|
-
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
-
trimWhitespace: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
-
match: z.ZodOptional<z.ZodObject<{
|
|
83
|
-
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
-
trim: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
-
normalize: z.ZodOptional<z.ZodEnum<{
|
|
86
|
-
none: "none";
|
|
87
|
-
NFC: "NFC";
|
|
88
|
-
NFKC: "NFKC";
|
|
89
|
-
}>>;
|
|
90
|
-
foldDiacritics: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
-
collapseInnerWhitespace: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
-
ignorePunctuation: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
-
levenshtein: z.ZodOptional<z.ZodNumber>;
|
|
94
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
95
|
-
}, z.core.$loose>>;
|
|
96
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
97
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
98
|
-
}, z.core.$loose>>;
|
|
99
|
-
scoringStrategy: z.ZodEnum<{
|
|
100
|
-
"all-or-nothing": "all-or-nothing";
|
|
101
|
-
partial: "partial";
|
|
102
|
-
}>;
|
|
103
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
104
|
-
type: z.ZodEnum<{
|
|
105
|
-
image: "image";
|
|
106
|
-
audio: "audio";
|
|
107
|
-
video: "video";
|
|
108
|
-
embed: "embed";
|
|
109
|
-
}>;
|
|
110
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
111
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
112
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
113
|
-
}, z.core.$loose>>;
|
|
114
|
-
feedback: z.ZodOptional<z.ZodObject<{
|
|
115
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
116
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
117
|
-
}, z.core.$loose>>;
|
|
118
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
119
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
120
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
121
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 3 | 4 | 5>>;
|
|
122
|
-
}, z.core.$loose>;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* JSON Schema (Draft 7) representation of the Multiple Choice activity data
|
|
126
|
-
* contract, generated natively by Zod 4. Draft 7 is mandated by Requirement
|
|
127
|
-
* 2.2 for the widest AI-prompt / OpenAPI tooling compatibility. The semantic
|
|
128
|
-
* `.refine()` guards are not representable in JSON Schema and are
|
|
129
|
-
* intentionally omitted — the export captures the *structural* contract only.
|
|
130
|
-
* Since v0.3 the source schemas are loose, so these no longer emit
|
|
131
|
-
* `additionalProperties: false` — the JSON Schema and `validateActivity` now
|
|
132
|
-
* agree on unknown-key handling.
|
|
133
|
-
*/
|
|
134
|
-
declare const multipleChoiceJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
135
|
-
/**
|
|
136
|
-
* JSON Schema (Draft 7) representation of the Fill-in-the-Blanks activity data
|
|
137
|
-
* contract, generated natively by Zod 4. Structural contract only (semantic
|
|
138
|
-
* `.refine()` guards are Zod-only and not representable in JSON Schema).
|
|
139
|
-
*/
|
|
140
|
-
declare const fillInTheBlanksJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
141
|
-
/**
|
|
142
|
-
* JSON Schema (Draft 7) representation of the Written Response activity data
|
|
143
|
-
* contract. Structural contract only.
|
|
144
|
-
*/
|
|
145
|
-
declare const writtenResponseJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
146
|
-
/**
|
|
147
|
-
* Derives the JSON Schema (Draft 7) for any REGISTERED activity type — the
|
|
148
|
-
* live, registry-backed replacement for the static per-type exports above,
|
|
149
|
-
* and the building block for AI generation pipelines (R6.1): pass the result
|
|
150
|
-
* as a structured-output schema so a model can only emit valid items.
|
|
151
|
-
*
|
|
152
|
-
* @throws UnknownActivityTypeError when `type` has no registered descriptor.
|
|
153
|
-
*/
|
|
154
|
-
declare function jsonSchemaFor(type: string): Record<string, unknown>;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Optional media attached to an activity, rendered above the question or
|
|
158
|
-
* passage — e.g. a recording to listen to, or an embedded video to watch
|
|
159
|
-
* before answering. URL-only by design: hosting/delivery (S3/CDN, or the
|
|
160
|
-
* provider's own embed for `embed`) is the consuming app's responsibility
|
|
161
|
-
* (see requirements "Non-Goals and Shared Responsibility").
|
|
162
|
-
*
|
|
163
|
-
* - `image`: rendered as `<img>` — `alt` is REQUIRED (WCAG 1.1.1 / Req 14.5).
|
|
164
|
-
* - `audio` / `video`: rendered with native controls; `alt` is an optional
|
|
165
|
-
* accessible label; `captionsUrl` points at a WebVTT `<track>`. `url` must
|
|
166
|
-
* be a direct media file (NOT a YouTube/Vimeo page — use `embed` for those).
|
|
167
|
-
* - `embed`: rendered as a sandboxed `<iframe>` for provider players
|
|
168
|
-
* (YouTube/Vimeo/etc.). `url` MUST be the provider's *embeddable* URL
|
|
169
|
-
* (e.g. `https://www.youtube.com/embed/<id>`). `alt` is REQUIRED and used
|
|
170
|
-
* as the iframe's accessible `title` (WCAG 4.1.2 / 2.4.1).
|
|
171
|
-
*/
|
|
172
|
-
/**
|
|
173
|
-
* Media URL policy (security-reviewed): absolute URLs must use `https:`,
|
|
174
|
-
* `http:`, `data:`, or `blob:`; root-relative paths (`/media/x.mp3`) are
|
|
175
|
-
* allowed for same-origin hosting. Everything else — notably `javascript:`,
|
|
176
|
-
* `file:`, `ftp:` — is rejected: these URLs land in `src` attributes
|
|
177
|
-
* (including an iframe for `embed`), so an unvetted scheme is a stored-XSS
|
|
178
|
-
* vector in every consuming app.
|
|
179
|
-
*/
|
|
180
|
-
declare const MediaUrlSchema: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
181
|
-
declare const MediaSchema: z.ZodObject<{
|
|
182
|
-
type: z.ZodEnum<{
|
|
183
|
-
image: "image";
|
|
184
|
-
audio: "audio";
|
|
185
|
-
video: "video";
|
|
186
|
-
embed: "embed";
|
|
187
|
-
}>;
|
|
188
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
189
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
190
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
191
|
-
}, z.core.$loose>;
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Zod schema for a single Multiple Choice option. Loose: unknown keys are
|
|
195
|
-
* preserved through validation (forward-compat / consumer sidecars — B7).
|
|
196
|
-
*/
|
|
197
|
-
declare const MultipleChoiceOptionSchema: z.ZodObject<{
|
|
198
|
-
id: z.ZodString;
|
|
199
|
-
text: z.ZodString;
|
|
200
|
-
isCorrect: z.ZodBoolean;
|
|
201
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
202
|
-
}, z.core.$loose>;
|
|
203
|
-
/**
|
|
204
|
-
* Zod schema validating the full Multiple Choice activity data contract.
|
|
205
|
-
* Loose at every level: unknown keys are preserved, never stripped, so a
|
|
206
|
-
* v0.3 runtime reading a future payload (or a consumer sidecar field) does
|
|
207
|
-
* not silently delete data.
|
|
208
|
-
*
|
|
209
|
-
* Semantic guards: (1) at least one option must be correct, otherwise the
|
|
210
|
-
* activity can never be answered correctly; (2) `mode: 'single'` must have
|
|
211
|
-
* exactly one correct option — multiple correct options under single-select
|
|
212
|
-
* make `showCorrectAnswers` and the xAPI correct-response ambiguous and mask
|
|
213
|
-
* authoring errors; (3) option ids must be unique — the scorer looks options
|
|
214
|
-
* up by id, so a duplicate id makes one option unscoreable. All are
|
|
215
|
-
* unrepresentable in JSON Schema and are dropped from `toJSONSchema` output
|
|
216
|
-
* by design.
|
|
217
|
-
*/
|
|
218
|
-
declare const MultipleChoiceDataSchema: z.ZodObject<{
|
|
219
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
220
|
-
type: z.ZodLiteral<"multiple-choice">;
|
|
221
|
-
id: z.ZodString;
|
|
222
|
-
title: z.ZodString;
|
|
223
|
-
question: z.ZodString;
|
|
224
|
-
questionHtml: z.ZodOptional<z.ZodString>;
|
|
225
|
-
mode: z.ZodEnum<{
|
|
226
|
-
single: "single";
|
|
227
|
-
multi: "multi";
|
|
228
|
-
}>;
|
|
229
|
-
options: z.ZodArray<z.ZodObject<{
|
|
230
|
-
id: z.ZodString;
|
|
231
|
-
text: z.ZodString;
|
|
232
|
-
isCorrect: z.ZodBoolean;
|
|
233
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
234
|
-
}, z.core.$loose>>;
|
|
235
|
-
scoringStrategy: z.ZodEnum<{
|
|
236
|
-
"all-or-nothing": "all-or-nothing";
|
|
237
|
-
partial: "partial";
|
|
238
|
-
}>;
|
|
239
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
240
|
-
type: z.ZodEnum<{
|
|
241
|
-
image: "image";
|
|
242
|
-
audio: "audio";
|
|
243
|
-
video: "video";
|
|
244
|
-
embed: "embed";
|
|
245
|
-
}>;
|
|
246
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
247
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
248
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
249
|
-
}, z.core.$loose>>;
|
|
250
|
-
feedback: z.ZodOptional<z.ZodObject<{
|
|
251
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
252
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
253
|
-
}, z.core.$loose>>;
|
|
254
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
255
|
-
shuffle: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
257
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
258
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 3 | 4 | 5>>;
|
|
259
|
-
}, z.core.$loose>;
|
|
260
|
-
|
|
261
|
-
/** A redacted Multiple Choice option: id and display text only — no `isCorrect`, no feedback. */
|
|
262
|
-
declare const RedactedMultipleChoiceOptionSchema: z.ZodObject<{
|
|
263
|
-
id: z.ZodString;
|
|
264
|
-
text: z.ZodString;
|
|
265
|
-
}, z.core.$strict>;
|
|
266
|
-
/**
|
|
267
|
-
* Redacted Multiple Choice data: renderable (question, mode, options to pick
|
|
268
|
-
* from) with the answer key, per-option feedback, overall feedback, and the
|
|
269
|
-
* scoring strategy removed. `scoringStrategy` is answer-key by design: MC
|
|
270
|
-
* `partial` carries a wrong-selection penalty `all-or-nothing` does not, so
|
|
271
|
-
* knowing the strategy tells a learner whether guessing is free.
|
|
272
|
-
*/
|
|
273
|
-
declare const RedactedMultipleChoiceDataSchema: z.ZodObject<{
|
|
274
|
-
type: z.ZodLiteral<"multiple-choice">;
|
|
275
|
-
question: z.ZodString;
|
|
276
|
-
questionHtml: z.ZodOptional<z.ZodString>;
|
|
277
|
-
mode: z.ZodEnum<{
|
|
278
|
-
single: "single";
|
|
279
|
-
multi: "multi";
|
|
280
|
-
}>;
|
|
281
|
-
options: z.ZodArray<z.ZodObject<{
|
|
282
|
-
id: z.ZodString;
|
|
283
|
-
text: z.ZodString;
|
|
284
|
-
}, z.core.$strict>>;
|
|
285
|
-
shuffle: z.ZodOptional<z.ZodBoolean>;
|
|
286
|
-
/** Marker distinguishing a redacted projection from full activity data. */
|
|
287
|
-
redacted: z.ZodLiteral<true>;
|
|
288
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
289
|
-
id: z.ZodString;
|
|
290
|
-
title: z.ZodString;
|
|
291
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
292
|
-
type: z.ZodEnum<{
|
|
293
|
-
image: "image";
|
|
294
|
-
audio: "audio";
|
|
295
|
-
video: "video";
|
|
296
|
-
embed: "embed";
|
|
297
|
-
}>;
|
|
298
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
299
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
300
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
301
|
-
}, z.core.$loose>>;
|
|
302
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
303
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
304
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
305
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 3 | 4 | 5>>;
|
|
306
|
-
}, z.core.$strict>;
|
|
307
|
-
/** A redacted blank: id and hint only — no accepted answers, no matching rules, no feedback. */
|
|
308
|
-
declare const RedactedBlankConfigSchema: z.ZodObject<{
|
|
309
|
-
id: z.ZodString;
|
|
310
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
311
|
-
}, z.core.$strict>;
|
|
312
|
-
/** Redacted Fill-in-the-Blanks data: passage and blank slots, key removed. */
|
|
313
|
-
declare const RedactedFillInTheBlanksDataSchema: z.ZodObject<{
|
|
314
|
-
type: z.ZodLiteral<"fill-in-the-blanks">;
|
|
315
|
-
passage: z.ZodString;
|
|
316
|
-
passageHtml: z.ZodOptional<z.ZodString>;
|
|
317
|
-
blanks: z.ZodArray<z.ZodObject<{
|
|
318
|
-
id: z.ZodString;
|
|
319
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
320
|
-
}, z.core.$strict>>;
|
|
321
|
-
/** Marker distinguishing a redacted projection from full activity data. */
|
|
322
|
-
redacted: z.ZodLiteral<true>;
|
|
323
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
324
|
-
id: z.ZodString;
|
|
325
|
-
title: z.ZodString;
|
|
326
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
327
|
-
type: z.ZodEnum<{
|
|
328
|
-
image: "image";
|
|
329
|
-
audio: "audio";
|
|
330
|
-
video: "video";
|
|
331
|
-
embed: "embed";
|
|
332
|
-
}>;
|
|
333
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
334
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
335
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
336
|
-
}, z.core.$loose>>;
|
|
337
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
338
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
339
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
340
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 3 | 4 | 5>>;
|
|
341
|
-
}, z.core.$strict>;
|
|
342
|
-
/**
|
|
343
|
-
* Redacted Written Response data: the prompt, word bounds and rubric are
|
|
344
|
-
* learner-visible (a rubric tells the learner what they are graded on);
|
|
345
|
-
* authored pass/fail feedback is removed until the grade exists.
|
|
346
|
-
*/
|
|
347
|
-
declare const RedactedWrittenResponseDataSchema: z.ZodObject<{
|
|
348
|
-
type: z.ZodLiteral<"written-response">;
|
|
349
|
-
prompt: z.ZodString;
|
|
350
|
-
promptHtml: z.ZodOptional<z.ZodString>;
|
|
351
|
-
minWords: z.ZodNumber;
|
|
352
|
-
maxWords: z.ZodNumber;
|
|
353
|
-
rubric: z.ZodOptional<z.ZodObject<{
|
|
354
|
-
label: z.ZodOptional<z.ZodString>;
|
|
355
|
-
criteria: z.ZodArray<z.ZodObject<{
|
|
356
|
-
name: z.ZodString;
|
|
357
|
-
description: z.ZodOptional<z.ZodString>;
|
|
358
|
-
weight: z.ZodNumber;
|
|
359
|
-
}, z.core.$loose>>;
|
|
360
|
-
}, z.core.$loose>>;
|
|
361
|
-
languageTarget: z.ZodOptional<z.ZodString>;
|
|
362
|
-
/** Marker distinguishing a redacted projection from full activity data. */
|
|
363
|
-
redacted: z.ZodLiteral<true>;
|
|
364
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
365
|
-
id: z.ZodString;
|
|
366
|
-
title: z.ZodString;
|
|
367
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
368
|
-
type: z.ZodEnum<{
|
|
369
|
-
image: "image";
|
|
370
|
-
audio: "audio";
|
|
371
|
-
video: "video";
|
|
372
|
-
embed: "embed";
|
|
373
|
-
}>;
|
|
374
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
375
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
376
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
377
|
-
}, z.core.$loose>>;
|
|
378
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
379
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
380
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
381
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 3 | 4 | 5>>;
|
|
382
|
-
}, z.core.$strict>;
|
|
383
|
-
|
|
384
|
-
/** Zod schema for a single rubric criterion. Loose: unknown keys preserved. */
|
|
385
|
-
declare const WrittenResponseRubricCriterionSchema: z.ZodObject<{
|
|
386
|
-
name: z.ZodString;
|
|
387
|
-
description: z.ZodOptional<z.ZodString>;
|
|
388
|
-
weight: z.ZodNumber;
|
|
389
|
-
}, z.core.$loose>;
|
|
390
|
-
/** Zod schema for a written-response grading rubric. Loose: unknown keys preserved. */
|
|
391
|
-
declare const WrittenResponseRubricSchema: z.ZodObject<{
|
|
392
|
-
label: z.ZodOptional<z.ZodString>;
|
|
393
|
-
criteria: z.ZodArray<z.ZodObject<{
|
|
394
|
-
name: z.ZodString;
|
|
395
|
-
description: z.ZodOptional<z.ZodString>;
|
|
396
|
-
weight: z.ZodNumber;
|
|
397
|
-
}, z.core.$loose>>;
|
|
398
|
-
}, z.core.$loose>;
|
|
399
|
-
/**
|
|
400
|
-
* Zod schema validating the Written Response activity data contract (Req 22).
|
|
401
|
-
*
|
|
402
|
-
* Wire-format constraints (Req 22.9): field names are locked for
|
|
403
|
-
* byte-compatibility with consumer-stored rows, and the schema is loose at
|
|
404
|
-
* EVERY level (Req 22.5) — unknown top-level keys, `promptHtml`, `rubric`
|
|
405
|
-
* sidecars and any future fields survive `validateActivity` verbatim.
|
|
406
|
-
*/
|
|
407
|
-
declare const WrittenResponseDataSchema: z.ZodObject<{
|
|
408
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
409
|
-
type: z.ZodLiteral<"written-response">;
|
|
410
|
-
id: z.ZodString;
|
|
411
|
-
title: z.ZodString;
|
|
412
|
-
prompt: z.ZodString;
|
|
413
|
-
promptHtml: z.ZodOptional<z.ZodString>;
|
|
414
|
-
minWords: z.ZodNumber;
|
|
415
|
-
maxWords: z.ZodNumber;
|
|
416
|
-
rubric: z.ZodOptional<z.ZodObject<{
|
|
417
|
-
label: z.ZodOptional<z.ZodString>;
|
|
418
|
-
criteria: z.ZodArray<z.ZodObject<{
|
|
419
|
-
name: z.ZodString;
|
|
420
|
-
description: z.ZodOptional<z.ZodString>;
|
|
421
|
-
weight: z.ZodNumber;
|
|
422
|
-
}, z.core.$loose>>;
|
|
423
|
-
}, z.core.$loose>>;
|
|
424
|
-
languageTarget: z.ZodOptional<z.ZodString>;
|
|
425
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
426
|
-
type: z.ZodEnum<{
|
|
427
|
-
image: "image";
|
|
428
|
-
audio: "audio";
|
|
429
|
-
video: "video";
|
|
430
|
-
embed: "embed";
|
|
431
|
-
}>;
|
|
432
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
433
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
434
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
435
|
-
}, z.core.$loose>>;
|
|
436
|
-
feedback: z.ZodOptional<z.ZodObject<{
|
|
437
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
438
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
439
|
-
}, z.core.$loose>>;
|
|
440
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
441
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
442
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
443
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 3 | 4 | 5>>;
|
|
444
|
-
}, z.core.$loose>;
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* Validates raw activity data against the schema registered for the given
|
|
448
|
-
* activity type (built-in or consumer-registered via `registerActivityType`).
|
|
449
|
-
*
|
|
450
|
-
* Unknown keys are PRESERVED, not stripped: every built-in schema is loose,
|
|
451
|
-
* so consumer sidecar fields and forward-version fields survive validation
|
|
452
|
-
* verbatim in the returned `data`.
|
|
453
|
-
*
|
|
454
|
-
* @returns `{ success: true, data }` with the typed, validated data, or
|
|
455
|
-
* `{ success: false, errors }` with one entry per failed constraint.
|
|
456
|
-
* @throws UnknownActivityTypeError when `type` has no registered descriptor.
|
|
457
|
-
*/
|
|
458
|
-
declare function validateActivity<T extends ActivityType>(type: T, data: unknown): ValidationResult<ActivityDataMap[T]>;
|
|
459
|
-
|
|
460
|
-
export { BlankConfigSchema, FeedbackSchema, FillInTheBlanksDataSchema, MediaSchema, MediaUrlSchema, MultipleChoiceDataSchema, MultipleChoiceOptionSchema, RedactedBlankConfigSchema, RedactedFillInTheBlanksDataSchema, RedactedMultipleChoiceDataSchema, RedactedMultipleChoiceOptionSchema, RedactedWrittenResponseDataSchema, TextMatchPolicySchema, WrittenResponseDataSchema, WrittenResponseRubricCriterionSchema, WrittenResponseRubricSchema, fillInTheBlanksJsonSchema, jsonSchemaFor, multipleChoiceJsonSchema, validateActivity, writtenResponseJsonSchema };
|
|
1
|
+
import './activity-wkzRemHx.js';
|
|
2
|
+
export { B as BlankConfigSchema, F as FeedbackSchema, a as FillInTheBlanksDataSchema, b as ItemGroupSchema, M as MediaSchema, c as MediaUrlSchema, d as MultipleChoiceDataSchema, e as MultipleChoiceOptionSchema, R as RedactedBlankConfigSchema, f as RedactedFillInTheBlanksDataSchema, g as RedactedItemGroupSchema, h as RedactedMultipleChoiceDataSchema, i as RedactedMultipleChoiceOptionSchema, j as RedactedStimulusSchema, k as RedactedWrittenResponseDataSchema, p as StimulusSchema, T as TextMatchPolicySchema, W as WrittenResponseDataSchema, q as WrittenResponseRubricCriterionSchema, r as WrittenResponseRubricSchema, s as fillInTheBlanksJsonSchema, t as itemGroupJsonSchema, u as jsonSchemaFor, v as multipleChoiceJsonSchema, w as stimulusJsonSchema, x as validateActivity, y as validateItemGroup, z as writtenResponseJsonSchema } from './index-CLmXzBhB.js';
|
|
3
|
+
import 'zod/v4';
|
package/dist/schemas.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ItemGroupSchema,
|
|
3
|
+
RedactedItemGroupSchema,
|
|
4
|
+
RedactedStimulusSchema,
|
|
5
|
+
StimulusSchema,
|
|
2
6
|
fillInTheBlanksJsonSchema,
|
|
7
|
+
itemGroupJsonSchema,
|
|
3
8
|
jsonSchemaFor,
|
|
4
9
|
multipleChoiceJsonSchema,
|
|
10
|
+
stimulusJsonSchema,
|
|
5
11
|
validateActivity,
|
|
12
|
+
validateItemGroup,
|
|
6
13
|
writtenResponseJsonSchema
|
|
7
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LSHDNA2T.js";
|
|
8
15
|
import {
|
|
9
16
|
BlankConfigSchema,
|
|
10
17
|
FeedbackSchema,
|
|
@@ -22,29 +29,35 @@ import {
|
|
|
22
29
|
WrittenResponseDataSchema,
|
|
23
30
|
WrittenResponseRubricCriterionSchema,
|
|
24
31
|
WrittenResponseRubricSchema
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-3YAVDV5F.js";
|
|
32
|
+
} from "./chunk-NUCEUU4P.js";
|
|
27
33
|
export {
|
|
28
34
|
BlankConfigSchema,
|
|
29
35
|
FeedbackSchema,
|
|
30
36
|
FillInTheBlanksDataSchema,
|
|
37
|
+
ItemGroupSchema,
|
|
31
38
|
MediaSchema,
|
|
32
39
|
MediaUrlSchema,
|
|
33
40
|
MultipleChoiceDataSchema,
|
|
34
41
|
MultipleChoiceOptionSchema,
|
|
35
42
|
RedactedBlankConfigSchema,
|
|
36
43
|
RedactedFillInTheBlanksDataSchema,
|
|
44
|
+
RedactedItemGroupSchema,
|
|
37
45
|
RedactedMultipleChoiceDataSchema,
|
|
38
46
|
RedactedMultipleChoiceOptionSchema,
|
|
47
|
+
RedactedStimulusSchema,
|
|
39
48
|
RedactedWrittenResponseDataSchema,
|
|
49
|
+
StimulusSchema,
|
|
40
50
|
TextMatchPolicySchema,
|
|
41
51
|
WrittenResponseDataSchema,
|
|
42
52
|
WrittenResponseRubricCriterionSchema,
|
|
43
53
|
WrittenResponseRubricSchema,
|
|
44
54
|
fillInTheBlanksJsonSchema,
|
|
55
|
+
itemGroupJsonSchema,
|
|
45
56
|
jsonSchemaFor,
|
|
46
57
|
multipleChoiceJsonSchema,
|
|
58
|
+
stimulusJsonSchema,
|
|
47
59
|
validateActivity,
|
|
60
|
+
validateItemGroup,
|
|
48
61
|
writtenResponseJsonSchema
|
|
49
62
|
};
|
|
50
63
|
//# sourceMappingURL=schemas.js.map
|
package/dist/scoring.cjs
CHANGED
|
@@ -7,12 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkSM5HUGYUcjs = require('./chunk-SM5HUGYU.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
require('./chunk-PIMX4B4D.cjs');
|
|
14
|
+
var _chunk4JR3UXX6cjs = require('./chunk-4JR3UXX6.cjs');
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
|
|
@@ -24,5 +23,5 @@ require('./chunk-PIMX4B4D.cjs');
|
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
|
|
27
|
-
exports.DEFAULT_PASS_THRESHOLD =
|
|
26
|
+
exports.DEFAULT_PASS_THRESHOLD = _chunkSM5HUGYUcjs.DEFAULT_PASS_THRESHOLD; exports.classifyBand = _chunkSM5HUGYUcjs.classifyBand; exports.composeAssessmentScore = _chunkSM5HUGYUcjs.composeAssessmentScore; exports.computePassThreshold = _chunkSM5HUGYUcjs.computePassThreshold; exports.evaluate = _chunkSM5HUGYUcjs.evaluate; exports.gte = _chunkSM5HUGYUcjs.gte; exports.levenshteinDistance = _chunk4JR3UXX6cjs.levenshteinDistance; exports.matchText = _chunk4JR3UXX6cjs.matchText; exports.roundGrade = _chunkSM5HUGYUcjs.roundGrade; exports.score = _chunkSM5HUGYUcjs.score;
|
|
28
27
|
//# sourceMappingURL=scoring.cjs.map
|
package/dist/scoring.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/learning-kit/learning-kit/packages/lk-core/dist/scoring.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/learning-kit/learning-kit/packages/lk-core/dist/scoring.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yjBAAC","file":"/home/runner/work/learning-kit/learning-kit/packages/lk-core/dist/scoring.cjs"}
|
package/dist/scoring.d.cts
CHANGED
|
@@ -193,8 +193,16 @@ declare const DEFAULT_PASS_THRESHOLD = 0.7;
|
|
|
193
193
|
/**
|
|
194
194
|
* Returns `true` iff `score` meets or exceeds the activity's `passThreshold`,
|
|
195
195
|
* defaulting to {@link DEFAULT_PASS_THRESHOLD} (0.7) when the field is absent.
|
|
196
|
+
*
|
|
197
|
+
* Pass a {@link RoundingPolicy} to compare the way an assessment total is
|
|
198
|
+
* compared — both sides rounded, via {@link gte} — so an item shown as "70%"
|
|
199
|
+
* cannot be recorded as a fail at 69.6. It is **opt-in** rather than the
|
|
200
|
+
* default because switching it on changes item-level pass/fail for scores in
|
|
201
|
+
* the rounding band, and this SDK does not alter historical grades without an
|
|
202
|
+
* explicit decision. Absent, the comparison is the exact raw `>=` it has
|
|
203
|
+
* always been.
|
|
196
204
|
*/
|
|
197
|
-
declare function computePassThreshold(activityData: ActivityData, score: number): boolean;
|
|
205
|
+
declare function computePassThreshold(activityData: ActivityData, score: number, rounding?: RoundingPolicy): boolean;
|
|
198
206
|
/**
|
|
199
207
|
* Scores a learner response against activity data and returns a full
|
|
200
208
|
* {@link ScoringResult}.
|
package/dist/scoring.d.ts
CHANGED
|
@@ -193,8 +193,16 @@ declare const DEFAULT_PASS_THRESHOLD = 0.7;
|
|
|
193
193
|
/**
|
|
194
194
|
* Returns `true` iff `score` meets or exceeds the activity's `passThreshold`,
|
|
195
195
|
* defaulting to {@link DEFAULT_PASS_THRESHOLD} (0.7) when the field is absent.
|
|
196
|
+
*
|
|
197
|
+
* Pass a {@link RoundingPolicy} to compare the way an assessment total is
|
|
198
|
+
* compared — both sides rounded, via {@link gte} — so an item shown as "70%"
|
|
199
|
+
* cannot be recorded as a fail at 69.6. It is **opt-in** rather than the
|
|
200
|
+
* default because switching it on changes item-level pass/fail for scores in
|
|
201
|
+
* the rounding band, and this SDK does not alter historical grades without an
|
|
202
|
+
* explicit decision. Absent, the comparison is the exact raw `>=` it has
|
|
203
|
+
* always been.
|
|
196
204
|
*/
|
|
197
|
-
declare function computePassThreshold(activityData: ActivityData, score: number): boolean;
|
|
205
|
+
declare function computePassThreshold(activityData: ActivityData, score: number, rounding?: RoundingPolicy): boolean;
|
|
198
206
|
/**
|
|
199
207
|
* Scores a learner response against activity data and returns a full
|
|
200
208
|
* {@link ScoringResult}.
|
package/dist/scoring.js
CHANGED
|
@@ -7,12 +7,11 @@ import {
|
|
|
7
7
|
gte,
|
|
8
8
|
roundGrade,
|
|
9
9
|
score
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DUQVGLQ3.js";
|
|
11
11
|
import {
|
|
12
12
|
levenshteinDistance,
|
|
13
13
|
matchText
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-3YAVDV5F.js";
|
|
14
|
+
} from "./chunk-NUCEUU4P.js";
|
|
16
15
|
export {
|
|
17
16
|
DEFAULT_PASS_THRESHOLD,
|
|
18
17
|
classifyBand,
|
package/dist/xapi.cjs
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _chunkRUZ52Q7Acjs = require('./chunk-RUZ52Q7A.cjs');
|
|
7
|
-
require('./chunk-PIMX4B4D.cjs');
|
|
8
6
|
|
|
7
|
+
var _chunkR7PDJBRXcjs = require('./chunk-R7PDJBRX.cjs');
|
|
8
|
+
require('./chunk-4JR3UXX6.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.XAPIVerb = _chunkR7PDJBRXcjs.XAPIVerb; exports.XAPI_VERB_DISPLAY = _chunkR7PDJBRXcjs.XAPI_VERB_DISPLAY; exports.validateXAPIStatement = _chunkR7PDJBRXcjs.validateXAPIStatement; exports.xAPIBuilder = _chunkR7PDJBRXcjs.xAPIBuilder; exports.xapiDefinitionFor = _chunkR7PDJBRXcjs.xapiDefinitionFor;
|
|
14
16
|
//# sourceMappingURL=xapi.cjs.map
|
package/dist/xapi.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/learning-kit/learning-kit/packages/lk-core/dist/xapi.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/learning-kit/learning-kit/packages/lk-core/dist/xapi.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACF,8SAAC","file":"/home/runner/work/learning-kit/learning-kit/packages/lk-core/dist/xapi.cjs"}
|
package/dist/xapi.d.cts
CHANGED
|
@@ -114,6 +114,23 @@ declare const xAPIBuilder: {
|
|
|
114
114
|
buildSubmittedStatement(params: SubmittedStatementParams): XAPIStatement;
|
|
115
115
|
buildCompletedStatement(params: CompletedStatementParams): XAPIStatement;
|
|
116
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* Builds the xAPI `object.definition` interop fields for an activity from its
|
|
119
|
+
* REGISTERED descriptor, rather than having every renderer hand-roll them.
|
|
120
|
+
*
|
|
121
|
+
* `ActivityTypeDescriptor.interop` declares the activity-type IRI, the
|
|
122
|
+
* cmi.interaction type and how to derive `correctResponsesPattern`; before
|
|
123
|
+
* this, those fields had no reader anywhere and each component rebuilt the
|
|
124
|
+
* same strings inline — the same "declared but never used" defect the SDK
|
|
125
|
+
* fixed elsewhere. Reading them here also means a consumer-registered type
|
|
126
|
+
* gets correct interop for free.
|
|
127
|
+
*
|
|
128
|
+
* Returns an empty object for an unregistered type or one that declares no
|
|
129
|
+
* interop, so it is always safe to spread.
|
|
130
|
+
*/
|
|
131
|
+
declare function xapiDefinitionFor(data: {
|
|
132
|
+
type: string;
|
|
133
|
+
}): Partial<XAPIObjectParams>;
|
|
117
134
|
|
|
118
135
|
/**
|
|
119
136
|
* Validates a constructed {@link XAPIStatement} against the xAPI 1.0.3
|
|
@@ -130,4 +147,4 @@ declare const xAPIBuilder: {
|
|
|
130
147
|
*/
|
|
131
148
|
declare function validateXAPIStatement(statement: XAPIStatement): void;
|
|
132
149
|
|
|
133
|
-
export { type AnsweredStatementParams, type CompletedStatementParams, type SubmittedStatementParams, type XAPIObjectParams, type XAPIStatementParams, XAPIVerb, type XAPIVerbKey, XAPI_VERB_DISPLAY, validateXAPIStatement, xAPIBuilder };
|
|
150
|
+
export { type AnsweredStatementParams, type CompletedStatementParams, type SubmittedStatementParams, type XAPIObjectParams, type XAPIStatementParams, XAPIVerb, type XAPIVerbKey, XAPI_VERB_DISPLAY, validateXAPIStatement, xAPIBuilder, xapiDefinitionFor };
|