@intellectif/lk-core 0.22.0 → 1.0.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/CHANGELOG.md +15 -0
- package/README.md +5 -5
- package/dist/{activity-CYc7SD3d.d.cts → activity-DgpBJeBc.d.cts} +11 -15
- package/dist/{activity-CYc7SD3d.d.ts → activity-DgpBJeBc.d.ts} +11 -15
- package/dist/ai-check.cjs +8 -8
- package/dist/ai-check.d.cts +1 -1
- package/dist/ai-check.d.ts +1 -1
- package/dist/ai-check.js +3 -3
- package/dist/{chunk-2CV6NU32.cjs → chunk-2JT2WUQ2.cjs} +77 -39
- package/dist/chunk-2JT2WUQ2.cjs.map +1 -0
- package/dist/{chunk-D4TOPSHV.cjs → chunk-DSDXL3JO.cjs} +1216 -1105
- package/dist/chunk-DSDXL3JO.cjs.map +1 -0
- package/dist/{chunk-D3GP5MET.js → chunk-FBKTION6.js} +1093 -982
- package/dist/chunk-FBKTION6.js.map +1 -0
- package/dist/{chunk-Q7MV3IXJ.js → chunk-IARLJ5MW.js} +15 -16
- package/dist/chunk-IARLJ5MW.js.map +1 -0
- package/dist/{chunk-5UCR4UNR.js → chunk-RCZCP5OE.js} +12 -7
- package/dist/chunk-RCZCP5OE.js.map +1 -0
- package/dist/{chunk-X5DAXBJI.js → chunk-SJVRUPJT.js} +2 -2
- package/dist/{chunk-EOFWSGLU.cjs → chunk-TJJFKKH2.cjs} +4 -4
- package/dist/{chunk-EOFWSGLU.cjs.map → chunk-TJJFKKH2.cjs.map} +1 -1
- package/dist/{chunk-WQVZPIN7.cjs → chunk-VSH7ECQL.cjs} +44 -45
- package/dist/chunk-VSH7ECQL.cjs.map +1 -0
- package/dist/{chunk-OPMY2MNS.cjs → chunk-W5KB3DNT.cjs} +19 -14
- package/dist/chunk-W5KB3DNT.cjs.map +1 -0
- package/dist/{chunk-Z7QQZ53L.js → chunk-XS6U2ARZ.js} +70 -32
- package/dist/chunk-XS6U2ARZ.js.map +1 -0
- package/dist/index-BVNeSCWC.d.ts +548 -0
- package/dist/index-BlOLlwOi.d.cts +548 -0
- package/dist/index.cjs +129 -206
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +115 -15
- package/dist/index.d.ts +115 -15
- package/dist/index.js +26 -103
- package/dist/index.js.map +1 -1
- package/dist/schemas.cjs +3 -94
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +2 -3
- package/dist/schemas.d.ts +2 -3
- package/dist/schemas.js +6 -97
- package/dist/scoring.cjs +3 -3
- package/dist/scoring.d.cts +2 -2
- package/dist/scoring.d.ts +2 -2
- package/dist/scoring.js +2 -2
- package/dist/xapi.cjs +3 -3
- package/dist/xapi.d.cts +1 -1
- package/dist/xapi.d.ts +1 -1
- package/dist/xapi.js +2 -2
- package/package.json +4 -4
- package/vectors/README.md +32 -2
- package/vectors/scoring.json +1 -498
- package/vectors/validation.json +6742 -0
- package/vectors/validation.mjs +195 -0
- package/dist/chunk-2CV6NU32.cjs.map +0 -1
- package/dist/chunk-5UCR4UNR.js.map +0 -1
- package/dist/chunk-D3GP5MET.js.map +0 -1
- package/dist/chunk-D4TOPSHV.cjs.map +0 -1
- package/dist/chunk-OPMY2MNS.cjs.map +0 -1
- package/dist/chunk-Q7MV3IXJ.js.map +0 -1
- package/dist/chunk-WQVZPIN7.cjs.map +0 -1
- package/dist/chunk-Z7QQZ53L.js.map +0 -1
- package/dist/index-0Z3-nnAP.d.ts +0 -2303
- package/dist/index-CxxiNSSH.d.cts +0 -2303
- /package/dist/{chunk-X5DAXBJI.js.map → chunk-SJVRUPJT.js.map} +0 -0
package/dist/index-0Z3-nnAP.d.ts
DELETED
|
@@ -1,2303 +0,0 @@
|
|
|
1
|
-
import { a as ActivityData, d as ActivityMedia, aq as ValidationResult, f as ActivityType, b as ActivityDataMap } from './activity-CYc7SD3d.js';
|
|
2
|
-
import { z } from 'zod/v4';
|
|
3
|
-
|
|
4
|
-
/** What a stimulus primarily is. Drives validation and layout, never scoring. */
|
|
5
|
-
type StimulusKind = 'text' | 'audio' | 'video' | 'image' | 'mixed';
|
|
6
|
-
/**
|
|
7
|
-
* Shared material that several items refer to: a reading passage, a
|
|
8
|
-
* recording, a chart. Modelled as CONTENT — it lives inside the item group
|
|
9
|
-
* that carries it — so it works in a lesson quiz, a sequence and an exam
|
|
10
|
-
* section alike, and needs no blueprint to exist.
|
|
11
|
-
*
|
|
12
|
-
* Learner-visible by definition: the point of a stimulus is that the learner
|
|
13
|
-
* reads or hears it. The one exception is `transcript`, an author asset that
|
|
14
|
-
* `redactItemGroup` removes.
|
|
15
|
-
*/
|
|
16
|
-
interface Stimulus {
|
|
17
|
-
id: string;
|
|
18
|
-
kind: StimulusKind;
|
|
19
|
-
/** Optional heading (a passage title). */
|
|
20
|
-
title?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Plain-text body: the passage itself, or short instructions above media.
|
|
23
|
-
* Required for `text` and `mixed`.
|
|
24
|
-
*/
|
|
25
|
-
body?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Optional sanitised rich-HTML sidecar of `body`. Requires `body`, which is
|
|
28
|
-
* the accessible fallback rendered when no sanitiser is supplied.
|
|
29
|
-
*/
|
|
30
|
-
bodyHtml?: string;
|
|
31
|
-
/** The recording, video or image. Required for `audio`, `video`, `image` and `mixed`. */
|
|
32
|
-
media?: ActivityMedia;
|
|
33
|
-
/**
|
|
34
|
-
* Author-only transcript of `media` — for item generation and grading,
|
|
35
|
-
* never shown to the learner. Removed by `redactItemGroup`.
|
|
36
|
-
*/
|
|
37
|
-
transcript?: string;
|
|
38
|
-
/** BCP 47 language tag of the material, when it differs from the items'. */
|
|
39
|
-
locale?: string;
|
|
40
|
-
/** Source credit, shown to the learner after the material. */
|
|
41
|
-
attribution?: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* A quiz inside an interactive video: one moment of the video, and the
|
|
45
|
-
* questions shown there. The video pauses when playback reaches `at`, and the
|
|
46
|
-
* questions are shown one at a time, in `itemIds` order.
|
|
47
|
-
*/
|
|
48
|
-
interface TimelineCue {
|
|
49
|
-
/** Unique within the timeline. Names the quiz in events, the contents panel and drafts. */
|
|
50
|
-
id: string;
|
|
51
|
-
/**
|
|
52
|
-
* Seconds from the start of the video: finite and 0 or more. The SDK never
|
|
53
|
-
* reads the video, so it cannot check this against the duration: a quiz at
|
|
54
|
-
* or past the end opens when the video ends.
|
|
55
|
-
*/
|
|
56
|
-
at: number;
|
|
57
|
-
/**
|
|
58
|
-
* `id`s of items in this group, in the order the quiz shows them. Non-empty.
|
|
59
|
-
* Every item of the group belongs to exactly one quiz.
|
|
60
|
-
*/
|
|
61
|
-
itemIds: string[];
|
|
62
|
-
/** Optional heading shown above the questions. At most 120 characters. */
|
|
63
|
-
title?: string;
|
|
64
|
-
/**
|
|
65
|
-
* Every question must be answered (practice) or submitted (exam) before
|
|
66
|
-
* playback may pass `at`. Default false.
|
|
67
|
-
*/
|
|
68
|
-
required?: boolean;
|
|
69
|
-
}
|
|
70
|
-
/** A titled section of the video. */
|
|
71
|
-
interface TimelineChapter {
|
|
72
|
-
/** Seconds from the start: finite, 0 or more, strictly increasing across the list. */
|
|
73
|
-
at: number;
|
|
74
|
-
/** Non-empty after trimming; at most 120 characters. */
|
|
75
|
-
title: string;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* The arrangement that turns an item group with a video stimulus into an
|
|
79
|
-
* interactive video: when each quiz opens, the video's chapters, and how far
|
|
80
|
-
* ahead a learner may seek.
|
|
81
|
-
*
|
|
82
|
-
* It lives on the container rather than inside `stimulus` because it describes
|
|
83
|
-
* how THESE questions are arranged over the material, not the material itself.
|
|
84
|
-
*/
|
|
85
|
-
interface MediaTimeline {
|
|
86
|
-
cues: TimelineCue[];
|
|
87
|
-
chapters?: TimelineChapter[];
|
|
88
|
-
/**
|
|
89
|
-
* `free` (default): seek anywhere. `no-skip-ahead`: rewind freely, never past
|
|
90
|
-
* the furthest point reached. Either way, playback never passes a `required`
|
|
91
|
-
* quiz that is not finished.
|
|
92
|
-
*/
|
|
93
|
-
navigation?: 'free' | 'no-skip-ahead';
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Where a learner stands in an interactive video, stored by the host so the
|
|
97
|
-
* video can resume. Kept apart from `AttemptState`, which holds answers by slot
|
|
98
|
-
* and drops fields it does not know. Read it back through
|
|
99
|
-
* `readMediaProgress`, never directly.
|
|
100
|
-
*/
|
|
101
|
-
interface MediaProgress {
|
|
102
|
-
progressVersion: '1.0';
|
|
103
|
-
/** Seconds: where playback last stood. */
|
|
104
|
-
at: number;
|
|
105
|
-
/**
|
|
106
|
-
* Seconds: the furthest point reached. Decides how far `no-skip-ahead` lets
|
|
107
|
-
* the learner seek, and how much of the transcript it shows.
|
|
108
|
-
*/
|
|
109
|
-
furthest: number;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* One stimulus serving several items. Two rules, both taken from observed
|
|
113
|
-
* failures: a group is SHUFFLE-ATOMIC (shuffling a sequence moves the group
|
|
114
|
-
* as one block — interleaving two passages' questions is the defect), and its
|
|
115
|
-
* stimulus is presented persistently alongside every item, never behind a
|
|
116
|
-
* toggle the learner must reopen per question.
|
|
117
|
-
*
|
|
118
|
-
* Generic over the item type so one shape describes a group of full activity
|
|
119
|
-
* data (authoring, server) and a group of `redact()` projections (client)
|
|
120
|
-
* without a cast at every boundary.
|
|
121
|
-
*/
|
|
122
|
-
interface ItemGroup<TItem = ActivityData> {
|
|
123
|
-
schemaVersion: '1.0';
|
|
124
|
-
type: 'item-group';
|
|
125
|
-
id: string;
|
|
126
|
-
title?: string;
|
|
127
|
-
/**
|
|
128
|
-
* Stable identity for this entry's slots, independent of where it sits in
|
|
129
|
-
* the array. See {@link SequenceSlot.slotId}: without one, inserting a
|
|
130
|
-
* question above this group re-maps every slot id beneath it, and stored
|
|
131
|
-
* grades quietly start naming different questions.
|
|
132
|
-
*/
|
|
133
|
-
slotKey?: string;
|
|
134
|
-
stimulus: Stimulus;
|
|
135
|
-
/**
|
|
136
|
-
* The items, in authored order. Non-empty; ids unique within the group; no
|
|
137
|
-
* nested groups.
|
|
138
|
-
*
|
|
139
|
-
* An item may declare its own `slotKey`, for the same reason an entry can:
|
|
140
|
-
* it pins the item's identity within the group (`"reading.q1"` rather than
|
|
141
|
-
* `"reading.0"`), so inserting a question into a published group does not
|
|
142
|
-
* re-map the ones after it.
|
|
143
|
-
*/
|
|
144
|
-
items: (TItem & {
|
|
145
|
-
slotKey?: string;
|
|
146
|
-
})[];
|
|
147
|
-
/**
|
|
148
|
-
* `none` (default) keeps authored order; `within-group` shuffles the items
|
|
149
|
-
* among themselves under the sequence seed. Either way the group stays one
|
|
150
|
-
* contiguous block.
|
|
151
|
-
*/
|
|
152
|
-
shuffle?: 'none' | 'within-group';
|
|
153
|
-
/**
|
|
154
|
-
* Makes the group an interactive video: the stimulus must be a video, every
|
|
155
|
-
* item must be one of `INTERACTIVE_VIDEO_ITEM_TYPES`, and every item belongs
|
|
156
|
-
* to exactly one quiz. Items are then presented in quiz order, never
|
|
157
|
-
* shuffled. An older lk-core that does not know this field presents the same
|
|
158
|
-
* items as an ordinary video testlet, with the same slots and grades.
|
|
159
|
-
*/
|
|
160
|
-
timeline?: MediaTimeline;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* What a sequence is made of: loose activities and item groups, in authored
|
|
164
|
-
* order.
|
|
165
|
-
*
|
|
166
|
-
* A plain activity may carry `slotKey` here even though no activity SCHEMA
|
|
167
|
-
* declares one, because a slot key describes an item's PLACE in a paper, not
|
|
168
|
-
* its content — the same question keeps its own id in every paper it appears
|
|
169
|
-
* in. Putting it on the entry rather than on the activity is what lets it be
|
|
170
|
-
* authored without every activity type having to know about assessment
|
|
171
|
-
* assembly. See {@link SequenceSlot.slotId}.
|
|
172
|
-
*/
|
|
173
|
-
type SequenceEntry<TItem = ActivityData> = (TItem & {
|
|
174
|
-
slotKey?: string;
|
|
175
|
-
}) | ItemGroup<TItem>;
|
|
176
|
-
/** The group a presented slot belongs to. */
|
|
177
|
-
interface SequenceSlotGroup {
|
|
178
|
-
id: string;
|
|
179
|
-
title?: string;
|
|
180
|
-
stimulus: Stimulus;
|
|
181
|
-
/** 0-based position of this slot within the group's PRESENTED order. */
|
|
182
|
-
position: number;
|
|
183
|
-
/** Number of slots in the group. */
|
|
184
|
-
size: number;
|
|
185
|
-
/** The group's timeline, when the group is an interactive video. */
|
|
186
|
-
timeline?: MediaTimeline;
|
|
187
|
-
/** The quiz this slot's item sits in, when the group is an interactive video. */
|
|
188
|
-
cue?: TimelineCue;
|
|
189
|
-
}
|
|
190
|
-
/** One presented position in a flattened sequence. */
|
|
191
|
-
interface SequenceSlot<TItem = ActivityData> {
|
|
192
|
-
/**
|
|
193
|
-
* Identity of the slot within the sequence definition — unique, and stable
|
|
194
|
-
* under shuffling. Feed it to `composeAssessmentScore` as `slotId`.
|
|
195
|
-
*
|
|
196
|
-
* By default it is derived from the AUTHORED position (`"2"` for the third
|
|
197
|
-
* top-level entry; `"2.1"` for the second item of that entry when it is a
|
|
198
|
-
* group), so the same activity can appear in two entries and still be two
|
|
199
|
-
* slots.
|
|
200
|
-
*
|
|
201
|
-
* **A positional id is only valid against one version of the entries
|
|
202
|
-
* array.** Insert a question at the top of a published paper and every id
|
|
203
|
-
* below it shifts: rows stored as `"3"` now name what used to be entry 2,
|
|
204
|
-
* and a re-grade or a review render pairs each response with the wrong
|
|
205
|
-
* question — silently, because the ids still look valid. For any content
|
|
206
|
-
* whose slot ids you persist, give the entries an explicit `slotKey`; it is
|
|
207
|
-
* used verbatim here and survives insertion, deletion and re-ordering.
|
|
208
|
-
*/
|
|
209
|
-
slotId: string;
|
|
210
|
-
/** 0-based PRESENTED position, after shuffling. */
|
|
211
|
-
index: number;
|
|
212
|
-
activity: TItem;
|
|
213
|
-
/** Present when the slot comes from an item group. */
|
|
214
|
-
group?: SequenceSlotGroup;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* What an author allows AI to do for one item: see `ActivityAiPermissions`.
|
|
219
|
-
* Loose like every content schema, so a key a later release adds survives an
|
|
220
|
-
* older one's validation (B7).
|
|
221
|
-
*/
|
|
222
|
-
declare const AiPermissionsSchema: z.ZodObject<{
|
|
223
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
224
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
225
|
-
}, z.core.$loose>;
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Zod schema for the slower second recording of a dictation. Loose like every
|
|
229
|
-
* content schema (a sidecar survives), audio only, and — deliberately — with no
|
|
230
|
-
* `captionsUrl` and no `playback` of its own; the activity-level guards below
|
|
231
|
-
* refuse both if an author writes them anyway.
|
|
232
|
-
*/
|
|
233
|
-
declare const DictationSlowMediaSchema: z.ZodObject<{
|
|
234
|
-
type: z.ZodLiteral<"audio">;
|
|
235
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
236
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
237
|
-
}, z.core.$loose>;
|
|
238
|
-
/**
|
|
239
|
-
* Zod schema for one whole-word rewrite rule. Both halves are bounded: `to`
|
|
240
|
-
* because a rule expands text, `from` because it is compiled into the pattern
|
|
241
|
-
* every attempt is searched with.
|
|
242
|
-
*/
|
|
243
|
-
declare const DictationEquivalenceSchema: z.ZodObject<{
|
|
244
|
-
from: z.ZodString;
|
|
245
|
-
to: z.ZodString;
|
|
246
|
-
}, z.core.$loose>;
|
|
247
|
-
/** Zod schema for a dictation's grading tolerances. At most `DICTATION_MAX_EQUIVALENCES` rules. */
|
|
248
|
-
declare const DictationToleranceSchema: z.ZodObject<{
|
|
249
|
-
equivalences: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
250
|
-
from: z.ZodString;
|
|
251
|
-
to: z.ZodString;
|
|
252
|
-
}, z.core.$loose>>>;
|
|
253
|
-
}, z.core.$loose>;
|
|
254
|
-
declare const DictationDataSchema: z.ZodObject<{
|
|
255
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
256
|
-
type: z.ZodLiteral<"dictation">;
|
|
257
|
-
id: z.ZodString;
|
|
258
|
-
title: z.ZodString;
|
|
259
|
-
transcript: z.ZodString;
|
|
260
|
-
acceptedTranscripts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
261
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
262
|
-
type: z.ZodEnum<{
|
|
263
|
-
video: "video";
|
|
264
|
-
audio: "audio";
|
|
265
|
-
image: "image";
|
|
266
|
-
embed: "embed";
|
|
267
|
-
}>;
|
|
268
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
269
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
270
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
271
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
272
|
-
kind: z.ZodEnum<{
|
|
273
|
-
captions: "captions";
|
|
274
|
-
subtitles: "subtitles";
|
|
275
|
-
}>;
|
|
276
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
277
|
-
srclang: z.ZodString;
|
|
278
|
-
label: z.ZodString;
|
|
279
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
280
|
-
}, z.core.$strict>>>;
|
|
281
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
282
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
283
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
284
|
-
native: "native";
|
|
285
|
-
minimal: "minimal";
|
|
286
|
-
}>>;
|
|
287
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
288
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
289
|
-
allow: "allow";
|
|
290
|
-
none: "none";
|
|
291
|
-
}>>;
|
|
292
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
293
|
-
allow: "allow";
|
|
294
|
-
fixed: "fixed";
|
|
295
|
-
}>>;
|
|
296
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
297
|
-
"hide-download": "hide-download";
|
|
298
|
-
"hide-rate": "hide-rate";
|
|
299
|
-
}>>>;
|
|
300
|
-
}, z.core.$strict>>;
|
|
301
|
-
}, z.core.$loose>>;
|
|
302
|
-
slowMedia: z.ZodOptional<z.ZodObject<{
|
|
303
|
-
type: z.ZodLiteral<"audio">;
|
|
304
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
305
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
306
|
-
}, z.core.$loose>>;
|
|
307
|
-
hints: z.ZodOptional<z.ZodObject<{
|
|
308
|
-
mode: z.ZodLiteral<"progressive-words">;
|
|
309
|
-
}, z.core.$loose>>;
|
|
310
|
-
tolerance: z.ZodOptional<z.ZodObject<{
|
|
311
|
-
equivalences: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
312
|
-
from: z.ZodString;
|
|
313
|
-
to: z.ZodString;
|
|
314
|
-
}, z.core.$loose>>>;
|
|
315
|
-
}, z.core.$loose>>;
|
|
316
|
-
feedback: z.ZodOptional<z.ZodObject<{
|
|
317
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
318
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
319
|
-
}, z.core.$loose>>;
|
|
320
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
321
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
322
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
323
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
324
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
325
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
327
|
-
}, z.core.$loose>>;
|
|
328
|
-
}, z.core.$loose>;
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Optional authored "overall feedback" shown after submission, selected by
|
|
332
|
-
* whether the learner passed (h5p-style overall feedback). Both fields are
|
|
333
|
-
* optional; non-empty when present.
|
|
334
|
-
*/
|
|
335
|
-
declare const FeedbackSchema: z.ZodObject<{
|
|
336
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
337
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
338
|
-
}, z.core.$loose>;
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Zod schema for a `TextMatchPolicy` — the opt-in matching tolerances a blank
|
|
342
|
-
* may declare. Every default reproduces the v1 trim + case-fold semantics.
|
|
343
|
-
*/
|
|
344
|
-
declare const TextMatchPolicySchema: z.ZodObject<{
|
|
345
|
-
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
346
|
-
trim: z.ZodOptional<z.ZodBoolean>;
|
|
347
|
-
normalize: z.ZodOptional<z.ZodEnum<{
|
|
348
|
-
none: "none";
|
|
349
|
-
NFC: "NFC";
|
|
350
|
-
NFKC: "NFKC";
|
|
351
|
-
}>>;
|
|
352
|
-
foldDiacritics: z.ZodOptional<z.ZodBoolean>;
|
|
353
|
-
collapseInnerWhitespace: z.ZodOptional<z.ZodBoolean>;
|
|
354
|
-
ignorePunctuation: z.ZodOptional<z.ZodBoolean>;
|
|
355
|
-
levenshtein: z.ZodOptional<z.ZodNumber>;
|
|
356
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
357
|
-
}, z.core.$loose>;
|
|
358
|
-
/**
|
|
359
|
-
* Zod schema for a single fill-in-the-blank slot configuration. Loose:
|
|
360
|
-
* unknown keys are preserved through validation. Accepted answers must
|
|
361
|
-
* contain non-whitespace characters — a whitespace-only accepted answer
|
|
362
|
-
* normalizes to the empty string and would mark an empty response correct.
|
|
363
|
-
*/
|
|
364
|
-
declare const BlankConfigSchema: z.ZodObject<{
|
|
365
|
-
id: z.ZodString;
|
|
366
|
-
acceptedAnswers: z.ZodArray<z.ZodString>;
|
|
367
|
-
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
368
|
-
trimWhitespace: z.ZodOptional<z.ZodBoolean>;
|
|
369
|
-
match: z.ZodOptional<z.ZodObject<{
|
|
370
|
-
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
371
|
-
trim: z.ZodOptional<z.ZodBoolean>;
|
|
372
|
-
normalize: z.ZodOptional<z.ZodEnum<{
|
|
373
|
-
none: "none";
|
|
374
|
-
NFC: "NFC";
|
|
375
|
-
NFKC: "NFKC";
|
|
376
|
-
}>>;
|
|
377
|
-
foldDiacritics: z.ZodOptional<z.ZodBoolean>;
|
|
378
|
-
collapseInnerWhitespace: z.ZodOptional<z.ZodBoolean>;
|
|
379
|
-
ignorePunctuation: z.ZodOptional<z.ZodBoolean>;
|
|
380
|
-
levenshtein: z.ZodOptional<z.ZodNumber>;
|
|
381
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
382
|
-
}, z.core.$loose>>;
|
|
383
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
384
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
385
|
-
}, z.core.$loose>;
|
|
386
|
-
/**
|
|
387
|
-
* Zod schema validating the full Fill-in-the-Blanks activity data contract.
|
|
388
|
-
* Loose at every level: unknown keys are preserved, never stripped (B7).
|
|
389
|
-
*
|
|
390
|
-
* The refinement enforces a true one-to-one correspondence between `{{id}}`
|
|
391
|
-
* placeholders and `blanks[].id`: every blank id appears EXACTLY ONCE in the
|
|
392
|
-
* passage and exactly once in `blanks[]`. (The previous set-based check let
|
|
393
|
-
* duplicate placeholders and duplicate blank configs through, corrupting the
|
|
394
|
-
* partial-score denominator and per-item details.)
|
|
395
|
-
*/
|
|
396
|
-
declare const FillInTheBlanksDataSchema: z.ZodObject<{
|
|
397
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
398
|
-
type: z.ZodLiteral<"fill-in-the-blanks">;
|
|
399
|
-
id: z.ZodString;
|
|
400
|
-
title: z.ZodString;
|
|
401
|
-
passage: z.ZodString;
|
|
402
|
-
passageHtml: z.ZodOptional<z.ZodString>;
|
|
403
|
-
blanks: z.ZodArray<z.ZodObject<{
|
|
404
|
-
id: z.ZodString;
|
|
405
|
-
acceptedAnswers: z.ZodArray<z.ZodString>;
|
|
406
|
-
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
407
|
-
trimWhitespace: z.ZodOptional<z.ZodBoolean>;
|
|
408
|
-
match: z.ZodOptional<z.ZodObject<{
|
|
409
|
-
caseSensitive: z.ZodOptional<z.ZodBoolean>;
|
|
410
|
-
trim: z.ZodOptional<z.ZodBoolean>;
|
|
411
|
-
normalize: z.ZodOptional<z.ZodEnum<{
|
|
412
|
-
none: "none";
|
|
413
|
-
NFC: "NFC";
|
|
414
|
-
NFKC: "NFKC";
|
|
415
|
-
}>>;
|
|
416
|
-
foldDiacritics: z.ZodOptional<z.ZodBoolean>;
|
|
417
|
-
collapseInnerWhitespace: z.ZodOptional<z.ZodBoolean>;
|
|
418
|
-
ignorePunctuation: z.ZodOptional<z.ZodBoolean>;
|
|
419
|
-
levenshtein: z.ZodOptional<z.ZodNumber>;
|
|
420
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
421
|
-
}, z.core.$loose>>;
|
|
422
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
423
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
424
|
-
}, z.core.$loose>>;
|
|
425
|
-
scoringStrategy: z.ZodEnum<{
|
|
426
|
-
"all-or-nothing": "all-or-nothing";
|
|
427
|
-
partial: "partial";
|
|
428
|
-
}>;
|
|
429
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
430
|
-
type: z.ZodEnum<{
|
|
431
|
-
video: "video";
|
|
432
|
-
audio: "audio";
|
|
433
|
-
image: "image";
|
|
434
|
-
embed: "embed";
|
|
435
|
-
}>;
|
|
436
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
437
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
438
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
439
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
440
|
-
kind: z.ZodEnum<{
|
|
441
|
-
captions: "captions";
|
|
442
|
-
subtitles: "subtitles";
|
|
443
|
-
}>;
|
|
444
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
445
|
-
srclang: z.ZodString;
|
|
446
|
-
label: z.ZodString;
|
|
447
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
448
|
-
}, z.core.$strict>>>;
|
|
449
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
450
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
451
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
452
|
-
native: "native";
|
|
453
|
-
minimal: "minimal";
|
|
454
|
-
}>>;
|
|
455
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
456
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
457
|
-
allow: "allow";
|
|
458
|
-
none: "none";
|
|
459
|
-
}>>;
|
|
460
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
461
|
-
allow: "allow";
|
|
462
|
-
fixed: "fixed";
|
|
463
|
-
}>>;
|
|
464
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
465
|
-
"hide-download": "hide-download";
|
|
466
|
-
"hide-rate": "hide-rate";
|
|
467
|
-
}>>>;
|
|
468
|
-
}, z.core.$strict>>;
|
|
469
|
-
}, z.core.$loose>>;
|
|
470
|
-
feedback: z.ZodOptional<z.ZodObject<{
|
|
471
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
472
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
473
|
-
}, z.core.$loose>>;
|
|
474
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
475
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
476
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
477
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
478
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
479
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
480
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
481
|
-
}, z.core.$loose>>;
|
|
482
|
-
}, z.core.$loose>;
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Zod schema for one selectable choice. Loose, like every other schema here:
|
|
486
|
-
* unknown keys are preserved so a consumer sidecar survives validation.
|
|
487
|
-
*/
|
|
488
|
-
declare const GapSelectChoiceSchema: z.ZodObject<{
|
|
489
|
-
id: z.ZodString;
|
|
490
|
-
text: z.ZodString;
|
|
491
|
-
}, z.core.$loose>;
|
|
492
|
-
/** Zod schema for a shared word bank. */
|
|
493
|
-
declare const GapSelectBankSchema: z.ZodObject<{
|
|
494
|
-
id: z.ZodString;
|
|
495
|
-
choices: z.ZodArray<z.ZodObject<{
|
|
496
|
-
id: z.ZodString;
|
|
497
|
-
text: z.ZodString;
|
|
498
|
-
}, z.core.$loose>>;
|
|
499
|
-
}, z.core.$loose>;
|
|
500
|
-
/** Zod schema for one gap. The `choices` / `bankId` exclusivity is checked on the activity. */
|
|
501
|
-
declare const GapSelectGapSchema: z.ZodObject<{
|
|
502
|
-
id: z.ZodString;
|
|
503
|
-
choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
504
|
-
id: z.ZodString;
|
|
505
|
-
text: z.ZodString;
|
|
506
|
-
}, z.core.$loose>>>;
|
|
507
|
-
bankId: z.ZodOptional<z.ZodString>;
|
|
508
|
-
correctChoiceId: z.ZodString;
|
|
509
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
510
|
-
}, z.core.$loose>;
|
|
511
|
-
/**
|
|
512
|
-
* Zod schema validating the full Gap Select data contract.
|
|
513
|
-
*
|
|
514
|
-
* Six semantic guards, none of them expressible in JSON Schema and all of them
|
|
515
|
-
* authoring errors that would otherwise reach a learner:
|
|
516
|
-
*
|
|
517
|
-
* 1. **Bank ids are unique** — two banks sharing an id makes which one a gap
|
|
518
|
-
* draws from a matter of array order.
|
|
519
|
-
* 2. **Gap ids are unique** — the scorer looks a gap's selection up by id, so a
|
|
520
|
-
* duplicate makes one gap unscoreable (the same defect the Multiple Choice
|
|
521
|
-
* option-id guard exists for).
|
|
522
|
-
* 3. **Passage placeholders and gaps pair one to one**, each `{{id}}` appearing
|
|
523
|
-
* exactly once — the Fill-in-the-Blanks bijection, for the same reason: a
|
|
524
|
-
* gap with nowhere to render is a question the learner never sees, and a
|
|
525
|
-
* placeholder with no gap renders as literal `{{id}}` text.
|
|
526
|
-
* 4. **Exactly one choice source per gap** — `choices` or `bankId`, never both
|
|
527
|
-
* and never neither.
|
|
528
|
-
* 5. **A `bankId` names a bank that exists.**
|
|
529
|
-
* 6. **`correctChoiceId` is one of the choices the gap actually offers**, and
|
|
530
|
-
* choice ids within a resolved set are unique. An answer key pointing at a
|
|
531
|
-
* choice nobody can pick is an item that cannot be passed.
|
|
532
|
-
*/
|
|
533
|
-
declare const GapSelectDataSchema: z.ZodObject<{
|
|
534
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
535
|
-
type: z.ZodLiteral<"gap-select">;
|
|
536
|
-
id: z.ZodString;
|
|
537
|
-
title: z.ZodString;
|
|
538
|
-
passage: z.ZodString;
|
|
539
|
-
passageHtml: z.ZodOptional<z.ZodString>;
|
|
540
|
-
gaps: z.ZodArray<z.ZodObject<{
|
|
541
|
-
id: z.ZodString;
|
|
542
|
-
choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
543
|
-
id: z.ZodString;
|
|
544
|
-
text: z.ZodString;
|
|
545
|
-
}, z.core.$loose>>>;
|
|
546
|
-
bankId: z.ZodOptional<z.ZodString>;
|
|
547
|
-
correctChoiceId: z.ZodString;
|
|
548
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
549
|
-
}, z.core.$loose>>;
|
|
550
|
-
banks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
551
|
-
id: z.ZodString;
|
|
552
|
-
choices: z.ZodArray<z.ZodObject<{
|
|
553
|
-
id: z.ZodString;
|
|
554
|
-
text: z.ZodString;
|
|
555
|
-
}, z.core.$loose>>;
|
|
556
|
-
}, z.core.$loose>>>;
|
|
557
|
-
scoringStrategy: z.ZodEnum<{
|
|
558
|
-
"all-or-nothing": "all-or-nothing";
|
|
559
|
-
partial: "partial";
|
|
560
|
-
}>;
|
|
561
|
-
presentation: z.ZodOptional<z.ZodLiteral<"dropdown">>;
|
|
562
|
-
shuffleChoices: z.ZodOptional<z.ZodBoolean>;
|
|
563
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
564
|
-
type: z.ZodEnum<{
|
|
565
|
-
video: "video";
|
|
566
|
-
audio: "audio";
|
|
567
|
-
image: "image";
|
|
568
|
-
embed: "embed";
|
|
569
|
-
}>;
|
|
570
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
571
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
572
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
573
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
574
|
-
kind: z.ZodEnum<{
|
|
575
|
-
captions: "captions";
|
|
576
|
-
subtitles: "subtitles";
|
|
577
|
-
}>;
|
|
578
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
579
|
-
srclang: z.ZodString;
|
|
580
|
-
label: z.ZodString;
|
|
581
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
582
|
-
}, z.core.$strict>>>;
|
|
583
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
584
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
585
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
586
|
-
native: "native";
|
|
587
|
-
minimal: "minimal";
|
|
588
|
-
}>>;
|
|
589
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
590
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
591
|
-
allow: "allow";
|
|
592
|
-
none: "none";
|
|
593
|
-
}>>;
|
|
594
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
595
|
-
allow: "allow";
|
|
596
|
-
fixed: "fixed";
|
|
597
|
-
}>>;
|
|
598
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
599
|
-
"hide-download": "hide-download";
|
|
600
|
-
"hide-rate": "hide-rate";
|
|
601
|
-
}>>>;
|
|
602
|
-
}, z.core.$strict>>;
|
|
603
|
-
}, z.core.$loose>>;
|
|
604
|
-
feedback: z.ZodOptional<z.ZodObject<{
|
|
605
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
606
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
607
|
-
}, z.core.$loose>>;
|
|
608
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
609
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
610
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
611
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
612
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
613
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
614
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
615
|
-
}, z.core.$loose>>;
|
|
616
|
-
}, z.core.$loose>;
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* Zod schema for a {@link Stimulus}. Loose: unknown keys preserved.
|
|
620
|
-
*
|
|
621
|
-
* The semantic guards exist because a stimulus that does not carry what its
|
|
622
|
-
* `kind` promises is an authoring error that must not reach an exam: an
|
|
623
|
-
* "audio" stimulus with no recording renders as a blank panel above six
|
|
624
|
-
* listening questions. Unrepresentable in JSON Schema; dropped from
|
|
625
|
-
* `stimulusJsonSchema` by design.
|
|
626
|
-
*/
|
|
627
|
-
declare const StimulusSchema: z.ZodObject<{
|
|
628
|
-
id: z.ZodString;
|
|
629
|
-
kind: z.ZodEnum<{
|
|
630
|
-
video: "video";
|
|
631
|
-
audio: "audio";
|
|
632
|
-
image: "image";
|
|
633
|
-
text: "text";
|
|
634
|
-
mixed: "mixed";
|
|
635
|
-
}>;
|
|
636
|
-
title: z.ZodOptional<z.ZodString>;
|
|
637
|
-
body: z.ZodOptional<z.ZodString>;
|
|
638
|
-
bodyHtml: z.ZodOptional<z.ZodString>;
|
|
639
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
640
|
-
type: z.ZodEnum<{
|
|
641
|
-
video: "video";
|
|
642
|
-
audio: "audio";
|
|
643
|
-
image: "image";
|
|
644
|
-
embed: "embed";
|
|
645
|
-
}>;
|
|
646
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
647
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
648
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
649
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
650
|
-
kind: z.ZodEnum<{
|
|
651
|
-
captions: "captions";
|
|
652
|
-
subtitles: "subtitles";
|
|
653
|
-
}>;
|
|
654
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
655
|
-
srclang: z.ZodString;
|
|
656
|
-
label: z.ZodString;
|
|
657
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
658
|
-
}, z.core.$strict>>>;
|
|
659
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
660
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
661
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
662
|
-
native: "native";
|
|
663
|
-
minimal: "minimal";
|
|
664
|
-
}>>;
|
|
665
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
666
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
667
|
-
allow: "allow";
|
|
668
|
-
none: "none";
|
|
669
|
-
}>>;
|
|
670
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
671
|
-
allow: "allow";
|
|
672
|
-
fixed: "fixed";
|
|
673
|
-
}>>;
|
|
674
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
675
|
-
"hide-download": "hide-download";
|
|
676
|
-
"hide-rate": "hide-rate";
|
|
677
|
-
}>>>;
|
|
678
|
-
}, z.core.$strict>>;
|
|
679
|
-
}, z.core.$loose>>;
|
|
680
|
-
transcript: z.ZodOptional<z.ZodString>;
|
|
681
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
682
|
-
attribution: z.ZodOptional<z.ZodString>;
|
|
683
|
-
}, z.core.$loose>;
|
|
684
|
-
/**
|
|
685
|
-
* A quiz. STRICT, like every part of a timeline: a misspelt `requried` would
|
|
686
|
-
* otherwise be kept and the quiz silently optional on a paper that believed it
|
|
687
|
-
* was required.
|
|
688
|
-
*/
|
|
689
|
-
declare const TimelineCueSchema: z.ZodObject<{
|
|
690
|
-
id: z.ZodString;
|
|
691
|
-
at: z.ZodNumber;
|
|
692
|
-
itemIds: z.ZodArray<z.ZodString>;
|
|
693
|
-
title: z.ZodOptional<z.ZodString>;
|
|
694
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
695
|
-
}, z.core.$strict>;
|
|
696
|
-
declare const TimelineChapterSchema: z.ZodObject<{
|
|
697
|
-
at: z.ZodNumber;
|
|
698
|
-
title: z.ZodString;
|
|
699
|
-
}, z.core.$strict>;
|
|
700
|
-
/**
|
|
701
|
-
* A timeline on its own: its quizzes, chapters and navigation. The rules that
|
|
702
|
-
* need the group — every item in exactly one quiz, a video stimulus, the five
|
|
703
|
-
* item types — are {@link timelineIssues}, which both group schemas run.
|
|
704
|
-
*/
|
|
705
|
-
declare const MediaTimelineSchema: z.ZodObject<{
|
|
706
|
-
cues: z.ZodArray<z.ZodObject<{
|
|
707
|
-
id: z.ZodString;
|
|
708
|
-
at: z.ZodNumber;
|
|
709
|
-
itemIds: z.ZodArray<z.ZodString>;
|
|
710
|
-
title: z.ZodOptional<z.ZodString>;
|
|
711
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
712
|
-
}, z.core.$strict>>;
|
|
713
|
-
chapters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
714
|
-
at: z.ZodNumber;
|
|
715
|
-
title: z.ZodString;
|
|
716
|
-
}, z.core.$strict>>>;
|
|
717
|
-
navigation: z.ZodOptional<z.ZodEnum<{
|
|
718
|
-
free: "free";
|
|
719
|
-
"no-skip-ahead": "no-skip-ahead";
|
|
720
|
-
}>>;
|
|
721
|
-
}, z.core.$strict>;
|
|
722
|
-
/**
|
|
723
|
-
* Zod schema for an {@link ItemGroup} CONTAINER. Loose: unknown keys
|
|
724
|
-
* preserved. Validates the group's own fields and the stimulus in full, and
|
|
725
|
-
* each item only structurally (`type` and `id`); use {@link validateItemGroup}
|
|
726
|
-
* to validate the items against their registered schemas as well.
|
|
727
|
-
*/
|
|
728
|
-
declare const ItemGroupSchema: z.ZodObject<{
|
|
729
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
730
|
-
type: z.ZodLiteral<"item-group">;
|
|
731
|
-
id: z.ZodString;
|
|
732
|
-
title: z.ZodOptional<z.ZodString>;
|
|
733
|
-
slotKey: z.ZodOptional<z.ZodString>;
|
|
734
|
-
stimulus: z.ZodObject<{
|
|
735
|
-
id: z.ZodString;
|
|
736
|
-
kind: z.ZodEnum<{
|
|
737
|
-
video: "video";
|
|
738
|
-
audio: "audio";
|
|
739
|
-
image: "image";
|
|
740
|
-
text: "text";
|
|
741
|
-
mixed: "mixed";
|
|
742
|
-
}>;
|
|
743
|
-
title: z.ZodOptional<z.ZodString>;
|
|
744
|
-
body: z.ZodOptional<z.ZodString>;
|
|
745
|
-
bodyHtml: z.ZodOptional<z.ZodString>;
|
|
746
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
747
|
-
type: z.ZodEnum<{
|
|
748
|
-
video: "video";
|
|
749
|
-
audio: "audio";
|
|
750
|
-
image: "image";
|
|
751
|
-
embed: "embed";
|
|
752
|
-
}>;
|
|
753
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
754
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
755
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
756
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
757
|
-
kind: z.ZodEnum<{
|
|
758
|
-
captions: "captions";
|
|
759
|
-
subtitles: "subtitles";
|
|
760
|
-
}>;
|
|
761
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
762
|
-
srclang: z.ZodString;
|
|
763
|
-
label: z.ZodString;
|
|
764
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
765
|
-
}, z.core.$strict>>>;
|
|
766
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
767
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
768
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
769
|
-
native: "native";
|
|
770
|
-
minimal: "minimal";
|
|
771
|
-
}>>;
|
|
772
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
773
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
774
|
-
allow: "allow";
|
|
775
|
-
none: "none";
|
|
776
|
-
}>>;
|
|
777
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
778
|
-
allow: "allow";
|
|
779
|
-
fixed: "fixed";
|
|
780
|
-
}>>;
|
|
781
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
782
|
-
"hide-download": "hide-download";
|
|
783
|
-
"hide-rate": "hide-rate";
|
|
784
|
-
}>>>;
|
|
785
|
-
}, z.core.$strict>>;
|
|
786
|
-
}, z.core.$loose>>;
|
|
787
|
-
transcript: z.ZodOptional<z.ZodString>;
|
|
788
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
789
|
-
attribution: z.ZodOptional<z.ZodString>;
|
|
790
|
-
}, z.core.$loose>;
|
|
791
|
-
items: z.ZodArray<z.ZodObject<{
|
|
792
|
-
type: z.ZodString;
|
|
793
|
-
id: z.ZodString;
|
|
794
|
-
slotKey: z.ZodOptional<z.ZodString>;
|
|
795
|
-
}, z.core.$loose>>;
|
|
796
|
-
shuffle: z.ZodOptional<z.ZodEnum<{
|
|
797
|
-
none: "none";
|
|
798
|
-
"within-group": "within-group";
|
|
799
|
-
}>>;
|
|
800
|
-
timeline: z.ZodOptional<z.ZodObject<{
|
|
801
|
-
cues: z.ZodArray<z.ZodObject<{
|
|
802
|
-
id: z.ZodString;
|
|
803
|
-
at: z.ZodNumber;
|
|
804
|
-
itemIds: z.ZodArray<z.ZodString>;
|
|
805
|
-
title: z.ZodOptional<z.ZodString>;
|
|
806
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
807
|
-
}, z.core.$strict>>;
|
|
808
|
-
chapters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
809
|
-
at: z.ZodNumber;
|
|
810
|
-
title: z.ZodString;
|
|
811
|
-
}, z.core.$strict>>>;
|
|
812
|
-
navigation: z.ZodOptional<z.ZodEnum<{
|
|
813
|
-
free: "free";
|
|
814
|
-
"no-skip-ahead": "no-skip-ahead";
|
|
815
|
-
}>>;
|
|
816
|
-
}, z.core.$strict>>;
|
|
817
|
-
}, z.core.$loose>;
|
|
818
|
-
/** The learner-safe shape of a stimulus, derived from the strict schema below. */
|
|
819
|
-
type RedactedStimulus = z.infer<typeof RedactedStimulusSchema>;
|
|
820
|
-
/** Strict learner-safe stimulus: everything but the author-only `transcript`. */
|
|
821
|
-
declare const RedactedStimulusSchema: z.ZodObject<{
|
|
822
|
-
id: z.ZodString;
|
|
823
|
-
kind: z.ZodEnum<{
|
|
824
|
-
video: "video";
|
|
825
|
-
audio: "audio";
|
|
826
|
-
image: "image";
|
|
827
|
-
text: "text";
|
|
828
|
-
mixed: "mixed";
|
|
829
|
-
}>;
|
|
830
|
-
title: z.ZodOptional<z.ZodString>;
|
|
831
|
-
body: z.ZodOptional<z.ZodString>;
|
|
832
|
-
bodyHtml: z.ZodOptional<z.ZodString>;
|
|
833
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
834
|
-
type: z.ZodEnum<{
|
|
835
|
-
video: "video";
|
|
836
|
-
audio: "audio";
|
|
837
|
-
image: "image";
|
|
838
|
-
embed: "embed";
|
|
839
|
-
}>;
|
|
840
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
841
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
842
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
843
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
844
|
-
kind: z.ZodEnum<{
|
|
845
|
-
captions: "captions";
|
|
846
|
-
subtitles: "subtitles";
|
|
847
|
-
}>;
|
|
848
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
849
|
-
srclang: z.ZodString;
|
|
850
|
-
label: z.ZodString;
|
|
851
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
852
|
-
}, z.core.$strict>>>;
|
|
853
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
854
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
855
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
856
|
-
native: "native";
|
|
857
|
-
minimal: "minimal";
|
|
858
|
-
}>>;
|
|
859
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
860
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
861
|
-
allow: "allow";
|
|
862
|
-
none: "none";
|
|
863
|
-
}>>;
|
|
864
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
865
|
-
allow: "allow";
|
|
866
|
-
fixed: "fixed";
|
|
867
|
-
}>>;
|
|
868
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
869
|
-
"hide-download": "hide-download";
|
|
870
|
-
"hide-rate": "hide-rate";
|
|
871
|
-
}>>>;
|
|
872
|
-
}, z.core.$strict>>;
|
|
873
|
-
}, z.core.$strict>>;
|
|
874
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
875
|
-
attribution: z.ZodOptional<z.ZodString>;
|
|
876
|
-
}, z.core.$strict>;
|
|
877
|
-
/**
|
|
878
|
-
* Strict learner-safe item group. Items are left opaque here — each is proven
|
|
879
|
-
* learner-safe by `assertRedacted` against its OWN type's redacted schema,
|
|
880
|
-
* which is the only place that knowledge lives. The one exception is the one
|
|
881
|
-
* rule that spans the container and an item: a captioned stimulus recording
|
|
882
|
-
* played to a dictation is not learner-safe, because the captions are the
|
|
883
|
-
* dictation's answer.
|
|
884
|
-
*/
|
|
885
|
-
declare const RedactedItemGroupSchema: z.ZodObject<{
|
|
886
|
-
redacted: z.ZodLiteral<true>;
|
|
887
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
888
|
-
type: z.ZodLiteral<"item-group">;
|
|
889
|
-
id: z.ZodString;
|
|
890
|
-
title: z.ZodOptional<z.ZodString>;
|
|
891
|
-
slotKey: z.ZodOptional<z.ZodString>;
|
|
892
|
-
stimulus: z.ZodObject<{
|
|
893
|
-
id: z.ZodString;
|
|
894
|
-
kind: z.ZodEnum<{
|
|
895
|
-
video: "video";
|
|
896
|
-
audio: "audio";
|
|
897
|
-
image: "image";
|
|
898
|
-
text: "text";
|
|
899
|
-
mixed: "mixed";
|
|
900
|
-
}>;
|
|
901
|
-
title: z.ZodOptional<z.ZodString>;
|
|
902
|
-
body: z.ZodOptional<z.ZodString>;
|
|
903
|
-
bodyHtml: z.ZodOptional<z.ZodString>;
|
|
904
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
905
|
-
type: z.ZodEnum<{
|
|
906
|
-
video: "video";
|
|
907
|
-
audio: "audio";
|
|
908
|
-
image: "image";
|
|
909
|
-
embed: "embed";
|
|
910
|
-
}>;
|
|
911
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
912
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
913
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
914
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
915
|
-
kind: z.ZodEnum<{
|
|
916
|
-
captions: "captions";
|
|
917
|
-
subtitles: "subtitles";
|
|
918
|
-
}>;
|
|
919
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
920
|
-
srclang: z.ZodString;
|
|
921
|
-
label: z.ZodString;
|
|
922
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
923
|
-
}, z.core.$strict>>>;
|
|
924
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
925
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
926
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
927
|
-
native: "native";
|
|
928
|
-
minimal: "minimal";
|
|
929
|
-
}>>;
|
|
930
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
931
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
932
|
-
allow: "allow";
|
|
933
|
-
none: "none";
|
|
934
|
-
}>>;
|
|
935
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
936
|
-
allow: "allow";
|
|
937
|
-
fixed: "fixed";
|
|
938
|
-
}>>;
|
|
939
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
940
|
-
"hide-download": "hide-download";
|
|
941
|
-
"hide-rate": "hide-rate";
|
|
942
|
-
}>>>;
|
|
943
|
-
}, z.core.$strict>>;
|
|
944
|
-
}, z.core.$strict>>;
|
|
945
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
946
|
-
attribution: z.ZodOptional<z.ZodString>;
|
|
947
|
-
}, z.core.$strict>;
|
|
948
|
-
items: z.ZodArray<z.ZodUnknown>;
|
|
949
|
-
shuffle: z.ZodOptional<z.ZodEnum<{
|
|
950
|
-
none: "none";
|
|
951
|
-
"within-group": "within-group";
|
|
952
|
-
}>>;
|
|
953
|
-
timeline: z.ZodOptional<z.ZodObject<{
|
|
954
|
-
cues: z.ZodArray<z.ZodObject<{
|
|
955
|
-
id: z.ZodString;
|
|
956
|
-
at: z.ZodNumber;
|
|
957
|
-
itemIds: z.ZodArray<z.ZodString>;
|
|
958
|
-
title: z.ZodOptional<z.ZodString>;
|
|
959
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
960
|
-
}, z.core.$strict>>;
|
|
961
|
-
chapters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
962
|
-
at: z.ZodNumber;
|
|
963
|
-
title: z.ZodString;
|
|
964
|
-
}, z.core.$strict>>>;
|
|
965
|
-
navigation: z.ZodOptional<z.ZodEnum<{
|
|
966
|
-
free: "free";
|
|
967
|
-
"no-skip-ahead": "no-skip-ahead";
|
|
968
|
-
}>>;
|
|
969
|
-
}, z.core.$strict>>;
|
|
970
|
-
}, z.core.$strict>;
|
|
971
|
-
/**
|
|
972
|
-
* Validates an item group in full: the container and stimulus against
|
|
973
|
-
* {@link ItemGroupSchema}, then every item against the schema registered for
|
|
974
|
-
* its `type`. Errors from items are reported at `items.<index>.…`.
|
|
975
|
-
*
|
|
976
|
-
* Unlike `validateActivity`, an item whose type is not registered is REPORTED
|
|
977
|
-
* (code `unknown_activity_type`) rather than thrown: a group is validated as
|
|
978
|
-
* a whole, and an author fixing a six-item group wants every problem listed,
|
|
979
|
-
* not the first one that happened to throw.
|
|
980
|
-
*/
|
|
981
|
-
declare function validateItemGroup(data: unknown): ValidationResult<ItemGroup>;
|
|
982
|
-
|
|
983
|
-
/**
|
|
984
|
-
* JSON Schema (Draft 7) for a `Stimulus`. Structural contract only — the
|
|
985
|
-
* kind/media/body consistency guards are Zod-only.
|
|
986
|
-
*/
|
|
987
|
-
declare const stimulusJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
988
|
-
/**
|
|
989
|
-
* JSON Schema (Draft 7) for an `ItemGroup` CONTAINER. Items appear as objects
|
|
990
|
-
* with `type` and `id` only; each item's own contract is `jsonSchemaFor(type)`.
|
|
991
|
-
* For an AI generation pipeline, ask for the group and each item separately
|
|
992
|
-
* rather than a single nested schema — that keeps the per-type schema the
|
|
993
|
-
* registry's, not a copy.
|
|
994
|
-
*/
|
|
995
|
-
declare const itemGroupJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
996
|
-
/**
|
|
997
|
-
* JSON Schema (Draft 7) representation of the Multiple Choice activity data
|
|
998
|
-
* contract, generated natively by Zod 4. Draft 7 is mandated by Requirement
|
|
999
|
-
* 2.2 for the widest AI-prompt / OpenAPI tooling compatibility. The semantic
|
|
1000
|
-
* `.refine()` guards are not representable in JSON Schema and are
|
|
1001
|
-
* intentionally omitted — the export captures the *structural* contract only.
|
|
1002
|
-
* Since v0.3 the source schemas are loose, so these no longer emit
|
|
1003
|
-
* `additionalProperties: false` — the JSON Schema and `validateActivity` now
|
|
1004
|
-
* agree on unknown-key handling.
|
|
1005
|
-
*/
|
|
1006
|
-
/**
|
|
1007
|
-
* JSON Schema (Draft 7) representation of the Gap Select activity data
|
|
1008
|
-
* contract. Structural contract only: the six semantic guards — the
|
|
1009
|
-
* passage/gap bijection, id uniqueness, the one-choice-source rule, and an
|
|
1010
|
-
* answer key that names a choice the gap offers — are Zod-only, as they are
|
|
1011
|
-
* for the other types.
|
|
1012
|
-
*/
|
|
1013
|
-
declare const gapSelectJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
1014
|
-
/**
|
|
1015
|
-
* JSON Schema (Draft 7) representation of the Dictation activity data
|
|
1016
|
-
* contract. Structural contract, plus the raw length caps JSON Schema can
|
|
1017
|
-
* state in code points as zod counts them — `maxLength` 2000 on a transcript
|
|
1018
|
-
* and an accepted transcript, 200 on a rule's `from` and `to`. The twelve
|
|
1019
|
-
* semantic guards — a transcript that survives normalisation, the caps after
|
|
1020
|
-
* equivalences are applied, distinct candidates, audio only, the
|
|
1021
|
-
* slow-recording rules, no captions, no transcript in the title — are
|
|
1022
|
-
* Zod-only, as they are for the other types.
|
|
1023
|
-
*/
|
|
1024
|
-
declare const dictationJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
1025
|
-
/**
|
|
1026
|
-
* JSON Schema (Draft 7) representation of the Read Aloud activity data
|
|
1027
|
-
* contract. Structural contract, plus the raw cap JSON Schema can state in code
|
|
1028
|
-
* points as zod counts them — `maxLength` 2000 on the reference text — and the
|
|
1029
|
-
* canonical locale pattern. The ten semantic guards — the cap after
|
|
1030
|
-
* normalisation, a text that survives it, the spaced-script rule, the
|
|
1031
|
-
* model-recording rules, unique dimensions, a weight above 0, and the take
|
|
1032
|
-
* bounds — are Zod-only, as they are for the other types.
|
|
1033
|
-
*/
|
|
1034
|
-
declare const readAloudJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
1035
|
-
declare const multipleChoiceJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
1036
|
-
/**
|
|
1037
|
-
* JSON Schema (Draft 7) representation of the Fill-in-the-Blanks activity data
|
|
1038
|
-
* contract, generated natively by Zod 4. Structural contract only (semantic
|
|
1039
|
-
* `.refine()` guards are Zod-only and not representable in JSON Schema).
|
|
1040
|
-
*/
|
|
1041
|
-
declare const fillInTheBlanksJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
1042
|
-
/**
|
|
1043
|
-
* JSON Schema (Draft 7) representation of the Written Response activity data
|
|
1044
|
-
* contract. Structural contract only.
|
|
1045
|
-
*/
|
|
1046
|
-
declare const writtenResponseJsonSchema: z.core.JSONSchema.JSONSchema;
|
|
1047
|
-
/**
|
|
1048
|
-
* Derives the JSON Schema (Draft 7) for any REGISTERED activity type — the
|
|
1049
|
-
* live, registry-backed replacement for the static per-type exports above,
|
|
1050
|
-
* and the building block for AI generation pipelines (R6.1): pass the result
|
|
1051
|
-
* as a structured-output schema so a model can only emit valid items.
|
|
1052
|
-
*
|
|
1053
|
-
* @throws UnknownActivityTypeError when `type` has no registered descriptor.
|
|
1054
|
-
*/
|
|
1055
|
-
declare function jsonSchemaFor(type: string): Record<string, unknown>;
|
|
1056
|
-
|
|
1057
|
-
/**
|
|
1058
|
-
* Optional media attached to an activity, rendered above the question or
|
|
1059
|
-
* passage — e.g. a recording to listen to, or an embedded video to watch
|
|
1060
|
-
* before answering. URL-only by design: hosting/delivery (S3/CDN, or the
|
|
1061
|
-
* provider's own embed for `embed`) is the consuming app's responsibility
|
|
1062
|
-
* (see requirements "Non-Goals and Shared Responsibility").
|
|
1063
|
-
*
|
|
1064
|
-
* - `image`: rendered as `<img>` — `alt` is REQUIRED (WCAG 1.1.1 / Req 14.5).
|
|
1065
|
-
* - `audio` / `video`: rendered with native controls; `alt` is an optional
|
|
1066
|
-
* accessible label; `captionsUrl` points at a WebVTT `<track>`. `url` must
|
|
1067
|
-
* be a direct media file (NOT a YouTube/Vimeo page — use `embed` for those).
|
|
1068
|
-
* - `embed`: rendered as a sandboxed `<iframe>` for provider players
|
|
1069
|
-
* (YouTube/Vimeo/etc.). `url` MUST be the provider's *embeddable* URL
|
|
1070
|
-
* (e.g. `https://www.youtube.com/embed/<id>`). `alt` is REQUIRED and used
|
|
1071
|
-
* as the iframe's accessible `title` (WCAG 4.1.2 / 2.4.1).
|
|
1072
|
-
*/
|
|
1073
|
-
/**
|
|
1074
|
-
* Media URL policy (security-reviewed): absolute URLs must use `https:`,
|
|
1075
|
-
* `http:`, `data:`, or `blob:`; root-relative paths (`/media/x.mp3`) are
|
|
1076
|
-
* allowed for same-origin hosting. Everything else — notably `javascript:`,
|
|
1077
|
-
* `file:`, `ftp:` — is rejected: these URLs land in `src` attributes
|
|
1078
|
-
* (including an iframe for `embed`), so an unvetted scheme is a stored-XSS
|
|
1079
|
-
* vector in every consuming app.
|
|
1080
|
-
*/
|
|
1081
|
-
declare const MediaUrlSchema: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1082
|
-
/**
|
|
1083
|
-
* Hints to the BROWSER'S OWN control bar, emitted as `controlsList` tokens.
|
|
1084
|
-
*
|
|
1085
|
-
* They remove a button, never a capability, and only in engines that implement
|
|
1086
|
-
* `controlsList` at all. `hide-download` does NOT prevent a download — the URL
|
|
1087
|
-
* is in the page and the bytes are in the network panel. If a recording must
|
|
1088
|
-
* not be kept, issue a short-lived signed URL; that is the consuming
|
|
1089
|
-
* application's control, not the SDK's.
|
|
1090
|
-
*
|
|
1091
|
-
* Meaningful only alongside the native bar: there is nothing to hint at once
|
|
1092
|
-
* the SDK owns the transport.
|
|
1093
|
-
*/
|
|
1094
|
-
declare const NativeControlHintSchema: z.ZodEnum<{
|
|
1095
|
-
"hide-download": "hide-download";
|
|
1096
|
-
"hide-rate": "hide-rate";
|
|
1097
|
-
}>;
|
|
1098
|
-
/**
|
|
1099
|
-
* How an audio recording may be played.
|
|
1100
|
-
*
|
|
1101
|
-
* STRICT on purpose: an unknown key here is an authoring error. {@link
|
|
1102
|
-
* MediaSchema} is loose, so without this a typo one level down (`maxPlay`,
|
|
1103
|
-
* `seeking`) would be silently accepted and the whole policy would quietly do
|
|
1104
|
-
* nothing on an exam that believed it was enforced.
|
|
1105
|
-
*
|
|
1106
|
-
* Nothing here is required together with anything else — `{ maxPlays: 2 }` is a
|
|
1107
|
-
* complete, valid policy, because `controls` and `seek` RESOLVE to the only
|
|
1108
|
-
* values that can keep that promise. The refinements below reject only a
|
|
1109
|
-
* combination an author wrote **explicitly** that the renderer cannot honour.
|
|
1110
|
-
*/
|
|
1111
|
-
declare const MediaPlaybackSchema: z.ZodObject<{
|
|
1112
|
-
/**
|
|
1113
|
-
* `native` (the resolved default) renders today's `<audio controls>`
|
|
1114
|
-
* unchanged. `minimal` — resolved automatically whenever any enforcement
|
|
1115
|
-
* field is set — replaces the browser bar with the SDK transport:
|
|
1116
|
-
* play/pause, elapsed/total, mute, volume, optional speed, optional
|
|
1117
|
-
* scrubber, and a live plays-remaining status.
|
|
1118
|
-
*/
|
|
1119
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
1120
|
-
native: "native";
|
|
1121
|
-
minimal: "minimal";
|
|
1122
|
-
}>>;
|
|
1123
|
-
/**
|
|
1124
|
-
* How many times the recording may be STARTED. A play is consumed when
|
|
1125
|
-
* playback begins from anywhere other than where it last stopped, so
|
|
1126
|
-
* pausing, resuming, and paging between the questions of one listening
|
|
1127
|
-
* group are all free. Enforced in `practice` and `exam`; never in `review`.
|
|
1128
|
-
*/
|
|
1129
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
1130
|
-
/** `none` renders no scrubber and reverts an out-of-band seek to the high-water mark. */
|
|
1131
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
1132
|
-
allow: "allow";
|
|
1133
|
-
none: "none";
|
|
1134
|
-
}>>;
|
|
1135
|
-
/** `fixed` renders no speed control and snaps `playbackRate` back to 1. */
|
|
1136
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
1137
|
-
allow: "allow";
|
|
1138
|
-
fixed: "fixed";
|
|
1139
|
-
}>>;
|
|
1140
|
-
/** Advisory only. See {@link NativeControlHintSchema}. */
|
|
1141
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1142
|
-
"hide-download": "hide-download";
|
|
1143
|
-
"hide-rate": "hide-rate";
|
|
1144
|
-
}>>>;
|
|
1145
|
-
}, z.core.$strict>;
|
|
1146
|
-
/**
|
|
1147
|
-
* A text track for an audio or video recording. STRICT, for the same reason
|
|
1148
|
-
* {@link MediaPlaybackSchema} is: a misspelt `srclnag` would otherwise be kept
|
|
1149
|
-
* and the track shown with no language.
|
|
1150
|
-
*/
|
|
1151
|
-
declare const MediaTrackSchema: z.ZodObject<{
|
|
1152
|
-
kind: z.ZodEnum<{
|
|
1153
|
-
captions: "captions";
|
|
1154
|
-
subtitles: "subtitles";
|
|
1155
|
-
}>;
|
|
1156
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1157
|
-
srclang: z.ZodString;
|
|
1158
|
-
label: z.ZodString;
|
|
1159
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
1160
|
-
}, z.core.$strict>;
|
|
1161
|
-
declare const MediaSchema: z.ZodObject<{
|
|
1162
|
-
type: z.ZodEnum<{
|
|
1163
|
-
video: "video";
|
|
1164
|
-
audio: "audio";
|
|
1165
|
-
image: "image";
|
|
1166
|
-
embed: "embed";
|
|
1167
|
-
}>;
|
|
1168
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1169
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1170
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1171
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1172
|
-
kind: z.ZodEnum<{
|
|
1173
|
-
captions: "captions";
|
|
1174
|
-
subtitles: "subtitles";
|
|
1175
|
-
}>;
|
|
1176
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1177
|
-
srclang: z.ZodString;
|
|
1178
|
-
label: z.ZodString;
|
|
1179
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
1180
|
-
}, z.core.$strict>>>;
|
|
1181
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1182
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
1183
|
-
/**
|
|
1184
|
-
* `native` (the resolved default) renders today's `<audio controls>`
|
|
1185
|
-
* unchanged. `minimal` — resolved automatically whenever any enforcement
|
|
1186
|
-
* field is set — replaces the browser bar with the SDK transport:
|
|
1187
|
-
* play/pause, elapsed/total, mute, volume, optional speed, optional
|
|
1188
|
-
* scrubber, and a live plays-remaining status.
|
|
1189
|
-
*/
|
|
1190
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
1191
|
-
native: "native";
|
|
1192
|
-
minimal: "minimal";
|
|
1193
|
-
}>>;
|
|
1194
|
-
/**
|
|
1195
|
-
* How many times the recording may be STARTED. A play is consumed when
|
|
1196
|
-
* playback begins from anywhere other than where it last stopped, so
|
|
1197
|
-
* pausing, resuming, and paging between the questions of one listening
|
|
1198
|
-
* group are all free. Enforced in `practice` and `exam`; never in `review`.
|
|
1199
|
-
*/
|
|
1200
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
1201
|
-
/** `none` renders no scrubber and reverts an out-of-band seek to the high-water mark. */
|
|
1202
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
1203
|
-
allow: "allow";
|
|
1204
|
-
none: "none";
|
|
1205
|
-
}>>;
|
|
1206
|
-
/** `fixed` renders no speed control and snaps `playbackRate` back to 1. */
|
|
1207
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
1208
|
-
allow: "allow";
|
|
1209
|
-
fixed: "fixed";
|
|
1210
|
-
}>>;
|
|
1211
|
-
/** Advisory only. See {@link NativeControlHintSchema}. */
|
|
1212
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1213
|
-
"hide-download": "hide-download";
|
|
1214
|
-
"hide-rate": "hide-rate";
|
|
1215
|
-
}>>>;
|
|
1216
|
-
}, z.core.$strict>>;
|
|
1217
|
-
}, z.core.$loose>;
|
|
1218
|
-
/**
|
|
1219
|
-
* The strict counterpart of {@link MediaSchema}, for the redacted shapes.
|
|
1220
|
-
*
|
|
1221
|
-
* `RedactedActivityDataSchema` and `RedactedStimulusSchema` are `strictObject`
|
|
1222
|
-
* precisely so an unknown key is a validation failure rather than a
|
|
1223
|
-
* passthrough — but they embedded the LOOSE `MediaSchema`, so the strictness
|
|
1224
|
-
* stopped at the media boundary and `media.secretAnswerHint` passed
|
|
1225
|
-
* `assertRedacted`. This closes it.
|
|
1226
|
-
*/
|
|
1227
|
-
declare const RedactedMediaSchema: z.ZodObject<{
|
|
1228
|
-
type: z.ZodEnum<{
|
|
1229
|
-
video: "video";
|
|
1230
|
-
audio: "audio";
|
|
1231
|
-
image: "image";
|
|
1232
|
-
embed: "embed";
|
|
1233
|
-
}>;
|
|
1234
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1235
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1236
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1237
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1238
|
-
kind: z.ZodEnum<{
|
|
1239
|
-
captions: "captions";
|
|
1240
|
-
subtitles: "subtitles";
|
|
1241
|
-
}>;
|
|
1242
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1243
|
-
srclang: z.ZodString;
|
|
1244
|
-
label: z.ZodString;
|
|
1245
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
1246
|
-
}, z.core.$strict>>>;
|
|
1247
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1248
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
1249
|
-
/**
|
|
1250
|
-
* `native` (the resolved default) renders today's `<audio controls>`
|
|
1251
|
-
* unchanged. `minimal` — resolved automatically whenever any enforcement
|
|
1252
|
-
* field is set — replaces the browser bar with the SDK transport:
|
|
1253
|
-
* play/pause, elapsed/total, mute, volume, optional speed, optional
|
|
1254
|
-
* scrubber, and a live plays-remaining status.
|
|
1255
|
-
*/
|
|
1256
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
1257
|
-
native: "native";
|
|
1258
|
-
minimal: "minimal";
|
|
1259
|
-
}>>;
|
|
1260
|
-
/**
|
|
1261
|
-
* How many times the recording may be STARTED. A play is consumed when
|
|
1262
|
-
* playback begins from anywhere other than where it last stopped, so
|
|
1263
|
-
* pausing, resuming, and paging between the questions of one listening
|
|
1264
|
-
* group are all free. Enforced in `practice` and `exam`; never in `review`.
|
|
1265
|
-
*/
|
|
1266
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
1267
|
-
/** `none` renders no scrubber and reverts an out-of-band seek to the high-water mark. */
|
|
1268
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
1269
|
-
allow: "allow";
|
|
1270
|
-
none: "none";
|
|
1271
|
-
}>>;
|
|
1272
|
-
/** `fixed` renders no speed control and snaps `playbackRate` back to 1. */
|
|
1273
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
1274
|
-
allow: "allow";
|
|
1275
|
-
fixed: "fixed";
|
|
1276
|
-
}>>;
|
|
1277
|
-
/** Advisory only. See {@link NativeControlHintSchema}. */
|
|
1278
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1279
|
-
"hide-download": "hide-download";
|
|
1280
|
-
"hide-rate": "hide-rate";
|
|
1281
|
-
}>>>;
|
|
1282
|
-
}, z.core.$strict>>;
|
|
1283
|
-
}, z.core.$strict>;
|
|
1284
|
-
|
|
1285
|
-
/**
|
|
1286
|
-
* Zod schema for a single Multiple Choice option. Loose: unknown keys are
|
|
1287
|
-
* preserved through validation (forward-compat / consumer sidecars — B7).
|
|
1288
|
-
*/
|
|
1289
|
-
/**
|
|
1290
|
-
* A picture or recording carried by one option.
|
|
1291
|
-
*
|
|
1292
|
-
* LOOSE, like `MediaSchema` and every other content schema: a consumer's own
|
|
1293
|
-
* fields — an asset id, a CDN key — ride along and survive validation (B7).
|
|
1294
|
-
* Making it strict to catch a typo would reject exactly the sidecars the SDK
|
|
1295
|
-
* promises to preserve, and an invariant test guards that promise by counting
|
|
1296
|
-
* the closed objects in the exported JSON Schema.
|
|
1297
|
-
*
|
|
1298
|
-
* The two things that must NOT be swallowed are named explicitly instead. The
|
|
1299
|
-
* `type` enum refuses the kinds that cannot be an option, and a refinement
|
|
1300
|
-
* refuses `playback`, which would otherwise sit there looking like an enforced
|
|
1301
|
-
* budget while nothing read it.
|
|
1302
|
-
*
|
|
1303
|
-
* The URL goes through `MediaUrlSchema`, the same security-reviewed allow-list
|
|
1304
|
-
* activity media uses — `javascript:`, `file:` and `ftp:` are stored-XSS
|
|
1305
|
-
* vectors wherever the value lands in a `src`, and that list is not forked.
|
|
1306
|
-
*/
|
|
1307
|
-
declare const MultipleChoiceOptionMediaSchema: z.ZodObject<{
|
|
1308
|
-
type: z.ZodEnum<{
|
|
1309
|
-
audio: "audio";
|
|
1310
|
-
image: "image";
|
|
1311
|
-
}>;
|
|
1312
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1313
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1314
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1315
|
-
}, z.core.$loose>;
|
|
1316
|
-
declare const MultipleChoiceOptionSchema: z.ZodObject<{
|
|
1317
|
-
id: z.ZodString;
|
|
1318
|
-
text: z.ZodString;
|
|
1319
|
-
isCorrect: z.ZodBoolean;
|
|
1320
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
1321
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1322
|
-
type: z.ZodEnum<{
|
|
1323
|
-
audio: "audio";
|
|
1324
|
-
image: "image";
|
|
1325
|
-
}>;
|
|
1326
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1327
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1328
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1329
|
-
}, z.core.$loose>>;
|
|
1330
|
-
}, z.core.$loose>;
|
|
1331
|
-
/**
|
|
1332
|
-
* Zod schema validating the full Multiple Choice activity data contract.
|
|
1333
|
-
* Loose at every level: unknown keys are preserved, never stripped, so a
|
|
1334
|
-
* v0.3 runtime reading a future payload (or a consumer sidecar field) does
|
|
1335
|
-
* not silently delete data.
|
|
1336
|
-
*
|
|
1337
|
-
* Semantic guards: (1) at least one option must be correct, otherwise the
|
|
1338
|
-
* activity can never be answered correctly; (2) `mode: 'single'` must have
|
|
1339
|
-
* exactly one correct option — multiple correct options under single-select
|
|
1340
|
-
* make `showCorrectAnswers` and the xAPI correct-response ambiguous and mask
|
|
1341
|
-
* authoring errors; (3) option ids must be unique — the scorer looks options
|
|
1342
|
-
* up by id, so a duplicate id makes one option unscoreable. All are
|
|
1343
|
-
* unrepresentable in JSON Schema and are dropped from `toJSONSchema` output
|
|
1344
|
-
* by design.
|
|
1345
|
-
*/
|
|
1346
|
-
declare const MultipleChoiceDataSchema: z.ZodObject<{
|
|
1347
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
1348
|
-
type: z.ZodLiteral<"multiple-choice">;
|
|
1349
|
-
id: z.ZodString;
|
|
1350
|
-
title: z.ZodString;
|
|
1351
|
-
question: z.ZodString;
|
|
1352
|
-
questionHtml: z.ZodOptional<z.ZodString>;
|
|
1353
|
-
mode: z.ZodEnum<{
|
|
1354
|
-
single: "single";
|
|
1355
|
-
multi: "multi";
|
|
1356
|
-
}>;
|
|
1357
|
-
options: z.ZodArray<z.ZodObject<{
|
|
1358
|
-
id: z.ZodString;
|
|
1359
|
-
text: z.ZodString;
|
|
1360
|
-
isCorrect: z.ZodBoolean;
|
|
1361
|
-
feedback: z.ZodOptional<z.ZodString>;
|
|
1362
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1363
|
-
type: z.ZodEnum<{
|
|
1364
|
-
audio: "audio";
|
|
1365
|
-
image: "image";
|
|
1366
|
-
}>;
|
|
1367
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1368
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1369
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1370
|
-
}, z.core.$loose>>;
|
|
1371
|
-
}, z.core.$loose>>;
|
|
1372
|
-
scoringStrategy: z.ZodEnum<{
|
|
1373
|
-
"all-or-nothing": "all-or-nothing";
|
|
1374
|
-
partial: "partial";
|
|
1375
|
-
}>;
|
|
1376
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1377
|
-
type: z.ZodEnum<{
|
|
1378
|
-
video: "video";
|
|
1379
|
-
audio: "audio";
|
|
1380
|
-
image: "image";
|
|
1381
|
-
embed: "embed";
|
|
1382
|
-
}>;
|
|
1383
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1384
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1385
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1386
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1387
|
-
kind: z.ZodEnum<{
|
|
1388
|
-
captions: "captions";
|
|
1389
|
-
subtitles: "subtitles";
|
|
1390
|
-
}>;
|
|
1391
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1392
|
-
srclang: z.ZodString;
|
|
1393
|
-
label: z.ZodString;
|
|
1394
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
1395
|
-
}, z.core.$strict>>>;
|
|
1396
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1397
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
1398
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
1399
|
-
native: "native";
|
|
1400
|
-
minimal: "minimal";
|
|
1401
|
-
}>>;
|
|
1402
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
1403
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
1404
|
-
allow: "allow";
|
|
1405
|
-
none: "none";
|
|
1406
|
-
}>>;
|
|
1407
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
1408
|
-
allow: "allow";
|
|
1409
|
-
fixed: "fixed";
|
|
1410
|
-
}>>;
|
|
1411
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1412
|
-
"hide-download": "hide-download";
|
|
1413
|
-
"hide-rate": "hide-rate";
|
|
1414
|
-
}>>>;
|
|
1415
|
-
}, z.core.$strict>>;
|
|
1416
|
-
}, z.core.$loose>>;
|
|
1417
|
-
feedback: z.ZodOptional<z.ZodObject<{
|
|
1418
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
1419
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
1420
|
-
}, z.core.$loose>>;
|
|
1421
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1422
|
-
shuffle: z.ZodOptional<z.ZodBoolean>;
|
|
1423
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
1424
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1425
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
1426
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
1427
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
1428
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
1429
|
-
}, z.core.$loose>>;
|
|
1430
|
-
}, z.core.$loose>;
|
|
1431
|
-
|
|
1432
|
-
/**
|
|
1433
|
-
* Zod schema for the slower model recording of a read-aloud item.
|
|
1434
|
-
*
|
|
1435
|
-
* STRICT, where every other content schema is loose: these three fields are the
|
|
1436
|
-
* whole contract, so the two keys an author reaches for — a `playback` policy
|
|
1437
|
-
* and a `captionsUrl` — are refused here rather than by guards of their own. The
|
|
1438
|
-
* policy belongs on `media`, which this recording follows; a captions track
|
|
1439
|
-
* belongs on `media` too, where it is allowed, because the text being read is
|
|
1440
|
-
* public and captions of it give nothing away.
|
|
1441
|
-
*/
|
|
1442
|
-
declare const ReadAloudSlowMediaSchema: z.ZodObject<{
|
|
1443
|
-
type: z.ZodLiteral<"audio">;
|
|
1444
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1445
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1446
|
-
}, z.core.$strict>;
|
|
1447
|
-
/**
|
|
1448
|
-
* Zod schema validating the full Read Aloud data contract.
|
|
1449
|
-
*
|
|
1450
|
-
* Ten semantic guards, none expressible in JSON Schema, each an authoring
|
|
1451
|
-
* error that would otherwise reach a learner or a grade:
|
|
1452
|
-
*
|
|
1453
|
-
* 1. **The text is bounded**, before and after normalisation (NFC composition
|
|
1454
|
-
* can lengthen it), because it is tokenised as a dictation transcript is and
|
|
1455
|
-
* the normaliser cuts a longer one without saying so — so a grade would be
|
|
1456
|
-
* computed against words the item had silently lost.
|
|
1457
|
-
* 2. **The text is written in a script that separates its words with spaces.**
|
|
1458
|
-
* The tokeniser splits on spaces alone, so a run of Han, kana, Thai, Lao,
|
|
1459
|
-
* Khmer or Myanmar letters is one word however many it holds, and every
|
|
1460
|
-
* per-word mark for it would be one mark for the whole sentence.
|
|
1461
|
-
* 3. **The model recording is audio.** A read-aloud model is read aloud.
|
|
1462
|
-
* 4. **A slow model recording accompanies a recording** — never a stand-in for
|
|
1463
|
-
* it.
|
|
1464
|
-
* 5. **The slow recording is a different file.**
|
|
1465
|
-
* 6. **A slow recording never sits beside a play budget** — a budget on one
|
|
1466
|
-
* file and a free second file of the same content is no budget.
|
|
1467
|
-
* 7. **No dimension is weighed twice**: two entries for one name hide which
|
|
1468
|
-
* weight the grade used.
|
|
1469
|
-
* 8. **Some dimension carries a weight above 0**, or there is no weighted total
|
|
1470
|
-
* to compute and every take would be unscorable.
|
|
1471
|
-
* 9. **The shortest take is shorter than the longest.**
|
|
1472
|
-
* 10. **Something survives normalisation of the text**: a text of nothing but
|
|
1473
|
-
* punctuation is tokenised into no word at all, so a silent take would
|
|
1474
|
-
* record no omission and a perfect reading would align as one insertion
|
|
1475
|
-
* after another — which is what a feedback component renders.
|
|
1476
|
-
*
|
|
1477
|
-
* The guards run even when an unrelated field was refused, but a guard that
|
|
1478
|
-
* reads a field zod refused waits until that field parses: zod leaves a refused
|
|
1479
|
-
* optional field — a recording, a slow recording — out of the value the guards
|
|
1480
|
-
* read, and a refused required field is kept as it was given, which need not be
|
|
1481
|
-
* of the type the guard expects.
|
|
1482
|
-
*
|
|
1483
|
-
* Guard 4 reports at `media`, where the recording it asks for belongs and where
|
|
1484
|
-
* the dictation schema reports the same rule. Guard 10 is checked beside guards
|
|
1485
|
-
* 1 and 2, which read the same text, and numbered after them so that every
|
|
1486
|
-
* other guard keeps the number it was given.
|
|
1487
|
-
*/
|
|
1488
|
-
declare const ReadAloudDataSchema: z.ZodObject<{
|
|
1489
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
1490
|
-
type: z.ZodLiteral<"read-aloud">;
|
|
1491
|
-
id: z.ZodString;
|
|
1492
|
-
title: z.ZodString;
|
|
1493
|
-
instructions: z.ZodOptional<z.ZodString>;
|
|
1494
|
-
referenceText: z.ZodString;
|
|
1495
|
-
locale: z.ZodString;
|
|
1496
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1497
|
-
type: z.ZodEnum<{
|
|
1498
|
-
video: "video";
|
|
1499
|
-
audio: "audio";
|
|
1500
|
-
image: "image";
|
|
1501
|
-
embed: "embed";
|
|
1502
|
-
}>;
|
|
1503
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1504
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1505
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1506
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1507
|
-
kind: z.ZodEnum<{
|
|
1508
|
-
captions: "captions";
|
|
1509
|
-
subtitles: "subtitles";
|
|
1510
|
-
}>;
|
|
1511
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1512
|
-
srclang: z.ZodString;
|
|
1513
|
-
label: z.ZodString;
|
|
1514
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
1515
|
-
}, z.core.$strict>>>;
|
|
1516
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1517
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
1518
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
1519
|
-
native: "native";
|
|
1520
|
-
minimal: "minimal";
|
|
1521
|
-
}>>;
|
|
1522
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
1523
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
1524
|
-
allow: "allow";
|
|
1525
|
-
none: "none";
|
|
1526
|
-
}>>;
|
|
1527
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
1528
|
-
allow: "allow";
|
|
1529
|
-
fixed: "fixed";
|
|
1530
|
-
}>>;
|
|
1531
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1532
|
-
"hide-download": "hide-download";
|
|
1533
|
-
"hide-rate": "hide-rate";
|
|
1534
|
-
}>>>;
|
|
1535
|
-
}, z.core.$strict>>;
|
|
1536
|
-
}, z.core.$loose>>;
|
|
1537
|
-
slowMedia: z.ZodOptional<z.ZodObject<{
|
|
1538
|
-
type: z.ZodLiteral<"audio">;
|
|
1539
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1540
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1541
|
-
}, z.core.$strict>>;
|
|
1542
|
-
recording: z.ZodObject<{
|
|
1543
|
-
maxSeconds: z.ZodNumber;
|
|
1544
|
-
minSeconds: z.ZodOptional<z.ZodNumber>;
|
|
1545
|
-
maxTakes: z.ZodOptional<z.ZodNumber>;
|
|
1546
|
-
}, z.core.$loose>;
|
|
1547
|
-
scoring: z.ZodObject<{
|
|
1548
|
-
dimensions: z.ZodArray<z.ZodObject<{
|
|
1549
|
-
name: z.ZodEnum<{
|
|
1550
|
-
accuracy: "accuracy";
|
|
1551
|
-
fluency: "fluency";
|
|
1552
|
-
completeness: "completeness";
|
|
1553
|
-
prosody: "prosody";
|
|
1554
|
-
}>;
|
|
1555
|
-
weight: z.ZodNumber;
|
|
1556
|
-
}, z.core.$loose>>;
|
|
1557
|
-
}, z.core.$loose>;
|
|
1558
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1559
|
-
feedback: z.ZodOptional<z.ZodObject<{
|
|
1560
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
1561
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
1562
|
-
}, z.core.$loose>>;
|
|
1563
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1564
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
1565
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
1566
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
1567
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
1568
|
-
}, z.core.$loose>>;
|
|
1569
|
-
}, z.core.$loose>;
|
|
1570
|
-
|
|
1571
|
-
/** A redacted Multiple Choice option: id and display text only — no `isCorrect`, no feedback. */
|
|
1572
|
-
declare const RedactedMultipleChoiceOptionMediaSchema: z.ZodObject<{
|
|
1573
|
-
type: z.ZodEnum<{
|
|
1574
|
-
audio: "audio";
|
|
1575
|
-
image: "image";
|
|
1576
|
-
}>;
|
|
1577
|
-
url: z.ZodString;
|
|
1578
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1579
|
-
captionsUrl: z.ZodOptional<z.ZodString>;
|
|
1580
|
-
}, z.core.$strict>;
|
|
1581
|
-
/**
|
|
1582
|
-
* A redacted Multiple Choice option: id, display text and its picture or
|
|
1583
|
-
* recording — no `isCorrect`, no feedback.
|
|
1584
|
-
*
|
|
1585
|
-
* The media survives intact for the reason a gap-select choice does: it is the
|
|
1586
|
-
* option the learner is being asked to pick, and an exam that stripped it would
|
|
1587
|
-
* show a row of blanks. Nothing in it is an answer key — the key is `isCorrect`,
|
|
1588
|
-
* which is gone.
|
|
1589
|
-
*/
|
|
1590
|
-
declare const RedactedMultipleChoiceOptionSchema: z.ZodObject<{
|
|
1591
|
-
id: z.ZodString;
|
|
1592
|
-
text: z.ZodString;
|
|
1593
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1594
|
-
type: z.ZodEnum<{
|
|
1595
|
-
audio: "audio";
|
|
1596
|
-
image: "image";
|
|
1597
|
-
}>;
|
|
1598
|
-
url: z.ZodString;
|
|
1599
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1600
|
-
captionsUrl: z.ZodOptional<z.ZodString>;
|
|
1601
|
-
}, z.core.$strict>>;
|
|
1602
|
-
}, z.core.$strict>;
|
|
1603
|
-
/**
|
|
1604
|
-
* Redacted Multiple Choice data: renderable (question, mode, options to pick
|
|
1605
|
-
* from) with the answer key, per-option feedback, overall feedback, and the
|
|
1606
|
-
* scoring strategy removed. `scoringStrategy` is answer-key by design: MC
|
|
1607
|
-
* `partial` carries a wrong-selection penalty `all-or-nothing` does not, so
|
|
1608
|
-
* knowing the strategy tells a learner whether guessing is free.
|
|
1609
|
-
*/
|
|
1610
|
-
declare const RedactedMultipleChoiceDataSchema: z.ZodObject<{
|
|
1611
|
-
type: z.ZodLiteral<"multiple-choice">;
|
|
1612
|
-
question: z.ZodString;
|
|
1613
|
-
questionHtml: z.ZodOptional<z.ZodString>;
|
|
1614
|
-
mode: z.ZodEnum<{
|
|
1615
|
-
single: "single";
|
|
1616
|
-
multi: "multi";
|
|
1617
|
-
}>;
|
|
1618
|
-
options: z.ZodArray<z.ZodObject<{
|
|
1619
|
-
id: z.ZodString;
|
|
1620
|
-
text: z.ZodString;
|
|
1621
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1622
|
-
type: z.ZodEnum<{
|
|
1623
|
-
audio: "audio";
|
|
1624
|
-
image: "image";
|
|
1625
|
-
}>;
|
|
1626
|
-
url: z.ZodString;
|
|
1627
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1628
|
-
captionsUrl: z.ZodOptional<z.ZodString>;
|
|
1629
|
-
}, z.core.$strict>>;
|
|
1630
|
-
}, z.core.$strict>>;
|
|
1631
|
-
shuffle: z.ZodOptional<z.ZodBoolean>;
|
|
1632
|
-
/** Marker distinguishing a redacted projection from full activity data. */
|
|
1633
|
-
redacted: z.ZodLiteral<true>;
|
|
1634
|
-
/** Slot identity, carried through redaction so the client and the plan agree. */
|
|
1635
|
-
slotKey: z.ZodOptional<z.ZodString>;
|
|
1636
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
1637
|
-
id: z.ZodString;
|
|
1638
|
-
title: z.ZodString;
|
|
1639
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1640
|
-
type: z.ZodEnum<{
|
|
1641
|
-
video: "video";
|
|
1642
|
-
audio: "audio";
|
|
1643
|
-
image: "image";
|
|
1644
|
-
embed: "embed";
|
|
1645
|
-
}>;
|
|
1646
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1647
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1648
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1649
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1650
|
-
kind: z.ZodEnum<{
|
|
1651
|
-
captions: "captions";
|
|
1652
|
-
subtitles: "subtitles";
|
|
1653
|
-
}>;
|
|
1654
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1655
|
-
srclang: z.ZodString;
|
|
1656
|
-
label: z.ZodString;
|
|
1657
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
1658
|
-
}, z.core.$strict>>>;
|
|
1659
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1660
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
1661
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
1662
|
-
native: "native";
|
|
1663
|
-
minimal: "minimal";
|
|
1664
|
-
}>>;
|
|
1665
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
1666
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
1667
|
-
allow: "allow";
|
|
1668
|
-
none: "none";
|
|
1669
|
-
}>>;
|
|
1670
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
1671
|
-
allow: "allow";
|
|
1672
|
-
fixed: "fixed";
|
|
1673
|
-
}>>;
|
|
1674
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1675
|
-
"hide-download": "hide-download";
|
|
1676
|
-
"hide-rate": "hide-rate";
|
|
1677
|
-
}>>>;
|
|
1678
|
-
}, z.core.$strict>>;
|
|
1679
|
-
}, z.core.$strict>>;
|
|
1680
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1681
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
1682
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1683
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
1684
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
1685
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
1686
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
1687
|
-
}, z.core.$strict>>;
|
|
1688
|
-
}, z.core.$strict>;
|
|
1689
|
-
/** A redacted blank: id and hint only — no accepted answers, no matching rules, no feedback. */
|
|
1690
|
-
declare const RedactedBlankConfigSchema: z.ZodObject<{
|
|
1691
|
-
id: z.ZodString;
|
|
1692
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
1693
|
-
}, z.core.$strict>;
|
|
1694
|
-
/** Redacted Fill-in-the-Blanks data: passage and blank slots, key removed. */
|
|
1695
|
-
declare const RedactedFillInTheBlanksDataSchema: z.ZodObject<{
|
|
1696
|
-
type: z.ZodLiteral<"fill-in-the-blanks">;
|
|
1697
|
-
passage: z.ZodString;
|
|
1698
|
-
passageHtml: z.ZodOptional<z.ZodString>;
|
|
1699
|
-
blanks: z.ZodArray<z.ZodObject<{
|
|
1700
|
-
id: z.ZodString;
|
|
1701
|
-
hint: z.ZodOptional<z.ZodString>;
|
|
1702
|
-
}, z.core.$strict>>;
|
|
1703
|
-
/** Marker distinguishing a redacted projection from full activity data. */
|
|
1704
|
-
redacted: z.ZodLiteral<true>;
|
|
1705
|
-
/** Slot identity, carried through redaction so the client and the plan agree. */
|
|
1706
|
-
slotKey: z.ZodOptional<z.ZodString>;
|
|
1707
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
1708
|
-
id: z.ZodString;
|
|
1709
|
-
title: z.ZodString;
|
|
1710
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1711
|
-
type: z.ZodEnum<{
|
|
1712
|
-
video: "video";
|
|
1713
|
-
audio: "audio";
|
|
1714
|
-
image: "image";
|
|
1715
|
-
embed: "embed";
|
|
1716
|
-
}>;
|
|
1717
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1718
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1719
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1720
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1721
|
-
kind: z.ZodEnum<{
|
|
1722
|
-
captions: "captions";
|
|
1723
|
-
subtitles: "subtitles";
|
|
1724
|
-
}>;
|
|
1725
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1726
|
-
srclang: z.ZodString;
|
|
1727
|
-
label: z.ZodString;
|
|
1728
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
1729
|
-
}, z.core.$strict>>>;
|
|
1730
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1731
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
1732
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
1733
|
-
native: "native";
|
|
1734
|
-
minimal: "minimal";
|
|
1735
|
-
}>>;
|
|
1736
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
1737
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
1738
|
-
allow: "allow";
|
|
1739
|
-
none: "none";
|
|
1740
|
-
}>>;
|
|
1741
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
1742
|
-
allow: "allow";
|
|
1743
|
-
fixed: "fixed";
|
|
1744
|
-
}>>;
|
|
1745
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1746
|
-
"hide-download": "hide-download";
|
|
1747
|
-
"hide-rate": "hide-rate";
|
|
1748
|
-
}>>>;
|
|
1749
|
-
}, z.core.$strict>>;
|
|
1750
|
-
}, z.core.$strict>>;
|
|
1751
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1752
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
1753
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1754
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
1755
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
1756
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
1757
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
1758
|
-
}, z.core.$strict>>;
|
|
1759
|
-
}, z.core.$strict>;
|
|
1760
|
-
/** A redacted choice: exactly what it always was. Which one is correct was never stored here. */
|
|
1761
|
-
declare const RedactedGapSelectChoiceSchema: z.ZodObject<{
|
|
1762
|
-
id: z.ZodString;
|
|
1763
|
-
text: z.ZodString;
|
|
1764
|
-
}, z.core.$strict>;
|
|
1765
|
-
/** A redacted word bank: every choice survives, because the learner picks from them. */
|
|
1766
|
-
declare const RedactedGapSelectBankSchema: z.ZodObject<{
|
|
1767
|
-
id: z.ZodString;
|
|
1768
|
-
choices: z.ZodArray<z.ZodObject<{
|
|
1769
|
-
id: z.ZodString;
|
|
1770
|
-
text: z.ZodString;
|
|
1771
|
-
}, z.core.$strict>>;
|
|
1772
|
-
}, z.core.$strict>;
|
|
1773
|
-
/** A redacted gap: its choice source survives; `correctChoiceId` and feedback do not. */
|
|
1774
|
-
declare const RedactedGapSelectGapSchema: z.ZodObject<{
|
|
1775
|
-
id: z.ZodString;
|
|
1776
|
-
choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1777
|
-
id: z.ZodString;
|
|
1778
|
-
text: z.ZodString;
|
|
1779
|
-
}, z.core.$strict>>>;
|
|
1780
|
-
bankId: z.ZodOptional<z.ZodString>;
|
|
1781
|
-
}, z.core.$strict>;
|
|
1782
|
-
/**
|
|
1783
|
-
* Redacted Gap Select data — the type where redaction **inverts** the
|
|
1784
|
-
* Fill-in-the-Blanks rule, and the reason this is a separate schema rather than
|
|
1785
|
-
* a variant of it.
|
|
1786
|
-
*
|
|
1787
|
-
* In Fill-in-the-Blanks the candidate answers ARE the key, so `acceptedAnswers`
|
|
1788
|
-
* is stripped. Here the learner cannot answer at all without seeing every
|
|
1789
|
-
* choice, so `choices` and `banks` must survive in full and `correctChoiceId`
|
|
1790
|
-
* is the only field withheld. A policy that treated "the list of candidate
|
|
1791
|
-
* answers" as answer-key for both types would ship an unanswerable exam.
|
|
1792
|
-
*
|
|
1793
|
-
* `scoringStrategy` stays answer-key for the same reason it does on the other
|
|
1794
|
-
* two: knowing whether marking is partial tells a learner whether guessing at a
|
|
1795
|
-
* gap is free.
|
|
1796
|
-
*/
|
|
1797
|
-
declare const RedactedGapSelectDataSchema: z.ZodObject<{
|
|
1798
|
-
type: z.ZodLiteral<"gap-select">;
|
|
1799
|
-
passage: z.ZodString;
|
|
1800
|
-
passageHtml: z.ZodOptional<z.ZodString>;
|
|
1801
|
-
gaps: z.ZodArray<z.ZodObject<{
|
|
1802
|
-
id: z.ZodString;
|
|
1803
|
-
choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1804
|
-
id: z.ZodString;
|
|
1805
|
-
text: z.ZodString;
|
|
1806
|
-
}, z.core.$strict>>>;
|
|
1807
|
-
bankId: z.ZodOptional<z.ZodString>;
|
|
1808
|
-
}, z.core.$strict>>;
|
|
1809
|
-
banks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1810
|
-
id: z.ZodString;
|
|
1811
|
-
choices: z.ZodArray<z.ZodObject<{
|
|
1812
|
-
id: z.ZodString;
|
|
1813
|
-
text: z.ZodString;
|
|
1814
|
-
}, z.core.$strict>>;
|
|
1815
|
-
}, z.core.$strict>>>;
|
|
1816
|
-
presentation: z.ZodOptional<z.ZodLiteral<"dropdown">>;
|
|
1817
|
-
shuffleChoices: z.ZodOptional<z.ZodBoolean>;
|
|
1818
|
-
/** Marker distinguishing a redacted projection from full activity data. */
|
|
1819
|
-
redacted: z.ZodLiteral<true>;
|
|
1820
|
-
/** Slot identity, carried through redaction so the client and the plan agree. */
|
|
1821
|
-
slotKey: z.ZodOptional<z.ZodString>;
|
|
1822
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
1823
|
-
id: z.ZodString;
|
|
1824
|
-
title: z.ZodString;
|
|
1825
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1826
|
-
type: z.ZodEnum<{
|
|
1827
|
-
video: "video";
|
|
1828
|
-
audio: "audio";
|
|
1829
|
-
image: "image";
|
|
1830
|
-
embed: "embed";
|
|
1831
|
-
}>;
|
|
1832
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1833
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1834
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1835
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1836
|
-
kind: z.ZodEnum<{
|
|
1837
|
-
captions: "captions";
|
|
1838
|
-
subtitles: "subtitles";
|
|
1839
|
-
}>;
|
|
1840
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1841
|
-
srclang: z.ZodString;
|
|
1842
|
-
label: z.ZodString;
|
|
1843
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
1844
|
-
}, z.core.$strict>>>;
|
|
1845
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1846
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
1847
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
1848
|
-
native: "native";
|
|
1849
|
-
minimal: "minimal";
|
|
1850
|
-
}>>;
|
|
1851
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
1852
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
1853
|
-
allow: "allow";
|
|
1854
|
-
none: "none";
|
|
1855
|
-
}>>;
|
|
1856
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
1857
|
-
allow: "allow";
|
|
1858
|
-
fixed: "fixed";
|
|
1859
|
-
}>>;
|
|
1860
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1861
|
-
"hide-download": "hide-download";
|
|
1862
|
-
"hide-rate": "hide-rate";
|
|
1863
|
-
}>>>;
|
|
1864
|
-
}, z.core.$strict>>;
|
|
1865
|
-
}, z.core.$strict>>;
|
|
1866
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1867
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
1868
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1869
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
1870
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
1871
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
1872
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
1873
|
-
}, z.core.$strict>>;
|
|
1874
|
-
}, z.core.$strict>;
|
|
1875
|
-
/**
|
|
1876
|
-
* Redacted Written Response data: the prompt, word bounds and rubric are
|
|
1877
|
-
* learner-visible (a rubric tells the learner what they are graded on);
|
|
1878
|
-
* authored pass/fail feedback is removed until the grade exists.
|
|
1879
|
-
*/
|
|
1880
|
-
declare const RedactedWrittenResponseDataSchema: z.ZodObject<{
|
|
1881
|
-
type: z.ZodLiteral<"written-response">;
|
|
1882
|
-
prompt: z.ZodString;
|
|
1883
|
-
promptHtml: z.ZodOptional<z.ZodString>;
|
|
1884
|
-
minWords: z.ZodNumber;
|
|
1885
|
-
maxWords: z.ZodNumber;
|
|
1886
|
-
rubric: z.ZodOptional<z.ZodObject<{
|
|
1887
|
-
label: z.ZodOptional<z.ZodString>;
|
|
1888
|
-
criteria: z.ZodArray<z.ZodObject<{
|
|
1889
|
-
name: z.ZodString;
|
|
1890
|
-
description: z.ZodOptional<z.ZodString>;
|
|
1891
|
-
weight: z.ZodNumber;
|
|
1892
|
-
}, z.core.$strict>>;
|
|
1893
|
-
}, z.core.$strict>>;
|
|
1894
|
-
languageTarget: z.ZodOptional<z.ZodString>;
|
|
1895
|
-
/** Marker distinguishing a redacted projection from full activity data. */
|
|
1896
|
-
redacted: z.ZodLiteral<true>;
|
|
1897
|
-
/** Slot identity, carried through redaction so the client and the plan agree. */
|
|
1898
|
-
slotKey: z.ZodOptional<z.ZodString>;
|
|
1899
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
1900
|
-
id: z.ZodString;
|
|
1901
|
-
title: z.ZodString;
|
|
1902
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1903
|
-
type: z.ZodEnum<{
|
|
1904
|
-
video: "video";
|
|
1905
|
-
audio: "audio";
|
|
1906
|
-
image: "image";
|
|
1907
|
-
embed: "embed";
|
|
1908
|
-
}>;
|
|
1909
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1910
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1911
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1912
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1913
|
-
kind: z.ZodEnum<{
|
|
1914
|
-
captions: "captions";
|
|
1915
|
-
subtitles: "subtitles";
|
|
1916
|
-
}>;
|
|
1917
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1918
|
-
srclang: z.ZodString;
|
|
1919
|
-
label: z.ZodString;
|
|
1920
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
1921
|
-
}, z.core.$strict>>>;
|
|
1922
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1923
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
1924
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
1925
|
-
native: "native";
|
|
1926
|
-
minimal: "minimal";
|
|
1927
|
-
}>>;
|
|
1928
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
1929
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
1930
|
-
allow: "allow";
|
|
1931
|
-
none: "none";
|
|
1932
|
-
}>>;
|
|
1933
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
1934
|
-
allow: "allow";
|
|
1935
|
-
fixed: "fixed";
|
|
1936
|
-
}>>;
|
|
1937
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1938
|
-
"hide-download": "hide-download";
|
|
1939
|
-
"hide-rate": "hide-rate";
|
|
1940
|
-
}>>>;
|
|
1941
|
-
}, z.core.$strict>>;
|
|
1942
|
-
}, z.core.$strict>>;
|
|
1943
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
1944
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
1945
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1946
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
1947
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
1948
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
1949
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
1950
|
-
}, z.core.$strict>>;
|
|
1951
|
-
}, z.core.$strict>;
|
|
1952
|
-
/** A redacted slow recording: unchanged — it is public, and it never carried captions or a policy. */
|
|
1953
|
-
declare const RedactedDictationSlowMediaSchema: z.ZodObject<{
|
|
1954
|
-
type: z.ZodLiteral<"audio">;
|
|
1955
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1956
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1957
|
-
}, z.core.$strict>;
|
|
1958
|
-
/**
|
|
1959
|
-
* Redacted Dictation data: the recording(s) and the hint mode survive; the
|
|
1960
|
-
* transcript, the accepted alternatives and the tolerance — the whole answer
|
|
1961
|
-
* key — do not. A `progressive-words` hint mode reveals nothing by itself: the
|
|
1962
|
-
* words it would reveal are the transcript, and that is gone.
|
|
1963
|
-
*
|
|
1964
|
-
* Three rules of the content schema are repeated here, because a projection
|
|
1965
|
-
* built by hand never passed through it: captions on the recording ARE the
|
|
1966
|
-
* answer, so a payload carrying them is not learner-safe; a slow recording
|
|
1967
|
-
* beside a play budget is an unbudgeted copy of the budgeted content; and so is
|
|
1968
|
-
* a slow recording with no recording beside it, which in a group sits beside a
|
|
1969
|
-
* stimulus recording that may be budgeted.
|
|
1970
|
-
*/
|
|
1971
|
-
declare const RedactedDictationDataSchema: z.ZodObject<{
|
|
1972
|
-
type: z.ZodLiteral<"dictation">;
|
|
1973
|
-
slowMedia: z.ZodOptional<z.ZodObject<{
|
|
1974
|
-
type: z.ZodLiteral<"audio">;
|
|
1975
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1976
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1977
|
-
}, z.core.$strict>>;
|
|
1978
|
-
hints: z.ZodOptional<z.ZodObject<{
|
|
1979
|
-
mode: z.ZodLiteral<"progressive-words">;
|
|
1980
|
-
}, z.core.$strict>>;
|
|
1981
|
-
/** Marker distinguishing a redacted projection from full activity data. */
|
|
1982
|
-
redacted: z.ZodLiteral<true>;
|
|
1983
|
-
/** Slot identity, carried through redaction so the client and the plan agree. */
|
|
1984
|
-
slotKey: z.ZodOptional<z.ZodString>;
|
|
1985
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
1986
|
-
id: z.ZodString;
|
|
1987
|
-
title: z.ZodString;
|
|
1988
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
1989
|
-
type: z.ZodEnum<{
|
|
1990
|
-
video: "video";
|
|
1991
|
-
audio: "audio";
|
|
1992
|
-
image: "image";
|
|
1993
|
-
embed: "embed";
|
|
1994
|
-
}>;
|
|
1995
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
1996
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
1997
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
1998
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1999
|
-
kind: z.ZodEnum<{
|
|
2000
|
-
captions: "captions";
|
|
2001
|
-
subtitles: "subtitles";
|
|
2002
|
-
}>;
|
|
2003
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
2004
|
-
srclang: z.ZodString;
|
|
2005
|
-
label: z.ZodString;
|
|
2006
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
2007
|
-
}, z.core.$strict>>>;
|
|
2008
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
2009
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
2010
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
2011
|
-
native: "native";
|
|
2012
|
-
minimal: "minimal";
|
|
2013
|
-
}>>;
|
|
2014
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
2015
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
2016
|
-
allow: "allow";
|
|
2017
|
-
none: "none";
|
|
2018
|
-
}>>;
|
|
2019
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
2020
|
-
allow: "allow";
|
|
2021
|
-
fixed: "fixed";
|
|
2022
|
-
}>>;
|
|
2023
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
2024
|
-
"hide-download": "hide-download";
|
|
2025
|
-
"hide-rate": "hide-rate";
|
|
2026
|
-
}>>>;
|
|
2027
|
-
}, z.core.$strict>>;
|
|
2028
|
-
}, z.core.$strict>>;
|
|
2029
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
2030
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
2031
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2032
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
2033
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
2034
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
2035
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
2036
|
-
}, z.core.$strict>>;
|
|
2037
|
-
}, z.core.$strict>;
|
|
2038
|
-
/**
|
|
2039
|
-
* Redacted Read Aloud data: everything survives, because a read-aloud item has
|
|
2040
|
-
* no answer key — the learner is shown the very text they are asked to read.
|
|
2041
|
-
* What redaction removes is the authored pass/fail feedback, which is written
|
|
2042
|
-
* about a grade that does not exist yet.
|
|
2043
|
-
*
|
|
2044
|
-
* `locale` is REQUIRED here, overriding the optional one on the shared base: it
|
|
2045
|
-
* decides the grade (an assessment made for another locale is unscorable), so a
|
|
2046
|
-
* projection that dropped it would send an exam client an item no assessor could
|
|
2047
|
-
* be asked for. Four rules of the content schema are repeated, because a
|
|
2048
|
-
* projection built by hand never passed through it: the recording is audio, a
|
|
2049
|
-
* slow recording accompanies a recording, is a different file, and never sits
|
|
2050
|
-
* beside a play budget — the last two being how an unbudgeted copy of budgeted
|
|
2051
|
-
* content would reach a learner.
|
|
2052
|
-
*/
|
|
2053
|
-
declare const RedactedReadAloudDataSchema: z.ZodObject<{
|
|
2054
|
-
type: z.ZodLiteral<"read-aloud">;
|
|
2055
|
-
locale: z.ZodString;
|
|
2056
|
-
instructions: z.ZodOptional<z.ZodString>;
|
|
2057
|
-
referenceText: z.ZodString;
|
|
2058
|
-
slowMedia: z.ZodOptional<z.ZodObject<{
|
|
2059
|
-
type: z.ZodLiteral<"audio">;
|
|
2060
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
2061
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
2062
|
-
}, z.core.$strict>>;
|
|
2063
|
-
recording: z.ZodObject<{
|
|
2064
|
-
maxSeconds: z.ZodNumber;
|
|
2065
|
-
minSeconds: z.ZodOptional<z.ZodNumber>;
|
|
2066
|
-
maxTakes: z.ZodOptional<z.ZodNumber>;
|
|
2067
|
-
}, z.core.$strict>;
|
|
2068
|
-
scoring: z.ZodObject<{
|
|
2069
|
-
dimensions: z.ZodArray<z.ZodObject<{
|
|
2070
|
-
name: z.ZodEnum<{
|
|
2071
|
-
accuracy: "accuracy";
|
|
2072
|
-
fluency: "fluency";
|
|
2073
|
-
completeness: "completeness";
|
|
2074
|
-
prosody: "prosody";
|
|
2075
|
-
}>;
|
|
2076
|
-
weight: z.ZodNumber;
|
|
2077
|
-
}, z.core.$strict>>;
|
|
2078
|
-
}, z.core.$strict>;
|
|
2079
|
-
/** Marker distinguishing a redacted projection from full activity data. */
|
|
2080
|
-
redacted: z.ZodLiteral<true>;
|
|
2081
|
-
/** Slot identity, carried through redaction so the client and the plan agree. */
|
|
2082
|
-
slotKey: z.ZodOptional<z.ZodString>;
|
|
2083
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
2084
|
-
id: z.ZodString;
|
|
2085
|
-
title: z.ZodString;
|
|
2086
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
2087
|
-
type: z.ZodEnum<{
|
|
2088
|
-
video: "video";
|
|
2089
|
-
audio: "audio";
|
|
2090
|
-
image: "image";
|
|
2091
|
-
embed: "embed";
|
|
2092
|
-
}>;
|
|
2093
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
2094
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
2095
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
2096
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2097
|
-
kind: z.ZodEnum<{
|
|
2098
|
-
captions: "captions";
|
|
2099
|
-
subtitles: "subtitles";
|
|
2100
|
-
}>;
|
|
2101
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
2102
|
-
srclang: z.ZodString;
|
|
2103
|
-
label: z.ZodString;
|
|
2104
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
2105
|
-
}, z.core.$strict>>>;
|
|
2106
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
2107
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
2108
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
2109
|
-
native: "native";
|
|
2110
|
-
minimal: "minimal";
|
|
2111
|
-
}>>;
|
|
2112
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
2113
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
2114
|
-
allow: "allow";
|
|
2115
|
-
none: "none";
|
|
2116
|
-
}>>;
|
|
2117
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
2118
|
-
allow: "allow";
|
|
2119
|
-
fixed: "fixed";
|
|
2120
|
-
}>>;
|
|
2121
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
2122
|
-
"hide-download": "hide-download";
|
|
2123
|
-
"hide-rate": "hide-rate";
|
|
2124
|
-
}>>>;
|
|
2125
|
-
}, z.core.$strict>>;
|
|
2126
|
-
}, z.core.$strict>>;
|
|
2127
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
2128
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2129
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
2130
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
2131
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
2132
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
2133
|
-
}, z.core.$strict>>;
|
|
2134
|
-
}, z.core.$strict>;
|
|
2135
|
-
/**
|
|
2136
|
-
* The learner-safe SHAPE of each built-in type, derived from the strict schema
|
|
2137
|
-
* above rather than hand-written beside it.
|
|
2138
|
-
*
|
|
2139
|
-
* `redact()` returns {@link RedactedActivityData}, which proves a payload is
|
|
2140
|
-
* learner-safe but is index-signature typed — it deliberately says nothing
|
|
2141
|
-
* about what the payload still CONTAINS. That is right for the assertion and
|
|
2142
|
-
* useless for anything that has to render or transport the result, so every
|
|
2143
|
-
* integrator ends up re-declaring these interfaces by hand and they drift the
|
|
2144
|
-
* moment a schema changes. Deriving them with `z.infer` means the type and the
|
|
2145
|
-
* validator can never disagree.
|
|
2146
|
-
*
|
|
2147
|
-
* Use them for the payload a server sends an exam client, and for the props of
|
|
2148
|
-
* a renderer that must never see an answer key.
|
|
2149
|
-
*/
|
|
2150
|
-
type RedactedMultipleChoiceOption = z.infer<typeof RedactedMultipleChoiceOptionSchema>;
|
|
2151
|
-
/** An option's picture or recording, unchanged by redaction — it is what the learner picks. */
|
|
2152
|
-
type RedactedMultipleChoiceOptionMedia = z.infer<typeof RedactedMultipleChoiceOptionMediaSchema>;
|
|
2153
|
-
/** A Multiple Choice item with the answer key, feedback and strategy removed. */
|
|
2154
|
-
type RedactedMultipleChoiceData = z.infer<typeof RedactedMultipleChoiceDataSchema>;
|
|
2155
|
-
/** A blank with its accepted answers and matching rules removed; the hint survives. */
|
|
2156
|
-
type RedactedBlankConfig = z.infer<typeof RedactedBlankConfigSchema>;
|
|
2157
|
-
/** A Fill-in-the-Blanks item with every accepted answer removed. */
|
|
2158
|
-
type RedactedFillInTheBlanksData = z.infer<typeof RedactedFillInTheBlanksDataSchema>;
|
|
2159
|
-
/** A Written Response item; the rubric survives, because it tells the learner what is assessed. */
|
|
2160
|
-
type RedactedWrittenResponseData = z.infer<typeof RedactedWrittenResponseDataSchema>;
|
|
2161
|
-
/** A selectable choice, unchanged by redaction. */
|
|
2162
|
-
type RedactedGapSelectChoice = z.infer<typeof RedactedGapSelectChoiceSchema>;
|
|
2163
|
-
/** A word bank, unchanged by redaction — the learner picks from it. */
|
|
2164
|
-
type RedactedGapSelectBank = z.infer<typeof RedactedGapSelectBankSchema>;
|
|
2165
|
-
/** A gap with its `correctChoiceId` removed; every choice it offers survives. */
|
|
2166
|
-
type RedactedGapSelectGap = z.infer<typeof RedactedGapSelectGapSchema>;
|
|
2167
|
-
/** A Gap Select item the learner can still answer: choices intact, answer key gone. */
|
|
2168
|
-
type RedactedGapSelectData = z.infer<typeof RedactedGapSelectDataSchema>;
|
|
2169
|
-
/** The slower recording of a dictation, unchanged by redaction. */
|
|
2170
|
-
type RedactedDictationSlowMedia = z.infer<typeof RedactedDictationSlowMediaSchema>;
|
|
2171
|
-
/** A Dictation item with its transcript, accepted alternatives and tolerances removed. */
|
|
2172
|
-
type RedactedDictationData = z.infer<typeof RedactedDictationDataSchema>;
|
|
2173
|
-
/**
|
|
2174
|
-
* A Read Aloud item, which keeps everything but the authored feedback: the text
|
|
2175
|
-
* to read is what the learner is asked to read. The slow recording needs no
|
|
2176
|
-
* redacted counterpart of its own — the content schema for it is already strict.
|
|
2177
|
-
*/
|
|
2178
|
-
type RedactedReadAloudData = z.infer<typeof RedactedReadAloudDataSchema>;
|
|
2179
|
-
/**
|
|
2180
|
-
* Discriminated union of every built-in redacted activity. Narrow it on
|
|
2181
|
-
* `type`, exactly as you would {@link ActivityData}:
|
|
2182
|
-
*
|
|
2183
|
-
* ```ts
|
|
2184
|
-
* function render(item: RedactedActivity) {
|
|
2185
|
-
* if (item.type === 'multiple-choice') {
|
|
2186
|
-
* return item.options.map((option) => option.text); // no `isCorrect` to leak
|
|
2187
|
-
* }
|
|
2188
|
-
* }
|
|
2189
|
-
* ```
|
|
2190
|
-
*/
|
|
2191
|
-
type RedactedActivity = RedactedMultipleChoiceData | RedactedFillInTheBlanksData | RedactedWrittenResponseData | RedactedGapSelectData | RedactedDictationData | RedactedReadAloudData;
|
|
2192
|
-
|
|
2193
|
-
/** Zod schema for a single rubric criterion. Loose: unknown keys preserved. */
|
|
2194
|
-
declare const WrittenResponseRubricCriterionSchema: z.ZodObject<{
|
|
2195
|
-
name: z.ZodString;
|
|
2196
|
-
description: z.ZodOptional<z.ZodString>;
|
|
2197
|
-
weight: z.ZodNumber;
|
|
2198
|
-
}, z.core.$loose>;
|
|
2199
|
-
/** Zod schema for a written-response grading rubric. Loose: unknown keys preserved. */
|
|
2200
|
-
declare const WrittenResponseRubricSchema: z.ZodObject<{
|
|
2201
|
-
label: z.ZodOptional<z.ZodString>;
|
|
2202
|
-
criteria: z.ZodArray<z.ZodObject<{
|
|
2203
|
-
name: z.ZodString;
|
|
2204
|
-
description: z.ZodOptional<z.ZodString>;
|
|
2205
|
-
weight: z.ZodNumber;
|
|
2206
|
-
}, z.core.$loose>>;
|
|
2207
|
-
}, z.core.$loose>;
|
|
2208
|
-
/**
|
|
2209
|
-
* Zod schema validating the Written Response activity data contract (Req 22).
|
|
2210
|
-
*
|
|
2211
|
-
* Wire-format constraints (Req 22.9): field names are locked for
|
|
2212
|
-
* byte-compatibility with consumer-stored rows, and the schema is loose at
|
|
2213
|
-
* EVERY level (Req 22.5) — unknown top-level keys, `promptHtml`, `rubric`
|
|
2214
|
-
* sidecars and any future fields survive `validateActivity` verbatim.
|
|
2215
|
-
*/
|
|
2216
|
-
declare const WrittenResponseDataSchema: z.ZodObject<{
|
|
2217
|
-
schemaVersion: z.ZodLiteral<"1.0">;
|
|
2218
|
-
type: z.ZodLiteral<"written-response">;
|
|
2219
|
-
id: z.ZodString;
|
|
2220
|
-
title: z.ZodString;
|
|
2221
|
-
prompt: z.ZodString;
|
|
2222
|
-
promptHtml: z.ZodOptional<z.ZodString>;
|
|
2223
|
-
minWords: z.ZodNumber;
|
|
2224
|
-
maxWords: z.ZodNumber;
|
|
2225
|
-
rubric: z.ZodOptional<z.ZodObject<{
|
|
2226
|
-
label: z.ZodOptional<z.ZodString>;
|
|
2227
|
-
criteria: z.ZodArray<z.ZodObject<{
|
|
2228
|
-
name: z.ZodString;
|
|
2229
|
-
description: z.ZodOptional<z.ZodString>;
|
|
2230
|
-
weight: z.ZodNumber;
|
|
2231
|
-
}, z.core.$loose>>;
|
|
2232
|
-
}, z.core.$loose>>;
|
|
2233
|
-
languageTarget: z.ZodOptional<z.ZodString>;
|
|
2234
|
-
media: z.ZodOptional<z.ZodObject<{
|
|
2235
|
-
type: z.ZodEnum<{
|
|
2236
|
-
video: "video";
|
|
2237
|
-
audio: "audio";
|
|
2238
|
-
image: "image";
|
|
2239
|
-
embed: "embed";
|
|
2240
|
-
}>;
|
|
2241
|
-
url: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
2242
|
-
alt: z.ZodOptional<z.ZodString>;
|
|
2243
|
-
captionsUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
2244
|
-
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2245
|
-
kind: z.ZodEnum<{
|
|
2246
|
-
captions: "captions";
|
|
2247
|
-
subtitles: "subtitles";
|
|
2248
|
-
}>;
|
|
2249
|
-
src: z.ZodUnion<readonly [z.ZodURL, z.ZodString]>;
|
|
2250
|
-
srclang: z.ZodString;
|
|
2251
|
-
label: z.ZodString;
|
|
2252
|
-
default: z.ZodOptional<z.ZodBoolean>;
|
|
2253
|
-
}, z.core.$strict>>>;
|
|
2254
|
-
poster: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodString]>>;
|
|
2255
|
-
playback: z.ZodOptional<z.ZodObject<{
|
|
2256
|
-
controls: z.ZodOptional<z.ZodEnum<{
|
|
2257
|
-
native: "native";
|
|
2258
|
-
minimal: "minimal";
|
|
2259
|
-
}>>;
|
|
2260
|
-
maxPlays: z.ZodOptional<z.ZodNumber>;
|
|
2261
|
-
seek: z.ZodOptional<z.ZodEnum<{
|
|
2262
|
-
allow: "allow";
|
|
2263
|
-
none: "none";
|
|
2264
|
-
}>>;
|
|
2265
|
-
rate: z.ZodOptional<z.ZodEnum<{
|
|
2266
|
-
allow: "allow";
|
|
2267
|
-
fixed: "fixed";
|
|
2268
|
-
}>>;
|
|
2269
|
-
nativeControlHints: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
2270
|
-
"hide-download": "hide-download";
|
|
2271
|
-
"hide-rate": "hide-rate";
|
|
2272
|
-
}>>>;
|
|
2273
|
-
}, z.core.$strict>>;
|
|
2274
|
-
}, z.core.$loose>>;
|
|
2275
|
-
feedback: z.ZodOptional<z.ZodObject<{
|
|
2276
|
-
correct: z.ZodOptional<z.ZodString>;
|
|
2277
|
-
incorrect: z.ZodOptional<z.ZodString>;
|
|
2278
|
-
}, z.core.$loose>>;
|
|
2279
|
-
passThreshold: z.ZodOptional<z.ZodNumber>;
|
|
2280
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
2281
|
-
learningObjectives: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2282
|
-
difficultyLevel: z.ZodOptional<z.ZodLiteral<1 | 2 | 4 | 3 | 5>>;
|
|
2283
|
-
ai: z.ZodOptional<z.ZodObject<{
|
|
2284
|
-
explanations: z.ZodOptional<z.ZodBoolean>;
|
|
2285
|
-
hints: z.ZodOptional<z.ZodBoolean>;
|
|
2286
|
-
}, z.core.$loose>>;
|
|
2287
|
-
}, z.core.$loose>;
|
|
2288
|
-
|
|
2289
|
-
/**
|
|
2290
|
-
* Validates raw activity data against the schema registered for the given
|
|
2291
|
-
* activity type (built-in or consumer-registered via `registerActivityType`).
|
|
2292
|
-
*
|
|
2293
|
-
* Unknown keys are PRESERVED, not stripped: every built-in schema is loose,
|
|
2294
|
-
* so consumer sidecar fields and forward-version fields survive validation
|
|
2295
|
-
* verbatim in the returned `data`.
|
|
2296
|
-
*
|
|
2297
|
-
* @returns `{ success: true, data }` with the typed, validated data, or
|
|
2298
|
-
* `{ success: false, errors }` with one entry per failed constraint.
|
|
2299
|
-
* @throws UnknownActivityTypeError when `type` has no registered descriptor.
|
|
2300
|
-
*/
|
|
2301
|
-
declare function validateActivity<T extends ActivityType>(type: T, data: unknown): ValidationResult<ActivityDataMap[T]>;
|
|
2302
|
-
|
|
2303
|
-
export { RedactedReadAloudDataSchema as $, AiPermissionsSchema as A, BlankConfigSchema as B, RedactedFillInTheBlanksDataSchema as C, DictationDataSchema as D, type RedactedGapSelectBank as E, FeedbackSchema as F, GapSelectBankSchema as G, RedactedGapSelectBankSchema as H, type ItemGroup as I, type RedactedGapSelectChoice as J, RedactedGapSelectChoiceSchema as K, type RedactedGapSelectData as L, MediaPlaybackSchema as M, NativeControlHintSchema as N, RedactedGapSelectDataSchema as O, type RedactedGapSelectGap as P, RedactedGapSelectGapSchema as Q, ReadAloudDataSchema as R, RedactedItemGroupSchema as S, RedactedMediaSchema as T, type RedactedMultipleChoiceData as U, RedactedMultipleChoiceDataSchema as V, type RedactedMultipleChoiceOption as W, type RedactedMultipleChoiceOptionMedia as X, RedactedMultipleChoiceOptionMediaSchema as Y, RedactedMultipleChoiceOptionSchema as Z, type RedactedReadAloudData as _, DictationEquivalenceSchema as a, type RedactedStimulus as a0, RedactedStimulusSchema as a1, type RedactedWrittenResponseData as a2, RedactedWrittenResponseDataSchema as a3, type SequenceEntry as a4, type SequenceSlot as a5, type SequenceSlotGroup as a6, type Stimulus as a7, type StimulusKind as a8, StimulusSchema as a9, TextMatchPolicySchema as aa, type TimelineChapter as ab, TimelineChapterSchema as ac, type TimelineCue as ad, TimelineCueSchema as ae, WrittenResponseDataSchema as af, WrittenResponseRubricCriterionSchema as ag, WrittenResponseRubricSchema as ah, dictationJsonSchema as ai, fillInTheBlanksJsonSchema as aj, gapSelectJsonSchema as ak, itemGroupJsonSchema as al, jsonSchemaFor as am, multipleChoiceJsonSchema as an, readAloudJsonSchema as ao, stimulusJsonSchema as ap, validateActivity as aq, validateItemGroup as ar, writtenResponseJsonSchema as as, DictationSlowMediaSchema as b, DictationToleranceSchema as c, FillInTheBlanksDataSchema as d, GapSelectChoiceSchema as e, GapSelectDataSchema as f, GapSelectGapSchema as g, ItemGroupSchema as h, type MediaProgress as i, MediaSchema as j, type MediaTimeline as k, MediaTimelineSchema as l, MediaTrackSchema as m, MediaUrlSchema as n, MultipleChoiceDataSchema as o, MultipleChoiceOptionMediaSchema as p, MultipleChoiceOptionSchema as q, ReadAloudSlowMediaSchema as r, type RedactedActivity as s, type RedactedBlankConfig as t, RedactedBlankConfigSchema as u, type RedactedDictationData as v, RedactedDictationDataSchema as w, type RedactedDictationSlowMedia as x, RedactedDictationSlowMediaSchema as y, type RedactedFillInTheBlanksData as z };
|