@pie-element/match 13.0.4-next.20261011174919 → 13.0.4

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.
@@ -0,0 +1,478 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://cdn.jsdelivr.net/npm/@pie-element/match@13.0.4/dist/schemas/model.schema.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "id": {
7
+ "type": "string",
8
+ "description": "Identifier to identify the Pie Element in html markup, Must be unique within a pie item config."
9
+ },
10
+ "element": {
11
+ "type": "string",
12
+ "description": "The html Element tag name: the key in the item config's `elements` map, e.g. \"multiple-choice\""
13
+ },
14
+ "accessibilityCatalogs": {
15
+ "type": "array",
16
+ "items": {
17
+ "$ref": "#/definitions/AccessibilityCatalog"
18
+ },
19
+ "description": "QTI-aligned accessibility catalogs whose cards dock to content nodes by `data-catalog-idref`"
20
+ },
21
+ "feedback": {
22
+ "$ref": "#/definitions/MatchFeedback",
23
+ "description": "Feedback for student responses"
24
+ },
25
+ "headers": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "string"
29
+ },
30
+ "description": "Array of strings for column headers; the first heads the question column"
31
+ },
32
+ "layout": {
33
+ "type": "number",
34
+ "description": "The number of columns to be presented, the question column included"
35
+ },
36
+ "lockChoiceOrder": {
37
+ "type": "boolean",
38
+ "description": "Indicates if the order of the rows should be randomly sorted on render"
39
+ },
40
+ "partialScoring": {
41
+ "type": "boolean",
42
+ "description": "Indicates if partial scoring should be used"
43
+ },
44
+ "choiceMode": {
45
+ "type": "string",
46
+ "enum": [
47
+ "radio",
48
+ "checkbox"
49
+ ],
50
+ "description": "Indicates if the control for responses should be single (radio) or multiple (checkbox)"
51
+ },
52
+ "prompt": {
53
+ "type": "string",
54
+ "description": "The question prompt or item stem"
55
+ },
56
+ "promptEnabled": {
57
+ "type": "boolean",
58
+ "description": "Determines if prompt should show"
59
+ },
60
+ "rows": {
61
+ "type": "array",
62
+ "items": {
63
+ "$ref": "#/definitions/MatchRow"
64
+ },
65
+ "description": "The rows of choices to be presented."
66
+ },
67
+ "rationale": {
68
+ "type": "string",
69
+ "description": "Indicates value for rationale"
70
+ },
71
+ "scoringType": {
72
+ "type": "string",
73
+ "enum": [
74
+ "auto",
75
+ "rubric"
76
+ ],
77
+ "description": "Indicates scoring type"
78
+ },
79
+ "studentInstructions": {
80
+ "type": "string",
81
+ "description": "Not read by this element"
82
+ },
83
+ "teacherInstructions": {
84
+ "type": "string",
85
+ "description": "Indicates teacher instructions"
86
+ },
87
+ "feedbackEnabled": {
88
+ "type": "boolean",
89
+ "description": "Indicates if Feedback is enabled"
90
+ },
91
+ "rationaleEnabled": {
92
+ "type": "boolean",
93
+ "description": "Indicates if Rationale are enabled"
94
+ },
95
+ "spellCheckEnabled": {
96
+ "type": "boolean",
97
+ "description": "Indicates if spellcheck is enabled for the author. Default value is true"
98
+ },
99
+ "studentInstructionsEnabled": {
100
+ "type": "boolean",
101
+ "description": "Indicates if Student Instructions are enabled"
102
+ },
103
+ "teacherInstructionsEnabled": {
104
+ "type": "boolean",
105
+ "description": "Indicates if Teacher Instructions are enabled"
106
+ },
107
+ "toolbarEditorPosition": {
108
+ "type": "string",
109
+ "enum": [
110
+ "bottom",
111
+ "top"
112
+ ],
113
+ "description": "Indicates the editor's toolbar position which can be 'bottom' or 'top'",
114
+ "default": "bottom"
115
+ },
116
+ "rubricEnabled": {
117
+ "type": "boolean",
118
+ "description": "Indicates if Rubric is enabled"
119
+ },
120
+ "language": {
121
+ "type": "string",
122
+ "description": "Indicates the language of the component Supported options: en, es, en_US, en-US, es_ES, es-ES, es_MX, es-MX"
123
+ },
124
+ "extraCSSRules": {
125
+ "$ref": "#/definitions/ExtraCSSRules",
126
+ "description": "Host-supplied CSS scoped to the element"
127
+ },
128
+ "enableImages": {
129
+ "type": "boolean",
130
+ "description": "Enables images in row titles when the host's configuration sets no `rows.inputConfiguration`.\n\nDeprecated: Use the configuration's `rows.inputConfiguration`.",
131
+ "deprecated": true
132
+ },
133
+ "config": {
134
+ "type": "object",
135
+ "additionalProperties": {},
136
+ "description": "The delivery merges these keys over the model.\n\nDeprecated: Set the keys on the model itself.",
137
+ "deprecated": true
138
+ }
139
+ },
140
+ "required": [
141
+ "element",
142
+ "headers",
143
+ "id",
144
+ "rows"
145
+ ],
146
+ "description": "Model for the `@pie-element/match` Interaction",
147
+ "definitions": {
148
+ "AccessibilityCatalog": {
149
+ "type": "object",
150
+ "properties": {
151
+ "identifier": {
152
+ "type": "string"
153
+ },
154
+ "cards": {
155
+ "type": "array",
156
+ "items": {
157
+ "$ref": "#/definitions/CatalogCard"
158
+ }
159
+ }
160
+ },
161
+ "required": [
162
+ "identifier",
163
+ "cards"
164
+ ]
165
+ },
166
+ "CatalogCard": {
167
+ "type": "object",
168
+ "properties": {
169
+ "catalog": {
170
+ "type": "string"
171
+ },
172
+ "language": {
173
+ "type": "string"
174
+ },
175
+ "content": {
176
+ "type": "string"
177
+ },
178
+ "payload": {
179
+ "$ref": "#/definitions/CatalogCardPayload"
180
+ }
181
+ },
182
+ "required": [
183
+ "catalog"
184
+ ],
185
+ "description": "QTI-aligned accessibility catalog entry: one alternate representation of a content node, docked to it by `data-catalog-idref`.\n\nMaps onto QTI 3's `qti-card`. `catalog` is QTI's `@support` and is the only discriminant — there is deliberately no second `kind` field. `language` is the card entry's `xml:lang`. QTI's single content slot is represented by exactly one of two fields, never both, with nothing mirrored between them:\n\n- `content` — the string form, for alternates a string can express: SSML for `spoken`, plain text for `simplified-language`.\n- `payload` — the structured form, for what a string cannot express. Today only a signing video.\n\nOne generic payload slot rather than a field per accommodation (`signLanguage`, `braille`, …), which is the shape pie-players canonicalises and the shape this repo now follows. A field per accommodation makes every new structured alternate a breaking widening of this type in every consumer that reads cards, and it gives the same fact two names across repos — which produced a real bug: a card carrying `signLanguage` rendered its video in the player and was simultaneously reported as carrying no payload by the player's \"what alternates exist\" path, because only one of the two read paths knew about the alias.\n\n`catalog` is a bare `string` because the vocabulary is open-ended and unknown tokens must be ignored rather than rejected. TypeScript therefore cannot express \"a `sign-language` card must carry a payload\", so a `{ catalog: 'sign-language', content: '<url>' }` object still satisfies this type. That legacy bare-URL form is not supported: runtime validation on the consuming side must reject it rather than render the URL as visible text. Narrow with `isSignLanguageCard`."
186
+ },
187
+ "CatalogCardPayload": {
188
+ "anyOf": [
189
+ {
190
+ "$ref": "#/definitions/SignLanguageCardPayload"
191
+ },
192
+ {
193
+ "$ref": "#/definitions/SpokenAudioCardPayload"
194
+ }
195
+ ],
196
+ "description": "The structured forms a card's `payload` may take.\n\nWhich one applies is decided by the card's `catalog`, so this union carries no discriminant of its own — a second discriminant could contradict the first. Consumers select a card by catalog type and then validate the payload structurally, which they must do regardless: catalog data is authored, wire-facing and untrusted."
197
+ },
198
+ "SignLanguageCardPayload": {
199
+ "type": "object",
200
+ "properties": {
201
+ "signLang": {
202
+ "type": "string",
203
+ "description": "Language tag for the signed translation — BCP 47, which admits ISO 639-3 subtags for languages with no 639-1/2 code. \"ase\" is ASL, matching QTI 3 `xml:lang`.\n\nThis is the language of the *adaptation*, not the item's base content language (AfA/PNP's `languageOfAdaptation`). The distinction is load bearing: a Spanish item's signed alternate is LSM, not ASL, so `signLang` must never be inferred from the item or assessment content language.\n\nOptional, and redundant on almost every card. The card's `language` states the same code and is the only field pie-players resolves a card on — resolution runs before anything knows the card is a signing card, so it can only key on the generic field — and the player falls back to it when this is absent. Author it only where the two differ: a card tagged with the item's content language (`language: 'en-US'`, `signLang: 'ase'`) so resolution reaches it by the default-language rung. The pie-api-aws importer emits `language` alone."
204
+ },
205
+ "media": {
206
+ "$ref": "#/definitions/MediaAssetRef"
207
+ },
208
+ "fragment": {
209
+ "$ref": "#/definitions/MediaFragmentRange"
210
+ }
211
+ },
212
+ "required": [
213
+ "media"
214
+ ],
215
+ "description": "Payload for a `sign-language` catalog card: a signed translation of the content node the card is docked to."
216
+ },
217
+ "MediaAssetRef": {
218
+ "type": "object",
219
+ "properties": {
220
+ "version": {
221
+ "type": "number",
222
+ "const": 1
223
+ },
224
+ "id": {
225
+ "type": "string"
226
+ },
227
+ "kind": {
228
+ "$ref": "#/definitions/MediaKind"
229
+ },
230
+ "sources": {
231
+ "type": "array",
232
+ "items": {
233
+ "$ref": "#/definitions/MediaSource"
234
+ }
235
+ },
236
+ "poster": {
237
+ "type": "string"
238
+ },
239
+ "thumbnail": {
240
+ "type": "string"
241
+ },
242
+ "durationSeconds": {
243
+ "type": "number"
244
+ },
245
+ "tracks": {
246
+ "type": "array",
247
+ "items": {
248
+ "$ref": "#/definitions/TextTrackRef"
249
+ }
250
+ },
251
+ "transcript": {
252
+ "$ref": "#/definitions/TranscriptRef"
253
+ },
254
+ "label": {
255
+ "type": "string"
256
+ },
257
+ "description": {
258
+ "type": "string"
259
+ },
260
+ "lang": {
261
+ "type": "string",
262
+ "description": "Language of the asset itself, as authored metadata. Sign-language cards leave it unset: the card's `language` already states the adaptation language, and a second copy is a second thing to keep in agreement."
263
+ }
264
+ },
265
+ "required": [
266
+ "version",
267
+ "id",
268
+ "kind",
269
+ "sources"
270
+ ],
271
+ "description": "Reference to a media asset and its playable encodings.\n\nStructurally mirrors the `MediaAssetRef` in the pie-players `media-asset-contract` PRD. The two definitions are deliberately kept as separate declarations rather than a shared package dependency: this repo owns the item-model side of the contract, pie-players owns the player side, and both read the same authored JSON, so structural typing is sufficient for interop. Fixture parity — not a package edge — is what pins them together.\n\nSign-language catalog cards were the first consumer and use only the core source fields. The optional presentation, track, and transcript metadata is declared for broader consumers such as video stimuli; it remains meaningless for a signing clip, where captions would duplicate the text already on screen."
272
+ },
273
+ "MediaKind": {
274
+ "type": "string",
275
+ "enum": [
276
+ "image",
277
+ "audio",
278
+ "video",
279
+ "other"
280
+ ]
281
+ },
282
+ "MediaSource": {
283
+ "type": "object",
284
+ "properties": {
285
+ "src": {
286
+ "type": "string"
287
+ },
288
+ "type": {
289
+ "type": "string",
290
+ "description": "MIME type, e.g. \"video/mp4\"."
291
+ },
292
+ "width": {
293
+ "type": "number"
294
+ },
295
+ "height": {
296
+ "type": "number"
297
+ },
298
+ "bitrate": {
299
+ "type": "number"
300
+ }
301
+ },
302
+ "required": [
303
+ "src"
304
+ ],
305
+ "description": "One playable encoding of a media asset."
306
+ },
307
+ "TextTrackRef": {
308
+ "type": "object",
309
+ "properties": {
310
+ "src": {
311
+ "type": "string"
312
+ },
313
+ "kind": {
314
+ "type": "string",
315
+ "enum": [
316
+ "captions",
317
+ "subtitles",
318
+ "descriptions",
319
+ "chapters",
320
+ "metadata"
321
+ ]
322
+ },
323
+ "lang": {
324
+ "type": "string"
325
+ },
326
+ "label": {
327
+ "type": "string"
328
+ },
329
+ "default": {
330
+ "type": "boolean"
331
+ }
332
+ },
333
+ "required": [
334
+ "src",
335
+ "kind",
336
+ "lang",
337
+ "label"
338
+ ],
339
+ "description": "One authored text track associated with an audio or video asset."
340
+ },
341
+ "TranscriptRef": {
342
+ "type": "object",
343
+ "properties": {
344
+ "src": {
345
+ "type": "string"
346
+ },
347
+ "html": {
348
+ "type": "string"
349
+ },
350
+ "plainText": {
351
+ "type": "string"
352
+ },
353
+ "lang": {
354
+ "type": "string"
355
+ }
356
+ },
357
+ "description": "Inline or externally hosted transcript content for a media asset."
358
+ },
359
+ "MediaFragmentRange": {
360
+ "type": "object",
361
+ "properties": {
362
+ "startSeconds": {
363
+ "type": "number"
364
+ },
365
+ "endSeconds": {
366
+ "type": "number"
367
+ }
368
+ },
369
+ "required": [
370
+ "startSeconds"
371
+ ],
372
+ "description": "A time slice within a media asset, so one recording can serve several content nodes. Mirrors QTI 3's Media Fragments URI usage."
373
+ },
374
+ "SpokenAudioCardPayload": {
375
+ "type": "object",
376
+ "properties": {
377
+ "media": {
378
+ "$ref": "#/definitions/MediaAssetRef"
379
+ },
380
+ "fragment": {
381
+ "$ref": "#/definitions/MediaFragmentRange"
382
+ }
383
+ },
384
+ "required": [
385
+ "media"
386
+ ],
387
+ "description": "Payload for a `spoken` catalog card that is a recording rather than a script.\n\nQTI 3 treats recorded audio and synthesized speech as the same support: both are `spoken`, so this is not a new accommodation, it is the other form the existing one can take. A node commonly carries both this and a `content` card in the same language — the script is both what the audio was generated from and the fallback for when the audio cannot play; pie-players resolves between them with `CatalogLookupOptions.form`.\n\nNo `kind` discriminant, for the same reason `SignLanguageCardPayload` has none: the card's `catalog` already says what this is."
388
+ },
389
+ "MatchFeedback": {
390
+ "type": "object",
391
+ "properties": {
392
+ "correct": {
393
+ "$ref": "#/definitions/MatchFeedbackLevel",
394
+ "description": "Indicates the configuration for feedback when answer is correct"
395
+ },
396
+ "incorrect": {
397
+ "$ref": "#/definitions/MatchFeedbackLevel",
398
+ "description": "Indicates the configuration for feedback when answer is incorrect"
399
+ },
400
+ "partial": {
401
+ "$ref": "#/definitions/MatchFeedbackLevel",
402
+ "description": "Indicates the configuration for feedback when answer is partially correct"
403
+ }
404
+ }
405
+ },
406
+ "MatchFeedbackLevel": {
407
+ "type": "object",
408
+ "properties": {
409
+ "type": {
410
+ "type": "string",
411
+ "enum": [
412
+ "default",
413
+ "custom",
414
+ "none"
415
+ ],
416
+ "description": "Indicates the feedback type"
417
+ },
418
+ "default": {
419
+ "type": "string",
420
+ "description": "Indicates the feedback value"
421
+ },
422
+ "custom": {
423
+ "type": "string",
424
+ "description": "Indicates the feedback custom value"
425
+ }
426
+ },
427
+ "required": [
428
+ "type"
429
+ ],
430
+ "description": "Feedback configuration for one correctness level"
431
+ },
432
+ "MatchRow": {
433
+ "type": "object",
434
+ "properties": {
435
+ "id": {
436
+ "type": [
437
+ "string",
438
+ "number"
439
+ ],
440
+ "description": "Identifier for a row"
441
+ },
442
+ "title": {
443
+ "type": "string",
444
+ "description": "Title that will be displayed for the row"
445
+ },
446
+ "values": {
447
+ "type": "array",
448
+ "items": {
449
+ "type": "boolean"
450
+ },
451
+ "description": "Array of boolean values indicating which columns are selected in the row"
452
+ }
453
+ },
454
+ "required": [
455
+ "id",
456
+ "title",
457
+ "values"
458
+ ],
459
+ "description": "One row in the match list."
460
+ },
461
+ "ExtraCSSRules": {
462
+ "type": "object",
463
+ "properties": {
464
+ "names": {
465
+ "type": "array",
466
+ "items": {
467
+ "type": "string"
468
+ }
469
+ },
470
+ "rules": {
471
+ "type": "string"
472
+ }
473
+ },
474
+ "description": "Host-supplied CSS scoped to the element: `rules` is a stylesheet whose class names are listed in `names`."
475
+ }
476
+ },
477
+ "additionalProperties": false
478
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://cdn.jsdelivr.net/npm/@pie-element/match@13.0.4/dist/schemas/session.schema.json",
4
+ "type": "object",
5
+ "properties": {
6
+ "id": {
7
+ "type": "string",
8
+ "description": "Identifier of the session"
9
+ },
10
+ "element": {
11
+ "type": "string",
12
+ "description": "The element the session belongs to"
13
+ },
14
+ "answers": {
15
+ "type": "object",
16
+ "additionalProperties": {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "boolean"
20
+ }
21
+ },
22
+ "description": "For each row id, which answer columns the learner selected"
23
+ },
24
+ "shuffledValues": {
25
+ "type": "array",
26
+ "items": {
27
+ "type": [
28
+ "string",
29
+ "number"
30
+ ]
31
+ },
32
+ "description": "Row ids in the order they were shuffled for this learner, when row order is not locked"
33
+ }
34
+ },
35
+ "definitions": {}
36
+ }