@pie-element/matrix 5.0.4-next.20261011174919 → 5.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.
- package/dist/author/Main.d.ts +27 -15
- package/dist/author/Main.js +39 -50
- package/dist/author/defaults.d.ts +24 -24
- package/dist/author/index.d.ts +16 -18
- package/dist/author/index.js +4 -0
- package/dist/browser/author/index.js +10 -19
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +10 -19
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +4 -4
- package/dist/controller/index.d.ts +22 -5
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +263 -0
- package/dist/schemas/model.schema.json +360 -0
- package/dist/schemas/session.schema.json +23 -0
- package/dist/types.d.ts +67 -0
- package/package.json +16 -12
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/matrix@5.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
|
+
"rowLabels": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"description": "Indicates the row labels"
|
|
27
|
+
},
|
|
28
|
+
"columnLabels": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"description": "Indicates the column labels"
|
|
34
|
+
},
|
|
35
|
+
"matrixValues": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"additionalProperties": {
|
|
38
|
+
"type": "number"
|
|
39
|
+
},
|
|
40
|
+
"description": "Indicates the matrix values: the score of each cell, keyed `row-column` with 0-based indices; a cell without a value scores 0"
|
|
41
|
+
},
|
|
42
|
+
"labelType": {
|
|
43
|
+
"$ref": "#/definitions/MatrixLabelType",
|
|
44
|
+
"description": "Indicates the matrix label type"
|
|
45
|
+
},
|
|
46
|
+
"prompt": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"description": "The question prompt or item stem"
|
|
49
|
+
},
|
|
50
|
+
"promptEnabled": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"description": "Not read by this element: the prompt always shows"
|
|
53
|
+
},
|
|
54
|
+
"teacherInstructions": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Indicates teacher instructions"
|
|
57
|
+
},
|
|
58
|
+
"teacherInstructionsEnabled": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"description": "Indicates if Teacher Instructions are enabled"
|
|
61
|
+
},
|
|
62
|
+
"spellCheckEnabled": {
|
|
63
|
+
"type": "boolean",
|
|
64
|
+
"description": "Indicates if spellcheck is enabled for the author. Default value is true"
|
|
65
|
+
},
|
|
66
|
+
"scoringType": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"enum": [
|
|
69
|
+
"auto",
|
|
70
|
+
"rubric"
|
|
71
|
+
],
|
|
72
|
+
"description": "Indicates scoring type"
|
|
73
|
+
},
|
|
74
|
+
"language": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "Indicates the language of the component Supported options: en, es, en_US, en-US, es_ES, es-ES, es_MX, es-MX"
|
|
77
|
+
},
|
|
78
|
+
"extraCSSRules": {
|
|
79
|
+
"$ref": "#/definitions/ExtraCSSRules",
|
|
80
|
+
"description": "Host-supplied CSS scoped to the element"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"required": [
|
|
84
|
+
"element",
|
|
85
|
+
"id"
|
|
86
|
+
],
|
|
87
|
+
"description": "Model for the Matrix Interaction",
|
|
88
|
+
"definitions": {
|
|
89
|
+
"AccessibilityCatalog": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"properties": {
|
|
92
|
+
"identifier": {
|
|
93
|
+
"type": "string"
|
|
94
|
+
},
|
|
95
|
+
"cards": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"items": {
|
|
98
|
+
"$ref": "#/definitions/CatalogCard"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": [
|
|
103
|
+
"identifier",
|
|
104
|
+
"cards"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"CatalogCard": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"properties": {
|
|
110
|
+
"catalog": {
|
|
111
|
+
"type": "string"
|
|
112
|
+
},
|
|
113
|
+
"language": {
|
|
114
|
+
"type": "string"
|
|
115
|
+
},
|
|
116
|
+
"content": {
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"payload": {
|
|
120
|
+
"$ref": "#/definitions/CatalogCardPayload"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"required": [
|
|
124
|
+
"catalog"
|
|
125
|
+
],
|
|
126
|
+
"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`."
|
|
127
|
+
},
|
|
128
|
+
"CatalogCardPayload": {
|
|
129
|
+
"anyOf": [
|
|
130
|
+
{
|
|
131
|
+
"$ref": "#/definitions/SignLanguageCardPayload"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"$ref": "#/definitions/SpokenAudioCardPayload"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"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."
|
|
138
|
+
},
|
|
139
|
+
"SignLanguageCardPayload": {
|
|
140
|
+
"type": "object",
|
|
141
|
+
"properties": {
|
|
142
|
+
"signLang": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"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."
|
|
145
|
+
},
|
|
146
|
+
"media": {
|
|
147
|
+
"$ref": "#/definitions/MediaAssetRef"
|
|
148
|
+
},
|
|
149
|
+
"fragment": {
|
|
150
|
+
"$ref": "#/definitions/MediaFragmentRange"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"required": [
|
|
154
|
+
"media"
|
|
155
|
+
],
|
|
156
|
+
"description": "Payload for a `sign-language` catalog card: a signed translation of the content node the card is docked to."
|
|
157
|
+
},
|
|
158
|
+
"MediaAssetRef": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"properties": {
|
|
161
|
+
"version": {
|
|
162
|
+
"type": "number",
|
|
163
|
+
"const": 1
|
|
164
|
+
},
|
|
165
|
+
"id": {
|
|
166
|
+
"type": "string"
|
|
167
|
+
},
|
|
168
|
+
"kind": {
|
|
169
|
+
"$ref": "#/definitions/MediaKind"
|
|
170
|
+
},
|
|
171
|
+
"sources": {
|
|
172
|
+
"type": "array",
|
|
173
|
+
"items": {
|
|
174
|
+
"$ref": "#/definitions/MediaSource"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"poster": {
|
|
178
|
+
"type": "string"
|
|
179
|
+
},
|
|
180
|
+
"thumbnail": {
|
|
181
|
+
"type": "string"
|
|
182
|
+
},
|
|
183
|
+
"durationSeconds": {
|
|
184
|
+
"type": "number"
|
|
185
|
+
},
|
|
186
|
+
"tracks": {
|
|
187
|
+
"type": "array",
|
|
188
|
+
"items": {
|
|
189
|
+
"$ref": "#/definitions/TextTrackRef"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"transcript": {
|
|
193
|
+
"$ref": "#/definitions/TranscriptRef"
|
|
194
|
+
},
|
|
195
|
+
"label": {
|
|
196
|
+
"type": "string"
|
|
197
|
+
},
|
|
198
|
+
"description": {
|
|
199
|
+
"type": "string"
|
|
200
|
+
},
|
|
201
|
+
"lang": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"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."
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"required": [
|
|
207
|
+
"version",
|
|
208
|
+
"id",
|
|
209
|
+
"kind",
|
|
210
|
+
"sources"
|
|
211
|
+
],
|
|
212
|
+
"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."
|
|
213
|
+
},
|
|
214
|
+
"MediaKind": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"enum": [
|
|
217
|
+
"image",
|
|
218
|
+
"audio",
|
|
219
|
+
"video",
|
|
220
|
+
"other"
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
"MediaSource": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"properties": {
|
|
226
|
+
"src": {
|
|
227
|
+
"type": "string"
|
|
228
|
+
},
|
|
229
|
+
"type": {
|
|
230
|
+
"type": "string",
|
|
231
|
+
"description": "MIME type, e.g. \"video/mp4\"."
|
|
232
|
+
},
|
|
233
|
+
"width": {
|
|
234
|
+
"type": "number"
|
|
235
|
+
},
|
|
236
|
+
"height": {
|
|
237
|
+
"type": "number"
|
|
238
|
+
},
|
|
239
|
+
"bitrate": {
|
|
240
|
+
"type": "number"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"required": [
|
|
244
|
+
"src"
|
|
245
|
+
],
|
|
246
|
+
"description": "One playable encoding of a media asset."
|
|
247
|
+
},
|
|
248
|
+
"TextTrackRef": {
|
|
249
|
+
"type": "object",
|
|
250
|
+
"properties": {
|
|
251
|
+
"src": {
|
|
252
|
+
"type": "string"
|
|
253
|
+
},
|
|
254
|
+
"kind": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"enum": [
|
|
257
|
+
"captions",
|
|
258
|
+
"subtitles",
|
|
259
|
+
"descriptions",
|
|
260
|
+
"chapters",
|
|
261
|
+
"metadata"
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
"lang": {
|
|
265
|
+
"type": "string"
|
|
266
|
+
},
|
|
267
|
+
"label": {
|
|
268
|
+
"type": "string"
|
|
269
|
+
},
|
|
270
|
+
"default": {
|
|
271
|
+
"type": "boolean"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
"required": [
|
|
275
|
+
"src",
|
|
276
|
+
"kind",
|
|
277
|
+
"lang",
|
|
278
|
+
"label"
|
|
279
|
+
],
|
|
280
|
+
"description": "One authored text track associated with an audio or video asset."
|
|
281
|
+
},
|
|
282
|
+
"TranscriptRef": {
|
|
283
|
+
"type": "object",
|
|
284
|
+
"properties": {
|
|
285
|
+
"src": {
|
|
286
|
+
"type": "string"
|
|
287
|
+
},
|
|
288
|
+
"html": {
|
|
289
|
+
"type": "string"
|
|
290
|
+
},
|
|
291
|
+
"plainText": {
|
|
292
|
+
"type": "string"
|
|
293
|
+
},
|
|
294
|
+
"lang": {
|
|
295
|
+
"type": "string"
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"description": "Inline or externally hosted transcript content for a media asset."
|
|
299
|
+
},
|
|
300
|
+
"MediaFragmentRange": {
|
|
301
|
+
"type": "object",
|
|
302
|
+
"properties": {
|
|
303
|
+
"startSeconds": {
|
|
304
|
+
"type": "number"
|
|
305
|
+
},
|
|
306
|
+
"endSeconds": {
|
|
307
|
+
"type": "number"
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
"required": [
|
|
311
|
+
"startSeconds"
|
|
312
|
+
],
|
|
313
|
+
"description": "A time slice within a media asset, so one recording can serve several content nodes. Mirrors QTI 3's Media Fragments URI usage."
|
|
314
|
+
},
|
|
315
|
+
"SpokenAudioCardPayload": {
|
|
316
|
+
"type": "object",
|
|
317
|
+
"properties": {
|
|
318
|
+
"media": {
|
|
319
|
+
"$ref": "#/definitions/MediaAssetRef"
|
|
320
|
+
},
|
|
321
|
+
"fragment": {
|
|
322
|
+
"$ref": "#/definitions/MediaFragmentRange"
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"required": [
|
|
326
|
+
"media"
|
|
327
|
+
],
|
|
328
|
+
"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."
|
|
329
|
+
},
|
|
330
|
+
"MatrixLabelType": {
|
|
331
|
+
"type": "string",
|
|
332
|
+
"enum": [
|
|
333
|
+
"agreement",
|
|
334
|
+
"frequency",
|
|
335
|
+
"yesNo",
|
|
336
|
+
"importance",
|
|
337
|
+
"likelihood",
|
|
338
|
+
"like",
|
|
339
|
+
"custom"
|
|
340
|
+
],
|
|
341
|
+
"description": "The preset that labels the columns; changing the number of rows or columns sets `custom`"
|
|
342
|
+
},
|
|
343
|
+
"ExtraCSSRules": {
|
|
344
|
+
"type": "object",
|
|
345
|
+
"properties": {
|
|
346
|
+
"names": {
|
|
347
|
+
"type": "array",
|
|
348
|
+
"items": {
|
|
349
|
+
"type": "string"
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
"rules": {
|
|
353
|
+
"type": "string"
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
"description": "Host-supplied CSS scoped to the element: `rules` is a stylesheet whose class names are listed in `names`."
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"additionalProperties": false
|
|
360
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://cdn.jsdelivr.net/npm/@pie-element/matrix@5.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
|
+
"value": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": {
|
|
17
|
+
"type": "number"
|
|
18
|
+
},
|
|
19
|
+
"description": "The chosen cell of each answered row, keyed `row-column`, with that cell's value from the model's `matrixValues` (0 when it has none)"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"definitions": {}
|
|
23
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ConfigureProp, ConfigurePropWithEnabled, ContentDimensions, EditableHtmlConfigureProp, EditableHtmlPluginConfigureRequired, ExtraCSSRules, PieModel } from '@pie-element/shared-types';
|
|
2
|
+
/** The preset that labels the columns; changing the number of rows or columns sets `custom` */
|
|
3
|
+
export type MatrixLabelType = 'agreement' | 'frequency' | 'yesNo' | 'importance' | 'likelihood' | 'like' | 'custom';
|
|
4
|
+
/** Model for the Matrix Interaction */
|
|
5
|
+
export interface MatrixModel extends PieModel {
|
|
6
|
+
/** Indicates the row labels */
|
|
7
|
+
rowLabels?: string[];
|
|
8
|
+
/** Indicates the column labels */
|
|
9
|
+
columnLabels?: string[];
|
|
10
|
+
/** Indicates the matrix values: the score of each cell, keyed `row-column` with 0-based indices; a cell without a value scores 0 */
|
|
11
|
+
matrixValues?: Record<string, number>;
|
|
12
|
+
/** Indicates the matrix label type */
|
|
13
|
+
labelType?: MatrixLabelType;
|
|
14
|
+
/** The question prompt or item stem */
|
|
15
|
+
prompt?: string;
|
|
16
|
+
/** Not read by this element: the prompt always shows */
|
|
17
|
+
promptEnabled?: boolean;
|
|
18
|
+
/** Indicates teacher instructions */
|
|
19
|
+
teacherInstructions?: string;
|
|
20
|
+
/** Indicates if Teacher Instructions are enabled */
|
|
21
|
+
teacherInstructionsEnabled?: boolean;
|
|
22
|
+
/** Indicates if spellcheck is enabled for the author. Default value is true */
|
|
23
|
+
spellCheckEnabled?: boolean;
|
|
24
|
+
/** Indicates scoring type */
|
|
25
|
+
scoringType?: 'auto' | 'rubric';
|
|
26
|
+
/**
|
|
27
|
+
* Indicates the language of the component
|
|
28
|
+
* Supported options: en, es, en_US, en-US, es_ES, es-ES, es_MX, es-MX
|
|
29
|
+
*/
|
|
30
|
+
language?: string;
|
|
31
|
+
/** Host-supplied CSS scoped to the element */
|
|
32
|
+
extraCSSRules?: ExtraCSSRules;
|
|
33
|
+
}
|
|
34
|
+
/** Config Object for `@pie-element/matrix` */
|
|
35
|
+
export interface MatrixConfiguration {
|
|
36
|
+
/**
|
|
37
|
+
* Base editable html input configuration regarding plugins that are enabled/disabled
|
|
38
|
+
* E.g. audio, video, image
|
|
39
|
+
*/
|
|
40
|
+
baseInputConfiguration?: EditableHtmlConfigureProp;
|
|
41
|
+
/** Indicates if the settings panel is not available */
|
|
42
|
+
settingsPanelDisabled?: boolean;
|
|
43
|
+
/** Configuration for the author's spellcheck; `enabled` is not read, the model's `spellCheckEnabled` turns it on */
|
|
44
|
+
spellCheck?: ConfigurePropWithEnabled;
|
|
45
|
+
/** Teacher Instructions configuration */
|
|
46
|
+
teacherInstructions?: EditableHtmlPluginConfigureRequired;
|
|
47
|
+
/** Configuration for the prompt */
|
|
48
|
+
prompt?: EditableHtmlPluginConfigureRequired;
|
|
49
|
+
/** Scoring Type configuration */
|
|
50
|
+
scoringType?: ConfigureProp;
|
|
51
|
+
/** Dimensions of the authoring container */
|
|
52
|
+
contentDimensions?: ContentDimensions;
|
|
53
|
+
/** Not read by this element: the prompt always shows */
|
|
54
|
+
showPrompt?: boolean;
|
|
55
|
+
/** Not read by this element: `prompt.label` labels the prompt */
|
|
56
|
+
promptLabel?: string;
|
|
57
|
+
/** Not read by this element, which has no partial scoring */
|
|
58
|
+
settingsPartialScoring?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface MatrixSession {
|
|
61
|
+
/** Identifier of the session */
|
|
62
|
+
id?: string;
|
|
63
|
+
/** The element the session belongs to */
|
|
64
|
+
element?: string;
|
|
65
|
+
/** The chosen cell of each answered row, keyed `row-column`, with that cell's value from the model's `matrixValues` (0 when it has none) */
|
|
66
|
+
value?: Record<string, number>;
|
|
67
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/matrix",
|
|
3
|
-
"version": "5.0.4
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,20 +11,21 @@
|
|
|
11
11
|
"@emotion/react": "^11.14.0",
|
|
12
12
|
"@mui/icons-material": "^7.3.4",
|
|
13
13
|
"@mui/material": "^7.3.4",
|
|
14
|
-
"@pie-lib/render-ui": "8.0.4
|
|
15
|
-
"@pie-lib/translator": "5.0.
|
|
14
|
+
"@pie-lib/render-ui": "8.0.4",
|
|
15
|
+
"@pie-lib/translator": "5.0.1",
|
|
16
16
|
"debug": "^4.1.1",
|
|
17
17
|
"prop-types": "^15.8.1",
|
|
18
18
|
"styled-components": "^6.5.3",
|
|
19
|
-
"@pie-lib/editable-html-tip-tap": "3.0.4
|
|
20
|
-
"@pie-lib/config-ui": "14.0.4
|
|
21
|
-
"@pie-element/shared-configure-events": "0.1.
|
|
22
|
-
"@pie-element/shared-lodash": "0.1.
|
|
23
|
-
"@pie-element/shared-player-events": "0.1.
|
|
24
|
-
"@pie-element/shared-math-rendering-mathjax": "0.1.5
|
|
19
|
+
"@pie-lib/editable-html-tip-tap": "3.0.4",
|
|
20
|
+
"@pie-lib/config-ui": "14.0.4",
|
|
21
|
+
"@pie-element/shared-configure-events": "0.1.1",
|
|
22
|
+
"@pie-element/shared-lodash": "0.1.2",
|
|
23
|
+
"@pie-element/shared-player-events": "0.1.1",
|
|
24
|
+
"@pie-element/shared-math-rendering-mathjax": "0.1.5",
|
|
25
25
|
"react-is": "^18.3.1",
|
|
26
26
|
"react": "^18.2.0",
|
|
27
|
-
"react-dom": "^18.2.0"
|
|
27
|
+
"react-dom": "^18.2.0",
|
|
28
|
+
"@pie-element/shared-types": "0.2.1"
|
|
28
29
|
},
|
|
29
30
|
"exports": {
|
|
30
31
|
".": {
|
|
@@ -67,6 +68,9 @@
|
|
|
67
68
|
"types": "./dist/runtime-support.d.ts",
|
|
68
69
|
"default": "./dist/runtime-support.js"
|
|
69
70
|
},
|
|
71
|
+
"./schemas/model.schema.json": "./dist/schemas/model.schema.json",
|
|
72
|
+
"./schemas/configuration.schema.json": "./dist/schemas/configuration.schema.json",
|
|
73
|
+
"./schemas/session.schema.json": "./dist/schemas/session.schema.json",
|
|
70
74
|
"./package.json": "./package.json"
|
|
71
75
|
},
|
|
72
76
|
"type": "module",
|
|
@@ -80,7 +84,7 @@
|
|
|
80
84
|
],
|
|
81
85
|
"sideEffects": false,
|
|
82
86
|
"scripts": {
|
|
83
|
-
"build": "bun x vite build && bun x vite build --config ../../../tools/vite/element-browser.config.ts && bun x vite build --config ../../../tools/vite/element-browser-editor-runtime.config.ts && bun x vite build --config vite.config.iife.ts && bun x tsc --emitDeclarationOnly",
|
|
87
|
+
"build": "bun x vite build && bun x vite build --config ../../../tools/vite/element-browser.config.ts && bun x vite build --config ../../../tools/vite/element-browser-editor-runtime.config.ts && bun x vite build --config vite.config.iife.ts && bun x tsc --emitDeclarationOnly && bun ../../../tools/schemas/build.ts",
|
|
84
88
|
"dev": "bun x vite",
|
|
85
89
|
"demo": "bun x vite --mode demo",
|
|
86
90
|
"test": "bun x vitest run"
|
|
@@ -94,7 +98,7 @@
|
|
|
94
98
|
},
|
|
95
99
|
"browserEditorRuntime": {
|
|
96
100
|
"name": "@pie-element/shared-editor-runtime",
|
|
97
|
-
"version": "0.1.
|
|
101
|
+
"version": "0.1.2",
|
|
98
102
|
"views": {
|
|
99
103
|
"delivery": "editor-runtime/delivery",
|
|
100
104
|
"author": "editor-runtime/author",
|