@citolab/qti-components 9.1.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +208 -200
- package/dist/base.d.ts +54 -11
- package/dist/base.js +11 -1
- package/dist/{chunk-QCPN7E6K.js → chunk-7PXUE2GR.js} +3375 -3251
- package/dist/chunk-7PXUE2GR.js.map +1 -0
- package/dist/{chunk-XE7BALDO.js → chunk-A32YH4H5.js} +2 -2
- package/dist/{chunk-XE7BALDO.js.map → chunk-A32YH4H5.js.map} +1 -1
- package/dist/{chunk-MKZ374OJ.js → chunk-FG5JAWSN.js} +2 -2
- package/dist/{chunk-3VQSUWCK.js → chunk-G5RQ5GKG.js} +407 -131
- package/dist/chunk-G5RQ5GKG.js.map +1 -0
- package/dist/{chunk-5SU3MP6Y.js → chunk-GPGUXZ3X.js} +20 -6
- package/dist/{chunk-5SU3MP6Y.js.map → chunk-GPGUXZ3X.js.map} +1 -1
- package/dist/{chunk-5BXJRO5O.js → chunk-JGPWBIVD.js} +389 -229
- package/dist/chunk-JGPWBIVD.js.map +1 -0
- package/dist/{chunk-RT6WZ3P7.js → chunk-JLZCZVRX.js} +2 -2
- package/dist/{chunk-6ITD55QE.js → chunk-LFVPS7KB.js} +2 -2
- package/dist/{chunk-DAUU2NJL.js → chunk-RAJQKCQ3.js} +66 -9
- package/dist/chunk-RAJQKCQ3.js.map +1 -0
- package/dist/{chunk-WKWCOV5P.js → chunk-REKCRWJV.js} +83 -21
- package/dist/chunk-REKCRWJV.js.map +1 -0
- package/dist/{chunk-HDEG6BAZ.js → chunk-TLAVOBEM.js} +16 -8
- package/dist/chunk-TLAVOBEM.js.map +1 -0
- package/dist/{chunk-LDY4C2OT.js → chunk-YIYHCHHM.js} +2 -2
- package/dist/{chunk-WCWJPIUQ.js → chunk-YVZWNLF4.js} +191 -52
- package/dist/chunk-YVZWNLF4.js.map +1 -0
- package/dist/{chunk-KCK27QBP.js → chunk-ZG7FBQFP.js} +2 -2
- package/dist/{chunk-XYQNTF5B.js → chunk-ZOQVTG5L.js} +2 -2
- package/dist/{computed.types.d-CJarqC6s.d.ts → computed.types.d-DB5gfOh9.d.ts} +2 -16
- package/dist/corrections.d.ts +21 -10
- package/dist/corrections.js +20 -20
- package/dist/corrections.js.map +1 -1
- package/dist/elements.d.ts +43 -11
- package/dist/elements.js +4 -4
- package/dist/index.d.ts +14 -13
- package/dist/index.js +37 -15
- package/dist/{interaction.d-CJiMv8H7.d.ts → interaction.d-DegNJ5ZA.d.ts} +1 -1
- package/dist/interactions.d.ts +35 -35
- package/dist/interactions.js +3 -3
- package/dist/item.css +11 -2
- package/dist/item.d.ts +31 -82
- package/dist/item.js +7 -5
- package/dist/{item.types.d-QU7LljEK.d.ts → item.types.d-BDFrq19E.d.ts} +18 -2
- package/dist/loader.d.ts +3 -3
- package/dist/loader.js +2 -2
- package/dist/processing.d.ts +139 -20
- package/dist/processing.js +11 -3
- package/dist/qti-components-jsx.d.ts +1947 -98
- package/dist/{qti-condition-expression.d-CYwXOUb1.d.ts → qti-condition-expression.d-DLboq8bR.d.ts} +1 -1
- package/dist/{qti-expression.d-B_-m9emA.d.ts → qti-expression.d-BksT9iLB.d.ts} +26 -3
- package/dist/{qti-feedback.d-B1EIF-fU.d.ts → qti-feedback.d-D-w6-mJv.d.ts} +1 -1
- package/dist/qti-item.d-D_-9_0e6.d.ts +101 -0
- package/dist/qti-rule-base.d-Bdzg8eGH.d.ts +41 -0
- package/dist/{qti-test.d-C6lCEMRB.d.ts → qti-test.d-BfAZE6UF.d.ts} +61 -9
- package/dist/{qti-text-entry-interaction.d-BGdfV9qG.d.ts → qti-text-entry-interaction.d-CATtcPyX.d.ts} +10 -9
- package/dist/session.context.d-Cjs0BkJB.d.ts +33 -0
- package/dist/test.d.ts +8 -8
- package/dist/test.js +8 -6
- package/dist/transformers.js +1 -1
- package/package.json +12 -11
- package/dist/chunk-3VQSUWCK.js.map +0 -1
- package/dist/chunk-5BXJRO5O.js.map +0 -1
- package/dist/chunk-DAUU2NJL.js.map +0 -1
- package/dist/chunk-HDEG6BAZ.js.map +0 -1
- package/dist/chunk-QCPN7E6K.js.map +0 -1
- package/dist/chunk-WCWJPIUQ.js.map +0 -1
- package/dist/chunk-WKWCOV5P.js.map +0 -1
- package/dist/computed-item.types.d-BKZdSLLJ.d.ts +0 -19
- package/dist/qti-rule-base.d-ajOnfGXY.d.ts +0 -16
- /package/dist/{chunk-MKZ374OJ.js.map → chunk-FG5JAWSN.js.map} +0 -0
- /package/dist/{chunk-RT6WZ3P7.js.map → chunk-JLZCZVRX.js.map} +0 -0
- /package/dist/{chunk-6ITD55QE.js.map → chunk-LFVPS7KB.js.map} +0 -0
- /package/dist/{chunk-LDY4C2OT.js.map → chunk-YIYHCHHM.js.map} +0 -0
- /package/dist/{chunk-KCK27QBP.js.map → chunk-ZG7FBQFP.js.map} +0 -0
- /package/dist/{chunk-XYQNTF5B.js.map → chunk-ZOQVTG5L.js.map} +0 -0
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
responseAttributeConverter,
|
|
15
15
|
serializeResponseAttribute,
|
|
16
16
|
validationMessage
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YVZWNLF4.js";
|
|
18
18
|
|
|
19
19
|
// ../interactions/core/dist/elements/qti-associable-hotspot/qti-associable-hotspot.js
|
|
20
20
|
import { LitElement, html } from "lit";
|
|
@@ -192,7 +192,7 @@ __decorate2([
|
|
|
192
192
|
], QtiGap.prototype, "_dragDrop", void 0);
|
|
193
193
|
|
|
194
194
|
// ../interactions/core/dist/elements/qti-gap-img/qti-gap-img.js
|
|
195
|
-
import { LitElement as LitElement3 } from "lit";
|
|
195
|
+
import { html as html3, LitElement as LitElement3 } from "lit";
|
|
196
196
|
import { property as property3 } from "lit/decorators.js";
|
|
197
197
|
|
|
198
198
|
// ../interactions/core/dist/elements/qti-gap-img/qti-gap-img.styles.js
|
|
@@ -228,19 +228,35 @@ var QtiGapImg = class extends LitElement3 {
|
|
|
228
228
|
this.styles = qti_gap_img_styles_default;
|
|
229
229
|
}
|
|
230
230
|
connectedCallback() {
|
|
231
|
+
super.connectedCallback();
|
|
231
232
|
this.setAttribute("slot", "drags");
|
|
232
233
|
}
|
|
234
|
+
/*
|
|
235
|
+
* The slot is what makes qti-gap-img.styles.ts live.
|
|
236
|
+
*
|
|
237
|
+
* This used to skip `super.connectedCallback()`, so Lit never enabled updating, the element had
|
|
238
|
+
* no shadow root, and its own `:host { display: flex; align-items: center }` was dead code. The
|
|
239
|
+
* authored `<img>`/`<object>` was then laid out as an inline replaced element on a text baseline
|
|
240
|
+
* instead of being centred — it sat low in the chip with the line box's descender space below it,
|
|
241
|
+
* which is what pushed a placed chip out of the bottom of its hotspot.
|
|
242
|
+
*
|
|
243
|
+
* Shaped like qti-gap-text, the sibling chip that always did this correctly, so `exportparts`'
|
|
244
|
+
* `label` resolves for both.
|
|
245
|
+
*/
|
|
246
|
+
render() {
|
|
247
|
+
return html3`<slot part="label"></slot>`;
|
|
248
|
+
}
|
|
233
249
|
};
|
|
234
250
|
__decorate3([
|
|
235
251
|
property3({ type: Number, reflect: true })
|
|
236
252
|
], QtiGapImg.prototype, "tabindex", void 0);
|
|
237
253
|
|
|
238
254
|
// ../interactions/core/dist/elements/qti-gap-text/qti-gap-text.js
|
|
239
|
-
import { html as
|
|
255
|
+
import { html as html5, LitElement as LitElement4 } from "lit";
|
|
240
256
|
import { property as property5 } from "lit/decorators.js";
|
|
241
257
|
|
|
242
258
|
// ../interactions/core/dist/mixins/active-element/active-element.mixin.js
|
|
243
|
-
import { html as
|
|
259
|
+
import { html as html4 } from "lit";
|
|
244
260
|
import { property as property4, state as state3 } from "lit/decorators.js";
|
|
245
261
|
import { consume as consume3 } from "@lit/context";
|
|
246
262
|
var __decorate4 = function(decorators, target, key, desc) {
|
|
@@ -365,7 +381,7 @@ function ActiveElementMixin(Base, type) {
|
|
|
365
381
|
}));
|
|
366
382
|
}
|
|
367
383
|
render() {
|
|
368
|
-
return
|
|
384
|
+
return html4`<slot></slot>`;
|
|
369
385
|
}
|
|
370
386
|
}
|
|
371
387
|
__decorate4([
|
|
@@ -471,7 +487,7 @@ var QtiGapText = class extends ActiveElementMixin(LitElement4, "qti-gap-text") {
|
|
|
471
487
|
this.setAttribute("slot", "drags");
|
|
472
488
|
}
|
|
473
489
|
render() {
|
|
474
|
-
return
|
|
490
|
+
return html5`<div part="control"></div>
|
|
475
491
|
<slot part="label"></slot>`;
|
|
476
492
|
}
|
|
477
493
|
};
|
|
@@ -527,7 +543,7 @@ __decorate6([
|
|
|
527
543
|
], QtiHotspotChoice.prototype, "order", void 0);
|
|
528
544
|
|
|
529
545
|
// ../interactions/core/dist/elements/qti-hottext/qti-hottext.js
|
|
530
|
-
import { html as
|
|
546
|
+
import { html as html6, LitElement as LitElement6 } from "lit";
|
|
531
547
|
|
|
532
548
|
// ../interactions/core/dist/elements/qti-hottext/qti-hottext.styles.js
|
|
533
549
|
import { css as css6 } from "lit";
|
|
@@ -562,13 +578,13 @@ var QtiHottext = class extends ActiveElementMixin(LitElement6, "qti-hottext") {
|
|
|
562
578
|
this.styles = qti_hottext_styles_default;
|
|
563
579
|
}
|
|
564
580
|
render() {
|
|
565
|
-
return
|
|
581
|
+
return html6`<div part="control"><div part="control-mark"></div></div>
|
|
566
582
|
<slot part="label"></slot>`;
|
|
567
583
|
}
|
|
568
584
|
};
|
|
569
585
|
|
|
570
586
|
// ../interactions/core/dist/elements/qti-inline-choice/qti-inline-choice.js
|
|
571
|
-
import { html as
|
|
587
|
+
import { html as html7, LitElement as LitElement7 } from "lit";
|
|
572
588
|
import { property as property7 } from "lit/decorators.js";
|
|
573
589
|
|
|
574
590
|
// ../interactions/core/dist/elements/qti-inline-choice/qti-inline-choice.styles.js
|
|
@@ -617,7 +633,7 @@ var QtiInlineChoice = class extends ActiveElementMixin(LitElement7, "qti-inline-
|
|
|
617
633
|
this.removeEventListener("click", this.#onSelectInlineChoice);
|
|
618
634
|
}
|
|
619
635
|
render() {
|
|
620
|
-
return
|
|
636
|
+
return html7` <slot></slot> `;
|
|
621
637
|
}
|
|
622
638
|
#onSelectInlineChoice() {
|
|
623
639
|
this.dispatchEvent(new CustomEvent("qti-inline-choice-select", {
|
|
@@ -633,7 +649,7 @@ __decorate7([
|
|
|
633
649
|
], QtiInlineChoice.prototype, "identifier", void 0);
|
|
634
650
|
|
|
635
651
|
// ../interactions/core/dist/elements/qti-prompt/qti-prompt.js
|
|
636
|
-
import { html as
|
|
652
|
+
import { html as html8, LitElement as LitElement8 } from "lit";
|
|
637
653
|
|
|
638
654
|
// ../interactions/core/dist/elements/qti-prompt/qti-prompt.styles.js
|
|
639
655
|
import { css as css8 } from "lit";
|
|
@@ -654,7 +670,7 @@ var QtiPrompt = class extends LitElement8 {
|
|
|
654
670
|
this.styles = qti_prompt_styles_default;
|
|
655
671
|
}
|
|
656
672
|
render() {
|
|
657
|
-
return
|
|
673
|
+
return html8`<slot></slot>`;
|
|
658
674
|
}
|
|
659
675
|
connectedCallback() {
|
|
660
676
|
super.connectedCallback();
|
|
@@ -666,7 +682,7 @@ var QtiPrompt = class extends LitElement8 {
|
|
|
666
682
|
};
|
|
667
683
|
|
|
668
684
|
// ../interactions/core/dist/elements/qti-simple-associable-choice/qti-simple-associable-choice.js
|
|
669
|
-
import { html as
|
|
685
|
+
import { html as html9, LitElement as LitElement9 } from "lit";
|
|
670
686
|
import { property as property8, state as state4 } from "lit/decorators.js";
|
|
671
687
|
import { repeat as repeat3 } from "lit/directives/repeat.js";
|
|
672
688
|
import { consume as consume4 } from "@lit/context";
|
|
@@ -862,7 +878,7 @@ var QtiSimpleAssociableChoice = class extends ActiveElementMixin(LitElement9, "q
|
|
|
862
878
|
// So we have a slot for whenever another qti-simple-associable-choice is dropped in here.
|
|
863
879
|
// And we have slot for content like in this associate interaction
|
|
864
880
|
render() {
|
|
865
|
-
return
|
|
881
|
+
return html9`
|
|
866
882
|
<div part="control"></div>
|
|
867
883
|
<slot part="label"></slot>
|
|
868
884
|
<div part="drop">
|
|
@@ -899,7 +915,7 @@ __decorate8([
|
|
|
899
915
|
], QtiSimpleAssociableChoice.prototype, "_dragDrop", void 0);
|
|
900
916
|
|
|
901
917
|
// ../interactions/core/dist/elements/qti-simple-choice/qti-simple-choice.js
|
|
902
|
-
import { html as
|
|
918
|
+
import { html as html10, LitElement as LitElement10, nothing } from "lit";
|
|
903
919
|
import { property as property9 } from "lit/decorators.js";
|
|
904
920
|
|
|
905
921
|
// ../interactions/core/dist/elements/qti-simple-choice/qti-simple-choice.styles.js
|
|
@@ -972,8 +988,8 @@ var QtiSimpleChoice = class extends ActiveElementMixin(LitElement10, "qti-simple
|
|
|
972
988
|
return this["internals"].states.has("checked");
|
|
973
989
|
}
|
|
974
990
|
render() {
|
|
975
|
-
return
|
|
976
|
-
${this.marker ?
|
|
991
|
+
return html10`<div part="control" tabindex="0"><div part="control-mark"></div></div>
|
|
992
|
+
${this.marker ? html10`<div id="label" part="marker">${this.marker}</div>` : nothing}
|
|
977
993
|
<slot part="label"></slot>`;
|
|
978
994
|
}
|
|
979
995
|
};
|
|
@@ -997,7 +1013,7 @@ __decorate9([
|
|
|
997
1013
|
], QtiSimpleChoice.prototype, "marker", void 0);
|
|
998
1014
|
|
|
999
1015
|
// ../interactions/associate-interaction/dist/qti-associate-interaction.js
|
|
1000
|
-
import { html as
|
|
1016
|
+
import { html as html11 } from "lit";
|
|
1001
1017
|
import { repeat as repeat4 } from "lit/directives/repeat.js";
|
|
1002
1018
|
import { state as state5 } from "lit/decorators.js";
|
|
1003
1019
|
|
|
@@ -3371,8 +3387,8 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
3371
3387
|
const clone = element.cloneNode(true);
|
|
3372
3388
|
const computedStyles = window.getComputedStyle(element);
|
|
3373
3389
|
for (let i = 0; i < computedStyles.length; i++) {
|
|
3374
|
-
const
|
|
3375
|
-
clone.style.setProperty(
|
|
3390
|
+
const property27 = computedStyles[i];
|
|
3391
|
+
clone.style.setProperty(property27, computedStyles.getPropertyValue(property27));
|
|
3376
3392
|
}
|
|
3377
3393
|
const host = resolveDragCloneHost(element.isConnected ? element : this, this.dragCloneRoot());
|
|
3378
3394
|
this.cloneFrame = measureFixedFrame(host);
|
|
@@ -4641,7 +4657,7 @@ var QtiAssociateInteraction = class extends DragDropSlottedSortableMixin(Slotted
|
|
|
4641
4657
|
*/
|
|
4642
4658
|
#renderDrop(identifier, name) {
|
|
4643
4659
|
const drags = this._dragDrop?.nodesByTarget?.[identifier] ?? [];
|
|
4644
|
-
return
|
|
4660
|
+
return html11`<div name=${name} part="drop" data-declarative-drops identifier=${identifier}>
|
|
4645
4661
|
${repeat4(drags, (node) => node.getAttribute("identifier"), (node) => node)}
|
|
4646
4662
|
</div>`;
|
|
4647
4663
|
}
|
|
@@ -4698,10 +4714,10 @@ var QtiAssociateInteraction = class extends DragDropSlottedSortableMixin(Slotted
|
|
|
4698
4714
|
}) ?? [];
|
|
4699
4715
|
}
|
|
4700
4716
|
render() {
|
|
4701
|
-
return
|
|
4717
|
+
return html11` <slot name="prompt"></slot>
|
|
4702
4718
|
<slot part="drags" name="qti-simple-associable-choice"></slot>
|
|
4703
4719
|
<div part="drops">
|
|
4704
|
-
${this._childrenMap.length > 0 && Array.from({ length: this.#rowCount }, (_, index) =>
|
|
4720
|
+
${this._childrenMap.length > 0 && Array.from({ length: this.#rowCount }, (_, index) => html11`<div part="drop-row">
|
|
4705
4721
|
${this.#renderDrop(`droplist${index}_left`, `left${index}`)}
|
|
4706
4722
|
${this.#renderDrop(`droplist${index}_right`, `right${index}`)}
|
|
4707
4723
|
</div>`)}
|
|
@@ -4725,7 +4741,7 @@ __decorate12([
|
|
|
4725
4741
|
], QtiAssociateInteraction.prototype, "_childrenMap", void 0);
|
|
4726
4742
|
|
|
4727
4743
|
// ../interactions/choice-interaction/dist/qti-choice-interaction.js
|
|
4728
|
-
import { html as
|
|
4744
|
+
import { html as html12 } from "lit";
|
|
4729
4745
|
import { property as property14 } from "lit/decorators.js";
|
|
4730
4746
|
|
|
4731
4747
|
// ../interactions/core/dist/mixins/choices/choices.mixin.js
|
|
@@ -5181,7 +5197,7 @@ var QtiChoiceInteraction = class extends VocabularyMixin(ChoicesMixin(Interactio
|
|
|
5181
5197
|
this.style.setProperty("--item-count", choices.length.toString());
|
|
5182
5198
|
}
|
|
5183
5199
|
render() {
|
|
5184
|
-
return
|
|
5200
|
+
return html12`
|
|
5185
5201
|
<slot part="prompt" name="prompt"></slot>
|
|
5186
5202
|
<slot part="slot" @slotchange=${this.#handleSlotChange}></slot>
|
|
5187
5203
|
<div part="message" role="alert" id="validation-message"></div>
|
|
@@ -5193,7 +5209,7 @@ __decorate15([
|
|
|
5193
5209
|
], QtiChoiceInteraction.prototype, "orientation", void 0);
|
|
5194
5210
|
|
|
5195
5211
|
// ../interactions/custom-interaction/dist/qti-custom-interaction.js
|
|
5196
|
-
import { html as
|
|
5212
|
+
import { html as html13 } from "lit";
|
|
5197
5213
|
import { property as property15, state as state6 } from "lit/decorators.js";
|
|
5198
5214
|
|
|
5199
5215
|
// ../interactions/custom-interaction/dist/qti-custom-interaction.styles.js
|
|
@@ -5434,18 +5450,18 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
5434
5450
|
this.#resourceBaseUrl = indexResolved.baseUrl;
|
|
5435
5451
|
}
|
|
5436
5452
|
if (indexResolved.text) {
|
|
5437
|
-
let
|
|
5438
|
-
const alreadyModified =
|
|
5453
|
+
let html33 = indexResolved.text;
|
|
5454
|
+
const alreadyModified = html33.includes("postToParentWindows") || html33.includes("window.CES");
|
|
5439
5455
|
if (!alreadyModified) {
|
|
5440
5456
|
const cesScript = "<script>" + registerCES + "</script>";
|
|
5441
|
-
const headIndex =
|
|
5457
|
+
const headIndex = html33.indexOf("<head>");
|
|
5442
5458
|
if (headIndex !== -1) {
|
|
5443
|
-
|
|
5459
|
+
html33 = html33.slice(0, headIndex + 6) + cesScript + html33.slice(headIndex + 6);
|
|
5444
5460
|
} else {
|
|
5445
|
-
|
|
5461
|
+
html33 = cesScript + html33;
|
|
5446
5462
|
}
|
|
5447
5463
|
}
|
|
5448
|
-
const blob = new Blob([
|
|
5464
|
+
const blob = new Blob([html33], { type: "text/html" });
|
|
5449
5465
|
this.#contentBlobUrl = URL.createObjectURL(blob);
|
|
5450
5466
|
}
|
|
5451
5467
|
} else {
|
|
@@ -5460,18 +5476,18 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
5460
5476
|
this.#resourceBaseUrl = indexResolved.baseUrl;
|
|
5461
5477
|
}
|
|
5462
5478
|
if (indexResolved.text) {
|
|
5463
|
-
let
|
|
5464
|
-
const alreadyModified =
|
|
5479
|
+
let html33 = indexResolved.text;
|
|
5480
|
+
const alreadyModified = html33.includes("postToParentWindows") || html33.includes("window.CES");
|
|
5465
5481
|
if (!alreadyModified) {
|
|
5466
5482
|
const cesScript = "<script>" + registerCES + "</script>";
|
|
5467
|
-
const headIndex =
|
|
5483
|
+
const headIndex = html33.indexOf("<head>");
|
|
5468
5484
|
if (headIndex !== -1) {
|
|
5469
|
-
|
|
5485
|
+
html33 = html33.slice(0, headIndex + 6) + cesScript + html33.slice(headIndex + 6);
|
|
5470
5486
|
} else {
|
|
5471
|
-
|
|
5487
|
+
html33 = cesScript + html33;
|
|
5472
5488
|
}
|
|
5473
5489
|
}
|
|
5474
|
-
const blob = new Blob([
|
|
5490
|
+
const blob = new Blob([html33], { type: "text/html" });
|
|
5475
5491
|
this.#contentBlobUrl = URL.createObjectURL(blob);
|
|
5476
5492
|
}
|
|
5477
5493
|
}
|
|
@@ -5479,18 +5495,18 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
5479
5495
|
try {
|
|
5480
5496
|
const indexResponse = await fetch(indexUrl);
|
|
5481
5497
|
if (indexResponse.ok) {
|
|
5482
|
-
let
|
|
5483
|
-
const alreadyModified =
|
|
5498
|
+
let html33 = await indexResponse.text();
|
|
5499
|
+
const alreadyModified = html33.includes("postToParentWindows") || html33.includes("window.CES");
|
|
5484
5500
|
if (!alreadyModified) {
|
|
5485
5501
|
const cesScript = "<script>" + registerCES + "</script>";
|
|
5486
|
-
const headIndex =
|
|
5502
|
+
const headIndex = html33.indexOf("<head>");
|
|
5487
5503
|
if (headIndex !== -1) {
|
|
5488
|
-
|
|
5504
|
+
html33 = html33.slice(0, headIndex + 6) + cesScript + html33.slice(headIndex + 6);
|
|
5489
5505
|
} else {
|
|
5490
|
-
|
|
5506
|
+
html33 = cesScript + html33;
|
|
5491
5507
|
}
|
|
5492
5508
|
}
|
|
5493
|
-
const blob = new Blob([
|
|
5509
|
+
const blob = new Blob([html33], { type: "text/html" });
|
|
5494
5510
|
this.#contentBlobUrl = URL.createObjectURL(blob);
|
|
5495
5511
|
} else {
|
|
5496
5512
|
console.error(`Failed to fetch index.html: ${indexResponse.status}`);
|
|
@@ -5644,7 +5660,7 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
5644
5660
|
super.disconnectedCallback();
|
|
5645
5661
|
}
|
|
5646
5662
|
render() {
|
|
5647
|
-
return
|
|
5663
|
+
return html13`<iframe
|
|
5648
5664
|
width=${this.getAttribute("width")}
|
|
5649
5665
|
height=${this.getAttribute("height")}
|
|
5650
5666
|
frameborder="0"
|
|
@@ -5652,7 +5668,7 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
5652
5668
|
id="pciContainer"
|
|
5653
5669
|
>
|
|
5654
5670
|
</iframe>
|
|
5655
|
-
${this._errorMessage &&
|
|
5671
|
+
${this._errorMessage && html13`<div style="color:red">
|
|
5656
5672
|
<h1>Error</h1>
|
|
5657
5673
|
${this._errorMessage}
|
|
5658
5674
|
</div>`}`;
|
|
@@ -5720,7 +5736,7 @@ __decorate16([
|
|
|
5720
5736
|
], QtiCustomInteraction.prototype, "_errorMessage", void 0);
|
|
5721
5737
|
|
|
5722
5738
|
// ../interactions/end-attempt-interaction/dist/qti-end-attempt-interaction.js
|
|
5723
|
-
import { html as
|
|
5739
|
+
import { html as html14, LitElement as LitElement11 } from "lit";
|
|
5724
5740
|
import { property as property16 } from "lit/decorators.js";
|
|
5725
5741
|
|
|
5726
5742
|
// ../interactions/end-attempt-interaction/dist/qti-end-attempt-interaction.styles.js
|
|
@@ -5744,7 +5760,7 @@ var QtiEndAttemptInteraction = class extends LitElement11 {
|
|
|
5744
5760
|
this.styles = qti_end_attempt_interaction_styles_default;
|
|
5745
5761
|
}
|
|
5746
5762
|
render() {
|
|
5747
|
-
return
|
|
5763
|
+
return html14`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`;
|
|
5748
5764
|
}
|
|
5749
5765
|
endAttempt(_) {
|
|
5750
5766
|
this.dispatchEvent(new CustomEvent("end-attempt", {
|
|
@@ -5768,7 +5784,7 @@ __decorate17([
|
|
|
5768
5784
|
], QtiEndAttemptInteraction.prototype, "title", void 0);
|
|
5769
5785
|
|
|
5770
5786
|
// ../interactions/extended-text-interaction/dist/qti-extended-text-interaction.js
|
|
5771
|
-
import { html as
|
|
5787
|
+
import { html as html15 } from "lit";
|
|
5772
5788
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5773
5789
|
import { property as property17, state as state7 } from "lit/decorators.js";
|
|
5774
5790
|
|
|
@@ -5913,11 +5929,11 @@ var QtiExtendedTextInteraction = class extends Interaction {
|
|
|
5913
5929
|
*/
|
|
5914
5930
|
/** The prompt, above the field. */
|
|
5915
5931
|
renderPrompt() {
|
|
5916
|
-
return
|
|
5932
|
+
return html15`<slot name="prompt"></slot>`;
|
|
5917
5933
|
}
|
|
5918
5934
|
/** The field itself. */
|
|
5919
5935
|
renderTextarea() {
|
|
5920
|
-
return
|
|
5936
|
+
return html15`<textarea
|
|
5921
5937
|
part="textarea"
|
|
5922
5938
|
name="${this.responseIdentifier}"
|
|
5923
5939
|
spellcheck="false"
|
|
@@ -5938,10 +5954,10 @@ var QtiExtendedTextInteraction = class extends Interaction {
|
|
|
5938
5954
|
}
|
|
5939
5955
|
/** Hidden until `Interaction.reportValidity` shows it. */
|
|
5940
5956
|
renderValidationMessage() {
|
|
5941
|
-
return
|
|
5957
|
+
return html15`<div id="validation-message" part="message" role="alert" style="display:none;"></div>`;
|
|
5942
5958
|
}
|
|
5943
5959
|
render() {
|
|
5944
|
-
return
|
|
5960
|
+
return html15`${this.renderPrompt()}${this.renderTextarea()} ${this.renderValidationMessage()}`;
|
|
5945
5961
|
}
|
|
5946
5962
|
textChanged(event) {
|
|
5947
5963
|
if (this.disabled || this.readonly)
|
|
@@ -5991,7 +6007,7 @@ __decorate18([
|
|
|
5991
6007
|
], QtiExtendedTextInteraction.prototype, "_handleResponseChange", void 0);
|
|
5992
6008
|
|
|
5993
6009
|
// ../interactions/gap-match-interaction/dist/qti-gap-match-interaction.js
|
|
5994
|
-
import { html as
|
|
6010
|
+
import { html as html16 } from "lit";
|
|
5995
6011
|
|
|
5996
6012
|
// ../interactions/gap-match-interaction/dist/qti-gap-match-interaction.styles.js
|
|
5997
6013
|
import { css as css15 } from "lit";
|
|
@@ -6051,7 +6067,7 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(DragDrop
|
|
|
6051
6067
|
this.styles = qti_gap_match_interaction_styles_default;
|
|
6052
6068
|
}
|
|
6053
6069
|
render() {
|
|
6054
|
-
return
|
|
6070
|
+
return html16`<slot name="prompt"> </slot>
|
|
6055
6071
|
<slot part="drags" name="drags"></slot>
|
|
6056
6072
|
<slot part="drops"></slot>
|
|
6057
6073
|
<div role="alert" part="message" id="validation-message"></div>`;
|
|
@@ -6059,15 +6075,102 @@ var QtiGapMatchInteraction = class extends DragDropSlottedSortableMixin(DragDrop
|
|
|
6059
6075
|
};
|
|
6060
6076
|
|
|
6061
6077
|
// ../interactions/graphic-associate-interaction/dist/qti-graphic-associate-interaction.js
|
|
6062
|
-
import { html as
|
|
6078
|
+
import { html as html17, nothing as nothing2, svg } from "lit";
|
|
6063
6079
|
import { property as property18, queryAssignedElements, state as state8 } from "lit/decorators.js";
|
|
6064
6080
|
import { ifDefined as ifDefined2 } from "lit/directives/if-defined.js";
|
|
6065
6081
|
import { repeat as repeat5 } from "lit/directives/repeat.js";
|
|
6066
6082
|
|
|
6067
6083
|
// ../interactions/core/dist/internal/hotspots/hotspot.js
|
|
6084
|
+
function findGraphic(root) {
|
|
6085
|
+
return root.querySelector('img, object[type^="image"]');
|
|
6086
|
+
}
|
|
6087
|
+
function attributeLength(graphic, name) {
|
|
6088
|
+
const raw = graphic.getAttribute(name)?.trim();
|
|
6089
|
+
if (!raw || raw.endsWith("%"))
|
|
6090
|
+
return null;
|
|
6091
|
+
const parsed = parseFloat(raw);
|
|
6092
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
6093
|
+
}
|
|
6094
|
+
var probedSizes = /* @__PURE__ */ new WeakMap();
|
|
6095
|
+
var probes = /* @__PURE__ */ new WeakMap();
|
|
6096
|
+
function probeObject(object) {
|
|
6097
|
+
let probe = probes.get(object);
|
|
6098
|
+
if (!probe) {
|
|
6099
|
+
probe = new Promise((resolve) => {
|
|
6100
|
+
const url = object.data;
|
|
6101
|
+
if (!url) {
|
|
6102
|
+
resolve(null);
|
|
6103
|
+
return;
|
|
6104
|
+
}
|
|
6105
|
+
const image = new Image();
|
|
6106
|
+
image.onload = () => {
|
|
6107
|
+
const size = { width: image.naturalWidth, height: image.naturalHeight };
|
|
6108
|
+
if (!(size.width > 0) || !(size.height > 0)) {
|
|
6109
|
+
resolve(null);
|
|
6110
|
+
return;
|
|
6111
|
+
}
|
|
6112
|
+
probedSizes.set(object, size);
|
|
6113
|
+
resolve(size);
|
|
6114
|
+
};
|
|
6115
|
+
image.onerror = () => resolve(null);
|
|
6116
|
+
image.src = url;
|
|
6117
|
+
});
|
|
6118
|
+
probes.set(object, probe);
|
|
6119
|
+
}
|
|
6120
|
+
return probe;
|
|
6121
|
+
}
|
|
6122
|
+
function intrinsicSize(graphic) {
|
|
6123
|
+
if (graphic.localName === "object") {
|
|
6124
|
+
return probedSizes.get(graphic) ?? null;
|
|
6125
|
+
}
|
|
6126
|
+
const image = graphic;
|
|
6127
|
+
return image.naturalWidth > 0 && image.naturalHeight > 0 ? { width: image.naturalWidth, height: image.naturalHeight } : null;
|
|
6128
|
+
}
|
|
6129
|
+
function graphicSize(graphic) {
|
|
6130
|
+
const width = attributeLength(graphic, "width");
|
|
6131
|
+
const height = attributeLength(graphic, "height");
|
|
6132
|
+
if (width !== null && height !== null)
|
|
6133
|
+
return { width, height };
|
|
6134
|
+
const intrinsic = intrinsicSize(graphic);
|
|
6135
|
+
if (!intrinsic)
|
|
6136
|
+
return null;
|
|
6137
|
+
return { width: width ?? intrinsic.width, height: height ?? intrinsic.height };
|
|
6138
|
+
}
|
|
6139
|
+
function whenGraphicSized(graphic) {
|
|
6140
|
+
const known = graphicSize(graphic);
|
|
6141
|
+
if (known)
|
|
6142
|
+
return Promise.resolve(known);
|
|
6143
|
+
if (graphic.localName === "object") {
|
|
6144
|
+
return probeObject(graphic).then(() => graphicSize(graphic));
|
|
6145
|
+
}
|
|
6146
|
+
const image = graphic;
|
|
6147
|
+
if (image.complete)
|
|
6148
|
+
return Promise.resolve(null);
|
|
6149
|
+
return new Promise((resolve) => {
|
|
6150
|
+
const settle = () => {
|
|
6151
|
+
image.removeEventListener("load", settle);
|
|
6152
|
+
image.removeEventListener("error", settle);
|
|
6153
|
+
resolve(graphicSize(graphic));
|
|
6154
|
+
};
|
|
6155
|
+
image.addEventListener("load", settle);
|
|
6156
|
+
image.addEventListener("error", settle);
|
|
6157
|
+
});
|
|
6158
|
+
}
|
|
6068
6159
|
function positionShapes(shape, coordsNumber, img, hotspot) {
|
|
6069
|
-
const
|
|
6070
|
-
|
|
6160
|
+
const size = graphicSize(img);
|
|
6161
|
+
if (size) {
|
|
6162
|
+
applyShape(shape, coordsNumber, size, hotspot);
|
|
6163
|
+
return;
|
|
6164
|
+
}
|
|
6165
|
+
void whenGraphicSized(img).then((resolved) => {
|
|
6166
|
+
if (!resolved) {
|
|
6167
|
+
console.error("Cannot position hotspots: the graphic has no usable width/height.", img);
|
|
6168
|
+
return;
|
|
6169
|
+
}
|
|
6170
|
+
applyShape(shape, coordsNumber, resolved, hotspot);
|
|
6171
|
+
});
|
|
6172
|
+
}
|
|
6173
|
+
function applyShape(shape, coordsNumber, { width: imgWidth, height: imgHeight }, hotspot) {
|
|
6071
6174
|
switch (shape) {
|
|
6072
6175
|
case "circle":
|
|
6073
6176
|
{
|
|
@@ -6156,6 +6259,12 @@ function positionShapes(shape, coordsNumber, img, hotspot) {
|
|
|
6156
6259
|
hotspot.style.setProperty("--qti-shape-outline-bold", outline(8));
|
|
6157
6260
|
}
|
|
6158
6261
|
break;
|
|
6262
|
+
case "default":
|
|
6263
|
+
hotspot.style.left = "0%";
|
|
6264
|
+
hotspot.style.top = "0%";
|
|
6265
|
+
hotspot.style.width = "100%";
|
|
6266
|
+
hotspot.style.height = "100%";
|
|
6267
|
+
break;
|
|
6159
6268
|
default:
|
|
6160
6269
|
console.error(`Unsupported shape: ${shape}`);
|
|
6161
6270
|
break;
|
|
@@ -6216,6 +6325,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
6216
6325
|
#endPoint;
|
|
6217
6326
|
constructor() {
|
|
6218
6327
|
super();
|
|
6328
|
+
this.#hotspots = [];
|
|
6219
6329
|
this.#startPoint = null;
|
|
6220
6330
|
this.#endPoint = null;
|
|
6221
6331
|
this._response = [];
|
|
@@ -6246,7 +6356,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
6246
6356
|
return nothing2;
|
|
6247
6357
|
}
|
|
6248
6358
|
render() {
|
|
6249
|
-
return
|
|
6359
|
+
return html17`<slot name="prompt"></slot>
|
|
6250
6360
|
<line-container>
|
|
6251
6361
|
<svg
|
|
6252
6362
|
width=${ifDefined2(this.grImage[0]?.width)}
|
|
@@ -6294,7 +6404,7 @@ var QtiGraphicAssociateInteraction = class extends Interaction {
|
|
|
6294
6404
|
}
|
|
6295
6405
|
firstUpdated() {
|
|
6296
6406
|
super.firstUpdated();
|
|
6297
|
-
this.#hotspots = this.querySelectorAll("qti-associable-hotspot");
|
|
6407
|
+
this.#hotspots = Array.from(this.querySelectorAll("qti-associable-hotspot"));
|
|
6298
6408
|
this.addEventListener("mousemove", (event) => {
|
|
6299
6409
|
const img = this.grImage[0];
|
|
6300
6410
|
if (!img)
|
|
@@ -6358,7 +6468,7 @@ __decorate19([
|
|
|
6358
6468
|
], QtiGraphicAssociateInteraction.prototype, "response", null);
|
|
6359
6469
|
|
|
6360
6470
|
// ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.js
|
|
6361
|
-
import { html as
|
|
6471
|
+
import { html as html18 } from "lit";
|
|
6362
6472
|
|
|
6363
6473
|
// ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.styles.js
|
|
6364
6474
|
import { css as css17 } from "lit";
|
|
@@ -6432,7 +6542,7 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
6432
6542
|
this.styles = qti_graphic_gap_match_interaction_styles_default;
|
|
6433
6543
|
}
|
|
6434
6544
|
render() {
|
|
6435
|
-
return
|
|
6545
|
+
return html18` <slot name="prompt"></slot>
|
|
6436
6546
|
<slot part="image"></slot>
|
|
6437
6547
|
<slot part="drags" name="drags" class="hover-border"></slot>
|
|
6438
6548
|
<div role="alert" part="message" id="validation-message"></div>`;
|
|
@@ -6478,7 +6588,8 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
6478
6588
|
};
|
|
6479
6589
|
|
|
6480
6590
|
// ../interactions/graphic-order-interaction/dist/qti-graphic-order-interaction.js
|
|
6481
|
-
import { html as
|
|
6591
|
+
import { html as html19 } from "lit";
|
|
6592
|
+
import { property as property19 } from "lit/decorators.js";
|
|
6482
6593
|
|
|
6483
6594
|
// ../interactions/graphic-order-interaction/dist/qti-graphic-order-interaction.styles.js
|
|
6484
6595
|
import { css as css18 } from "lit";
|
|
@@ -6527,49 +6638,74 @@ var qti_graphic_order_interaction_styles_default = [
|
|
|
6527
6638
|
];
|
|
6528
6639
|
|
|
6529
6640
|
// ../interactions/graphic-order-interaction/dist/qti-graphic-order-interaction.js
|
|
6641
|
+
var __decorate20 = function(decorators, target, key, desc) {
|
|
6642
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6643
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6644
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6645
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6646
|
+
};
|
|
6530
6647
|
var QtiGraphicOrderInteraction = class _QtiGraphicOrderInteraction extends ChoicesMixin(Interaction, "qti-hotspot-choice") {
|
|
6531
6648
|
constructor() {
|
|
6532
6649
|
super(...arguments);
|
|
6650
|
+
this.maxChoices = 0;
|
|
6533
6651
|
this._choiceElements = [];
|
|
6652
|
+
this.#positionHotspotOnRegister = (e) => {
|
|
6653
|
+
this.#positionHotspot(e.target);
|
|
6654
|
+
this.refreshLocatorPins();
|
|
6655
|
+
};
|
|
6534
6656
|
}
|
|
6535
6657
|
static {
|
|
6536
6658
|
this.styles = qti_graphic_order_interaction_styles_default;
|
|
6537
6659
|
}
|
|
6538
6660
|
static #LOCATOR_CLASS = "cito-graphic-order-marker";
|
|
6539
6661
|
render() {
|
|
6540
|
-
return
|
|
6662
|
+
return html19`
|
|
6541
6663
|
<slot name="prompt"></slot>
|
|
6542
6664
|
<slot></slot>
|
|
6543
6665
|
<div role="alert" part="message" id="validation-message"></div>
|
|
6544
6666
|
`;
|
|
6545
6667
|
}
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6668
|
+
/*
|
|
6669
|
+
* Shadows ChoicesMixin's handler, deliberately without calling up to it.
|
|
6670
|
+
*
|
|
6671
|
+
* The mixin publishes the response as the set of *checked* choices in DOM order, which is
|
|
6672
|
+
* exactly what an ordering interaction must not do: the candidate's sequence never reached
|
|
6673
|
+
* RESPONSE, and with the mixin's max-choices default of 1 each click also cleared the previous
|
|
6674
|
+
* hotspot. Here the response IS the ordering, so the interaction owns it — and because the
|
|
6675
|
+
* response is the ordered list of identifiers, removing one renumbers the rest by itself.
|
|
6676
|
+
*/
|
|
6677
|
+
_choiceElementSelectedHandler(event) {
|
|
6678
|
+
const { identifier } = event.detail;
|
|
6679
|
+
if (!this._choiceElements.some((choice) => choice.identifier === identifier))
|
|
6550
6680
|
return;
|
|
6551
|
-
const
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
hotspot.order = currentSelection + 1;
|
|
6561
|
-
} else {
|
|
6562
|
-
const removedOrder = hotspot.order;
|
|
6563
|
-
hotspot.order = null;
|
|
6564
|
-
this._choiceElements.forEach((hotspot2) => {
|
|
6565
|
-
if (hotspot2.order != null && hotspot2.order > removedOrder) {
|
|
6566
|
-
hotspot2.order--;
|
|
6567
|
-
}
|
|
6568
|
-
});
|
|
6569
|
-
}
|
|
6570
|
-
this.refreshLocatorPins();
|
|
6571
|
-
this.choiceOrdering = false;
|
|
6681
|
+
const ordered = [...this.#orderedResponse()];
|
|
6682
|
+
const position = ordered.indexOf(identifier);
|
|
6683
|
+
if (position >= 0) {
|
|
6684
|
+
ordered.splice(position, 1);
|
|
6685
|
+
} else {
|
|
6686
|
+
const maxSelection = this.maxChoices > 0 ? this.maxChoices : this._choiceElements.length;
|
|
6687
|
+
if (ordered.length >= maxSelection)
|
|
6688
|
+
return;
|
|
6689
|
+
ordered.push(identifier);
|
|
6572
6690
|
}
|
|
6691
|
+
this.response = ordered;
|
|
6692
|
+
this.validate();
|
|
6693
|
+
this.reportValidity();
|
|
6694
|
+
this.saveResponse(this.response);
|
|
6695
|
+
}
|
|
6696
|
+
/** The response as the ordered identifier list this interaction always treats it as. */
|
|
6697
|
+
#orderedResponse() {
|
|
6698
|
+
if (Array.isArray(this.response))
|
|
6699
|
+
return this.response;
|
|
6700
|
+
return this.response ? [this.response] : [];
|
|
6701
|
+
}
|
|
6702
|
+
/*
|
|
6703
|
+
* Pins and `aria-ordervalue` are a pure function of the response, so any route into it repaints
|
|
6704
|
+
* them: a candidate's click, a restored attempt, a correct-response display, an author setting
|
|
6705
|
+
* the property. Nothing has to remember to keep a second copy of the ordering in step.
|
|
6706
|
+
*/
|
|
6707
|
+
handleOrderedResponseChange() {
|
|
6708
|
+
this.refreshLocatorPins();
|
|
6573
6709
|
}
|
|
6574
6710
|
#anchorNameForChoice(choice) {
|
|
6575
6711
|
const raw = choice.identifier || choice.getAttribute("identifier") || "hotspot";
|
|
@@ -6581,11 +6717,23 @@ var QtiGraphicOrderInteraction = class _QtiGraphicOrderInteraction extends Choic
|
|
|
6581
6717
|
return "var(--qti-selected-bg)";
|
|
6582
6718
|
}
|
|
6583
6719
|
refreshLocatorPins() {
|
|
6584
|
-
this
|
|
6720
|
+
const ordered = this.#orderedResponse();
|
|
6721
|
+
for (const choice of this._choiceElements) {
|
|
6722
|
+
const position = ordered.indexOf(choice.identifier);
|
|
6723
|
+
choice.order = position >= 0 ? position + 1 : null;
|
|
6724
|
+
}
|
|
6725
|
+
const orderedChoices = this._choiceElements.filter((choice) => choice.order != null).sort((a, b) => a.order - b.order);
|
|
6726
|
+
const markers = Array.from(this.querySelectorAll(`.${_QtiGraphicOrderInteraction.#LOCATOR_CLASS}`));
|
|
6727
|
+
const unchanged = markers.length === orderedChoices.length && orderedChoices.every((choice, index) => {
|
|
6728
|
+
const marker = markers[index];
|
|
6729
|
+
return marker.textContent === String(choice.order) && marker.style.getPropertyValue("position-anchor") === this.#anchorNameForChoice(choice) && marker.style.getPropertyValue("--qti-graphic-order-pin-color") === this.resolvePinColor(choice);
|
|
6730
|
+
});
|
|
6731
|
+
if (unchanged)
|
|
6732
|
+
return;
|
|
6733
|
+
markers.forEach((marker) => marker.remove());
|
|
6585
6734
|
this._choiceElements.forEach((choice) => {
|
|
6586
6735
|
choice.style.removeProperty("anchor-name");
|
|
6587
6736
|
});
|
|
6588
|
-
const orderedChoices = this._choiceElements.filter((choice) => choice.order != null).sort((a, b) => a.order - b.order);
|
|
6589
6737
|
orderedChoices.forEach((choice) => {
|
|
6590
6738
|
const anchorName = this.#anchorNameForChoice(choice);
|
|
6591
6739
|
choice.style.setProperty("anchor-name", anchorName);
|
|
@@ -6601,30 +6749,39 @@ var QtiGraphicOrderInteraction = class _QtiGraphicOrderInteraction extends Choic
|
|
|
6601
6749
|
this.append(marker);
|
|
6602
6750
|
});
|
|
6603
6751
|
}
|
|
6604
|
-
#
|
|
6605
|
-
const
|
|
6606
|
-
const hotspot = e.target;
|
|
6752
|
+
#positionHotspot(hotspot) {
|
|
6753
|
+
const graphic = findGraphic(this);
|
|
6607
6754
|
const coords = hotspot.getAttribute("coords");
|
|
6608
6755
|
const shape = hotspot.getAttribute("shape");
|
|
6756
|
+
if (!graphic) {
|
|
6757
|
+
console.error('No <img> or <object type="image/*"> found in <qti-graphic-order-interaction>.');
|
|
6758
|
+
return;
|
|
6759
|
+
}
|
|
6609
6760
|
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
6610
|
-
positionShapes(shape, coordsNumber,
|
|
6761
|
+
positionShapes(shape, coordsNumber, graphic, hotspot);
|
|
6611
6762
|
}
|
|
6763
|
+
#positionHotspotOnRegister;
|
|
6612
6764
|
connectedCallback() {
|
|
6613
6765
|
super.connectedCallback();
|
|
6614
|
-
this.addEventListener("activate-qti-hotspot-choice", this.#setHotspotOrder);
|
|
6615
6766
|
this.addEventListener("register-qti-hotspot-choice", this.#positionHotspotOnRegister);
|
|
6616
6767
|
this.refreshLocatorPins();
|
|
6768
|
+
this.querySelectorAll("qti-hotspot-choice").forEach((hotspot) => this.#positionHotspot(hotspot));
|
|
6617
6769
|
}
|
|
6618
6770
|
disconnectedCallback() {
|
|
6619
6771
|
this.querySelectorAll(`.${_QtiGraphicOrderInteraction.#LOCATOR_CLASS}`).forEach((marker) => marker.remove());
|
|
6620
6772
|
super.disconnectedCallback();
|
|
6621
|
-
this.removeEventListener("activate-qti-hotspot-choice", this.#setHotspotOrder);
|
|
6622
6773
|
this.removeEventListener("register-qti-hotspot-choice", this.#positionHotspotOnRegister);
|
|
6623
6774
|
}
|
|
6624
6775
|
};
|
|
6776
|
+
__decorate20([
|
|
6777
|
+
property19({ type: Number, attribute: "max-choices" })
|
|
6778
|
+
], QtiGraphicOrderInteraction.prototype, "maxChoices", void 0);
|
|
6779
|
+
__decorate20([
|
|
6780
|
+
watch("response")
|
|
6781
|
+
], QtiGraphicOrderInteraction.prototype, "handleOrderedResponseChange", null);
|
|
6625
6782
|
|
|
6626
6783
|
// ../interactions/hotspot-interaction/dist/qti-hotspot-interaction.js
|
|
6627
|
-
import { html as
|
|
6784
|
+
import { html as html20 } from "lit";
|
|
6628
6785
|
|
|
6629
6786
|
// ../interactions/hotspot-interaction/dist/qti-hotspot-interaction.styles.js
|
|
6630
6787
|
import { css as css19 } from "lit";
|
|
@@ -6689,7 +6846,7 @@ var QtiHotspotInteraction = class extends ChoicesMixin(Interaction, "qti-hotspot
|
|
|
6689
6846
|
this.styles = qti_hotspot_interaction_styles_default;
|
|
6690
6847
|
}
|
|
6691
6848
|
render() {
|
|
6692
|
-
return
|
|
6849
|
+
return html20`
|
|
6693
6850
|
<slot name="prompt"></slot>
|
|
6694
6851
|
<slot></slot>
|
|
6695
6852
|
<div part="message" role="alert" id="validation-message"></div>
|
|
@@ -6712,27 +6869,30 @@ var QtiHotspotInteraction = class extends ChoicesMixin(Interaction, "qti-hotspot
|
|
|
6712
6869
|
}
|
|
6713
6870
|
return this.#imageLoadPromise;
|
|
6714
6871
|
}
|
|
6715
|
-
async #
|
|
6872
|
+
async #positionHotspot(hotspot) {
|
|
6716
6873
|
const img = this.querySelector("img");
|
|
6717
|
-
const hotspot = e.target;
|
|
6718
6874
|
const coords = hotspot.getAttribute("coords");
|
|
6719
6875
|
const shape = hotspot.getAttribute("shape");
|
|
6720
6876
|
const coordsNumber = coords.split(",").map((s) => parseInt(s));
|
|
6721
6877
|
const loadedImg = await this.#getImageLoadPromise(img);
|
|
6722
6878
|
positionShapes(shape, coordsNumber, loadedImg, hotspot);
|
|
6723
6879
|
}
|
|
6880
|
+
#positionHotspotOnRegister = (e) => {
|
|
6881
|
+
this.#positionHotspot(e.target);
|
|
6882
|
+
};
|
|
6724
6883
|
connectedCallback() {
|
|
6725
6884
|
super.connectedCallback();
|
|
6726
6885
|
this.addEventListener("register-qti-hotspot-choice", this.#positionHotspotOnRegister);
|
|
6886
|
+
this.querySelectorAll("qti-hotspot-choice").forEach((hotspot) => this.#positionHotspot(hotspot));
|
|
6727
6887
|
}
|
|
6728
6888
|
disconnectedCallback() {
|
|
6729
6889
|
super.disconnectedCallback();
|
|
6730
|
-
this.removeEventListener("
|
|
6890
|
+
this.removeEventListener("register-qti-hotspot-choice", this.#positionHotspotOnRegister);
|
|
6731
6891
|
}
|
|
6732
6892
|
};
|
|
6733
6893
|
|
|
6734
6894
|
// ../interactions/hottext-interaction/dist/qti-hottext-interaction.js
|
|
6735
|
-
import { html as
|
|
6895
|
+
import { html as html21 } from "lit";
|
|
6736
6896
|
|
|
6737
6897
|
// ../interactions/hottext-interaction/dist/qti-hottext-interaction.styles.js
|
|
6738
6898
|
import { css as css20 } from "lit";
|
|
@@ -6751,7 +6911,7 @@ var qti_hottext_interaction_styles_default = [
|
|
|
6751
6911
|
var QtiHottextInteraction = class extends ChoicesMixin(Interaction, "qti-hottext") {
|
|
6752
6912
|
constructor() {
|
|
6753
6913
|
super(...arguments);
|
|
6754
|
-
this.render = () =>
|
|
6914
|
+
this.render = () => html21`<slot></slot>
|
|
6755
6915
|
<div part="message" role="alert" id="validation-message"></div>`;
|
|
6756
6916
|
}
|
|
6757
6917
|
static {
|
|
@@ -6760,8 +6920,8 @@ var QtiHottextInteraction = class extends ChoicesMixin(Interaction, "qti-hottext
|
|
|
6760
6920
|
};
|
|
6761
6921
|
|
|
6762
6922
|
// ../interactions/inline-choice-interaction/dist/qti-inline-choice-interaction.js
|
|
6763
|
-
import { html as
|
|
6764
|
-
import { property as
|
|
6923
|
+
import { html as html22 } from "lit";
|
|
6924
|
+
import { property as property20, state as state9 } from "lit/decorators.js";
|
|
6765
6925
|
import { consume as consume5 } from "@lit/context";
|
|
6766
6926
|
|
|
6767
6927
|
// ../interactions/core/dist/mixins/menu-auto-size/menu-auto-size.mixin.js
|
|
@@ -7136,7 +7296,7 @@ var styles2 = own;
|
|
|
7136
7296
|
var qti_inline_choice_interaction_styles_default = styles2;
|
|
7137
7297
|
|
|
7138
7298
|
// ../interactions/inline-choice-interaction/dist/qti-inline-choice-interaction.js
|
|
7139
|
-
var
|
|
7299
|
+
var __decorate21 = function(decorators, target, key, desc) {
|
|
7140
7300
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7141
7301
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7142
7302
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -7244,7 +7404,7 @@ var QtiInlineChoiceInteraction = class extends MenuAutoSizeMixin(Interaction) {
|
|
|
7244
7404
|
/** The closed combobox — the box showing the chosen option. */
|
|
7245
7405
|
renderTrigger() {
|
|
7246
7406
|
const selected = this.#selectedOption();
|
|
7247
|
-
return
|
|
7407
|
+
return html22`
|
|
7248
7408
|
<button
|
|
7249
7409
|
part="trigger"
|
|
7250
7410
|
type="button"
|
|
@@ -7268,7 +7428,7 @@ var QtiInlineChoiceInteraction = class extends MenuAutoSizeMixin(Interaction) {
|
|
|
7268
7428
|
}
|
|
7269
7429
|
/** The popover listbox. */
|
|
7270
7430
|
renderMenu() {
|
|
7271
|
-
return
|
|
7431
|
+
return html22`
|
|
7272
7432
|
<div
|
|
7273
7433
|
id="${this._menuId}"
|
|
7274
7434
|
part="menu"
|
|
@@ -7292,10 +7452,10 @@ var QtiInlineChoiceInteraction = class extends MenuAutoSizeMixin(Interaction) {
|
|
|
7292
7452
|
}
|
|
7293
7453
|
/** Hidden until `Interaction.reportValidity` shows it. */
|
|
7294
7454
|
renderValidationMessage() {
|
|
7295
|
-
return
|
|
7455
|
+
return html22`<div id="validation-message" part="message" role="alert" style="display:none;"></div>`;
|
|
7296
7456
|
}
|
|
7297
7457
|
render() {
|
|
7298
|
-
return
|
|
7458
|
+
return html22` ${this.renderTrigger()} ${this.renderMenu()} ${this.renderValidationMessage()} `;
|
|
7299
7459
|
}
|
|
7300
7460
|
async connectedCallback() {
|
|
7301
7461
|
super.connectedCallback();
|
|
@@ -7506,24 +7666,24 @@ var QtiInlineChoiceInteraction = class extends MenuAutoSizeMixin(Interaction) {
|
|
|
7506
7666
|
return [...promptOption ? [promptOption] : [], ...slottedChoices];
|
|
7507
7667
|
}
|
|
7508
7668
|
};
|
|
7509
|
-
|
|
7669
|
+
__decorate21([
|
|
7510
7670
|
state9()
|
|
7511
7671
|
], QtiInlineChoiceInteraction.prototype, "options", void 0);
|
|
7512
|
-
|
|
7672
|
+
__decorate21([
|
|
7513
7673
|
state9()
|
|
7514
7674
|
], QtiInlineChoiceInteraction.prototype, "_dropdownOpen", void 0);
|
|
7515
|
-
|
|
7675
|
+
__decorate21([
|
|
7516
7676
|
consume5({ context: configContext, subscribe: true }),
|
|
7517
|
-
|
|
7677
|
+
property20({ attribute: false })
|
|
7518
7678
|
], QtiInlineChoiceInteraction.prototype, "configContext", void 0);
|
|
7519
|
-
|
|
7520
|
-
|
|
7679
|
+
__decorate21([
|
|
7680
|
+
property20({ type: String, attribute: "data-prompt" })
|
|
7521
7681
|
], QtiInlineChoiceInteraction.prototype, "dataPrompt", void 0);
|
|
7522
|
-
|
|
7682
|
+
__decorate21([
|
|
7523
7683
|
watch("dataPrompt", { waitUntilFirstUpdate: true })
|
|
7524
7684
|
], QtiInlineChoiceInteraction.prototype, "_handleDataPromptChange", void 0);
|
|
7525
|
-
|
|
7526
|
-
|
|
7685
|
+
__decorate21([
|
|
7686
|
+
property20({
|
|
7527
7687
|
type: Boolean,
|
|
7528
7688
|
reflect: true,
|
|
7529
7689
|
converter: {
|
|
@@ -7533,19 +7693,19 @@ __decorate20([
|
|
|
7533
7693
|
}
|
|
7534
7694
|
})
|
|
7535
7695
|
], QtiInlineChoiceInteraction.prototype, "required", void 0);
|
|
7536
|
-
|
|
7537
|
-
|
|
7696
|
+
__decorate21([
|
|
7697
|
+
property20({ type: Number, attribute: "min-choices" })
|
|
7538
7698
|
], QtiInlineChoiceInteraction.prototype, "minChoices", void 0);
|
|
7539
|
-
|
|
7699
|
+
__decorate21([
|
|
7540
7700
|
watch(["required", "minChoices"], { waitUntilFirstUpdate: true })
|
|
7541
7701
|
], QtiInlineChoiceInteraction.prototype, "_handleRequiredChange", void 0);
|
|
7542
|
-
|
|
7543
|
-
|
|
7702
|
+
__decorate21([
|
|
7703
|
+
property20({ attribute: "response", reflect: false, noAccessor: true })
|
|
7544
7704
|
], QtiInlineChoiceInteraction.prototype, "response", null);
|
|
7545
7705
|
|
|
7546
7706
|
// ../interactions/match-interaction/dist/qti-match-interaction.js
|
|
7547
|
-
import { html as
|
|
7548
|
-
import { property as
|
|
7707
|
+
import { html as html23, nothing as nothing3 } from "lit";
|
|
7708
|
+
import { property as property21, state as state10 } from "lit/decorators.js";
|
|
7549
7709
|
|
|
7550
7710
|
// ../interactions/match-interaction/dist/qti-match-interaction.styles.js
|
|
7551
7711
|
import { css as css22 } from "lit";
|
|
@@ -7725,7 +7885,7 @@ var qti_match_interaction_tabular_styles_default = [
|
|
|
7725
7885
|
];
|
|
7726
7886
|
|
|
7727
7887
|
// ../interactions/match-interaction/dist/qti-match-interaction.js
|
|
7728
|
-
var
|
|
7888
|
+
var __decorate22 = function(decorators, target, key, desc) {
|
|
7729
7889
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7730
7890
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7731
7891
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -7868,11 +8028,11 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(DragDropSlo
|
|
|
7868
8028
|
}
|
|
7869
8029
|
render() {
|
|
7870
8030
|
const isTabular = this.class.split(" ").includes("qti-match-tabular");
|
|
7871
|
-
return
|
|
8031
|
+
return html23`
|
|
7872
8032
|
<slot name="prompt"></slot>
|
|
7873
8033
|
<slot ?hidden=${isTabular}></slot>
|
|
7874
8034
|
|
|
7875
|
-
${isTabular ?
|
|
8035
|
+
${isTabular ? html23`
|
|
7876
8036
|
<div
|
|
7877
8037
|
part="grid"
|
|
7878
8038
|
role="grid"
|
|
@@ -7882,7 +8042,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(DragDropSlo
|
|
|
7882
8042
|
<div part="cols-wrap" role="row"><slot name="match-cols" part="c-header"></slot></div>
|
|
7883
8043
|
<div part="rows-wrap"><slot name="match-rows" part="r-header"></slot></div>
|
|
7884
8044
|
<div part="checkbox-grid">
|
|
7885
|
-
${this.sourceChoices.map((row, r) =>
|
|
8045
|
+
${this.sourceChoices.map((row, r) => html23`
|
|
7886
8046
|
<div role="row" style="display: contents;">
|
|
7887
8047
|
${this.targetChoices.map((col, c) => {
|
|
7888
8048
|
const rowId = row.getAttribute("identifier");
|
|
@@ -7896,7 +8056,7 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(DragDropSlo
|
|
|
7896
8056
|
const controlPart = `control ${type} ${checkedMarker} ${stateVariant}`.trim();
|
|
7897
8057
|
const controlMarkPart = `control-mark ${type} ${checkedMarker} ${stateVariant}`.trim();
|
|
7898
8058
|
const disable = row.matchMax === 1 ? false : row.matchMax !== 0 && selectedInRowCount >= row.matchMax && !checked;
|
|
7899
|
-
return
|
|
8059
|
+
return html23`
|
|
7900
8060
|
<label
|
|
7901
8061
|
part="input-cell"
|
|
7902
8062
|
role="gridcell"
|
|
@@ -7928,18 +8088,18 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(DragDropSlo
|
|
|
7928
8088
|
`;
|
|
7929
8089
|
}
|
|
7930
8090
|
};
|
|
7931
|
-
|
|
7932
|
-
|
|
8091
|
+
__decorate22([
|
|
8092
|
+
property21({ type: String })
|
|
7933
8093
|
], QtiMatchInteraction.prototype, "class", void 0);
|
|
7934
|
-
|
|
8094
|
+
__decorate22([
|
|
7935
8095
|
state10()
|
|
7936
8096
|
], QtiMatchInteraction.prototype, "_response", void 0);
|
|
7937
|
-
|
|
7938
|
-
|
|
8097
|
+
__decorate22([
|
|
8098
|
+
property21({ type: String, attribute: "response-identifier" })
|
|
7939
8099
|
], QtiMatchInteraction.prototype, "responseIdentifier", void 0);
|
|
7940
8100
|
|
|
7941
8101
|
// ../interactions/media-interaction/dist/qti-media-interaction.js
|
|
7942
|
-
import { html as
|
|
8102
|
+
import { html as html24 } from "lit";
|
|
7943
8103
|
|
|
7944
8104
|
// ../interactions/media-interaction/dist/qti-media-interaction.styles.js
|
|
7945
8105
|
import { css as css24 } from "lit";
|
|
@@ -7991,7 +8151,7 @@ var QtiMediaInteraction = class extends Interaction {
|
|
|
7991
8151
|
};
|
|
7992
8152
|
}
|
|
7993
8153
|
render() {
|
|
7994
|
-
return
|
|
8154
|
+
return html24` <slot name="prompt"></slot>
|
|
7995
8155
|
<slot></slot>`;
|
|
7996
8156
|
}
|
|
7997
8157
|
constructor() {
|
|
@@ -8010,9 +8170,9 @@ var QtiMediaInteraction = class extends Interaction {
|
|
|
8010
8170
|
};
|
|
8011
8171
|
|
|
8012
8172
|
// ../interactions/order-interaction/dist/qti-order-interaction.js
|
|
8013
|
-
import { html as
|
|
8173
|
+
import { html as html25 } from "lit";
|
|
8014
8174
|
import { repeat as repeat6 } from "lit/directives/repeat.js";
|
|
8015
|
-
import { property as
|
|
8175
|
+
import { property as property22, state as state11 } from "lit/decorators.js";
|
|
8016
8176
|
|
|
8017
8177
|
// ../interactions/order-interaction/dist/qti-order-interaction.styles.js
|
|
8018
8178
|
import { css as css25 } from "lit";
|
|
@@ -8234,7 +8394,7 @@ var qti_order_interaction_styles_default = [
|
|
|
8234
8394
|
];
|
|
8235
8395
|
|
|
8236
8396
|
// ../interactions/order-interaction/dist/qti-order-interaction.js
|
|
8237
|
-
var
|
|
8397
|
+
var __decorate23 = function(decorators, target, key, desc) {
|
|
8238
8398
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8239
8399
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8240
8400
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -8254,14 +8414,14 @@ var QtiOrderInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
8254
8414
|
if (this.nrChoices < choices.length) {
|
|
8255
8415
|
this.nrChoices = choices.length;
|
|
8256
8416
|
}
|
|
8257
|
-
return
|
|
8417
|
+
return html25` <slot name="prompt"> </slot>
|
|
8258
8418
|
<div part="container">
|
|
8259
8419
|
<slot part="drags"> </slot>
|
|
8260
8420
|
<div part="drops">
|
|
8261
8421
|
${[...Array(this.nrChoices)].map((_, i) => {
|
|
8262
8422
|
const identifier = `droplist${i}`;
|
|
8263
8423
|
const drags = this._dragDrop?.nodesByTarget?.[identifier] ?? [];
|
|
8264
|
-
return
|
|
8424
|
+
return html25`<div role="region" part="drop" data-declarative-drops identifier=${identifier}>
|
|
8265
8425
|
${repeat6(drags, (node) => node.getAttribute("identifier"), (node) => node)}
|
|
8266
8426
|
</div>`;
|
|
8267
8427
|
})}
|
|
@@ -8293,16 +8453,16 @@ var QtiOrderInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
8293
8453
|
this.childrenMap = Array.from(this.querySelectorAll("qti-simple-choice"));
|
|
8294
8454
|
}
|
|
8295
8455
|
};
|
|
8296
|
-
|
|
8456
|
+
__decorate23([
|
|
8297
8457
|
state11()
|
|
8298
8458
|
], QtiOrderInteraction.prototype, "nrChoices", void 0);
|
|
8299
|
-
|
|
8300
|
-
|
|
8459
|
+
__decorate23([
|
|
8460
|
+
property22({ type: String })
|
|
8301
8461
|
], QtiOrderInteraction.prototype, "orientation", void 0);
|
|
8302
8462
|
|
|
8303
8463
|
// ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.js
|
|
8304
|
-
import { css as css27, html as
|
|
8305
|
-
import { property as
|
|
8464
|
+
import { css as css27, html as html26 } from "lit";
|
|
8465
|
+
import { property as property23, state as state12 } from "lit/decorators.js";
|
|
8306
8466
|
import { consume as consume6 } from "@lit/context";
|
|
8307
8467
|
|
|
8308
8468
|
// ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.styles.js
|
|
@@ -8323,7 +8483,7 @@ var qti_portable_custom_interaction_styles_default = [
|
|
|
8323
8483
|
];
|
|
8324
8484
|
|
|
8325
8485
|
// ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.js
|
|
8326
|
-
var
|
|
8486
|
+
var __decorate24 = function(decorators, target, key, desc) {
|
|
8327
8487
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8328
8488
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8329
8489
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -10012,56 +10172,56 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
10012
10172
|
// Add this property to store the previous state
|
|
10013
10173
|
#previousState;
|
|
10014
10174
|
render() {
|
|
10015
|
-
return
|
|
10175
|
+
return html26`
|
|
10016
10176
|
<slot></slot>
|
|
10017
|
-
${this._errorMessage ?
|
|
10177
|
+
${this._errorMessage ? html26`<div style="color:red">
|
|
10018
10178
|
<h1>Error</h1>
|
|
10019
10179
|
${this._errorMessage}
|
|
10020
10180
|
</div>` : ""}
|
|
10021
10181
|
`;
|
|
10022
10182
|
}
|
|
10023
10183
|
};
|
|
10024
|
-
|
|
10025
|
-
|
|
10184
|
+
__decorate24([
|
|
10185
|
+
property23({ type: String, attribute: "module" })
|
|
10026
10186
|
], QtiPortableCustomInteraction.prototype, "module", void 0);
|
|
10027
|
-
|
|
10028
|
-
|
|
10187
|
+
__decorate24([
|
|
10188
|
+
property23({ type: String, attribute: "custom-interaction-type-identifier" })
|
|
10029
10189
|
], QtiPortableCustomInteraction.prototype, "customInteractionTypeIdentifier", void 0);
|
|
10030
|
-
|
|
10031
|
-
|
|
10190
|
+
__decorate24([
|
|
10191
|
+
property23({ type: String, attribute: "data-require-paths" })
|
|
10032
10192
|
], QtiPortableCustomInteraction.prototype, "requirePathsJson", void 0);
|
|
10033
|
-
|
|
10034
|
-
|
|
10193
|
+
__decorate24([
|
|
10194
|
+
property23({ type: String, attribute: "data-require-shim" })
|
|
10035
10195
|
], QtiPortableCustomInteraction.prototype, "requireShimJson", void 0);
|
|
10036
|
-
|
|
10037
|
-
|
|
10196
|
+
__decorate24([
|
|
10197
|
+
property23({ type: String, attribute: "data-require-js-url" })
|
|
10038
10198
|
], QtiPortableCustomInteraction.prototype, "requireJsUrl", void 0);
|
|
10039
|
-
|
|
10040
|
-
|
|
10199
|
+
__decorate24([
|
|
10200
|
+
property23({ type: String, attribute: "data-base-url" })
|
|
10041
10201
|
], QtiPortableCustomInteraction.prototype, "baseUrl", void 0);
|
|
10042
|
-
|
|
10043
|
-
|
|
10202
|
+
__decorate24([
|
|
10203
|
+
property23({ type: Boolean, attribute: "data-use-default-paths" })
|
|
10044
10204
|
], QtiPortableCustomInteraction.prototype, "useDefaultPaths", void 0);
|
|
10045
|
-
|
|
10046
|
-
|
|
10205
|
+
__decorate24([
|
|
10206
|
+
property23({ type: String, attribute: "data-status" })
|
|
10047
10207
|
], QtiPortableCustomInteraction.prototype, "status", void 0);
|
|
10048
|
-
|
|
10208
|
+
__decorate24([
|
|
10049
10209
|
state12()
|
|
10050
10210
|
], QtiPortableCustomInteraction.prototype, "_errorMessage", void 0);
|
|
10051
|
-
|
|
10211
|
+
__decorate24([
|
|
10052
10212
|
consume6({ context: itemContext, subscribe: true }),
|
|
10053
10213
|
state12()
|
|
10054
10214
|
], QtiPortableCustomInteraction.prototype, "context", void 0);
|
|
10055
|
-
|
|
10215
|
+
__decorate24([
|
|
10056
10216
|
consume6({ context: qtiContext, subscribe: true }),
|
|
10057
10217
|
state12()
|
|
10058
10218
|
], QtiPortableCustomInteraction.prototype, "qtiContext", void 0);
|
|
10059
|
-
|
|
10060
|
-
|
|
10219
|
+
__decorate24([
|
|
10220
|
+
property23({ attribute: "response", reflect: false, converter: responseAttributeConverter({ emptyAs: null }) })
|
|
10061
10221
|
], QtiPortableCustomInteraction.prototype, "response", void 0);
|
|
10062
10222
|
|
|
10063
10223
|
// ../interactions/position-object-interaction/dist/qti-position-object-interaction.js
|
|
10064
|
-
import { LitElement as LitElement12, html as
|
|
10224
|
+
import { LitElement as LitElement12, html as html27 } from "lit";
|
|
10065
10225
|
|
|
10066
10226
|
// ../interactions/position-object-interaction/dist/qti-position-object-interaction.styles.js
|
|
10067
10227
|
import { css as css28 } from "lit";
|
|
@@ -10087,12 +10247,12 @@ var QtiPositionObjectInteraction = class extends LitElement12 {
|
|
|
10087
10247
|
this.styles = qti_position_object_interaction_styles_default;
|
|
10088
10248
|
}
|
|
10089
10249
|
render() {
|
|
10090
|
-
return
|
|
10250
|
+
return html27`<slot></slot>`;
|
|
10091
10251
|
}
|
|
10092
10252
|
};
|
|
10093
10253
|
|
|
10094
10254
|
// ../interactions/position-object-interaction/dist/qti-position-object-stage.js
|
|
10095
|
-
import { LitElement as LitElement13, html as
|
|
10255
|
+
import { LitElement as LitElement13, html as html28 } from "lit";
|
|
10096
10256
|
|
|
10097
10257
|
// ../interactions/position-object-interaction/dist/qti-position-object-stage.styles.js
|
|
10098
10258
|
import { css as css29 } from "lit";
|
|
@@ -10112,7 +10272,7 @@ var QtiPositionObjectStage = class extends LitElement13 {
|
|
|
10112
10272
|
this.styles = qti_position_object_stage_styles_default;
|
|
10113
10273
|
}
|
|
10114
10274
|
render() {
|
|
10115
|
-
return
|
|
10275
|
+
return html28`<slot></slot>`;
|
|
10116
10276
|
}
|
|
10117
10277
|
constructor() {
|
|
10118
10278
|
super();
|
|
@@ -10152,8 +10312,8 @@ var QtiPositionObjectStage = class extends LitElement13 {
|
|
|
10152
10312
|
};
|
|
10153
10313
|
|
|
10154
10314
|
// ../interactions/select-point-interaction/dist/qti-select-point-interaction.js
|
|
10155
|
-
import { html as
|
|
10156
|
-
import { property as
|
|
10315
|
+
import { html as html29, nothing as nothing4 } from "lit";
|
|
10316
|
+
import { property as property24, state as state13 } from "lit/decorators.js";
|
|
10157
10317
|
import { repeat as repeat7 } from "lit/directives/repeat.js";
|
|
10158
10318
|
import { styleMap } from "lit/directives/style-map.js";
|
|
10159
10319
|
|
|
@@ -10200,7 +10360,7 @@ var qti_select_point_interaction_styles_default = [
|
|
|
10200
10360
|
];
|
|
10201
10361
|
|
|
10202
10362
|
// ../interactions/select-point-interaction/dist/qti-select-point-interaction.js
|
|
10203
|
-
var
|
|
10363
|
+
var __decorate25 = function(decorators, target, key, desc) {
|
|
10204
10364
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10205
10365
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10206
10366
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -10321,13 +10481,13 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
10321
10481
|
render() {
|
|
10322
10482
|
const rawResponse = this.response;
|
|
10323
10483
|
const responseList = Array.isArray(rawResponse) ? rawResponse : rawResponse ? [rawResponse] : [];
|
|
10324
|
-
return
|
|
10484
|
+
return html29` <slot name="prompt"></slot>
|
|
10325
10485
|
<point-container>
|
|
10326
10486
|
${repeat7(responseList.filter((point) => point), (point) => point, (point, index) => {
|
|
10327
10487
|
const [x, y] = point.split(" ").map(Number);
|
|
10328
10488
|
const leftPercentage = x / (this.#imageWidthOriginal || 1) * 100;
|
|
10329
10489
|
const topPercentage = y / (this.#imageHeightOriginal || 1) * 100;
|
|
10330
|
-
return
|
|
10490
|
+
return html29`
|
|
10331
10491
|
<button
|
|
10332
10492
|
part=${this.pointPart(point, index)}
|
|
10333
10493
|
style=${styleMap({
|
|
@@ -10394,20 +10554,20 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
10394
10554
|
}
|
|
10395
10555
|
}
|
|
10396
10556
|
};
|
|
10397
|
-
|
|
10398
|
-
|
|
10557
|
+
__decorate25([
|
|
10558
|
+
property24({
|
|
10399
10559
|
type: Number,
|
|
10400
10560
|
attribute: "max-choices"
|
|
10401
10561
|
})
|
|
10402
10562
|
], QtiSelectPointInteraction.prototype, "maxChoices", void 0);
|
|
10403
|
-
|
|
10404
|
-
|
|
10563
|
+
__decorate25([
|
|
10564
|
+
property24({
|
|
10405
10565
|
type: Number,
|
|
10406
10566
|
attribute: "min-choices"
|
|
10407
10567
|
})
|
|
10408
10568
|
], QtiSelectPointInteraction.prototype, "minChoices", void 0);
|
|
10409
|
-
|
|
10410
|
-
|
|
10569
|
+
__decorate25([
|
|
10570
|
+
property24({
|
|
10411
10571
|
attribute: "response",
|
|
10412
10572
|
reflect: false,
|
|
10413
10573
|
converter: {
|
|
@@ -10423,19 +10583,19 @@ __decorate24([
|
|
|
10423
10583
|
}
|
|
10424
10584
|
})
|
|
10425
10585
|
], QtiSelectPointInteraction.prototype, "response", void 0);
|
|
10426
|
-
|
|
10427
|
-
|
|
10586
|
+
__decorate25([
|
|
10587
|
+
property24({ attribute: "area-mappings" })
|
|
10428
10588
|
], QtiSelectPointInteraction.prototype, "areaMappings", void 0);
|
|
10429
|
-
|
|
10589
|
+
__decorate25([
|
|
10430
10590
|
state13()
|
|
10431
10591
|
], QtiSelectPointInteraction.prototype, "_areaEntries", void 0);
|
|
10432
|
-
|
|
10592
|
+
__decorate25([
|
|
10433
10593
|
watch("areaMappings")
|
|
10434
10594
|
], QtiSelectPointInteraction.prototype, "_handleAreaMappingsChange", void 0);
|
|
10435
10595
|
|
|
10436
10596
|
// ../interactions/slider-interaction/dist/qti-slider-interaction.js
|
|
10437
|
-
import { html as
|
|
10438
|
-
import { property as
|
|
10597
|
+
import { html as html30, nothing as nothing5 } from "lit";
|
|
10598
|
+
import { property as property25, query as query2 } from "lit/decorators.js";
|
|
10439
10599
|
|
|
10440
10600
|
// ../interactions/slider-interaction/dist/qti-slider-interaction.styles.js
|
|
10441
10601
|
import { css as css31 } from "lit";
|
|
@@ -10513,7 +10673,7 @@ var qti_slider_interaction_styles_default = [
|
|
|
10513
10673
|
];
|
|
10514
10674
|
|
|
10515
10675
|
// ../interactions/slider-interaction/dist/qti-slider-interaction.js
|
|
10516
|
-
var
|
|
10676
|
+
var __decorate26 = function(decorators, target, key, desc) {
|
|
10517
10677
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10518
10678
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10519
10679
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -10570,7 +10730,7 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
10570
10730
|
this.requestUpdate();
|
|
10571
10731
|
}
|
|
10572
10732
|
render() {
|
|
10573
|
-
return
|
|
10733
|
+
return html30`
|
|
10574
10734
|
<slot name="prompt"></slot>
|
|
10575
10735
|
<div id="slider" part="slider">
|
|
10576
10736
|
<div id="bounds" part="bounds">
|
|
@@ -10626,25 +10786,25 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
10626
10786
|
this.dispatchEvent(new Event("change", { bubbles: true }));
|
|
10627
10787
|
}
|
|
10628
10788
|
};
|
|
10629
|
-
|
|
10789
|
+
__decorate26([
|
|
10630
10790
|
query2("#rail")
|
|
10631
10791
|
], QtiSliderInteraction.prototype, "_rail", void 0);
|
|
10632
|
-
|
|
10633
|
-
|
|
10792
|
+
__decorate26([
|
|
10793
|
+
property25({ type: Number, attribute: "lower-bound" })
|
|
10634
10794
|
], QtiSliderInteraction.prototype, "min", void 0);
|
|
10635
|
-
|
|
10636
|
-
|
|
10795
|
+
__decorate26([
|
|
10796
|
+
property25({ type: Number, attribute: "upper-bound" })
|
|
10637
10797
|
], QtiSliderInteraction.prototype, "max", void 0);
|
|
10638
|
-
|
|
10639
|
-
|
|
10798
|
+
__decorate26([
|
|
10799
|
+
property25({ type: Number, attribute: "step" })
|
|
10640
10800
|
], QtiSliderInteraction.prototype, "step", void 0);
|
|
10641
|
-
|
|
10642
|
-
|
|
10801
|
+
__decorate26([
|
|
10802
|
+
property25({ attribute: "response", reflect: false, noAccessor: true })
|
|
10643
10803
|
], QtiSliderInteraction.prototype, "response", null);
|
|
10644
10804
|
|
|
10645
10805
|
// ../interactions/text-entry-interaction/dist/qti-text-entry-interaction.js
|
|
10646
|
-
import { html as
|
|
10647
|
-
import { property as
|
|
10806
|
+
import { html as html31 } from "lit";
|
|
10807
|
+
import { property as property26, query as query3 } from "lit/decorators.js";
|
|
10648
10808
|
import { ifDefined as ifDefined3 } from "lit/directives/if-defined.js";
|
|
10649
10809
|
import { createRef } from "lit/directives/ref.js";
|
|
10650
10810
|
|
|
@@ -10745,7 +10905,7 @@ var qti_text_entry_interaction_styles_default = [
|
|
|
10745
10905
|
];
|
|
10746
10906
|
|
|
10747
10907
|
// ../interactions/text-entry-interaction/dist/qti-text-entry-interaction.js
|
|
10748
|
-
var
|
|
10908
|
+
var __decorate27 = function(decorators, target, key, desc) {
|
|
10749
10909
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10750
10910
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10751
10911
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
@@ -10804,11 +10964,11 @@ var QtiTextEntryInteraction = class extends Interaction {
|
|
|
10804
10964
|
*/
|
|
10805
10965
|
/** The answer-key line, revealed above the field when the correct response is shown. */
|
|
10806
10966
|
renderAnswer() {
|
|
10807
|
-
return
|
|
10967
|
+
return html31`<div part="answer" aria-hidden="true"></div>`;
|
|
10808
10968
|
}
|
|
10809
10969
|
/** The field itself. */
|
|
10810
10970
|
renderInput() {
|
|
10811
|
-
return
|
|
10971
|
+
return html31`<input
|
|
10812
10972
|
part="input"
|
|
10813
10973
|
name="${this.responseIdentifier}"
|
|
10814
10974
|
spellcheck="false"
|
|
@@ -10830,10 +10990,10 @@ var QtiTextEntryInteraction = class extends Interaction {
|
|
|
10830
10990
|
}
|
|
10831
10991
|
/** Hidden until `Interaction.reportValidity` shows it. */
|
|
10832
10992
|
renderValidationMessage() {
|
|
10833
|
-
return
|
|
10993
|
+
return html31`<div id="validation-message" part="message" role="alert" style="display:none;"></div>`;
|
|
10834
10994
|
}
|
|
10835
10995
|
render() {
|
|
10836
|
-
return
|
|
10996
|
+
return html31` ${this.renderAnswer()} ${this.renderInput()} ${this.renderValidationMessage()} `;
|
|
10837
10997
|
}
|
|
10838
10998
|
textChanged(event) {
|
|
10839
10999
|
if (this.disabled || this.readonly)
|
|
@@ -10852,30 +11012,30 @@ var QtiTextEntryInteraction = class extends Interaction {
|
|
|
10852
11012
|
this.response = "";
|
|
10853
11013
|
}
|
|
10854
11014
|
};
|
|
10855
|
-
|
|
10856
|
-
|
|
11015
|
+
__decorate27([
|
|
11016
|
+
property26({ type: Number, attribute: "expected-length" })
|
|
10857
11017
|
], QtiTextEntryInteraction.prototype, "expectedLength", void 0);
|
|
10858
|
-
|
|
10859
|
-
|
|
11018
|
+
__decorate27([
|
|
11019
|
+
property26({ type: String, attribute: "pattern-mask" })
|
|
10860
11020
|
], QtiTextEntryInteraction.prototype, "patternMask", void 0);
|
|
10861
|
-
|
|
10862
|
-
|
|
11021
|
+
__decorate27([
|
|
11022
|
+
property26({ type: String, attribute: "placeholder-text" })
|
|
10863
11023
|
], QtiTextEntryInteraction.prototype, "placeholderText", void 0);
|
|
10864
|
-
|
|
10865
|
-
|
|
11024
|
+
__decorate27([
|
|
11025
|
+
property26({ type: String, attribute: "data-patternmask-message" })
|
|
10866
11026
|
], QtiTextEntryInteraction.prototype, "dataPatternmaskMessage", void 0);
|
|
10867
|
-
|
|
10868
|
-
|
|
11027
|
+
__decorate27([
|
|
11028
|
+
property26({ type: String, attribute: "response", reflect: false })
|
|
10869
11029
|
], QtiTextEntryInteraction.prototype, "response", void 0);
|
|
10870
|
-
|
|
11030
|
+
__decorate27([
|
|
10871
11031
|
query3("input")
|
|
10872
11032
|
], QtiTextEntryInteraction.prototype, "_input", void 0);
|
|
10873
|
-
|
|
11033
|
+
__decorate27([
|
|
10874
11034
|
watch("response", { waitUntilFirstUpdate: true })
|
|
10875
11035
|
], QtiTextEntryInteraction.prototype, "_handleValueChange", void 0);
|
|
10876
11036
|
|
|
10877
11037
|
// ../interactions/upload-interaction/dist/qti-upload-interaction.js
|
|
10878
|
-
import { html as
|
|
11038
|
+
import { html as html32 } from "lit";
|
|
10879
11039
|
|
|
10880
11040
|
// ../interactions/upload-interaction/dist/qti-upload-interaction.styles.js
|
|
10881
11041
|
import { css as css33 } from "lit";
|
|
@@ -10927,7 +11087,7 @@ var QtiUploadInteraction = class extends Interaction {
|
|
|
10927
11087
|
};
|
|
10928
11088
|
}
|
|
10929
11089
|
render() {
|
|
10930
|
-
return
|
|
11090
|
+
return html32`
|
|
10931
11091
|
<div>
|
|
10932
11092
|
<slot name="prompt"></slot>
|
|
10933
11093
|
<input type="file" @change="${this.#onFileChange}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" />
|
|
@@ -11514,7 +11674,6 @@ var elements31 = [{ tag: "qti-upload-interaction", ctor: QtiUploadInteraction }]
|
|
|
11514
11674
|
|
|
11515
11675
|
// ../qti-interactions/dist/elements.js
|
|
11516
11676
|
var qtiInteractionElements = [
|
|
11517
|
-
...qtiInteractionCoreElements,
|
|
11518
11677
|
...elements11,
|
|
11519
11678
|
...elements12,
|
|
11520
11679
|
...elements13,
|
|
@@ -11535,7 +11694,8 @@ var qtiInteractionElements = [
|
|
|
11535
11694
|
...elements28,
|
|
11536
11695
|
...elements29,
|
|
11537
11696
|
...elements30,
|
|
11538
|
-
...elements31
|
|
11697
|
+
...elements31,
|
|
11698
|
+
...qtiInteractionCoreElements
|
|
11539
11699
|
];
|
|
11540
11700
|
|
|
11541
11701
|
export {
|
|
@@ -11594,4 +11754,4 @@ export {
|
|
|
11594
11754
|
elements31 as elements21,
|
|
11595
11755
|
qtiInteractionElements
|
|
11596
11756
|
};
|
|
11597
|
-
//# sourceMappingURL=chunk-
|
|
11757
|
+
//# sourceMappingURL=chunk-JGPWBIVD.js.map
|