@citolab/qti-components 7.27.2 → 7.27.3
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 +216 -202
- package/dist/base.js +1 -1
- package/dist/{chunk-QUWFDFGZ.js → chunk-3XXXAWMZ.js} +18 -18
- package/dist/{chunk-TORB5UN2.js → chunk-A7HX4462.js} +291 -242
- package/dist/chunk-A7HX4462.js.map +1 -0
- package/dist/{chunk-KY3II5OX.js → chunk-CSYOTHK2.js} +220 -189
- package/dist/chunk-CSYOTHK2.js.map +1 -0
- package/dist/{chunk-G5ZUC3OT.js → chunk-CVB5ISWF.js} +23 -23
- package/dist/chunk-CVB5ISWF.js.map +1 -0
- package/dist/{chunk-TZMDZQFG.js → chunk-D6EHVZG2.js} +467 -217
- package/dist/chunk-D6EHVZG2.js.map +1 -0
- package/dist/{chunk-DG5TP35K.js → chunk-DGIXWHK3.js} +5 -5
- package/dist/{chunk-DG5TP35K.js.map → chunk-DGIXWHK3.js.map} +1 -1
- package/dist/{chunk-GG36UR7F.js → chunk-PHCCFYNE.js} +12 -12
- package/dist/{chunk-GG36UR7F.js.map → chunk-PHCCFYNE.js.map} +1 -1
- package/dist/{chunk-75ME6QG5.js → chunk-WMPG7ULB.js} +17 -17
- package/dist/elements.js +3 -3
- package/dist/index.js +8 -8
- package/dist/interactions.d.ts +8 -7
- package/dist/interactions.js +3 -3
- package/dist/item.js +3 -3
- package/dist/processing.js +2 -2
- package/dist/qti-components-jsx.d.ts +202 -202
- package/dist/test.js +5 -5
- package/package.json +11 -11
- package/dist/chunk-G5ZUC3OT.js.map +0 -1
- package/dist/chunk-KY3II5OX.js.map +0 -1
- package/dist/chunk-TORB5UN2.js.map +0 -1
- package/dist/chunk-TZMDZQFG.js.map +0 -1
- /package/dist/{chunk-QUWFDFGZ.js.map → chunk-3XXXAWMZ.js.map} +0 -0
- /package/dist/{chunk-75ME6QG5.js.map → chunk-WMPG7ULB.js.map} +0 -0
|
@@ -1,49 +1,52 @@
|
|
|
1
1
|
import {
|
|
2
2
|
o as o2
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DGIXWHK3.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-A7HX4462.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
|
};
|
|
@@ -2488,9 +2519,9 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2488
2519
|
updateClonePosition(clientX, clientY) {
|
|
2489
2520
|
if (!this.dragState.dragClone) return;
|
|
2490
2521
|
const { startOffset } = this.dragState;
|
|
2491
|
-
const
|
|
2522
|
+
const x = clientX - startOffset.x;
|
|
2492
2523
|
const y = clientY - startOffset.y;
|
|
2493
|
-
this.dragState.dragClone.style.left = `${
|
|
2524
|
+
this.dragState.dragClone.style.left = `${x}px`;
|
|
2494
2525
|
this.dragState.dragClone.style.top = `${y}px`;
|
|
2495
2526
|
}
|
|
2496
2527
|
activateAllDroppables() {
|
|
@@ -3452,11 +3483,11 @@ var QtiAssociateInteraction = class extends DragDropSlottedSortableMixin(Slotted
|
|
|
3452
3483
|
}) ?? [];
|
|
3453
3484
|
}
|
|
3454
3485
|
render() {
|
|
3455
|
-
return
|
|
3486
|
+
return T` <slot name="prompt"></slot>
|
|
3456
3487
|
<slot name="qti-simple-associable-choice"></slot>
|
|
3457
3488
|
<div part="drop-container">
|
|
3458
3489
|
${this._childrenMap.length > 0 && Array.from(Array(Math.ceil(this._childrenMap.length / 2)).keys()).map(
|
|
3459
|
-
(_, index) =>
|
|
3490
|
+
(_, index) => T`<div part="associables-container">
|
|
3460
3491
|
<div name="left${index}" part="drop-list" class="dl" identifier="droplist${index}_left"></div>
|
|
3461
3492
|
<div name="right${index}" part="drop-list" class="dl" identifier="droplist${index}_right"></div>
|
|
3462
3493
|
</div>`
|
|
@@ -3818,7 +3849,7 @@ var VocabularyMixin = (superClass, _selector) => {
|
|
|
3818
3849
|
return choiceElements.map((choice, index) => {
|
|
3819
3850
|
const order = Number(choice.style.order);
|
|
3820
3851
|
return { el: choice, order: Number.isFinite(order) ? order : index + 1, index };
|
|
3821
|
-
}).sort((a,
|
|
3852
|
+
}).sort((a, b2) => a.order - b2.order || a.index - b2.index).map((choice) => choice.el);
|
|
3822
3853
|
}
|
|
3823
3854
|
#getActiveLabelType() {
|
|
3824
3855
|
return this.#classes.filter((c3) => this.#allLabels.includes(c3)).pop() ?? null;
|
|
@@ -3962,7 +3993,7 @@ var QtiChoiceInteraction = class extends VocabularyMixin(ChoicesMixin(Interactio
|
|
|
3962
3993
|
this.style.setProperty("--item-count", choices.length.toString());
|
|
3963
3994
|
}
|
|
3964
3995
|
render() {
|
|
3965
|
-
return
|
|
3996
|
+
return T`
|
|
3966
3997
|
<slot part="prompt" name="prompt"></slot>
|
|
3967
3998
|
<slot part="slot" @slotchange=${this.#handleSlotChange}></slot>
|
|
3968
3999
|
<div part="message" role="alert" id="validation-message"></div>
|
|
@@ -4404,7 +4435,7 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4404
4435
|
super.disconnectedCallback();
|
|
4405
4436
|
}
|
|
4406
4437
|
render() {
|
|
4407
|
-
return
|
|
4438
|
+
return T`<iframe
|
|
4408
4439
|
width=${this.getAttribute("width")}
|
|
4409
4440
|
height=${this.getAttribute("height")}
|
|
4410
4441
|
frameborder="0"
|
|
@@ -4412,7 +4443,7 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
4412
4443
|
id="pciContainer"
|
|
4413
4444
|
>
|
|
4414
4445
|
</iframe>
|
|
4415
|
-
${this._errorMessage &&
|
|
4446
|
+
${this._errorMessage && T`<div style="color:red">
|
|
4416
4447
|
<h1>Error</h1>
|
|
4417
4448
|
${this._errorMessage}
|
|
4418
4449
|
</div>`}`;
|
|
@@ -4494,7 +4525,7 @@ var QtiEndAttemptInteraction = class extends i2 {
|
|
|
4494
4525
|
this.styles = qti_end_attempt_interaction_styles_default;
|
|
4495
4526
|
}
|
|
4496
4527
|
render() {
|
|
4497
|
-
return
|
|
4528
|
+
return T`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`;
|
|
4498
4529
|
}
|
|
4499
4530
|
endAttempt(_) {
|
|
4500
4531
|
this.dispatchEvent(
|
|
@@ -4599,7 +4630,7 @@ var QtiExtendedTextInteraction = class extends Interaction {
|
|
|
4599
4630
|
return isValid;
|
|
4600
4631
|
}
|
|
4601
4632
|
render() {
|
|
4602
|
-
return
|
|
4633
|
+
return T`<slot name="prompt"></slot
|
|
4603
4634
|
><textarea
|
|
4604
4635
|
part="textarea"
|
|
4605
4636
|
name="${this.responseIdentifier}"
|
|
@@ -4709,7 +4740,7 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4709
4740
|
this.styles = qti_gap_match_interaction_styles_default;
|
|
4710
4741
|
}
|
|
4711
4742
|
render() {
|
|
4712
|
-
return
|
|
4743
|
+
return T`<slot name="prompt"> </slot>
|
|
4713
4744
|
<slot part="drags" name="drags"></slot>
|
|
4714
4745
|
<slot part="drops"></slot>
|
|
4715
4746
|
<div role="alert" part="message" id="validation-message"></div>`;
|
|
@@ -4720,15 +4751,15 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4720
4751
|
let matches = [];
|
|
4721
4752
|
const response = Array.isArray(responseVariable.correctResponse) ? responseVariable.correctResponse : [responseVariable.correctResponse];
|
|
4722
4753
|
if (response) {
|
|
4723
|
-
matches = response.map((
|
|
4724
|
-
const split =
|
|
4754
|
+
matches = response.map((x) => {
|
|
4755
|
+
const split = x.split(" ");
|
|
4725
4756
|
return { text: split[0], gap: split[1] };
|
|
4726
4757
|
});
|
|
4727
4758
|
}
|
|
4728
4759
|
const gaps = this.querySelectorAll("qti-gap");
|
|
4729
4760
|
gaps.forEach((gap) => {
|
|
4730
4761
|
const identifier = gap.getAttribute("identifier");
|
|
4731
|
-
const textIdentifier = matches.find((
|
|
4762
|
+
const textIdentifier = matches.find((x) => x.gap === identifier)?.text;
|
|
4732
4763
|
const text = this.querySelector(`qti-gap-text[identifier="${textIdentifier}"]`)?.textContent.trim();
|
|
4733
4764
|
if (textIdentifier && text) {
|
|
4734
4765
|
if (!gap.nextElementSibling?.classList.contains("correct-option")) {
|
|
@@ -4759,8 +4790,8 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4759
4790
|
const correctResponse = Array.isArray(responseVariable.correctResponse) ? responseVariable.correctResponse : [responseVariable.correctResponse];
|
|
4760
4791
|
const matches = [];
|
|
4761
4792
|
if (correctResponse) {
|
|
4762
|
-
correctResponse.forEach((
|
|
4763
|
-
const split =
|
|
4793
|
+
correctResponse.forEach((x) => {
|
|
4794
|
+
const split = x.split(" ");
|
|
4764
4795
|
matches.push({ source: split[0], target: split[1] });
|
|
4765
4796
|
});
|
|
4766
4797
|
}
|
|
@@ -4775,7 +4806,7 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4775
4806
|
const targetChoices = Array.from(this.querySelectorAll("qti-gap"));
|
|
4776
4807
|
targetChoices.forEach((targetChoice) => {
|
|
4777
4808
|
const targetId = targetChoice.getAttribute("identifier");
|
|
4778
|
-
const targetMatches = matches.filter((
|
|
4809
|
+
const targetMatches = matches.filter((m) => m.target === targetId);
|
|
4779
4810
|
const selectedChoices = targetChoice.querySelectorAll(`qti-gap-text`);
|
|
4780
4811
|
selectedChoices.forEach((selectedChoice) => {
|
|
4781
4812
|
selectedChoice.internals.states.delete("candidate-correct");
|
|
@@ -4783,7 +4814,7 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4783
4814
|
if (!show) {
|
|
4784
4815
|
return;
|
|
4785
4816
|
}
|
|
4786
|
-
const isCorrect = targetMatches.find((
|
|
4817
|
+
const isCorrect = targetMatches.find((m) => m.source === selectedChoice.identifier)?.source !== void 0;
|
|
4787
4818
|
if (isCorrect) {
|
|
4788
4819
|
selectedChoice.internals.states.add("candidate-correct");
|
|
4789
4820
|
} else {
|
|
@@ -4794,56 +4825,56 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedB
|
|
|
4794
4825
|
}
|
|
4795
4826
|
};
|
|
4796
4827
|
|
|
4797
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
4798
|
-
var
|
|
4828
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/repeat.js
|
|
4829
|
+
var u2 = (e5, s, t2) => {
|
|
4799
4830
|
const r2 = /* @__PURE__ */ new Map();
|
|
4800
|
-
for (let l =
|
|
4831
|
+
for (let l = s; l <= t2; l++) r2.set(e5[l], l);
|
|
4801
4832
|
return r2;
|
|
4802
4833
|
};
|
|
4803
4834
|
var c2 = e2(class extends i3 {
|
|
4804
4835
|
constructor(e5) {
|
|
4805
4836
|
if (super(e5), e5.type !== t.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
4806
4837
|
}
|
|
4807
|
-
dt(e5,
|
|
4838
|
+
dt(e5, s, t2) {
|
|
4808
4839
|
let r2;
|
|
4809
|
-
void 0 === t2 ? t2 =
|
|
4840
|
+
void 0 === t2 ? t2 = s : void 0 !== s && (r2 = s);
|
|
4810
4841
|
const l = [], o6 = [];
|
|
4811
4842
|
let i5 = 0;
|
|
4812
|
-
for (const
|
|
4843
|
+
for (const s2 of e5) l[i5] = r2 ? r2(s2, i5) : i5, o6[i5] = t2(s2, i5), i5++;
|
|
4813
4844
|
return { values: o6, keys: l };
|
|
4814
4845
|
}
|
|
4815
|
-
render(e5,
|
|
4816
|
-
return this.dt(e5,
|
|
4846
|
+
render(e5, s, t2) {
|
|
4847
|
+
return this.dt(e5, s, t2).values;
|
|
4817
4848
|
}
|
|
4818
|
-
update(
|
|
4819
|
-
const d =
|
|
4849
|
+
update(s, [t2, r2, c3]) {
|
|
4850
|
+
const d = M(s), { values: p2, keys: a } = this.dt(t2, r2, c3);
|
|
4820
4851
|
if (!Array.isArray(d)) return this.ut = a, p2;
|
|
4821
|
-
const
|
|
4822
|
-
let
|
|
4823
|
-
for (;
|
|
4852
|
+
const h3 = this.ut ??= [], v2 = [];
|
|
4853
|
+
let m, y, x = 0, j = d.length - 1, k = 0, w = p2.length - 1;
|
|
4854
|
+
for (; x <= j && k <= w; ) if (null === d[x]) x++;
|
|
4824
4855
|
else if (null === d[j]) j--;
|
|
4825
|
-
else if (
|
|
4826
|
-
else if (
|
|
4827
|
-
else if (
|
|
4828
|
-
else if (
|
|
4829
|
-
else if (void 0 ===
|
|
4856
|
+
else if (h3[x] === a[k]) v2[k] = u(d[x], p2[k]), x++, k++;
|
|
4857
|
+
else if (h3[j] === a[w]) v2[w] = u(d[j], p2[w]), j--, w--;
|
|
4858
|
+
else if (h3[x] === a[w]) v2[w] = u(d[x], p2[w]), v(s, v2[w + 1], d[x]), x++, w--;
|
|
4859
|
+
else if (h3[j] === a[k]) v2[k] = u(d[j], p2[k]), v(s, d[x], d[j]), j--, k++;
|
|
4860
|
+
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
4861
|
const e5 = y.get(a[k]), t3 = void 0 !== e5 ? d[e5] : null;
|
|
4831
4862
|
if (null === t3) {
|
|
4832
|
-
const e6 = s
|
|
4833
|
-
|
|
4834
|
-
} else v2[k] =
|
|
4863
|
+
const e6 = v(s, d[x]);
|
|
4864
|
+
u(e6, p2[k]), v2[k] = e6;
|
|
4865
|
+
} else v2[k] = u(t3, p2[k]), v(s, d[x], t3), d[e5] = null;
|
|
4835
4866
|
k++;
|
|
4836
|
-
} else
|
|
4837
|
-
else
|
|
4838
|
-
for (; k <=
|
|
4839
|
-
const e5 = s
|
|
4840
|
-
|
|
4867
|
+
} else h(d[j]), j--;
|
|
4868
|
+
else h(d[x]), x++;
|
|
4869
|
+
for (; k <= w; ) {
|
|
4870
|
+
const e5 = v(s, v2[w + 1]);
|
|
4871
|
+
u(e5, p2[k]), v2[k++] = e5;
|
|
4841
4872
|
}
|
|
4842
|
-
for (;
|
|
4843
|
-
const e5 = d[
|
|
4844
|
-
null !== e5 &&
|
|
4873
|
+
for (; x <= j; ) {
|
|
4874
|
+
const e5 = d[x++];
|
|
4875
|
+
null !== e5 && h(e5);
|
|
4845
4876
|
}
|
|
4846
|
-
return this.ut = a,
|
|
4877
|
+
return this.ut = a, p(s, v2), E;
|
|
4847
4878
|
}
|
|
4848
4879
|
});
|
|
4849
4880
|
|
|
@@ -5018,7 +5049,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5018
5049
|
this._correctLines = correctResponses;
|
|
5019
5050
|
}
|
|
5020
5051
|
render() {
|
|
5021
|
-
return
|
|
5052
|
+
return T`<slot name="prompt"></slot>
|
|
5022
5053
|
<line-container>
|
|
5023
5054
|
<svg
|
|
5024
5055
|
width=${o2(this.grImage[0]?.width)}
|
|
@@ -5028,7 +5059,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5028
5059
|
${c2(
|
|
5029
5060
|
this.#getResponseArray(),
|
|
5030
5061
|
(line) => line,
|
|
5031
|
-
(line, index) =>
|
|
5062
|
+
(line, index) => b`
|
|
5032
5063
|
<line
|
|
5033
5064
|
part="line"
|
|
5034
5065
|
x1=${parseInt(this.querySelector(`[identifier=${line.split(" ")[0]}]`).style.left)}
|
|
@@ -5048,7 +5079,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5048
5079
|
${c2(
|
|
5049
5080
|
this._correctLines || [],
|
|
5050
5081
|
(line) => line,
|
|
5051
|
-
(line, _index) =>
|
|
5082
|
+
(line, _index) => b`
|
|
5052
5083
|
<line
|
|
5053
5084
|
part="correct-line"
|
|
5054
5085
|
x1=${parseInt(this.querySelector(`[identifier=${line.split(" ")[0]}]`).style.left)}
|
|
@@ -5061,7 +5092,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5061
5092
|
/>
|
|
5062
5093
|
`
|
|
5063
5094
|
)}
|
|
5064
|
-
${this.#startPoint &&
|
|
5095
|
+
${this.#startPoint && b`<line
|
|
5065
5096
|
part="point"
|
|
5066
5097
|
x1=${this.startCoord.x}
|
|
5067
5098
|
y1=${this.startCoord.y}
|
|
@@ -5080,7 +5111,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
5080
5111
|
const hotspot = e5.target;
|
|
5081
5112
|
const coords = hotspot.getAttribute("coords");
|
|
5082
5113
|
const shape = hotspot.getAttribute("shape");
|
|
5083
|
-
const coordsNumber = coords.split(",").map((
|
|
5114
|
+
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
5084
5115
|
positionShapes(shape, coordsNumber, img, hotspot);
|
|
5085
5116
|
}
|
|
5086
5117
|
firstUpdated() {
|
|
@@ -5210,7 +5241,7 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
5210
5241
|
this.styles = qti_graphic_gap_match_interaction_styles_default;
|
|
5211
5242
|
}
|
|
5212
5243
|
render() {
|
|
5213
|
-
return
|
|
5244
|
+
return T` <slot name="prompt"></slot>
|
|
5214
5245
|
<slot part="image"></slot>
|
|
5215
5246
|
<slot part="drags" name="drags" class="hover-border"></slot>
|
|
5216
5247
|
<div role="alert" part="message" id="validation-message"></div>`;
|
|
@@ -5222,7 +5253,7 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
5222
5253
|
const hotspot = e5.target;
|
|
5223
5254
|
const coords = hotspot.getAttribute("coords");
|
|
5224
5255
|
const shape = hotspot.getAttribute("shape");
|
|
5225
|
-
const coordsNumber = coords.split(",").map((
|
|
5256
|
+
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
5226
5257
|
switch (shape) {
|
|
5227
5258
|
case "circle":
|
|
5228
5259
|
{
|
|
@@ -5279,7 +5310,7 @@ var QtiGraphicOrderInteraction = class extends ChoicesMixin(Interaction, "qti-ho
|
|
|
5279
5310
|
this.styles = qti_graphic_order_interaction_styles_default;
|
|
5280
5311
|
}
|
|
5281
5312
|
render() {
|
|
5282
|
-
return
|
|
5313
|
+
return T`
|
|
5283
5314
|
<slot name="prompt"></slot>
|
|
5284
5315
|
<slot></slot>
|
|
5285
5316
|
<div role="alert" part="message" id="validation-message"></div>
|
|
@@ -5332,7 +5363,7 @@ var QtiGraphicOrderInteraction = class extends ChoicesMixin(Interaction, "qti-ho
|
|
|
5332
5363
|
const hotspot = e5.target;
|
|
5333
5364
|
const coords = hotspot.getAttribute("coords");
|
|
5334
5365
|
const shape = hotspot.getAttribute("shape");
|
|
5335
|
-
const coordsNumber = coords.split(",").map((
|
|
5366
|
+
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
5336
5367
|
positionShapes(shape, coordsNumber, img, hotspot);
|
|
5337
5368
|
}
|
|
5338
5369
|
connectedCallback() {
|
|
@@ -5370,7 +5401,7 @@ var QtiHotspotInteraction = class extends ChoicesMixin(Interaction, "qti-hotspot
|
|
|
5370
5401
|
this.styles = qti_hotspot_interaction_styles_default;
|
|
5371
5402
|
}
|
|
5372
5403
|
render() {
|
|
5373
|
-
return
|
|
5404
|
+
return T`
|
|
5374
5405
|
<slot name="prompt"></slot>
|
|
5375
5406
|
<slot></slot>
|
|
5376
5407
|
`;
|
|
@@ -5397,7 +5428,7 @@ var QtiHotspotInteraction = class extends ChoicesMixin(Interaction, "qti-hotspot
|
|
|
5397
5428
|
const hotspot = e5.target;
|
|
5398
5429
|
const coords = hotspot.getAttribute("coords");
|
|
5399
5430
|
const shape = hotspot.getAttribute("shape");
|
|
5400
|
-
const coordsNumber = coords.split(",").map((
|
|
5431
|
+
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
5401
5432
|
const loadedImg = await this.#getImageLoadPromise(img);
|
|
5402
5433
|
positionShapes(shape, coordsNumber, loadedImg, hotspot);
|
|
5403
5434
|
}
|
|
@@ -5419,7 +5450,7 @@ var QtiHottextInteraction = class extends ChoicesMixin(Interaction, "qti-hottext
|
|
|
5419
5450
|
constructor() {
|
|
5420
5451
|
super(...arguments);
|
|
5421
5452
|
this.class = "";
|
|
5422
|
-
this.render = () =>
|
|
5453
|
+
this.render = () => T`<slot></slot>
|
|
5423
5454
|
<div part="message" role="alert" id="validation-message"></div>`;
|
|
5424
5455
|
}
|
|
5425
5456
|
static {
|
|
@@ -5459,19 +5490,19 @@ __decorateClass([
|
|
|
5459
5490
|
n({ type: String, reflect: true })
|
|
5460
5491
|
], QtiHottextInteraction.prototype, "class", 2);
|
|
5461
5492
|
|
|
5462
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
5493
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/unsafe-html.js
|
|
5463
5494
|
var e3 = class extends i3 {
|
|
5464
5495
|
constructor(i5) {
|
|
5465
|
-
if (super(i5), this.it =
|
|
5496
|
+
if (super(i5), this.it = A, i5.type !== t.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
5466
5497
|
}
|
|
5467
5498
|
render(r2) {
|
|
5468
|
-
if (r2 ===
|
|
5469
|
-
if (r2 ===
|
|
5499
|
+
if (r2 === A || null == r2) return this._t = void 0, this.it = r2;
|
|
5500
|
+
if (r2 === E) return r2;
|
|
5470
5501
|
if ("string" != typeof r2) throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
5471
5502
|
if (r2 === this.it) return this._t;
|
|
5472
5503
|
this.it = r2;
|
|
5473
|
-
const
|
|
5474
|
-
return
|
|
5504
|
+
const s = [r2];
|
|
5505
|
+
return s.raw = s, this._t = { _$litType$: this.constructor.resultType, strings: s, values: [] };
|
|
5475
5506
|
}
|
|
5476
5507
|
};
|
|
5477
5508
|
e3.directiveName = "unsafeHTML", e3.resultType = 1;
|
|
@@ -5617,7 +5648,7 @@ var QtiInlineChoiceInteraction = class extends Interaction {
|
|
|
5617
5648
|
}
|
|
5618
5649
|
render() {
|
|
5619
5650
|
const selected = this.#selectedOption();
|
|
5620
|
-
return
|
|
5651
|
+
return T`
|
|
5621
5652
|
<button
|
|
5622
5653
|
part="trigger"
|
|
5623
5654
|
type="button"
|
|
@@ -5993,8 +6024,8 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
5993
6024
|
const correctResponse = Array.isArray(responseVariable.correctResponse) ? responseVariable.correctResponse : [responseVariable.correctResponse];
|
|
5994
6025
|
const matches = [];
|
|
5995
6026
|
if (correctResponse) {
|
|
5996
|
-
correctResponse.forEach((
|
|
5997
|
-
const split =
|
|
6027
|
+
correctResponse.forEach((x) => {
|
|
6028
|
+
const split = x.split(" ");
|
|
5998
6029
|
matches.push({ source: split[0], target: split[1] });
|
|
5999
6030
|
});
|
|
6000
6031
|
}
|
|
@@ -6012,7 +6043,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6012
6043
|
this.querySelectorAll(".correct-option").forEach((el) => el.remove());
|
|
6013
6044
|
this.targetChoices.forEach((targetChoice) => {
|
|
6014
6045
|
const targetId = targetChoice.getAttribute("identifier");
|
|
6015
|
-
const match = matches.find((
|
|
6046
|
+
const match = matches.find((m) => m.target === targetId);
|
|
6016
6047
|
if (match?.source) {
|
|
6017
6048
|
const sourceChoice = this.querySelector(`qti-simple-associable-choice[identifier="${match.source}"]`);
|
|
6018
6049
|
const text = sourceChoice?.textContent?.trim();
|
|
@@ -6047,7 +6078,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6047
6078
|
const matches = this.#getMatches(responseVariable);
|
|
6048
6079
|
this.targetChoices.forEach((targetChoice) => {
|
|
6049
6080
|
const targetId = targetChoice.getAttribute("identifier");
|
|
6050
|
-
const targetMatches = matches.filter((
|
|
6081
|
+
const targetMatches = matches.filter((m) => m.target === targetId);
|
|
6051
6082
|
const selectedChoices = targetChoice.querySelectorAll(`qti-simple-associable-choice`);
|
|
6052
6083
|
selectedChoices.forEach((selectedChoice) => {
|
|
6053
6084
|
selectedChoice.internals.states.delete("candidate-correct");
|
|
@@ -6055,7 +6086,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6055
6086
|
if (!show) {
|
|
6056
6087
|
return;
|
|
6057
6088
|
}
|
|
6058
|
-
const isCorrect = targetMatches.find((
|
|
6089
|
+
const isCorrect = targetMatches.find((m) => m.source === selectedChoice.identifier)?.source !== void 0;
|
|
6059
6090
|
if (isCorrect) {
|
|
6060
6091
|
selectedChoice.internals.states.add("candidate-correct");
|
|
6061
6092
|
} else {
|
|
@@ -6067,19 +6098,19 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6067
6098
|
render() {
|
|
6068
6099
|
const isTabular = this.class.split(" ").includes("qti-match-tabular");
|
|
6069
6100
|
const hasCorrectResponse = this.correctOptions !== null;
|
|
6070
|
-
return
|
|
6101
|
+
return T`
|
|
6071
6102
|
<slot name="prompt"></slot>
|
|
6072
6103
|
<slot ?hidden=${isTabular}></slot>
|
|
6073
6104
|
|
|
6074
|
-
${isTabular ?
|
|
6105
|
+
${isTabular ? T`
|
|
6075
6106
|
<table part="table">
|
|
6076
6107
|
<tr part="r-header">
|
|
6077
6108
|
<td></td>
|
|
6078
|
-
${this.targetChoices.map((col) =>
|
|
6109
|
+
${this.targetChoices.map((col) => T`<th part="r-header">${o3(col.innerHTML)}</th>`)}
|
|
6079
6110
|
</tr>
|
|
6080
6111
|
|
|
6081
6112
|
${this.sourceChoices.map(
|
|
6082
|
-
(row) =>
|
|
6113
|
+
(row) => T`<tr part="row">
|
|
6083
6114
|
<td part="c-header">${o3(row.innerHTML)}</td>
|
|
6084
6115
|
${this.targetChoices.map((col) => {
|
|
6085
6116
|
const rowId = row.getAttribute("identifier");
|
|
@@ -6093,7 +6124,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6093
6124
|
);
|
|
6094
6125
|
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
6126
|
const disable = this.correctOptions?.length > 0 ? true : row.matchMax === 1 ? false : row.matchMax !== 0 && selectedInRowCount >= row.matchMax && !checked;
|
|
6096
|
-
return
|
|
6127
|
+
return T`<td part="input-cell">
|
|
6097
6128
|
<div
|
|
6098
6129
|
class="input-container"
|
|
6099
6130
|
style="position: relative; width: 24px; height: 24px; margin: 0 auto;"
|
|
@@ -6107,7 +6138,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6107
6138
|
@change=${(e5) => this.handleRadioChange(e5)}
|
|
6108
6139
|
@click=${(e5) => row.matchMax === 1 ? this.handleRadioClick(e5) : null}
|
|
6109
6140
|
/>
|
|
6110
|
-
${type === "checkbox" && checked ?
|
|
6141
|
+
${type === "checkbox" && checked ? T`
|
|
6111
6142
|
<svg
|
|
6112
6143
|
part="checkmark"
|
|
6113
6144
|
viewBox="0 0 24 24"
|
|
@@ -6122,7 +6153,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6122
6153
|
</tr>`
|
|
6123
6154
|
)}
|
|
6124
6155
|
</table>
|
|
6125
|
-
` :
|
|
6156
|
+
` : A}
|
|
6126
6157
|
|
|
6127
6158
|
<div role="alert" part="message" id="validation-message"></div>
|
|
6128
6159
|
`;
|
|
@@ -6182,7 +6213,7 @@ var QtiMediaInteraction = class extends Interaction {
|
|
|
6182
6213
|
};
|
|
6183
6214
|
}
|
|
6184
6215
|
render() {
|
|
6185
|
-
return
|
|
6216
|
+
return T` <slot name="prompt"></slot>
|
|
6186
6217
|
<slot></slot>`;
|
|
6187
6218
|
}
|
|
6188
6219
|
constructor() {
|
|
@@ -6309,12 +6340,12 @@ var QtiOrderInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
6309
6340
|
if (this.nrChoices < choices.length) {
|
|
6310
6341
|
this.nrChoices = choices.length;
|
|
6311
6342
|
}
|
|
6312
|
-
return
|
|
6343
|
+
return T` <slot name="prompt"> </slot>
|
|
6313
6344
|
<div part="container">
|
|
6314
6345
|
<slot part="drags"> </slot>
|
|
6315
6346
|
<div part="drops">
|
|
6316
6347
|
${[...Array(this.nrChoices)].map(
|
|
6317
|
-
(_, i5) =>
|
|
6348
|
+
(_, i5) => T`<drop-list role="region" part="drop-list" identifier="droplist${i5}"></drop-list>`
|
|
6318
6349
|
)}
|
|
6319
6350
|
</div>
|
|
6320
6351
|
</div>`;
|
|
@@ -8123,9 +8154,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8123
8154
|
}
|
|
8124
8155
|
#previousState;
|
|
8125
8156
|
render() {
|
|
8126
|
-
return
|
|
8157
|
+
return T`
|
|
8127
8158
|
<slot></slot>
|
|
8128
|
-
${this._errorMessage ?
|
|
8159
|
+
${this._errorMessage ? T`<div style="color:red">
|
|
8129
8160
|
<h1>Error</h1>
|
|
8130
8161
|
${this._errorMessage}
|
|
8131
8162
|
</div>` : ""}
|
|
@@ -8188,7 +8219,7 @@ var QtiPositionObjectInteraction = class extends i2 {
|
|
|
8188
8219
|
this.styles = qti_position_object_interaction_styles_default;
|
|
8189
8220
|
}
|
|
8190
8221
|
render() {
|
|
8191
|
-
return
|
|
8222
|
+
return T`<slot></slot>`;
|
|
8192
8223
|
}
|
|
8193
8224
|
};
|
|
8194
8225
|
|
|
@@ -8206,7 +8237,7 @@ var QtiPositionObjectStage = class extends i2 {
|
|
|
8206
8237
|
this.styles = qti_position_object_stage_styles_default;
|
|
8207
8238
|
}
|
|
8208
8239
|
render() {
|
|
8209
|
-
return
|
|
8240
|
+
return T`<slot></slot>`;
|
|
8210
8241
|
}
|
|
8211
8242
|
constructor() {
|
|
8212
8243
|
super();
|
|
@@ -8245,7 +8276,7 @@ var QtiPositionObjectStage = class extends i2 {
|
|
|
8245
8276
|
}
|
|
8246
8277
|
};
|
|
8247
8278
|
|
|
8248
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
8279
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/style-map.js
|
|
8249
8280
|
var n2 = "important";
|
|
8250
8281
|
var i4 = " !" + n2;
|
|
8251
8282
|
var o4 = e2(class extends i3 {
|
|
@@ -8253,24 +8284,24 @@ var o4 = e2(class extends i3 {
|
|
|
8253
8284
|
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
8285
|
}
|
|
8255
8286
|
render(t2) {
|
|
8256
|
-
return Object.keys(t2).reduce((
|
|
8257
|
-
const
|
|
8258
|
-
return null ==
|
|
8259
|
-
}
|
|
8287
|
+
return Object.keys(t2).reduce((e5, r2) => {
|
|
8288
|
+
const s = t2[r2];
|
|
8289
|
+
return null == s ? e5 : e5 + `${r2 = r2.includes("-") ? r2 : r2.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${s};`;
|
|
8290
|
+
}, "");
|
|
8260
8291
|
}
|
|
8261
8292
|
update(e5, [r2]) {
|
|
8262
|
-
const { style:
|
|
8293
|
+
const { style: s } = e5.element;
|
|
8263
8294
|
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("-") ?
|
|
8295
|
+
for (const t2 of this.ft) null == r2[t2] && (this.ft.delete(t2), t2.includes("-") ? s.removeProperty(t2) : s[t2] = null);
|
|
8265
8296
|
for (const t2 in r2) {
|
|
8266
8297
|
const e6 = r2[t2];
|
|
8267
8298
|
if (null != e6) {
|
|
8268
8299
|
this.ft.add(t2);
|
|
8269
8300
|
const r3 = "string" == typeof e6 && e6.endsWith(i4);
|
|
8270
|
-
t2.includes("-") || r3 ?
|
|
8301
|
+
t2.includes("-") || r3 ? s.setProperty(t2, r3 ? e6.slice(0, -11) : e6, r3 ? n2 : "") : s[t2] = e6;
|
|
8271
8302
|
}
|
|
8272
8303
|
}
|
|
8273
|
-
return
|
|
8304
|
+
return E;
|
|
8274
8305
|
}
|
|
8275
8306
|
});
|
|
8276
8307
|
|
|
@@ -8318,9 +8349,9 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8318
8349
|
}
|
|
8319
8350
|
this.#calculateScale();
|
|
8320
8351
|
const rect = this.#imgElement.getBoundingClientRect();
|
|
8321
|
-
const
|
|
8352
|
+
const x = (event.clientX - rect.left) * this.#scaleX;
|
|
8322
8353
|
const y = (event.clientY - rect.top) * this.#scaleY;
|
|
8323
|
-
const newPoint = `${
|
|
8354
|
+
const newPoint = `${x.toFixed()} ${y.toFixed()}`;
|
|
8324
8355
|
if (this.maxChoices === 1) {
|
|
8325
8356
|
this.response = [newPoint];
|
|
8326
8357
|
} else {
|
|
@@ -8351,8 +8382,8 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8351
8382
|
#onResize;
|
|
8352
8383
|
get responsePoints() {
|
|
8353
8384
|
return (this.response || []).filter((point) => point).map((point) => {
|
|
8354
|
-
const [
|
|
8355
|
-
return { x
|
|
8385
|
+
const [x, y] = point.split(" ").map(Number);
|
|
8386
|
+
return { x, y };
|
|
8356
8387
|
});
|
|
8357
8388
|
}
|
|
8358
8389
|
toggleCandidateCorrection(show) {
|
|
@@ -8422,14 +8453,14 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8422
8453
|
}
|
|
8423
8454
|
}
|
|
8424
8455
|
render() {
|
|
8425
|
-
return
|
|
8456
|
+
return T` <slot name="prompt"></slot>
|
|
8426
8457
|
<point-container>
|
|
8427
8458
|
${c2(
|
|
8428
8459
|
(this.response || []).filter((point) => point),
|
|
8429
8460
|
(point) => point,
|
|
8430
8461
|
(point, index) => {
|
|
8431
|
-
const [
|
|
8432
|
-
const leftPercentage =
|
|
8462
|
+
const [x, y] = point.split(" ").map(Number);
|
|
8463
|
+
const leftPercentage = x / (this.#imageWidthOriginal || 1) * 100;
|
|
8433
8464
|
const topPercentage = y / (this.#imageHeightOriginal || 1) * 100;
|
|
8434
8465
|
const baseSize = 16;
|
|
8435
8466
|
const widthPercentage = baseSize / (this.#imageWidthOriginal || 1) * 100;
|
|
@@ -8440,7 +8471,7 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8440
8471
|
} else if (this._responseCorrection[index] === false) {
|
|
8441
8472
|
correctionPart = " incorrect";
|
|
8442
8473
|
}
|
|
8443
|
-
return
|
|
8474
|
+
return T`
|
|
8444
8475
|
<button
|
|
8445
8476
|
part="point${correctionPart}"
|
|
8446
8477
|
style=${o4({
|
|
@@ -8472,7 +8503,7 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
8472
8503
|
${c2(
|
|
8473
8504
|
this._correctAreas?.filter((area) => area) || [],
|
|
8474
8505
|
(area) => area,
|
|
8475
|
-
(area, i5) =>
|
|
8506
|
+
(area, i5) => T`<div
|
|
8476
8507
|
style=${o4({
|
|
8477
8508
|
position: "absolute",
|
|
8478
8509
|
pointerEvents: "none",
|
|
@@ -8683,7 +8714,7 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
8683
8714
|
this.requestUpdate();
|
|
8684
8715
|
}
|
|
8685
8716
|
render() {
|
|
8686
|
-
return
|
|
8717
|
+
return T`
|
|
8687
8718
|
<slot name="prompt"></slot>
|
|
8688
8719
|
<div id="slider" part="slider">
|
|
8689
8720
|
<div id="bounds" part="bounds">
|
|
@@ -8698,7 +8729,7 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
8698
8729
|
<div id="value" part="value">${this.response}</div>
|
|
8699
8730
|
</div>
|
|
8700
8731
|
|
|
8701
|
-
${this.#correctResponseNumber !== null ?
|
|
8732
|
+
${this.#correctResponseNumber !== null ? T`
|
|
8702
8733
|
<div id="knob-correct" part="knob-correct">
|
|
8703
8734
|
<div id="value" part="value">${this.#correctResponseNumber}</div>
|
|
8704
8735
|
</div>
|
|
@@ -8756,24 +8787,24 @@ __decorateClass([
|
|
|
8756
8787
|
n({ type: Number, attribute: "step" })
|
|
8757
8788
|
], QtiSliderInteraction.prototype, "step", 2);
|
|
8758
8789
|
|
|
8759
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
8760
|
-
var e4 = () => new
|
|
8761
|
-
var
|
|
8790
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/ref.js
|
|
8791
|
+
var e4 = () => new h2();
|
|
8792
|
+
var h2 = class {
|
|
8762
8793
|
};
|
|
8763
8794
|
var o5 = /* @__PURE__ */ new WeakMap();
|
|
8764
8795
|
var n3 = e2(class extends f {
|
|
8765
8796
|
render(i5) {
|
|
8766
|
-
return
|
|
8797
|
+
return A;
|
|
8767
8798
|
}
|
|
8768
|
-
update(i5, [
|
|
8769
|
-
const e5 =
|
|
8770
|
-
return e5 && void 0 !== this.G && this.rt(void 0), (e5 || this.lt !== this.ct) && (this.G =
|
|
8799
|
+
update(i5, [s]) {
|
|
8800
|
+
const e5 = s !== this.G;
|
|
8801
|
+
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
8802
|
}
|
|
8772
8803
|
rt(t2) {
|
|
8773
8804
|
if (this.isConnected || (t2 = void 0), "function" == typeof this.G) {
|
|
8774
8805
|
const i5 = this.ht ?? globalThis;
|
|
8775
|
-
let
|
|
8776
|
-
void 0 ===
|
|
8806
|
+
let s = o5.get(i5);
|
|
8807
|
+
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
8808
|
} else this.G.value = t2;
|
|
8778
8809
|
}
|
|
8779
8810
|
get lt() {
|
|
@@ -8980,7 +9011,7 @@ var QtiTextEntryInteraction = class extends Interaction {
|
|
|
8980
9011
|
}
|
|
8981
9012
|
}
|
|
8982
9013
|
render() {
|
|
8983
|
-
return
|
|
9014
|
+
return T`
|
|
8984
9015
|
<input
|
|
8985
9016
|
part="input"
|
|
8986
9017
|
name="${this.responseIdentifier}"
|
|
@@ -9000,7 +9031,7 @@ var QtiTextEntryInteraction = class extends Interaction {
|
|
|
9000
9031
|
?disabled="${this.disabled}"
|
|
9001
9032
|
?readonly="${this.readonly}"
|
|
9002
9033
|
/>
|
|
9003
|
-
${this._correctResponse ?
|
|
9034
|
+
${this._correctResponse ? T`<div part="correct">${this._correctResponse}</div>` : A}
|
|
9004
9035
|
`;
|
|
9005
9036
|
}
|
|
9006
9037
|
// ${this._correctResponse ? html`<div popover part="correct">${this._correctResponse}</div>` : nothing}
|
|
@@ -9097,7 +9128,7 @@ var QtiUploadInteraction = class extends Interaction {
|
|
|
9097
9128
|
};
|
|
9098
9129
|
}
|
|
9099
9130
|
render() {
|
|
9100
|
-
return
|
|
9131
|
+
return T`
|
|
9101
9132
|
<div>
|
|
9102
9133
|
<slot name="prompt"></slot>
|
|
9103
9134
|
<input type="file" @change="${this.#onFileChange}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" />
|
|
@@ -9276,7 +9307,7 @@ var QtiPortableCustomInteractionTest = class extends QtiPortableCustomInteractio
|
|
|
9276
9307
|
* @param y The y coordinate
|
|
9277
9308
|
* @returns Promise that resolves when the click is performed
|
|
9278
9309
|
*/
|
|
9279
|
-
async iFrameMouseClick(
|
|
9310
|
+
async iFrameMouseClick(x, y) {
|
|
9280
9311
|
return new Promise((resolve) => {
|
|
9281
9312
|
const messageId = `click-${Date.now()}`;
|
|
9282
9313
|
const messageHandler = (event) => {
|
|
@@ -9287,7 +9318,7 @@ var QtiPortableCustomInteractionTest = class extends QtiPortableCustomInteractio
|
|
|
9287
9318
|
}
|
|
9288
9319
|
};
|
|
9289
9320
|
window.addEventListener("message", messageHandler);
|
|
9290
|
-
this.sendMessageToIframe("simulateClick", { x
|
|
9321
|
+
this.sendMessageToIframe("simulateClick", { x, y, messageId });
|
|
9291
9322
|
setTimeout(() => {
|
|
9292
9323
|
window.removeEventListener("message", messageHandler);
|
|
9293
9324
|
resolve();
|
|
@@ -9718,4 +9749,4 @@ lit-html/node/directives/ref.js:
|
|
|
9718
9749
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9719
9750
|
*)
|
|
9720
9751
|
*/
|
|
9721
|
-
//# sourceMappingURL=chunk-
|
|
9752
|
+
//# sourceMappingURL=chunk-CSYOTHK2.js.map
|