@citolab/qti-components 7.27.2 → 7.27.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/cdn/index.global.js +1 -1
- package/cdn/index.js +230 -212
- package/custom-elements.json +4214 -1176
- package/dist/base.d.ts +3 -2
- package/dist/base.js +1 -1
- package/dist/{chunk-TZMDZQFG.js → chunk-3HJE3KRM.js} +469 -221
- package/dist/chunk-3HJE3KRM.js.map +1 -0
- package/dist/{chunk-75ME6QG5.js → chunk-424AWLRU.js} +18 -18
- package/dist/{chunk-QUWFDFGZ.js → chunk-FFESMKSD.js} +277 -21
- package/dist/chunk-FFESMKSD.js.map +1 -0
- package/dist/{chunk-G5ZUC3OT.js → chunk-LQZCSHN5.js} +23 -23
- package/dist/chunk-LQZCSHN5.js.map +1 -0
- package/dist/{chunk-DG5TP35K.js → chunk-N7S3GNUP.js} +5 -5
- package/dist/{chunk-DG5TP35K.js.map → chunk-N7S3GNUP.js.map} +1 -1
- package/dist/{chunk-RXRKP6P7.js → chunk-SX63OCDZ.js} +2 -2
- package/dist/{chunk-K7HR6ZAY.js → chunk-UKPCQKPF.js} +2 -2
- package/dist/chunk-UKPCQKPF.js.map +1 -0
- package/dist/{chunk-KY3II5OX.js → chunk-XYTJOQRZ.js} +240 -202
- package/dist/chunk-XYTJOQRZ.js.map +1 -0
- package/dist/{chunk-GG36UR7F.js → chunk-YLIYPNMK.js} +1004 -12
- package/dist/chunk-YLIYPNMK.js.map +1 -0
- package/dist/{chunk-TORB5UN2.js → chunk-Z2SUBRH5.js} +304 -243
- package/dist/chunk-Z2SUBRH5.js.map +1 -0
- package/dist/elements.d.ts +67 -2
- package/dist/elements.js +10 -6
- package/dist/index.d.ts +5 -4
- package/dist/index.js +55 -11
- package/dist/interactions.d.ts +8 -7
- package/dist/interactions.js +3 -3
- package/dist/item.js +4 -4
- package/dist/loader.d.ts +2 -1
- package/dist/loader.js +2 -2
- package/dist/processing.d.ts +374 -17
- package/dist/processing.js +42 -2
- package/dist/qti-components-jsx.d.ts +1183 -126
- package/dist/{qti-rule-base-DGhWN-as.d.ts → qti-condition-expression-B1BYmCcq.d.ts} +1 -14
- package/dist/{qti-feedback-BZjWNyxP.d.ts → qti-feedback-ChmXhZuf.d.ts} +1 -1
- package/dist/qti-rule-base-ajOnfGXY.d.ts +16 -0
- package/dist/test.d.ts +2 -1
- package/dist/test.js +6 -6
- package/dist/transformers.js +1 -1
- package/package.json +11 -11
- package/dist/chunk-G5ZUC3OT.js.map +0 -1
- package/dist/chunk-GG36UR7F.js.map +0 -1
- package/dist/chunk-K7HR6ZAY.js.map +0 -1
- package/dist/chunk-KY3II5OX.js.map +0 -1
- package/dist/chunk-QUWFDFGZ.js.map +0 -1
- package/dist/chunk-TORB5UN2.js.map +0 -1
- package/dist/chunk-TZMDZQFG.js.map +0 -1
- /package/dist/{chunk-75ME6QG5.js.map → chunk-424AWLRU.js.map} +0 -0
- /package/dist/{chunk-RXRKP6P7.js.map → chunk-SX63OCDZ.js.map} +0 -0
|
@@ -1,49 +1,52 @@
|
|
|
1
1
|
import {
|
|
2
2
|
o as o2
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N7S3GNUP.js";
|
|
4
4
|
import {
|
|
5
|
+
A,
|
|
5
6
|
E,
|
|
6
7
|
Interaction,
|
|
7
8
|
M,
|
|
8
9
|
ScoringHelper,
|
|
9
10
|
T,
|
|
11
|
+
b,
|
|
10
12
|
c,
|
|
11
13
|
configContext,
|
|
12
14
|
e2 as e,
|
|
13
15
|
e3 as e2,
|
|
14
16
|
f,
|
|
17
|
+
h,
|
|
15
18
|
i,
|
|
16
19
|
i2,
|
|
17
20
|
i3,
|
|
18
21
|
itemContext,
|
|
19
|
-
m,
|
|
20
22
|
n,
|
|
21
23
|
o,
|
|
22
24
|
p,
|
|
23
25
|
qtiContext,
|
|
24
26
|
r,
|
|
25
27
|
removeDoubleSlashes,
|
|
26
|
-
s,
|
|
27
28
|
t2 as t,
|
|
29
|
+
u,
|
|
28
30
|
v,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
x
|
|
32
|
-
} from "./chunk-TORB5UN2.js";
|
|
31
|
+
watch
|
|
32
|
+
} from "./chunk-Z2SUBRH5.js";
|
|
33
33
|
import {
|
|
34
34
|
__decorateClass
|
|
35
35
|
} from "./chunk-QXBXORM3.js";
|
|
36
36
|
|
|
37
|
+
// ../interactions/core/src/elements/qti-associable-hotspot/qti-associable-hotspot.styles.ts
|
|
38
|
+
var qti_associable_hotspot_styles_default = i`
|
|
39
|
+
:host {
|
|
40
|
+
display: flex;
|
|
41
|
+
user-select: none;
|
|
42
|
+
position: absolute;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
|
|
37
46
|
// ../interactions/core/src/elements/qti-associable-hotspot/qti-associable-hotspot.ts
|
|
38
47
|
var QtiAssociableHotspot = class extends i2 {
|
|
39
48
|
static {
|
|
40
|
-
this.styles =
|
|
41
|
-
:host {
|
|
42
|
-
display: flex;
|
|
43
|
-
user-select: none;
|
|
44
|
-
position: absolute;
|
|
45
|
-
}
|
|
46
|
-
`;
|
|
49
|
+
this.styles = qti_associable_hotspot_styles_default;
|
|
47
50
|
}
|
|
48
51
|
connectedCallback() {
|
|
49
52
|
super.connectedCallback();
|
|
@@ -56,10 +59,18 @@ var QtiAssociableHotspot = class extends i2 {
|
|
|
56
59
|
);
|
|
57
60
|
}
|
|
58
61
|
render() {
|
|
59
|
-
return
|
|
62
|
+
return T` <slot name="drags"></slot> `;
|
|
60
63
|
}
|
|
61
64
|
};
|
|
62
65
|
|
|
66
|
+
// ../interactions/core/src/elements/qti-gap/qti-gap.styles.ts
|
|
67
|
+
var qti_gap_styles_default = i`
|
|
68
|
+
:host {
|
|
69
|
+
display: flex;
|
|
70
|
+
user-select: none;
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
|
|
63
74
|
// ../interactions/core/src/elements/qti-gap/qti-gap.ts
|
|
64
75
|
var QtiGap = class extends i2 {
|
|
65
76
|
constructor() {
|
|
@@ -67,21 +78,24 @@ var QtiGap = class extends i2 {
|
|
|
67
78
|
this.tabindex = 0;
|
|
68
79
|
}
|
|
69
80
|
static {
|
|
70
|
-
this.styles =
|
|
71
|
-
:host {
|
|
72
|
-
display: flex;
|
|
73
|
-
user-select: none;
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
81
|
+
this.styles = qti_gap_styles_default;
|
|
76
82
|
}
|
|
77
83
|
render() {
|
|
78
|
-
return
|
|
84
|
+
return T` <slot name="drags"></slot>`;
|
|
79
85
|
}
|
|
80
86
|
};
|
|
81
87
|
__decorateClass([
|
|
82
88
|
n({ type: Number, reflect: true })
|
|
83
89
|
], QtiGap.prototype, "tabindex", 2);
|
|
84
90
|
|
|
91
|
+
// ../interactions/core/src/elements/qti-gap-img/qti-gap-img.styles.ts
|
|
92
|
+
var qti_gap_img_styles_default = i`
|
|
93
|
+
:host {
|
|
94
|
+
display: flex;
|
|
95
|
+
user-select: none;
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
|
|
85
99
|
// ../interactions/core/src/elements/qti-gap-img/qti-gap-img.ts
|
|
86
100
|
var QtiGapImg = class extends i2 {
|
|
87
101
|
constructor() {
|
|
@@ -89,12 +103,7 @@ var QtiGapImg = class extends i2 {
|
|
|
89
103
|
this.tabindex = 0;
|
|
90
104
|
}
|
|
91
105
|
static {
|
|
92
|
-
this.styles =
|
|
93
|
-
:host {
|
|
94
|
-
display: flex;
|
|
95
|
-
user-select: none;
|
|
96
|
-
}
|
|
97
|
-
`;
|
|
106
|
+
this.styles = qti_gap_img_styles_default;
|
|
98
107
|
}
|
|
99
108
|
connectedCallback() {
|
|
100
109
|
this.setAttribute("slot", "drags");
|
|
@@ -174,7 +183,7 @@ function ActiveElementMixin(Base, type) {
|
|
|
174
183
|
);
|
|
175
184
|
}
|
|
176
185
|
render() {
|
|
177
|
-
return
|
|
186
|
+
return T`<slot></slot>`;
|
|
178
187
|
}
|
|
179
188
|
}
|
|
180
189
|
__decorateClass([
|
|
@@ -205,6 +214,14 @@ function ActiveElementMixin(Base, type) {
|
|
|
205
214
|
return QtiChoice;
|
|
206
215
|
}
|
|
207
216
|
|
|
217
|
+
// ../interactions/core/src/elements/qti-gap-text/qti-gap-text.styles.ts
|
|
218
|
+
var qti_gap_text_styles_default = i`
|
|
219
|
+
:host {
|
|
220
|
+
display: inline-flex;
|
|
221
|
+
user-select: none;
|
|
222
|
+
}
|
|
223
|
+
`;
|
|
224
|
+
|
|
208
225
|
// ../interactions/core/src/elements/qti-gap-text/qti-gap-text.ts
|
|
209
226
|
var QtiGapText = class extends ActiveElementMixin(i2, "qti-gap-text") {
|
|
210
227
|
constructor() {
|
|
@@ -212,35 +229,33 @@ var QtiGapText = class extends ActiveElementMixin(i2, "qti-gap-text") {
|
|
|
212
229
|
this.tabindex = 0;
|
|
213
230
|
}
|
|
214
231
|
static {
|
|
215
|
-
this.styles =
|
|
216
|
-
:host {
|
|
217
|
-
display: inline-flex;
|
|
218
|
-
user-select: none;
|
|
219
|
-
}
|
|
220
|
-
`;
|
|
232
|
+
this.styles = qti_gap_text_styles_default;
|
|
221
233
|
}
|
|
222
234
|
connectedCallback() {
|
|
223
235
|
super.connectedCallback();
|
|
224
236
|
this.setAttribute("slot", "drags");
|
|
225
237
|
}
|
|
226
238
|
render() {
|
|
227
|
-
return
|
|
239
|
+
return T`<slot></slot>`;
|
|
228
240
|
}
|
|
229
241
|
};
|
|
230
242
|
__decorateClass([
|
|
231
243
|
n({ type: Number, reflect: true })
|
|
232
244
|
], QtiGapText.prototype, "tabindex", 2);
|
|
233
245
|
|
|
246
|
+
// ../interactions/core/src/elements/qti-hotspot-choice/qti-hotspot-choice.styles.ts
|
|
247
|
+
var qti_hotspot_choice_styles_default = i`
|
|
248
|
+
:host {
|
|
249
|
+
display: flex;
|
|
250
|
+
user-select: none;
|
|
251
|
+
position: absolute;
|
|
252
|
+
}
|
|
253
|
+
`;
|
|
254
|
+
|
|
234
255
|
// ../interactions/core/src/elements/qti-hotspot-choice/qti-hotspot-choice.ts
|
|
235
256
|
var QtiHotspotChoice = class extends ActiveElementMixin(i2, "qti-hotspot-choice") {
|
|
236
257
|
static {
|
|
237
|
-
this.styles =
|
|
238
|
-
:host {
|
|
239
|
-
display: flex;
|
|
240
|
-
user-select: none;
|
|
241
|
-
position: absolute;
|
|
242
|
-
}
|
|
243
|
-
`;
|
|
258
|
+
this.styles = qti_hotspot_choice_styles_default;
|
|
244
259
|
}
|
|
245
260
|
};
|
|
246
261
|
__decorateClass([
|
|
@@ -250,18 +265,21 @@ __decorateClass([
|
|
|
250
265
|
n({ attribute: "aria-ordercorrectvalue", type: Number, reflect: true })
|
|
251
266
|
], QtiHotspotChoice.prototype, "orderCorrect", 2);
|
|
252
267
|
|
|
268
|
+
// ../interactions/core/src/elements/qti-hottext/qti-hottext.styles.ts
|
|
269
|
+
var qti_hottext_styles_default = i`
|
|
270
|
+
:host {
|
|
271
|
+
display: flex;
|
|
272
|
+
user-select: none;
|
|
273
|
+
}
|
|
274
|
+
`;
|
|
275
|
+
|
|
253
276
|
// ../interactions/core/src/elements/qti-hottext/qti-hottext.ts
|
|
254
277
|
var QtiHottext = class extends ActiveElementMixin(i2, "qti-hottext") {
|
|
255
278
|
static {
|
|
256
|
-
this.styles =
|
|
257
|
-
:host {
|
|
258
|
-
display: flex;
|
|
259
|
-
user-select: none;
|
|
260
|
-
}
|
|
261
|
-
`;
|
|
279
|
+
this.styles = qti_hottext_styles_default;
|
|
262
280
|
}
|
|
263
281
|
render() {
|
|
264
|
-
return
|
|
282
|
+
return T`<div part="ch"><div part="cha"></div></div>
|
|
265
283
|
<slot></slot> `;
|
|
266
284
|
}
|
|
267
285
|
};
|
|
@@ -299,7 +317,7 @@ var QtiInlineChoice = class extends ActiveElementMixin(i2, "qti-inline-choice")
|
|
|
299
317
|
this.removeEventListener("click", this.#onSelectInlineChoice);
|
|
300
318
|
}
|
|
301
319
|
render() {
|
|
302
|
-
return
|
|
320
|
+
return T` <slot></slot> `;
|
|
303
321
|
}
|
|
304
322
|
#onSelectInlineChoice() {
|
|
305
323
|
this.dispatchEvent(
|
|
@@ -316,10 +334,20 @@ __decorateClass([
|
|
|
316
334
|
n({ type: String })
|
|
317
335
|
], QtiInlineChoice.prototype, "identifier", 2);
|
|
318
336
|
|
|
337
|
+
// ../interactions/core/src/elements/qti-prompt/qti-prompt.styles.ts
|
|
338
|
+
var qti_prompt_styles_default = i`
|
|
339
|
+
:host {
|
|
340
|
+
display: block;
|
|
341
|
+
}
|
|
342
|
+
`;
|
|
343
|
+
|
|
319
344
|
// ../interactions/core/src/elements/qti-prompt/qti-prompt.ts
|
|
320
345
|
var QtiPrompt = class extends i2 {
|
|
346
|
+
static {
|
|
347
|
+
this.styles = qti_prompt_styles_default;
|
|
348
|
+
}
|
|
321
349
|
render() {
|
|
322
|
-
return
|
|
350
|
+
return T`<slot></slot>`;
|
|
323
351
|
}
|
|
324
352
|
connectedCallback() {
|
|
325
353
|
const inInteraction = this.parentElement.tagName.endsWith("INTERACTION");
|
|
@@ -329,6 +357,21 @@ var QtiPrompt = class extends i2 {
|
|
|
329
357
|
}
|
|
330
358
|
};
|
|
331
359
|
|
|
360
|
+
// ../interactions/core/src/elements/qti-simple-associable-choice/qti-simple-associable-choice.styles.ts
|
|
361
|
+
var qti_simple_associable_choice_styles_default = i`
|
|
362
|
+
:host {
|
|
363
|
+
display: flex;
|
|
364
|
+
user-select: none;
|
|
365
|
+
}
|
|
366
|
+
slot {
|
|
367
|
+
width: 100%;
|
|
368
|
+
display: block;
|
|
369
|
+
}
|
|
370
|
+
slot[name='qti-simple-associable-choice'] {
|
|
371
|
+
width: auto;
|
|
372
|
+
}
|
|
373
|
+
`;
|
|
374
|
+
|
|
332
375
|
// ../interactions/core/src/elements/qti-simple-associable-choice/qti-simple-associable-choice.ts
|
|
333
376
|
var QtiSimpleAssociableChoice = class extends ActiveElementMixin(i2, "qti-simple-associable-choice") {
|
|
334
377
|
constructor() {
|
|
@@ -338,19 +381,7 @@ var QtiSimpleAssociableChoice = class extends ActiveElementMixin(i2, "qti-simple
|
|
|
338
381
|
this.fixed = false;
|
|
339
382
|
}
|
|
340
383
|
static {
|
|
341
|
-
this.styles =
|
|
342
|
-
:host {
|
|
343
|
-
display: flex;
|
|
344
|
-
user-select: none;
|
|
345
|
-
}
|
|
346
|
-
slot {
|
|
347
|
-
width: 100%;
|
|
348
|
-
display: block;
|
|
349
|
-
}
|
|
350
|
-
slot[name='qti-simple-associable-choice'] {
|
|
351
|
-
width: auto;
|
|
352
|
-
}
|
|
353
|
-
`;
|
|
384
|
+
this.styles = qti_simple_associable_choice_styles_default;
|
|
354
385
|
}
|
|
355
386
|
// pk: This needs some explanation
|
|
356
387
|
// in the associate interaction there is a special slot for these qti-simple-associable-choices
|
|
@@ -365,7 +396,7 @@ var QtiSimpleAssociableChoice = class extends ActiveElementMixin(i2, "qti-simple
|
|
|
365
396
|
// So we have a slot for whenever another qti-simple-associable-choice is dropped in here.
|
|
366
397
|
// And we have slot for content like in this associate interaction
|
|
367
398
|
render() {
|
|
368
|
-
return
|
|
399
|
+
return T`
|
|
369
400
|
<slot part="slot"></slot>
|
|
370
401
|
<slot part="dropslot" name="qti-simple-associable-choice"></slot>
|
|
371
402
|
`;
|
|
@@ -429,10 +460,10 @@ var QtiSimpleChoice = class extends ActiveElementMixin(i2, "qti-simple-choice")
|
|
|
429
460
|
return this["internals"].states.has("--checked");
|
|
430
461
|
}
|
|
431
462
|
render() {
|
|
432
|
-
return
|
|
463
|
+
return T`<div part="ch">
|
|
433
464
|
<div part="cha"></div>
|
|
434
465
|
</div>
|
|
435
|
-
${this.marker ?
|
|
466
|
+
${this.marker ? T`<div id="label">${this.marker}</div>` : A}
|
|
436
467
|
<slot part="slot"></slot>`;
|
|
437
468
|
}
|
|
438
469
|
};
|
|
@@ -2124,7 +2155,15 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2124
2155
|
return;
|
|
2125
2156
|
}
|
|
2126
2157
|
downEvent.preventDefault();
|
|
2127
|
-
this.initiateDrag(
|
|
2158
|
+
this.initiateDrag(
|
|
2159
|
+
dragTarget,
|
|
2160
|
+
downEvent.clientX,
|
|
2161
|
+
downEvent.clientY,
|
|
2162
|
+
"mouse",
|
|
2163
|
+
"mouse",
|
|
2164
|
+
void 0,
|
|
2165
|
+
downEvent.isTrusted
|
|
2166
|
+
);
|
|
2128
2167
|
});
|
|
2129
2168
|
const touchDragSub = shadowRoot.when("touchstart").filter((e5) => {
|
|
2130
2169
|
const target = findDraggableTarget(e5, draggablesSelector);
|
|
@@ -2142,7 +2181,15 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2142
2181
|
this.lastTouchStartAt = Date.now();
|
|
2143
2182
|
startEvent.preventDefault();
|
|
2144
2183
|
startEvent.stopPropagation();
|
|
2145
|
-
this.initiateDrag(
|
|
2184
|
+
this.initiateDrag(
|
|
2185
|
+
dragTarget,
|
|
2186
|
+
touch.clientX,
|
|
2187
|
+
touch.clientY,
|
|
2188
|
+
"touch",
|
|
2189
|
+
"touch",
|
|
2190
|
+
void 0,
|
|
2191
|
+
startEvent.isTrusted
|
|
2192
|
+
);
|
|
2146
2193
|
});
|
|
2147
2194
|
let keyboardState = {
|
|
2148
2195
|
dragging: false,
|
|
@@ -2488,9 +2535,9 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2488
2535
|
updateClonePosition(clientX, clientY) {
|
|
2489
2536
|
if (!this.dragState.dragClone) return;
|
|
2490
2537
|
const { startOffset } = this.dragState;
|
|
2491
|
-
const
|
|
2538
|
+
const x = clientX - startOffset.x;
|
|
2492
2539
|
const y = clientY - startOffset.y;
|
|
2493
|
-
this.dragState.dragClone.style.left = `${
|
|
2540
|
+
this.dragState.dragClone.style.left = `${x}px`;
|
|
2494
2541
|
this.dragState.dragClone.style.top = `${y}px`;
|
|
2495
2542
|
}
|
|
2496
2543
|
activateAllDroppables() {
|
|
@@ -3271,11 +3318,7 @@ var DragDropSlottedSortableMixin = (superClass, sortableItemSelector = '[qti-dra
|
|
|
3271
3318
|
this.#sourceSlot = containingDroppable;
|
|
3272
3319
|
this.#sortableContext.sortContainer = containingDroppable;
|
|
3273
3320
|
const rect = dragElement.getBoundingClientRect();
|
|
3274
|
-
this.#sortableContext.placeholder = createDropPlaceholder(
|
|
3275
|
-
dragElement,
|
|
3276
|
-
rect,
|
|
3277
|
-
this.sortablePlaceholderConfig
|
|
3278
|
-
);
|
|
3321
|
+
this.#sortableContext.placeholder = createDropPlaceholder(dragElement, rect, this.sortablePlaceholderConfig);
|
|
3279
3322
|
const slotAttr = dragElement.getAttribute("slot");
|
|
3280
3323
|
if (slotAttr) {
|
|
3281
3324
|
this.#sortableContext.placeholder.setAttribute("slot", slotAttr);
|
|
@@ -3452,11 +3495,11 @@ var QtiAssociateInteraction = class extends DragDropSlottedSortableMixin(Slotted
|
|
|
3452
3495
|
}) ?? [];
|
|
3453
3496
|
}
|
|
3454
3497
|
render() {
|
|
3455
|
-
return
|
|
3498
|
+
return T` <slot name="prompt"></slot>
|
|
3456
3499
|
<slot name="qti-simple-associable-choice"></slot>
|
|
3457
3500
|
<div part="drop-container">
|
|
3458
3501
|
${this._childrenMap.length > 0 && Array.from(Array(Math.ceil(this._childrenMap.length / 2)).keys()).map(
|
|
3459
|
-
(_, index) =>
|
|
3502
|
+
(_, index) => T`<div part="associables-container">
|
|
3460
3503
|
<div name="left${index}" part="drop-list" class="dl" identifier="droplist${index}_left"></div>
|
|
3461
3504
|
<div name="right${index}" part="drop-list" class="dl" identifier="droplist${index}_right"></div>
|
|
3462
3505
|
</div>`
|
|
@@ -3818,7 +3861,7 @@ var VocabularyMixin = (superClass, _selector) => {
|
|
|
3818
3861
|
return choiceElements.map((choice, index) => {
|
|
3819
3862
|
const order = Number(choice.style.order);
|
|
3820
3863
|
return { el: choice, order: Number.isFinite(order) ? order : index + 1, index };
|
|
3821
|
-
}).sort((a,
|
|
3864
|
+
}).sort((a, b2) => a.order - b2.order || a.index - b2.index).map((choice) => choice.el);
|
|
3822
3865
|
}
|
|
3823
3866
|
#getActiveLabelType() {
|
|
3824
3867
|
return this.#classes.filter((c3) => this.#allLabels.includes(c3)).pop() ?? null;
|
|
@@ -3962,7 +4005,7 @@ var QtiChoiceInteraction = class extends VocabularyMixin(ChoicesMixin(Interactio
|
|
|
3962
4005
|
this.style.setProperty("--item-count", choices.length.toString());
|
|
3963
4006
|
}
|
|
3964
4007
|
render() {
|
|
3965
|
-
return
|
|
4008
|
+
return T`
|
|
3966
4009
|
<slot part="prompt" name="prompt"></slot>
|
|
3967
4010
|
<slot part="slot" @slotchange=${this.#handleSlotChange}></slot>
|
|
3968
4011
|
<div part="message" role="alert" id="validation-message"></div>
|
|
@@ -4404,7 +4447,7 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4404
4447
|
super.disconnectedCallback();
|
|
4405
4448
|
}
|
|
4406
4449
|
render() {
|
|
4407
|
-
return
|
|
4450
|
+
return T`<iframe
|
|
4408
4451
|
width=${this.getAttribute("width")}
|
|
4409
4452
|
height=${this.getAttribute("height")}
|
|
4410
4453
|
frameborder="0"
|
|
@@ -4412,7 +4455,7 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4412
4455
|
id="pciContainer"
|
|
4413
4456
|
>
|
|
4414
4457
|
</iframe>
|
|
4415
|
-
${this._errorMessage &&
|
|
4458
|
+
${this._errorMessage && T`<div style="color:red">
|
|
4416
4459
|
<h1>Error</h1>
|
|
4417
4460
|
${this._errorMessage}
|
|
4418
4461
|
</div>`}`;
|
|
@@ -4494,7 +4537,7 @@ var QtiEndAttemptInteraction = class extends i2 {
|
|
|
4494
4537
|
this.styles = qti_end_attempt_interaction_styles_default;
|
|
4495
4538
|
}
|
|
4496
4539
|
render() {
|
|
4497
|
-
return
|
|
4540
|
+
return T`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`;
|
|
4498
4541
|
}
|
|
4499
4542
|
endAttempt(_) {
|
|
4500
4543
|
this.dispatchEvent(
|
|
@@ -4599,7 +4642,7 @@ var QtiExtendedTextInteraction = class extends Interaction {
|
|
|
4599
4642
|
return isValid;
|
|
4600
4643
|
}
|
|
4601
4644
|
render() {
|
|
4602
|
-
return
|
|
4645
|
+
return T`<slot name="prompt"></slot
|
|
4603
4646
|
><textarea
|
|
4604
4647
|
part="textarea"
|
|
4605
4648
|
name="${this.responseIdentifier}"
|
|
@@ -4698,18 +4741,13 @@ var qti_gap_match_interaction_styles_default = i`
|
|
|
4698
4741
|
`;
|
|
4699
4742
|
|
|
4700
4743
|
// ../interactions/gap-match-interaction/src/qti-gap-match-interaction.ts
|
|
4701
|
-
var SlottedBase2 = DragDropSlottedMixin(
|
|
4702
|
-
Interaction,
|
|
4703
|
-
"qti-gap-text",
|
|
4704
|
-
"qti-gap",
|
|
4705
|
-
`slot[part='drags']`
|
|
4706
|
-
);
|
|
4744
|
+
var SlottedBase2 = DragDropSlottedMixin(Interaction, "qti-gap-text", "qti-gap", `slot[part='drags']`);
|
|
4707
4745
|
var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase2, '[qti-draggable="true"]') {
|
|
4708
4746
|
static {
|
|
4709
4747
|
this.styles = qti_gap_match_interaction_styles_default;
|
|
4710
4748
|
}
|
|
4711
4749
|
render() {
|
|
4712
|
-
return
|
|
4750
|
+
return T`<slot name="prompt"> </slot>
|
|
4713
4751
|
<slot part="drags" name="drags"></slot>
|
|
4714
4752
|
<slot part="drops"></slot>
|
|
4715
4753
|
<div role="alert" part="message" id="validation-message"></div>`;
|
|
@@ -4720,15 +4758,15 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4720
4758
|
let matches = [];
|
|
4721
4759
|
const response = Array.isArray(responseVariable.correctResponse) ? responseVariable.correctResponse : [responseVariable.correctResponse];
|
|
4722
4760
|
if (response) {
|
|
4723
|
-
matches = response.map((
|
|
4724
|
-
const split =
|
|
4761
|
+
matches = response.map((x) => {
|
|
4762
|
+
const split = x.split(" ");
|
|
4725
4763
|
return { text: split[0], gap: split[1] };
|
|
4726
4764
|
});
|
|
4727
4765
|
}
|
|
4728
4766
|
const gaps = this.querySelectorAll("qti-gap");
|
|
4729
4767
|
gaps.forEach((gap) => {
|
|
4730
4768
|
const identifier = gap.getAttribute("identifier");
|
|
4731
|
-
const textIdentifier = matches.find((
|
|
4769
|
+
const textIdentifier = matches.find((x) => x.gap === identifier)?.text;
|
|
4732
4770
|
const text = this.querySelector(`qti-gap-text[identifier="${textIdentifier}"]`)?.textContent.trim();
|
|
4733
4771
|
if (textIdentifier && text) {
|
|
4734
4772
|
if (!gap.nextElementSibling?.classList.contains("correct-option")) {
|
|
@@ -4759,8 +4797,8 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4759
4797
|
const correctResponse = Array.isArray(responseVariable.correctResponse) ? responseVariable.correctResponse : [responseVariable.correctResponse];
|
|
4760
4798
|
const matches = [];
|
|
4761
4799
|
if (correctResponse) {
|
|
4762
|
-
correctResponse.forEach((
|
|
4763
|
-
const split =
|
|
4800
|
+
correctResponse.forEach((x) => {
|
|
4801
|
+
const split = x.split(" ");
|
|
4764
4802
|
matches.push({ source: split[0], target: split[1] });
|
|
4765
4803
|
});
|
|
4766
4804
|
}
|
|
@@ -4775,7 +4813,7 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4775
4813
|
const targetChoices = Array.from(this.querySelectorAll("qti-gap"));
|
|
4776
4814
|
targetChoices.forEach((targetChoice) => {
|
|
4777
4815
|
const targetId = targetChoice.getAttribute("identifier");
|
|
4778
|
-
const targetMatches = matches.filter((
|
|
4816
|
+
const targetMatches = matches.filter((m) => m.target === targetId);
|
|
4779
4817
|
const selectedChoices = targetChoice.querySelectorAll(`qti-gap-text`);
|
|
4780
4818
|
selectedChoices.forEach((selectedChoice) => {
|
|
4781
4819
|
selectedChoice.internals.states.delete("candidate-correct");
|
|
@@ -4783,7 +4821,7 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4783
4821
|
if (!show) {
|
|
4784
4822
|
return;
|
|
4785
4823
|
}
|
|
4786
|
-
const isCorrect = targetMatches.find((
|
|
4824
|
+
const isCorrect = targetMatches.find((m) => m.source === selectedChoice.identifier)?.source !== void 0;
|
|
4787
4825
|
if (isCorrect) {
|
|
4788
4826
|
selectedChoice.internals.states.add("candidate-correct");
|
|
4789
4827
|
} else {
|
|
@@ -4794,56 +4832,56 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4794
4832
|
}
|
|
4795
4833
|
};
|
|
4796
4834
|
|
|
4797
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
4798
|
-
var
|
|
4835
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/repeat.js
|
|
4836
|
+
var u2 = (e5, s, t2) => {
|
|
4799
4837
|
const r2 = /* @__PURE__ */ new Map();
|
|
4800
|
-
for (let l =
|
|
4838
|
+
for (let l = s; l <= t2; l++) r2.set(e5[l], l);
|
|
4801
4839
|
return r2;
|
|
4802
4840
|
};
|
|
4803
4841
|
var c2 = e2(class extends i3 {
|
|
4804
4842
|
constructor(e5) {
|
|
4805
4843
|
if (super(e5), e5.type !== t.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
4806
4844
|
}
|
|
4807
|
-
dt(e5,
|
|
4845
|
+
dt(e5, s, t2) {
|
|
4808
4846
|
let r2;
|
|
4809
|
-
void 0 === t2 ? t2 =
|
|
4847
|
+
void 0 === t2 ? t2 = s : void 0 !== s && (r2 = s);
|
|
4810
4848
|
const l = [], o6 = [];
|
|
4811
4849
|
let i5 = 0;
|
|
4812
|
-
for (const
|
|
4850
|
+
for (const s2 of e5) l[i5] = r2 ? r2(s2, i5) : i5, o6[i5] = t2(s2, i5), i5++;
|
|
4813
4851
|
return { values: o6, keys: l };
|
|
4814
4852
|
}
|
|
4815
|
-
render(e5,
|
|
4816
|
-
return this.dt(e5,
|
|
4853
|
+
render(e5, s, t2) {
|
|
4854
|
+
return this.dt(e5, s, t2).values;
|
|
4817
4855
|
}
|
|
4818
|
-
update(
|
|
4819
|
-
const d =
|
|
4856
|
+
update(s, [t2, r2, c3]) {
|
|
4857
|
+
const d = M(s), { values: p2, keys: a } = this.dt(t2, r2, c3);
|
|
4820
4858
|
if (!Array.isArray(d)) return this.ut = a, p2;
|
|
4821
|
-
const
|
|
4822
|
-
let
|
|
4823
|
-
for (;
|
|
4859
|
+
const h3 = this.ut ??= [], v2 = [];
|
|
4860
|
+
let m, y, x = 0, j = d.length - 1, k = 0, w = p2.length - 1;
|
|
4861
|
+
for (; x <= j && k <= w; ) if (null === d[x]) x++;
|
|
4824
4862
|
else if (null === d[j]) j--;
|
|
4825
|
-
else if (
|
|
4826
|
-
else if (
|
|
4827
|
-
else if (
|
|
4828
|
-
else if (
|
|
4829
|
-
else if (void 0 ===
|
|
4863
|
+
else if (h3[x] === a[k]) v2[k] = u(d[x], p2[k]), x++, k++;
|
|
4864
|
+
else if (h3[j] === a[w]) v2[w] = u(d[j], p2[w]), j--, w--;
|
|
4865
|
+
else if (h3[x] === a[w]) v2[w] = u(d[x], p2[w]), v(s, v2[w + 1], d[x]), x++, w--;
|
|
4866
|
+
else if (h3[j] === a[k]) v2[k] = u(d[j], p2[k]), v(s, d[x], d[j]), j--, k++;
|
|
4867
|
+
else if (void 0 === m && (m = u2(a, k, w), y = u2(h3, x, j)), m.has(h3[x])) if (m.has(h3[j])) {
|
|
4830
4868
|
const e5 = y.get(a[k]), t3 = void 0 !== e5 ? d[e5] : null;
|
|
4831
4869
|
if (null === t3) {
|
|
4832
|
-
const e6 = s
|
|
4833
|
-
|
|
4834
|
-
} else v2[k] =
|
|
4870
|
+
const e6 = v(s, d[x]);
|
|
4871
|
+
u(e6, p2[k]), v2[k] = e6;
|
|
4872
|
+
} else v2[k] = u(t3, p2[k]), v(s, d[x], t3), d[e5] = null;
|
|
4835
4873
|
k++;
|
|
4836
|
-
} else
|
|
4837
|
-
else
|
|
4838
|
-
for (; k <=
|
|
4839
|
-
const e5 = s
|
|
4840
|
-
|
|
4874
|
+
} else h(d[j]), j--;
|
|
4875
|
+
else h(d[x]), x++;
|
|
4876
|
+
for (; k <= w; ) {
|
|
4877
|
+
const e5 = v(s, v2[w + 1]);
|
|
4878
|
+
u(e5, p2[k]), v2[k++] = e5;
|
|
4841
4879
|
}
|
|
4842
|
-
for (;
|
|
4843
|
-
const e5 = d[
|
|
4844
|
-
null !== e5 &&
|
|
4880
|
+
for (; x <= j; ) {
|
|
4881
|
+
const e5 = d[x++];
|
|
4882
|
+
null !== e5 && h(e5);
|
|
4845
4883
|
}
|
|
4846
|
-
return this.ut = a,
|
|
4884
|
+
return this.ut = a, p(s, v2), E;
|
|
4847
4885
|
}
|
|
4848
4886
|
});
|
|
4849
4887
|
|
|
@@ -5018,7 +5056,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5018
5056
|
this._correctLines = correctResponses;
|
|
5019
5057
|
}
|
|
5020
5058
|
render() {
|
|
5021
|
-
return
|
|
5059
|
+
return T`<slot name="prompt"></slot>
|
|
5022
5060
|
<line-container>
|
|
5023
5061
|
<svg
|
|
5024
5062
|
width=${o2(this.grImage[0]?.width)}
|
|
@@ -5028,7 +5066,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5028
5066
|
${c2(
|
|
5029
5067
|
this.#getResponseArray(),
|
|
5030
5068
|
(line) => line,
|
|
5031
|
-
(line, index) =>
|
|
5069
|
+
(line, index) => b`
|
|
5032
5070
|
<line
|
|
5033
5071
|
part="line"
|
|
5034
5072
|
x1=${parseInt(this.querySelector(`[identifier=${line.split(" ")[0]}]`).style.left)}
|
|
@@ -5048,7 +5086,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5048
5086
|
${c2(
|
|
5049
5087
|
this._correctLines || [],
|
|
5050
5088
|
(line) => line,
|
|
5051
|
-
(line, _index) =>
|
|
5089
|
+
(line, _index) => b`
|
|
5052
5090
|
<line
|
|
5053
5091
|
part="correct-line"
|
|
5054
5092
|
x1=${parseInt(this.querySelector(`[identifier=${line.split(" ")[0]}]`).style.left)}
|
|
@@ -5061,7 +5099,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5061
5099
|
/>
|
|
5062
5100
|
`
|
|
5063
5101
|
)}
|
|
5064
|
-
${this.#startPoint &&
|
|
5102
|
+
${this.#startPoint && b`<line
|
|
5065
5103
|
part="point"
|
|
5066
5104
|
x1=${this.startCoord.x}
|
|
5067
5105
|
y1=${this.startCoord.y}
|
|
@@ -5080,7 +5118,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5080
5118
|
const hotspot = e5.target;
|
|
5081
5119
|
const coords = hotspot.getAttribute("coords");
|
|
5082
5120
|
const shape = hotspot.getAttribute("shape");
|
|
5083
|
-
const coordsNumber = coords.split(",").map((
|
|
5121
|
+
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
5084
5122
|
positionShapes(shape, coordsNumber, img, hotspot);
|
|
5085
5123
|
}
|
|
5086
5124
|
firstUpdated() {
|
|
@@ -5210,7 +5248,7 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
5210
5248
|
this.styles = qti_graphic_gap_match_interaction_styles_default;
|
|
5211
5249
|
}
|
|
5212
5250
|
render() {
|
|
5213
|
-
return
|
|
5251
|
+
return T` <slot name="prompt"></slot>
|
|
5214
5252
|
<slot part="image"></slot>
|
|
5215
5253
|
<slot part="drags" name="drags" class="hover-border"></slot>
|
|
5216
5254
|
<div role="alert" part="message" id="validation-message"></div>`;
|
|
@@ -5222,7 +5260,7 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
5222
5260
|
const hotspot = e5.target;
|
|
5223
5261
|
const coords = hotspot.getAttribute("coords");
|
|
5224
5262
|
const shape = hotspot.getAttribute("shape");
|
|
5225
|
-
const coordsNumber = coords.split(",").map((
|
|
5263
|
+
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
5226
5264
|
switch (shape) {
|
|
5227
5265
|
case "circle":
|
|
5228
5266
|
{
|
|
@@ -5279,7 +5317,7 @@ var QtiGraphicOrderInteraction = class extends ChoicesMixin(Interaction, "qti-ho
|
|
|
5279
5317
|
this.styles = qti_graphic_order_interaction_styles_default;
|
|
5280
5318
|
}
|
|
5281
5319
|
render() {
|
|
5282
|
-
return
|
|
5320
|
+
return T`
|
|
5283
5321
|
<slot name="prompt"></slot>
|
|
5284
5322
|
<slot></slot>
|
|
5285
5323
|
<div role="alert" part="message" id="validation-message"></div>
|
|
@@ -5332,7 +5370,7 @@ var QtiGraphicOrderInteraction = class extends ChoicesMixin(Interaction, "qti-ho
|
|
|
5332
5370
|
const hotspot = e5.target;
|
|
5333
5371
|
const coords = hotspot.getAttribute("coords");
|
|
5334
5372
|
const shape = hotspot.getAttribute("shape");
|
|
5335
|
-
const coordsNumber = coords.split(",").map((
|
|
5373
|
+
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
5336
5374
|
positionShapes(shape, coordsNumber, img, hotspot);
|
|
5337
5375
|
}
|
|
5338
5376
|
connectedCallback() {
|
|
@@ -5370,7 +5408,7 @@ var QtiHotspotInteraction = class extends ChoicesMixin(Interaction, "qti-hotspot
|
|
|
5370
5408
|
this.styles = qti_hotspot_interaction_styles_default;
|
|
5371
5409
|
}
|
|
5372
5410
|
render() {
|
|
5373
|
-
return
|
|
5411
|
+
return T`
|
|
5374
5412
|
<slot name="prompt"></slot>
|
|
5375
5413
|
<slot></slot>
|
|
5376
5414
|
`;
|
|
@@ -5397,7 +5435,7 @@ var QtiHotspotInteraction = class extends ChoicesMixin(Interaction, "qti-hotspot
|
|
|
5397
5435
|
const hotspot = e5.target;
|
|
5398
5436
|
const coords = hotspot.getAttribute("coords");
|
|
5399
5437
|
const shape = hotspot.getAttribute("shape");
|
|
5400
|
-
const coordsNumber = coords.split(",").map((
|
|
5438
|
+
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
5401
5439
|
const loadedImg = await this.#getImageLoadPromise(img);
|
|
5402
5440
|
positionShapes(shape, coordsNumber, loadedImg, hotspot);
|
|
5403
5441
|
}
|
|
@@ -5419,7 +5457,7 @@ var QtiHottextInteraction = class extends ChoicesMixin(Interaction, "qti-hottext
|
|
|
5419
5457
|
constructor() {
|
|
5420
5458
|
super(...arguments);
|
|
5421
5459
|
this.class = "";
|
|
5422
|
-
this.render = () =>
|
|
5460
|
+
this.render = () => T`<slot></slot>
|
|
5423
5461
|
<div part="message" role="alert" id="validation-message"></div>`;
|
|
5424
5462
|
}
|
|
5425
5463
|
static {
|
|
@@ -5459,19 +5497,19 @@ __decorateClass([
|
|
|
5459
5497
|
n({ type: String, reflect: true })
|
|
5460
5498
|
], QtiHottextInteraction.prototype, "class", 2);
|
|
5461
5499
|
|
|
5462
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
5500
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/unsafe-html.js
|
|
5463
5501
|
var e3 = class extends i3 {
|
|
5464
5502
|
constructor(i5) {
|
|
5465
|
-
if (super(i5), this.it =
|
|
5503
|
+
if (super(i5), this.it = A, i5.type !== t.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
5466
5504
|
}
|
|
5467
5505
|
render(r2) {
|
|
5468
|
-
if (r2 ===
|
|
5469
|
-
if (r2 ===
|
|
5506
|
+
if (r2 === A || null == r2) return this._t = void 0, this.it = r2;
|
|
5507
|
+
if (r2 === E) return r2;
|
|
5470
5508
|
if ("string" != typeof r2) throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
5471
5509
|
if (r2 === this.it) return this._t;
|
|
5472
5510
|
this.it = r2;
|
|
5473
|
-
const
|
|
5474
|
-
return
|
|
5511
|
+
const s = [r2];
|
|
5512
|
+
return s.raw = s, this._t = { _$litType$: this.constructor.resultType, strings: s, values: [] };
|
|
5475
5513
|
}
|
|
5476
5514
|
};
|
|
5477
5515
|
e3.directiveName = "unsafeHTML", e3.resultType = 1;
|
|
@@ -5617,7 +5655,7 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5617
5655
|
}
|
|
5618
5656
|
render() {
|
|
5619
5657
|
const selected = this.#selectedOption();
|
|
5620
|
-
return
|
|
5658
|
+
return T`
|
|
5621
5659
|
<button
|
|
5622
5660
|
part="trigger"
|
|
5623
5661
|
type="button"
|
|
@@ -5993,8 +6031,8 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
5993
6031
|
const correctResponse = Array.isArray(responseVariable.correctResponse) ? responseVariable.correctResponse : [responseVariable.correctResponse];
|
|
5994
6032
|
const matches = [];
|
|
5995
6033
|
if (correctResponse) {
|
|
5996
|
-
correctResponse.forEach((
|
|
5997
|
-
const split =
|
|
6034
|
+
correctResponse.forEach((x) => {
|
|
6035
|
+
const split = x.split(" ");
|
|
5998
6036
|
matches.push({ source: split[0], target: split[1] });
|
|
5999
6037
|
});
|
|
6000
6038
|
}
|
|
@@ -6012,7 +6050,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6012
6050
|
this.querySelectorAll(".correct-option").forEach((el) => el.remove());
|
|
6013
6051
|
this.targetChoices.forEach((targetChoice) => {
|
|
6014
6052
|
const targetId = targetChoice.getAttribute("identifier");
|
|
6015
|
-
const match = matches.find((
|
|
6053
|
+
const match = matches.find((m) => m.target === targetId);
|
|
6016
6054
|
if (match?.source) {
|
|
6017
6055
|
const sourceChoice = this.querySelector(`qti-simple-associable-choice[identifier="${match.source}"]`);
|
|
6018
6056
|
const text = sourceChoice?.textContent?.trim();
|
|
@@ -6047,7 +6085,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6047
6085
|
const matches = this.#getMatches(responseVariable);
|
|
6048
6086
|
this.targetChoices.forEach((targetChoice) => {
|
|
6049
6087
|
const targetId = targetChoice.getAttribute("identifier");
|
|
6050
|
-
const targetMatches = matches.filter((
|
|
6088
|
+
const targetMatches = matches.filter((m) => m.target === targetId);
|
|
6051
6089
|
const selectedChoices = targetChoice.querySelectorAll(`qti-simple-associable-choice`);
|
|
6052
6090
|
selectedChoices.forEach((selectedChoice) => {
|
|
6053
6091
|
selectedChoice.internals.states.delete("candidate-correct");
|
|
@@ -6055,7 +6093,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6055
6093
|
if (!show) {
|
|
6056
6094
|
return;
|
|
6057
6095
|
}
|
|
6058
|
-
const isCorrect = targetMatches.find((
|
|
6096
|
+
const isCorrect = targetMatches.find((m) => m.source === selectedChoice.identifier)?.source !== void 0;
|
|
6059
6097
|
if (isCorrect) {
|
|
6060
6098
|
selectedChoice.internals.states.add("candidate-correct");
|
|
6061
6099
|
} else {
|
|
@@ -6067,19 +6105,19 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6067
6105
|
render() {
|
|
6068
6106
|
const isTabular = this.class.split(" ").includes("qti-match-tabular");
|
|
6069
6107
|
const hasCorrectResponse = this.correctOptions !== null;
|
|
6070
|
-
return
|
|
6108
|
+
return T`
|
|
6071
6109
|
<slot name="prompt"></slot>
|
|
6072
6110
|
<slot ?hidden=${isTabular}></slot>
|
|
6073
6111
|
|
|
6074
|
-
${isTabular ?
|
|
6112
|
+
${isTabular ? T`
|
|
6075
6113
|
<table part="table">
|
|
6076
6114
|
<tr part="r-header">
|
|
6077
6115
|
<td></td>
|
|
6078
|
-
${this.targetChoices.map((col) =>
|
|
6116
|
+
${this.targetChoices.map((col) => T`<th part="r-header">${o3(col.innerHTML)}</th>`)}
|
|
6079
6117
|
</tr>
|
|
6080
6118
|
|
|
6081
6119
|
${this.sourceChoices.map(
|
|
6082
|
-
(row) =>
|
|
6120
|
+
(row) => T`<tr part="row">
|
|
6083
6121
|
<td part="c-header">${o3(row.innerHTML)}</td>
|
|
6084
6122
|
${this.targetChoices.map((col) => {
|
|
6085
6123
|
const rowId = row.getAttribute("identifier");
|
|
@@ -6093,7 +6131,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6093
6131
|
);
|
|
6094
6132
|
const part = type === "radio" ? `rb ${checked ? "rb-checked" : ""} ${hasCorrectResponse ? isCorrect ? "rb-correct" : "rb-incorrect" : ""}` : `cb ${checked ? "cb-checked" : ""} ${hasCorrectResponse ? isCorrect ? "cb-correct" : "cb-incorrect" : ""}`;
|
|
6095
6133
|
const disable = this.correctOptions?.length > 0 ? true : row.matchMax === 1 ? false : row.matchMax !== 0 && selectedInRowCount >= row.matchMax && !checked;
|
|
6096
|
-
return
|
|
6134
|
+
return T`<td part="input-cell">
|
|
6097
6135
|
<div
|
|
6098
6136
|
class="input-container"
|
|
6099
6137
|
style="position: relative; width: 24px; height: 24px; margin: 0 auto;"
|
|
@@ -6107,7 +6145,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6107
6145
|
@change=${(e5) => this.handleRadioChange(e5)}
|
|
6108
6146
|
@click=${(e5) => row.matchMax === 1 ? this.handleRadioClick(e5) : null}
|
|
6109
6147
|
/>
|
|
6110
|
-
${type === "checkbox" && checked ?
|
|
6148
|
+
${type === "checkbox" && checked ? T`
|
|
6111
6149
|
<svg
|
|
6112
6150
|
part="checkmark"
|
|
6113
6151
|
viewBox="0 0 24 24"
|
|
@@ -6122,7 +6160,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6122
6160
|
</tr>`
|
|
6123
6161
|
)}
|
|
6124
6162
|
</table>
|
|
6125
|
-
` :
|
|
6163
|
+
` : A}
|
|
6126
6164
|
|
|
6127
6165
|
<div role="alert" part="message" id="validation-message"></div>
|
|
6128
6166
|
`;
|
|
@@ -6182,7 +6220,7 @@ var QtiMediaInteraction = class extends Interaction {
|
|
|
6182
6220
|
};
|
|
6183
6221
|
}
|
|
6184
6222
|
render() {
|
|
6185
|
-
return
|
|
6223
|
+
return T` <slot name="prompt"></slot>
|
|
6186
6224
|
<slot></slot>`;
|
|
6187
6225
|
}
|
|
6188
6226
|
constructor() {
|
|
@@ -6309,12 +6347,12 @@ var QtiOrderInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6309
6347
|
if (this.nrChoices < choices.length) {
|
|
6310
6348
|
this.nrChoices = choices.length;
|
|
6311
6349
|
}
|
|
6312
|
-
return
|
|
6350
|
+
return T` <slot name="prompt"> </slot>
|
|
6313
6351
|
<div part="container">
|
|
6314
6352
|
<slot part="drags"> </slot>
|
|
6315
6353
|
<div part="drops">
|
|
6316
6354
|
${[...Array(this.nrChoices)].map(
|
|
6317
|
-
(_, i5) =>
|
|
6355
|
+
(_, i5) => T`<drop-list role="region" part="drop-list" identifier="droplist${i5}"></drop-list>`
|
|
6318
6356
|
)}
|
|
6319
6357
|
</div>
|
|
6320
6358
|
</div>`;
|
|
@@ -8123,9 +8161,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8123
8161
|
}
|
|
8124
8162
|
#previousState;
|
|
8125
8163
|
render() {
|
|
8126
|
-
return
|
|
8164
|
+
return T`
|
|
8127
8165
|
<slot></slot>
|
|
8128
|
-
${this._errorMessage ?
|
|
8166
|
+
${this._errorMessage ? T`<div style="color:red">
|
|
8129
8167
|
<h1>Error</h1>
|
|
8130
8168
|
${this._errorMessage}
|
|
8131
8169
|
</div>` : ""}
|
|
@@ -8188,7 +8226,7 @@ var QtiPositionObjectInteraction = class extends i2 {
|
|
|
8188
8226
|
this.styles = qti_position_object_interaction_styles_default;
|
|
8189
8227
|
}
|
|
8190
8228
|
render() {
|
|
8191
|
-
return
|
|
8229
|
+
return T`<slot></slot>`;
|
|
8192
8230
|
}
|
|
8193
8231
|
};
|
|
8194
8232
|
|
|
@@ -8206,7 +8244,7 @@ var QtiPositionObjectStage = class extends i2 {
|
|
|
8206
8244
|
this.styles = qti_position_object_stage_styles_default;
|
|
8207
8245
|
}
|
|
8208
8246
|
render() {
|
|
8209
|
-
return
|
|
8247
|
+
return T`<slot></slot>`;
|
|
8210
8248
|
}
|
|
8211
8249
|
constructor() {
|
|
8212
8250
|
super();
|
|
@@ -8245,7 +8283,7 @@ var QtiPositionObjectStage = class extends i2 {
|
|
|
8245
8283
|
}
|
|
8246
8284
|
};
|
|
8247
8285
|
|
|
8248
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
8286
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/style-map.js
|
|
8249
8287
|
var n2 = "important";
|
|
8250
8288
|
var i4 = " !" + n2;
|
|
8251
8289
|
var o4 = e2(class extends i3 {
|
|
@@ -8253,24 +8291,24 @@ var o4 = e2(class extends i3 {
|
|
|
8253
8291
|
if (super(t2), t2.type !== t.ATTRIBUTE || "style" !== t2.name || t2.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
8254
8292
|
}
|
|
8255
8293
|
render(t2) {
|
|
8256
|
-
return Object.keys(t2).reduce((
|
|
8257
|
-
const
|
|
8258
|
-
return null ==
|
|
8259
|
-
}
|
|
8294
|
+
return Object.keys(t2).reduce((e5, r2) => {
|
|
8295
|
+
const s = t2[r2];
|
|
8296
|
+
return null == s ? e5 : e5 + `${r2 = r2.includes("-") ? r2 : r2.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
|
|
8297
|
+
}, "");
|
|
8260
8298
|
}
|
|
8261
8299
|
update(e5, [r2]) {
|
|
8262
|
-
const { style:
|
|
8300
|
+
const { style: s } = e5.element;
|
|
8263
8301
|
if (void 0 === this.ft) return this.ft = new Set(Object.keys(r2)), this.render(r2);
|
|
8264
|
-
for (const t2 of this.ft) null == r2[t2] && (this.ft.delete(t2), t2.includes("-") ?
|
|
8302
|
+
for (const t2 of this.ft) null == r2[t2] && (this.ft.delete(t2), t2.includes("-") ? s.removeProperty(t2) : s[t2] = null);
|
|
8265
8303
|
for (const t2 in r2) {
|
|
8266
8304
|
const e6 = r2[t2];
|
|
8267
8305
|
if (null != e6) {
|
|
8268
8306
|
this.ft.add(t2);
|
|
8269
8307
|
const r3 = "string" == typeof e6 && e6.endsWith(i4);
|
|
8270
|
-
t2.includes("-") || r3 ?
|
|
8308
|
+
t2.includes("-") || r3 ? s.setProperty(t2, r3 ? e6.slice(0, -11) : e6, r3 ? n2 : "") : s[t2] = e6;
|
|
8271
8309
|
}
|
|
8272
8310
|
}
|
|
8273
|
-
return
|
|
8311
|
+
return E;
|
|
8274
8312
|
}
|
|
8275
8313
|
});
|
|
8276
8314
|
|
|
@@ -8318,9 +8356,9 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8318
8356
|
}
|
|
8319
8357
|
this.#calculateScale();
|
|
8320
8358
|
const rect = this.#imgElement.getBoundingClientRect();
|
|
8321
|
-
const
|
|
8359
|
+
const x = (event.clientX - rect.left) * this.#scaleX;
|
|
8322
8360
|
const y = (event.clientY - rect.top) * this.#scaleY;
|
|
8323
|
-
const newPoint = `${
|
|
8361
|
+
const newPoint = `${x.toFixed()} ${y.toFixed()}`;
|
|
8324
8362
|
if (this.maxChoices === 1) {
|
|
8325
8363
|
this.response = [newPoint];
|
|
8326
8364
|
} else {
|
|
@@ -8351,8 +8389,8 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8351
8389
|
#onResize;
|
|
8352
8390
|
get responsePoints() {
|
|
8353
8391
|
return (this.response || []).filter((point) => point).map((point) => {
|
|
8354
|
-
const [
|
|
8355
|
-
return { x
|
|
8392
|
+
const [x, y] = point.split(" ").map(Number);
|
|
8393
|
+
return { x, y };
|
|
8356
8394
|
});
|
|
8357
8395
|
}
|
|
8358
8396
|
toggleCandidateCorrection(show) {
|
|
@@ -8422,14 +8460,14 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8422
8460
|
}
|
|
8423
8461
|
}
|
|
8424
8462
|
render() {
|
|
8425
|
-
return
|
|
8463
|
+
return T` <slot name="prompt"></slot>
|
|
8426
8464
|
<point-container>
|
|
8427
8465
|
${c2(
|
|
8428
8466
|
(this.response || []).filter((point) => point),
|
|
8429
8467
|
(point) => point,
|
|
8430
8468
|
(point, index) => {
|
|
8431
|
-
const [
|
|
8432
|
-
const leftPercentage =
|
|
8469
|
+
const [x, y] = point.split(" ").map(Number);
|
|
8470
|
+
const leftPercentage = x / (this.#imageWidthOriginal || 1) * 100;
|
|
8433
8471
|
const topPercentage = y / (this.#imageHeightOriginal || 1) * 100;
|
|
8434
8472
|
const baseSize = 16;
|
|
8435
8473
|
const widthPercentage = baseSize / (this.#imageWidthOriginal || 1) * 100;
|
|
@@ -8440,7 +8478,7 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8440
8478
|
} else if (this._responseCorrection[index] === false) {
|
|
8441
8479
|
correctionPart = " incorrect";
|
|
8442
8480
|
}
|
|
8443
|
-
return
|
|
8481
|
+
return T`
|
|
8444
8482
|
<button
|
|
8445
8483
|
part="point${correctionPart}"
|
|
8446
8484
|
style=${o4({
|
|
@@ -8472,7 +8510,7 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8472
8510
|
${c2(
|
|
8473
8511
|
this._correctAreas?.filter((area) => area) || [],
|
|
8474
8512
|
(area) => area,
|
|
8475
|
-
(area, i5) =>
|
|
8513
|
+
(area, i5) => T`<div
|
|
8476
8514
|
style=${o4({
|
|
8477
8515
|
position: "absolute",
|
|
8478
8516
|
pointerEvents: "none",
|
|
@@ -8683,7 +8721,7 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
8683
8721
|
this.requestUpdate();
|
|
8684
8722
|
}
|
|
8685
8723
|
render() {
|
|
8686
|
-
return
|
|
8724
|
+
return T`
|
|
8687
8725
|
<slot name="prompt"></slot>
|
|
8688
8726
|
<div id="slider" part="slider">
|
|
8689
8727
|
<div id="bounds" part="bounds">
|
|
@@ -8698,7 +8736,7 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
8698
8736
|
<div id="value" part="value">${this.response}</div>
|
|
8699
8737
|
</div>
|
|
8700
8738
|
|
|
8701
|
-
${this.#correctResponseNumber !== null ?
|
|
8739
|
+
${this.#correctResponseNumber !== null ? T`
|
|
8702
8740
|
<div id="knob-correct" part="knob-correct">
|
|
8703
8741
|
<div id="value" part="value">${this.#correctResponseNumber}</div>
|
|
8704
8742
|
</div>
|
|
@@ -8756,24 +8794,24 @@ __decorateClass([
|
|
|
8756
8794
|
n({ type: Number, attribute: "step" })
|
|
8757
8795
|
], QtiSliderInteraction.prototype, "step", 2);
|
|
8758
8796
|
|
|
8759
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
8760
|
-
var e4 = () => new
|
|
8761
|
-
var
|
|
8797
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/ref.js
|
|
8798
|
+
var e4 = () => new h2();
|
|
8799
|
+
var h2 = class {
|
|
8762
8800
|
};
|
|
8763
8801
|
var o5 = /* @__PURE__ */ new WeakMap();
|
|
8764
8802
|
var n3 = e2(class extends f {
|
|
8765
8803
|
render(i5) {
|
|
8766
|
-
return
|
|
8804
|
+
return A;
|
|
8767
8805
|
}
|
|
8768
|
-
update(i5, [
|
|
8769
|
-
const e5 =
|
|
8770
|
-
return e5 && void 0 !== this.G && this.rt(void 0), (e5 || this.lt !== this.ct) && (this.G =
|
|
8806
|
+
update(i5, [s]) {
|
|
8807
|
+
const e5 = s !== this.G;
|
|
8808
|
+
return e5 && void 0 !== this.G && this.rt(void 0), (e5 || this.lt !== this.ct) && (this.G = s, this.ht = i5.options?.host, this.rt(this.ct = i5.element)), A;
|
|
8771
8809
|
}
|
|
8772
8810
|
rt(t2) {
|
|
8773
8811
|
if (this.isConnected || (t2 = void 0), "function" == typeof this.G) {
|
|
8774
8812
|
const i5 = this.ht ?? globalThis;
|
|
8775
|
-
let
|
|
8776
|
-
void 0 ===
|
|
8813
|
+
let s = o5.get(i5);
|
|
8814
|
+
void 0 === s && (s = /* @__PURE__ */ new WeakMap(), o5.set(i5, s)), void 0 !== s.get(this.G) && this.G.call(this.ht, void 0), s.set(this.G, t2), void 0 !== t2 && this.G.call(this.ht, t2);
|
|
8777
8815
|
} else this.G.value = t2;
|
|
8778
8816
|
}
|
|
8779
8817
|
get lt() {
|
|
@@ -8980,7 +9018,7 @@ var QtiTextEntryInteraction = class extends Interaction {
|
|
|
8980
9018
|
}
|
|
8981
9019
|
}
|
|
8982
9020
|
render() {
|
|
8983
|
-
return
|
|
9021
|
+
return T`
|
|
8984
9022
|
<input
|
|
8985
9023
|
part="input"
|
|
8986
9024
|
name="${this.responseIdentifier}"
|
|
@@ -9000,7 +9038,7 @@ var QtiTextEntryInteraction = class extends Interaction {
|
|
|
9000
9038
|
?disabled="${this.disabled}"
|
|
9001
9039
|
?readonly="${this.readonly}"
|
|
9002
9040
|
/>
|
|
9003
|
-
${this._correctResponse ?
|
|
9041
|
+
${this._correctResponse ? T`<div part="correct">${this._correctResponse}</div>` : A}
|
|
9004
9042
|
`;
|
|
9005
9043
|
}
|
|
9006
9044
|
// ${this._correctResponse ? html`<div popover part="correct">${this._correctResponse}</div>` : nothing}
|
|
@@ -9097,7 +9135,7 @@ var QtiUploadInteraction = class extends Interaction {
|
|
|
9097
9135
|
};
|
|
9098
9136
|
}
|
|
9099
9137
|
render() {
|
|
9100
|
-
return
|
|
9138
|
+
return T`
|
|
9101
9139
|
<div>
|
|
9102
9140
|
<slot name="prompt"></slot>
|
|
9103
9141
|
<input type="file" @change="${this.#onFileChange}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" />
|
|
@@ -9276,7 +9314,7 @@ var QtiPortableCustomInteractionTest = class extends QtiPortableCustomInteractio
|
|
|
9276
9314
|
* @param y The y coordinate
|
|
9277
9315
|
* @returns Promise that resolves when the click is performed
|
|
9278
9316
|
*/
|
|
9279
|
-
async iFrameMouseClick(
|
|
9317
|
+
async iFrameMouseClick(x, y) {
|
|
9280
9318
|
return new Promise((resolve) => {
|
|
9281
9319
|
const messageId = `click-${Date.now()}`;
|
|
9282
9320
|
const messageHandler = (event) => {
|
|
@@ -9287,7 +9325,7 @@ var QtiPortableCustomInteractionTest = class extends QtiPortableCustomInteractio
|
|
|
9287
9325
|
}
|
|
9288
9326
|
};
|
|
9289
9327
|
window.addEventListener("message", messageHandler);
|
|
9290
|
-
this.sendMessageToIframe("simulateClick", { x
|
|
9328
|
+
this.sendMessageToIframe("simulateClick", { x, y, messageId });
|
|
9291
9329
|
setTimeout(() => {
|
|
9292
9330
|
window.removeEventListener("message", messageHandler);
|
|
9293
9331
|
resolve();
|
|
@@ -9718,4 +9756,4 @@ lit-html/node/directives/ref.js:
|
|
|
9718
9756
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9719
9757
|
*)
|
|
9720
9758
|
*/
|
|
9721
|
-
//# sourceMappingURL=chunk-
|
|
9759
|
+
//# sourceMappingURL=chunk-XYTJOQRZ.js.map
|