@citolab/qti-components 9.5.0 → 9.6.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 +1761 -204
- package/dist/base.d.ts +10 -10
- package/dist/base.js +7 -1
- package/dist/{chunk-SIE3E4FG.js → chunk-EAQOUBXA.js} +4 -4
- package/dist/{chunk-GBZNFSFY.js → chunk-H72OXVRF.js} +2 -2
- package/dist/{chunk-RU6332MD.js → chunk-I7ACMH74.js} +3 -3
- package/dist/{chunk-DAFB2E5H.js → chunk-LOKULHVY.js} +386 -241
- package/dist/chunk-LOKULHVY.js.map +1 -0
- package/dist/{chunk-MI7774NV.js → chunk-QOFGUIYE.js} +2 -2
- package/dist/{chunk-TDWJ6WZA.js → chunk-QUTM5TT6.js} +37 -1
- package/dist/chunk-QUTM5TT6.js.map +1 -0
- package/dist/chunk-QVZLJY75.js +7 -0
- package/dist/chunk-QVZLJY75.js.map +1 -0
- package/dist/{chunk-FD4AB6TM.js → chunk-RV7ADJ33.js} +2 -2
- package/dist/{chunk-OQDBARD5.js → chunk-TBJT7AGB.js} +2 -2
- package/dist/{chunk-SU63QGGD.js → chunk-TC4257SG.js} +6 -6
- package/dist/{chunk-6U3YPHXU.js → chunk-TFQAUWCM.js} +40 -5
- package/dist/{chunk-6U3YPHXU.js.map → chunk-TFQAUWCM.js.map} +1 -1
- package/dist/{chunk-6K3QWJHH.js → chunk-V3NKEAQY.js} +40 -4
- package/dist/chunk-V3NKEAQY.js.map +1 -0
- package/dist/{chunk-YZRODVYZ.js → chunk-YS6CBO45.js} +2 -2
- package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-SsTm3ieP.d.ts} +1 -1
- package/dist/corrections.d.ts +9 -9
- package/dist/corrections.js +8 -8
- package/dist/elements.d.ts +2 -2
- package/dist/elements.js +3 -3
- package/dist/index.d.ts +10 -10
- package/dist/index.js +23 -13
- package/dist/interactions.d.ts +4 -4
- package/dist/interactions.js +7 -3
- package/dist/item.css +2 -1
- package/dist/item.d.ts +4 -4
- package/dist/item.js +4 -4
- package/dist/{item.types.d-B55QkJ92.d.ts → item.types.d-DuVR0ZVK.d.ts} +7 -1
- package/dist/loader.d.ts +2 -2
- package/dist/processing.d.ts +10 -3
- package/dist/processing.js +3 -3
- package/dist/qti-components-jsx.d.ts +46 -26
- package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
- package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +1 -1
- package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-DbzPSJuK.d.ts} +1 -1
- package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-DjWvKbfL.d.ts} +1 -1
- package/dist/{qti-test.d-86TlaMlI.d.ts → qti-test.d-DOWT6YNa.d.ts} +4 -4
- package/dist/{qti-text-entry-interaction.d-C4eixT-D.d.ts → qti-text-entry-interaction.d-h5UZ8Qvp.d.ts} +28 -18
- package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
- package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-Cw8GcziG.d.ts} +1 -1
- package/dist/test.d.ts +7 -7
- package/dist/test.js +5 -5
- package/package.json +5 -5
- package/dist/chunk-6K3QWJHH.js.map +0 -1
- package/dist/chunk-DAFB2E5H.js.map +0 -1
- package/dist/chunk-TDWJ6WZA.js.map +0 -1
- package/dist/chunk-ZP6QQYSU.js +0 -7
- package/dist/chunk-ZP6QQYSU.js.map +0 -1
- /package/dist/{chunk-SIE3E4FG.js.map → chunk-EAQOUBXA.js.map} +0 -0
- /package/dist/{chunk-GBZNFSFY.js.map → chunk-H72OXVRF.js.map} +0 -0
- /package/dist/{chunk-RU6332MD.js.map → chunk-I7ACMH74.js.map} +0 -0
- /package/dist/{chunk-MI7774NV.js.map → chunk-QOFGUIYE.js.map} +0 -0
- /package/dist/{chunk-FD4AB6TM.js.map → chunk-RV7ADJ33.js.map} +0 -0
- /package/dist/{chunk-OQDBARD5.js.map → chunk-TBJT7AGB.js.map} +0 -0
- /package/dist/{chunk-SU63QGGD.js.map → chunk-TC4257SG.js.map} +0 -0
- /package/dist/{chunk-YZRODVYZ.js.map → chunk-YS6CBO45.js.map} +0 -0
|
@@ -6,15 +6,18 @@ import {
|
|
|
6
6
|
boxSizing,
|
|
7
7
|
configContext,
|
|
8
8
|
dropRegion,
|
|
9
|
+
inferRecordFieldBaseType,
|
|
9
10
|
interactionContext,
|
|
11
|
+
isRecordValue,
|
|
10
12
|
itemContext,
|
|
11
13
|
parseResponseAttribute,
|
|
12
14
|
qtiContext,
|
|
15
|
+
readRecordFieldValues,
|
|
13
16
|
removeDoubleSlashes,
|
|
14
17
|
responseAttributeConverter,
|
|
15
18
|
serializeResponseAttribute,
|
|
16
19
|
validationMessage
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QUTM5TT6.js";
|
|
18
21
|
|
|
19
22
|
// ../interactions/core/dist/elements/qti-associable-hotspot/qti-associable-hotspot.js
|
|
20
23
|
import { LitElement, html } from "lit";
|
|
@@ -207,6 +210,10 @@ var qti_gap_img_styles_default = [
|
|
|
207
210
|
align-items: center;
|
|
208
211
|
justify-content: center;
|
|
209
212
|
user-select: none;
|
|
213
|
+
/* In graphic-gap-match the picture's authored size is in the graphic's coordinate space, so it
|
|
214
|
+
scales with the graphic and keeps fitting its hotspot. The interaction publishes the factor;
|
|
215
|
+
anywhere else it is unset and the chip keeps its size. */
|
|
216
|
+
zoom: var(--qti-graphic-scale, 1);
|
|
210
217
|
}
|
|
211
218
|
`
|
|
212
219
|
];
|
|
@@ -1254,22 +1261,22 @@ var [Observable, Subscriber] = (() => {
|
|
|
1254
1261
|
const AsyncFromSyncIteratorPrototype = {
|
|
1255
1262
|
next(...args) {
|
|
1256
1263
|
const O = this;
|
|
1257
|
-
const
|
|
1258
|
-
if (!
|
|
1264
|
+
const state15 = privateState.get(O);
|
|
1265
|
+
if (!state15?.syncIteratorRecord)
|
|
1259
1266
|
throw new TypeError(
|
|
1260
1267
|
"AsyncFromSyncIteratorPrototype.next called on invalid object"
|
|
1261
1268
|
);
|
|
1262
|
-
const { syncIteratorRecord } =
|
|
1269
|
+
const { syncIteratorRecord } = state15;
|
|
1263
1270
|
return pTry(() => syncIteratorRecord.next(...args));
|
|
1264
1271
|
},
|
|
1265
1272
|
return(...args) {
|
|
1266
1273
|
const O = this;
|
|
1267
|
-
const
|
|
1268
|
-
if (!
|
|
1274
|
+
const state15 = privateState.get(O);
|
|
1275
|
+
if (!state15?.syncIteratorRecord)
|
|
1269
1276
|
throw new TypeError(
|
|
1270
1277
|
"AsyncFromSyncIteratorPrototype.return called on invalid object"
|
|
1271
1278
|
);
|
|
1272
|
-
const { syncIteratorRecord } =
|
|
1279
|
+
const { syncIteratorRecord } = state15;
|
|
1273
1280
|
return pTry(() => {
|
|
1274
1281
|
if (!syncIteratorRecord.return) return { value: void 0, done: true };
|
|
1275
1282
|
return syncIteratorRecord.return(...args);
|
|
@@ -1277,12 +1284,12 @@ var [Observable, Subscriber] = (() => {
|
|
|
1277
1284
|
},
|
|
1278
1285
|
throw(...args) {
|
|
1279
1286
|
const O = this;
|
|
1280
|
-
const
|
|
1281
|
-
if (!
|
|
1287
|
+
const state15 = privateState.get(O);
|
|
1288
|
+
if (!state15?.syncIteratorRecord)
|
|
1282
1289
|
throw new TypeError(
|
|
1283
1290
|
"AsyncFromSyncIteratorPrototype.throw called on invalid object"
|
|
1284
1291
|
);
|
|
1285
|
-
const { syncIteratorRecord } =
|
|
1292
|
+
const { syncIteratorRecord } = state15;
|
|
1286
1293
|
return pTry(() => {
|
|
1287
1294
|
if (!syncIteratorRecord.throw) {
|
|
1288
1295
|
syncIteratorRecord.return();
|
|
@@ -1348,11 +1355,11 @@ var [Observable, Subscriber] = (() => {
|
|
|
1348
1355
|
}
|
|
1349
1356
|
}
|
|
1350
1357
|
function closeASubscription(subscriber, reason) {
|
|
1351
|
-
const
|
|
1352
|
-
if (!
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
for (const teardown of
|
|
1358
|
+
const state15 = privateState.get(subscriber);
|
|
1359
|
+
if (!state15?.active) return;
|
|
1360
|
+
state15.active = false;
|
|
1361
|
+
state15.subscriptionController.abort(reason);
|
|
1362
|
+
for (const teardown of state15.teardowns.reverse()) {
|
|
1356
1363
|
if (isBrowserContext() && !isDocumentFullyActive(document)) return;
|
|
1357
1364
|
try {
|
|
1358
1365
|
teardown();
|
|
@@ -1433,10 +1440,10 @@ var [Observable, Subscriber] = (() => {
|
|
|
1433
1440
|
if (!(this instanceof Subscriber2))
|
|
1434
1441
|
throw new TypeError("illegal invocation");
|
|
1435
1442
|
if (!arguments.length) throw new TypeError("too few arguments");
|
|
1436
|
-
const
|
|
1437
|
-
if (!
|
|
1443
|
+
const state15 = privateState.get(this);
|
|
1444
|
+
if (!state15?.active) return;
|
|
1438
1445
|
if (isBrowserContext() && !isDocumentFullyActive(document)) return;
|
|
1439
|
-
const internalObservers = new Set(
|
|
1446
|
+
const internalObservers = new Set(state15.observers);
|
|
1440
1447
|
for (const observer of internalObservers) {
|
|
1441
1448
|
observer.next(value);
|
|
1442
1449
|
}
|
|
@@ -1446,14 +1453,14 @@ var [Observable, Subscriber] = (() => {
|
|
|
1446
1453
|
if (!(this instanceof Subscriber2))
|
|
1447
1454
|
throw new TypeError("illegal invocation");
|
|
1448
1455
|
if (!arguments.length) throw new TypeError("too few arguments");
|
|
1449
|
-
const
|
|
1450
|
-
if (!
|
|
1456
|
+
const state15 = privateState.get(this);
|
|
1457
|
+
if (!state15?.active) {
|
|
1451
1458
|
reportError(error);
|
|
1452
1459
|
return;
|
|
1453
1460
|
}
|
|
1454
1461
|
if (isBrowserContext() && !isDocumentFullyActive(document)) return;
|
|
1455
1462
|
closeASubscription(this, error);
|
|
1456
|
-
const internalObservers = new Set(
|
|
1463
|
+
const internalObservers = new Set(state15.observers);
|
|
1457
1464
|
for (const observer of internalObservers) {
|
|
1458
1465
|
observer.error(error);
|
|
1459
1466
|
}
|
|
@@ -1462,11 +1469,11 @@ var [Observable, Subscriber] = (() => {
|
|
|
1462
1469
|
complete() {
|
|
1463
1470
|
if (!(this instanceof Subscriber2))
|
|
1464
1471
|
throw new TypeError("illegal invocation");
|
|
1465
|
-
const
|
|
1466
|
-
if (!
|
|
1472
|
+
const state15 = privateState.get(this);
|
|
1473
|
+
if (!state15?.active) return;
|
|
1467
1474
|
if (isBrowserContext() && !isDocumentFullyActive(document)) return;
|
|
1468
1475
|
closeASubscription(this);
|
|
1469
|
-
const internalObservers = new Set(
|
|
1476
|
+
const internalObservers = new Set(state15.observers);
|
|
1470
1477
|
for (const observer of internalObservers) {
|
|
1471
1478
|
observer.complete();
|
|
1472
1479
|
}
|
|
@@ -1479,9 +1486,9 @@ var [Observable, Subscriber] = (() => {
|
|
|
1479
1486
|
throw new TypeError(`Parameter 1 is not of type 'Function'`);
|
|
1480
1487
|
}
|
|
1481
1488
|
if (isBrowserContext() && !isDocumentFullyActive(document)) return;
|
|
1482
|
-
const
|
|
1483
|
-
if (
|
|
1484
|
-
|
|
1489
|
+
const state15 = privateState.get(this);
|
|
1490
|
+
if (state15?.active)
|
|
1491
|
+
state15.teardowns.push(teardown);
|
|
1485
1492
|
else teardown();
|
|
1486
1493
|
}
|
|
1487
1494
|
get active() {
|
|
@@ -2665,17 +2672,17 @@ function isDraggableDisabled(target) {
|
|
|
2665
2672
|
return internals?.states?.has("disabled") ?? false;
|
|
2666
2673
|
}
|
|
2667
2674
|
var internalsOf = (el) => el?.internals;
|
|
2668
|
-
function setDragChipState(el,
|
|
2675
|
+
function setDragChipState(el, state15, on) {
|
|
2669
2676
|
const states = internalsOf(el)?.states;
|
|
2670
2677
|
if (!states)
|
|
2671
2678
|
return;
|
|
2672
2679
|
if (on)
|
|
2673
|
-
states.add(
|
|
2680
|
+
states.add(state15);
|
|
2674
2681
|
else
|
|
2675
|
-
states.delete(
|
|
2682
|
+
states.delete(state15);
|
|
2676
2683
|
}
|
|
2677
|
-
function hasDragChipState(el,
|
|
2678
|
-
return internalsOf(el)?.states?.has(
|
|
2684
|
+
function hasDragChipState(el, state15) {
|
|
2685
|
+
return internalsOf(el)?.states?.has(state15) ?? false;
|
|
2679
2686
|
}
|
|
2680
2687
|
function clearDragChipStates(el) {
|
|
2681
2688
|
setDragChipState(el, "dragging", false);
|
|
@@ -2771,7 +2778,7 @@ var resolveDragCloneHost = (dragSource, preferredHost) => {
|
|
|
2771
2778
|
return hostFor(fullscreenElement);
|
|
2772
2779
|
return host;
|
|
2773
2780
|
};
|
|
2774
|
-
var measureFixedFrame = (host) => {
|
|
2781
|
+
var measureFixedFrame = (host, ownZoom = 1) => {
|
|
2775
2782
|
const ownerDocument = host.ownerDocument ?? document;
|
|
2776
2783
|
const probe = ownerDocument.createElement("div");
|
|
2777
2784
|
probe.style.cssText = `position:fixed;left:0;top:0;width:${PROBE_SIZE}px;height:${PROBE_SIZE}px;margin:0;padding:0;border:0;visibility:hidden;pointer-events:none;`;
|
|
@@ -2780,7 +2787,9 @@ var measureFixedFrame = (host) => {
|
|
|
2780
2787
|
probe.remove();
|
|
2781
2788
|
return {
|
|
2782
2789
|
origin: { x: rect.left, y: rect.top },
|
|
2783
|
-
|
|
2790
|
+
// The clone's own `zoom` (copied from the chip with the rest of its computed style) multiplies
|
|
2791
|
+
// its left/top/width/height on top of whatever scales the host, so it is part of the frame.
|
|
2792
|
+
scale: { x: (rect.width / PROBE_SIZE || 1) * ownZoom, y: (rect.height / PROBE_SIZE || 1) * ownZoom }
|
|
2784
2793
|
};
|
|
2785
2794
|
};
|
|
2786
2795
|
var toFrameCoordinates = (frame, x, y) => ({
|
|
@@ -2821,6 +2830,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
2821
2830
|
returnAnchorItems: []
|
|
2822
2831
|
};
|
|
2823
2832
|
this.cloneFrame = IDENTITY_FIXED_FRAME;
|
|
2833
|
+
this.cloneZoom = 1;
|
|
2824
2834
|
this.subscriptions = [];
|
|
2825
2835
|
this.dragSubscriptions = [];
|
|
2826
2836
|
this.lastPointerDownAt = 0;
|
|
@@ -3391,7 +3401,8 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
3391
3401
|
clone.style.setProperty(property27, computedStyles.getPropertyValue(property27));
|
|
3392
3402
|
}
|
|
3393
3403
|
const host = resolveDragCloneHost(element.isConnected ? element : this, this.dragCloneRoot());
|
|
3394
|
-
this.
|
|
3404
|
+
this.cloneZoom = parseFloat(computedStyles.zoom) || 1;
|
|
3405
|
+
this.cloneFrame = measureFixedFrame(host, this.cloneZoom);
|
|
3395
3406
|
clone.style.position = "fixed";
|
|
3396
3407
|
clone.style.width = `${rect.width / this.cloneFrame.scale.x}px`;
|
|
3397
3408
|
clone.style.height = `${rect.height / this.cloneFrame.scale.y}px`;
|
|
@@ -3450,7 +3461,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
3450
3461
|
if (host === dragClone.parentNode)
|
|
3451
3462
|
return;
|
|
3452
3463
|
host.appendChild(dragClone);
|
|
3453
|
-
this.cloneFrame = measureFixedFrame(host);
|
|
3464
|
+
this.cloneFrame = measureFixedFrame(host, this.cloneZoom);
|
|
3454
3465
|
if (lastCoordinates) {
|
|
3455
3466
|
this.updateClonePosition(lastCoordinates.x, lastCoordinates.y);
|
|
3456
3467
|
}
|
|
@@ -3506,6 +3517,7 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
3506
3517
|
});
|
|
3507
3518
|
this.dragSubscriptions = [];
|
|
3508
3519
|
this.cloneFrame = IDENTITY_FIXED_FRAME;
|
|
3520
|
+
this.cloneZoom = 1;
|
|
3509
3521
|
this.dragState = {
|
|
3510
3522
|
dragging: false,
|
|
3511
3523
|
dragSource: null,
|
|
@@ -3520,14 +3532,14 @@ var DragDropCoreMixin = (superClass, draggablesSelector, droppablesSelector, dra
|
|
|
3520
3532
|
returnAnchorItems: []
|
|
3521
3533
|
};
|
|
3522
3534
|
}
|
|
3523
|
-
setInternalsState(
|
|
3535
|
+
setInternalsState(state15, enabled) {
|
|
3524
3536
|
const internals = this._internals;
|
|
3525
3537
|
if (!internals?.states)
|
|
3526
3538
|
return;
|
|
3527
3539
|
if (enabled) {
|
|
3528
|
-
internals.states.add(
|
|
3540
|
+
internals.states.add(state15);
|
|
3529
3541
|
} else {
|
|
3530
|
-
internals.states.delete(
|
|
3542
|
+
internals.states.delete(state15);
|
|
3531
3543
|
}
|
|
3532
3544
|
}
|
|
3533
3545
|
cleanup() {
|
|
@@ -6469,6 +6481,7 @@ __decorate19([
|
|
|
6469
6481
|
|
|
6470
6482
|
// ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.js
|
|
6471
6483
|
import { html as html18 } from "lit";
|
|
6484
|
+
import { state as state9 } from "lit/decorators.js";
|
|
6472
6485
|
|
|
6473
6486
|
// ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.styles.js
|
|
6474
6487
|
import { css as css17 } from "lit";
|
|
@@ -6564,15 +6577,34 @@ var qti_graphic_gap_match_interaction_styles_default = [
|
|
|
6564
6577
|
];
|
|
6565
6578
|
|
|
6566
6579
|
// ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.js
|
|
6580
|
+
var __decorate20 = function(decorators, target, key, desc) {
|
|
6581
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6582
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6583
|
+
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;
|
|
6584
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6585
|
+
};
|
|
6567
6586
|
var SlottedBase2 = DragDropSlottedMixin(Interaction, "qti-gap-img, qti-gap-text", "qti-associable-hotspot", `slot[part~='drags']`);
|
|
6568
6587
|
var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase2, '[qti-draggable="true"]') {
|
|
6588
|
+
constructor() {
|
|
6589
|
+
super(...arguments);
|
|
6590
|
+
this.autoSizeDropzones = false;
|
|
6591
|
+
this._graphicScale = 1;
|
|
6592
|
+
this.#graphicObserver = null;
|
|
6593
|
+
this.#observedGraphic = null;
|
|
6594
|
+
this.#positionHotspotOnRegister = (e) => {
|
|
6595
|
+
this.#positionHotspot(e.target);
|
|
6596
|
+
};
|
|
6597
|
+
}
|
|
6569
6598
|
static {
|
|
6570
6599
|
this.styles = qti_graphic_gap_match_interaction_styles_default;
|
|
6571
6600
|
}
|
|
6601
|
+
#graphicObserver;
|
|
6602
|
+
#observedGraphic;
|
|
6572
6603
|
render() {
|
|
6604
|
+
const scale = `--qti-graphic-scale: ${this._graphicScale}`;
|
|
6573
6605
|
return html18` <slot name="prompt"></slot>
|
|
6574
|
-
<slot part="image"></slot>
|
|
6575
|
-
<slot part="drags" name="drags" class="hover-border"></slot>
|
|
6606
|
+
<slot part="image" style=${scale}></slot>
|
|
6607
|
+
<slot part="drags" name="drags" class="hover-border" style=${scale}></slot>
|
|
6576
6608
|
<div role="alert" part="message" id="validation-message"></div>`;
|
|
6577
6609
|
}
|
|
6578
6610
|
shouldReturnToInventoryOnInventoryDrop() {
|
|
@@ -6620,11 +6652,30 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
6620
6652
|
if (!graphic || !coords || !shape)
|
|
6621
6653
|
return;
|
|
6622
6654
|
this.#keepDeclaredRatio(graphic);
|
|
6655
|
+
this.#observeGraphic(graphic);
|
|
6623
6656
|
positionShapes(shape, coords.split(",").map((s) => parseFloat(s)), graphic, hotspot);
|
|
6624
6657
|
}
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6658
|
+
/**
|
|
6659
|
+
* Tracks the graphic's rendered width. The authored chip sizes live in the same coordinate space
|
|
6660
|
+
* as the `coords` — an item that draws a 275x126 hotspot for a 275x126 tile means the tile to fill
|
|
6661
|
+
* it — so the chips scale by the same factor as the drop areas.
|
|
6662
|
+
*/
|
|
6663
|
+
#observeGraphic(graphic) {
|
|
6664
|
+
if (this.#observedGraphic === graphic)
|
|
6665
|
+
return;
|
|
6666
|
+
this.#graphicObserver?.disconnect();
|
|
6667
|
+
this.#observedGraphic = graphic;
|
|
6668
|
+
this.#graphicObserver = new ResizeObserver(() => {
|
|
6669
|
+
const declared = parseFloat(graphic.getAttribute("width") ?? "");
|
|
6670
|
+
const rendered = graphic.getBoundingClientRect().width;
|
|
6671
|
+
const scale = declared > 0 && rendered > 0 ? Math.min(1, rendered / declared) : 1;
|
|
6672
|
+
const rounded = Math.round(scale * 1e3) / 1e3;
|
|
6673
|
+
if (rounded !== this._graphicScale)
|
|
6674
|
+
this._graphicScale = rounded;
|
|
6675
|
+
});
|
|
6676
|
+
this.#graphicObserver.observe(graphic);
|
|
6677
|
+
}
|
|
6678
|
+
#positionHotspotOnRegister;
|
|
6628
6679
|
connectedCallback() {
|
|
6629
6680
|
super.connectedCallback();
|
|
6630
6681
|
this.addEventListener("qti-register-hotspot", this.#positionHotspotOnRegister);
|
|
@@ -6633,8 +6684,14 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
6633
6684
|
disconnectedCallback() {
|
|
6634
6685
|
super.disconnectedCallback();
|
|
6635
6686
|
this.removeEventListener("qti-register-hotspot", this.#positionHotspotOnRegister);
|
|
6687
|
+
this.#graphicObserver?.disconnect();
|
|
6688
|
+
this.#graphicObserver = null;
|
|
6689
|
+
this.#observedGraphic = null;
|
|
6636
6690
|
}
|
|
6637
6691
|
};
|
|
6692
|
+
__decorate20([
|
|
6693
|
+
state9()
|
|
6694
|
+
], QtiGraphicGapMatchInteraction.prototype, "_graphicScale", void 0);
|
|
6638
6695
|
|
|
6639
6696
|
// ../interactions/graphic-order-interaction/dist/qti-graphic-order-interaction.js
|
|
6640
6697
|
import { html as html19 } from "lit";
|
|
@@ -6687,7 +6744,7 @@ var qti_graphic_order_interaction_styles_default = [
|
|
|
6687
6744
|
];
|
|
6688
6745
|
|
|
6689
6746
|
// ../interactions/graphic-order-interaction/dist/qti-graphic-order-interaction.js
|
|
6690
|
-
var
|
|
6747
|
+
var __decorate21 = function(decorators, target, key, desc) {
|
|
6691
6748
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6692
6749
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6693
6750
|
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;
|
|
@@ -6822,10 +6879,10 @@ var QtiGraphicOrderInteraction = class _QtiGraphicOrderInteraction extends Choic
|
|
|
6822
6879
|
this.removeEventListener("register-qti-hotspot-choice", this.#positionHotspotOnRegister);
|
|
6823
6880
|
}
|
|
6824
6881
|
};
|
|
6825
|
-
|
|
6882
|
+
__decorate21([
|
|
6826
6883
|
property19({ type: Number, attribute: "max-choices" })
|
|
6827
6884
|
], QtiGraphicOrderInteraction.prototype, "maxChoices", void 0);
|
|
6828
|
-
|
|
6885
|
+
__decorate21([
|
|
6829
6886
|
watch("response")
|
|
6830
6887
|
], QtiGraphicOrderInteraction.prototype, "handleOrderedResponseChange", null);
|
|
6831
6888
|
|
|
@@ -6970,7 +7027,7 @@ var QtiHottextInteraction = class extends ChoicesMixin(Interaction, "qti-hottext
|
|
|
6970
7027
|
|
|
6971
7028
|
// ../interactions/inline-choice-interaction/dist/qti-inline-choice-interaction.js
|
|
6972
7029
|
import { html as html22 } from "lit";
|
|
6973
|
-
import { property as property20, state as
|
|
7030
|
+
import { property as property20, state as state10 } from "lit/decorators.js";
|
|
6974
7031
|
import { consume as consume5 } from "@lit/context";
|
|
6975
7032
|
|
|
6976
7033
|
// ../interactions/core/dist/mixins/menu-auto-size/menu-auto-size.mixin.js
|
|
@@ -7345,7 +7402,7 @@ var styles2 = own;
|
|
|
7345
7402
|
var qti_inline_choice_interaction_styles_default = styles2;
|
|
7346
7403
|
|
|
7347
7404
|
// ../interactions/inline-choice-interaction/dist/qti-inline-choice-interaction.js
|
|
7348
|
-
var
|
|
7405
|
+
var __decorate22 = function(decorators, target, key, desc) {
|
|
7349
7406
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7350
7407
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7351
7408
|
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;
|
|
@@ -7715,23 +7772,23 @@ var QtiInlineChoiceInteraction = class extends MenuAutoSizeMixin(Interaction) {
|
|
|
7715
7772
|
return [...promptOption ? [promptOption] : [], ...slottedChoices];
|
|
7716
7773
|
}
|
|
7717
7774
|
};
|
|
7718
|
-
|
|
7719
|
-
|
|
7775
|
+
__decorate22([
|
|
7776
|
+
state10()
|
|
7720
7777
|
], QtiInlineChoiceInteraction.prototype, "options", void 0);
|
|
7721
|
-
|
|
7722
|
-
|
|
7778
|
+
__decorate22([
|
|
7779
|
+
state10()
|
|
7723
7780
|
], QtiInlineChoiceInteraction.prototype, "_dropdownOpen", void 0);
|
|
7724
|
-
|
|
7781
|
+
__decorate22([
|
|
7725
7782
|
consume5({ context: configContext, subscribe: true }),
|
|
7726
7783
|
property20({ attribute: false })
|
|
7727
7784
|
], QtiInlineChoiceInteraction.prototype, "configContext", void 0);
|
|
7728
|
-
|
|
7785
|
+
__decorate22([
|
|
7729
7786
|
property20({ type: String, attribute: "data-prompt" })
|
|
7730
7787
|
], QtiInlineChoiceInteraction.prototype, "dataPrompt", void 0);
|
|
7731
|
-
|
|
7788
|
+
__decorate22([
|
|
7732
7789
|
watch("dataPrompt", { waitUntilFirstUpdate: true })
|
|
7733
7790
|
], QtiInlineChoiceInteraction.prototype, "_handleDataPromptChange", void 0);
|
|
7734
|
-
|
|
7791
|
+
__decorate22([
|
|
7735
7792
|
property20({
|
|
7736
7793
|
type: Boolean,
|
|
7737
7794
|
reflect: true,
|
|
@@ -7742,19 +7799,19 @@ __decorate21([
|
|
|
7742
7799
|
}
|
|
7743
7800
|
})
|
|
7744
7801
|
], QtiInlineChoiceInteraction.prototype, "required", void 0);
|
|
7745
|
-
|
|
7802
|
+
__decorate22([
|
|
7746
7803
|
property20({ type: Number, attribute: "min-choices" })
|
|
7747
7804
|
], QtiInlineChoiceInteraction.prototype, "minChoices", void 0);
|
|
7748
|
-
|
|
7805
|
+
__decorate22([
|
|
7749
7806
|
watch(["required", "minChoices"], { waitUntilFirstUpdate: true })
|
|
7750
7807
|
], QtiInlineChoiceInteraction.prototype, "_handleRequiredChange", void 0);
|
|
7751
|
-
|
|
7808
|
+
__decorate22([
|
|
7752
7809
|
property20({ attribute: "response", reflect: false, noAccessor: true })
|
|
7753
7810
|
], QtiInlineChoiceInteraction.prototype, "response", null);
|
|
7754
7811
|
|
|
7755
7812
|
// ../interactions/match-interaction/dist/qti-match-interaction.js
|
|
7756
7813
|
import { html as html23, nothing as nothing3 } from "lit";
|
|
7757
|
-
import { property as property21, state as
|
|
7814
|
+
import { property as property21, state as state11 } from "lit/decorators.js";
|
|
7758
7815
|
|
|
7759
7816
|
// ../interactions/match-interaction/dist/qti-match-interaction.styles.js
|
|
7760
7817
|
import { css as css22 } from "lit";
|
|
@@ -7934,7 +7991,7 @@ var qti_match_interaction_tabular_styles_default = [
|
|
|
7934
7991
|
];
|
|
7935
7992
|
|
|
7936
7993
|
// ../interactions/match-interaction/dist/qti-match-interaction.js
|
|
7937
|
-
var
|
|
7994
|
+
var __decorate23 = function(decorators, target, key, desc) {
|
|
7938
7995
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7939
7996
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7940
7997
|
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;
|
|
@@ -8137,13 +8194,13 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(DragDropSlo
|
|
|
8137
8194
|
`;
|
|
8138
8195
|
}
|
|
8139
8196
|
};
|
|
8140
|
-
|
|
8197
|
+
__decorate23([
|
|
8141
8198
|
property21({ type: String })
|
|
8142
8199
|
], QtiMatchInteraction.prototype, "class", void 0);
|
|
8143
|
-
|
|
8144
|
-
|
|
8200
|
+
__decorate23([
|
|
8201
|
+
state11()
|
|
8145
8202
|
], QtiMatchInteraction.prototype, "_response", void 0);
|
|
8146
|
-
|
|
8203
|
+
__decorate23([
|
|
8147
8204
|
property21({ type: String, attribute: "response-identifier" })
|
|
8148
8205
|
], QtiMatchInteraction.prototype, "responseIdentifier", void 0);
|
|
8149
8206
|
|
|
@@ -8221,7 +8278,7 @@ var QtiMediaInteraction = class extends Interaction {
|
|
|
8221
8278
|
// ../interactions/order-interaction/dist/qti-order-interaction.js
|
|
8222
8279
|
import { html as html25 } from "lit";
|
|
8223
8280
|
import { repeat as repeat6 } from "lit/directives/repeat.js";
|
|
8224
|
-
import { property as property22, state as
|
|
8281
|
+
import { property as property22, state as state12 } from "lit/decorators.js";
|
|
8225
8282
|
|
|
8226
8283
|
// ../interactions/order-interaction/dist/qti-order-interaction.styles.js
|
|
8227
8284
|
import { css as css25 } from "lit";
|
|
@@ -8443,7 +8500,7 @@ var qti_order_interaction_styles_default = [
|
|
|
8443
8500
|
];
|
|
8444
8501
|
|
|
8445
8502
|
// ../interactions/order-interaction/dist/qti-order-interaction.js
|
|
8446
|
-
var
|
|
8503
|
+
var __decorate24 = function(decorators, target, key, desc) {
|
|
8447
8504
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8448
8505
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8449
8506
|
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;
|
|
@@ -8502,18 +8559,21 @@ var QtiOrderInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
8502
8559
|
this.childrenMap = Array.from(this.querySelectorAll("qti-simple-choice"));
|
|
8503
8560
|
}
|
|
8504
8561
|
};
|
|
8505
|
-
|
|
8506
|
-
|
|
8562
|
+
__decorate24([
|
|
8563
|
+
state12()
|
|
8507
8564
|
], QtiOrderInteraction.prototype, "nrChoices", void 0);
|
|
8508
|
-
|
|
8565
|
+
__decorate24([
|
|
8509
8566
|
property22({ type: String })
|
|
8510
8567
|
], QtiOrderInteraction.prototype, "orientation", void 0);
|
|
8511
8568
|
|
|
8512
8569
|
// ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.js
|
|
8513
8570
|
import { css as css27, html as html26 } from "lit";
|
|
8514
|
-
import { property as property23, state as
|
|
8571
|
+
import { property as property23, state as state13 } from "lit/decorators.js";
|
|
8515
8572
|
import { consume as consume6 } from "@lit/context";
|
|
8516
8573
|
|
|
8574
|
+
// ../qti-theme/dist/native-css.js
|
|
8575
|
+
var native_css_default = "@layer qti-base {\n/* https://www.imsglobal.org/sites/default/files/spec/qti/v3/guide/img/qti3p0.css */\n/* ============================\n QTI 3 shared css\n 1. Display\n 2. Special Flex styles\n 3. Margin\n 4. Padding\n 5. Horizontal Alignment styles\n 6. Vertical Alignment styles\n 7. Height\n 8. Width\n 9. Text-Indent\n 10. List Style\n 11. Layout\n 12. Other QTI 3 presentation utilities\n ============================ */\n\n/* ==========\n Display css\n =========== */\n\n.qti-display-inline {\n display: inline;\n}\n\n.qti-display-inline-block {\n display: inline-block;\n}\n\n.qti-display-block {\n display: block;\n}\n\n.qti-display-flex {\n display: flex;\n}\n\n.qti-display-inline-flex {\n display: inline-flex;\n}\n\n.qti-display-grid {\n display: grid;\n}\n\n.qti-display-inline-grid {\n display: inline-grid;\n}\n\n.qti-display-table {\n display: table;\n}\n\n.qti-display-table-cell {\n display: table-cell;\n}\n\n.qti-display-table-row {\n display: table-row;\n}\n\n.qti-display-list-item {\n display: list-item;\n}\n\n.qti-display-inherit {\n display: inherit;\n}\n\n/* \n * hidden to screen readers and sighted\n */\n.qti-hidden {\n display: none;\n}\n\n/*\n * visible to screen readers, hidden to sighted\n */\n.qti-visually-hidden {\n position: fixed !important;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px);\n height: 1px;\n width: 1px;\n border: 0;\n margin: -1px;\n}\n\n/* =============================\n Special flex styles\n ============================= */\n\n.qti-flex-direction-column {\n flex-direction: column;\n}\n\n.qti-flex-direction-row {\n flex-direction: row;\n}\n\n.qti-flex-grow-1 {\n flex-grow: 1;\n}\n\n.qti-flex-grow-0 {\n flex-grow: 0;\n}\n\n/* =========\n Margin css\n ========== */\n\n/**\n * For margin Top and Bottom and Left and Right\n */\n.qti-margin-0 {\n margin: 0 !important;\n}\n\n.qti-margin-1 {\n margin: 0.25rem !important;\n}\n\n.qti-margin-2 {\n margin: 0.5rem !important;\n}\n\n.qti-margin-3 {\n margin: 1rem !important;\n}\n\n.qti-margin-4 {\n margin: 1.5rem !important;\n}\n\n.qti-margin-5 {\n margin: 3rem !important;\n}\n\n.qti-margin-auto {\n margin: auto !important;\n}\n\n/*\n For margin Left and Right\n */\n.qti-margin-x-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.qti-margin-x-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-x-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-x-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n}\n\n.qti-margin-x-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-x-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n}\n\n.qti-margin-x-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n/*\n For margin Top and Bottom\n */\n.qti-margin-y-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n}\n\n.qti-margin-y-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-y-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-y-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-y-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-y-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-y-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n}\n\n/*\n For margin Top\n */\n.qti-margin-t-0 {\n margin-top: 0 !important;\n}\n\n.qti-margin-t-1 {\n margin-top: 0.25rem !important;\n}\n\n.qti-margin-t-2 {\n margin-top: 0.5rem !important;\n}\n\n.qti-margin-t-3 {\n margin-top: 1rem !important;\n}\n\n.qti-margin-t-4 {\n margin-top: 1.5rem !important;\n}\n\n.qti-margin-t-5 {\n margin-top: 3rem !important;\n}\n\n.qti-margin-t-auto {\n margin-top: auto !important;\n}\n\n/* \n For margin Bottom\n */\n.qti-margin-b-0 {\n margin-bottom: 0 !important;\n}\n\n.qti-margin-b-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.qti-margin-b-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.qti-margin-b-3 {\n margin-bottom: 1rem !important;\n}\n\n.qti-margin-b-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.qti-margin-b-5 {\n margin-bottom: 3rem !important;\n}\n\n.qti-margin-b-auto {\n margin-bottom: auto !important;\n}\n\n/*\n For margin Start LTR\n */\n.qti-margin-s-0 {\n margin-left: 0 !important;\n}\n\n.qti-margin-s-1 {\n margin-left: 0.25rem !important;\n}\n\n.qti-margin-s-2 {\n margin-left: 0.5rem !important;\n}\n\n.qti-margin-s-3 {\n margin-left: 1rem !important;\n}\n\n.qti-margin-s-4 {\n margin-left: 1.5rem !important;\n}\n\n.qti-margin-s-5 {\n margin-left: 3rem !important;\n}\n\n.qti-margin-s-auto {\n margin-left: auto !important;\n}\n\n/* \n For margin End LTR\n */\n.qti-margin-e-0 {\n margin-right: 0 !important;\n}\n\n.qti-margin-e-1 {\n margin-right: 0.25rem !important;\n}\n\n.qti-margin-e-2 {\n margin-right: 0.5rem !important;\n}\n\n.qti-margin-e-3 {\n margin-right: 1rem !important;\n}\n\n.qti-margin-e-4 {\n margin-right: 1.5rem !important;\n}\n\n.qti-margin-e-5 {\n margin-right: 3rem !important;\n}\n\n.qti-margin-e-auto {\n margin-right: auto !important;\n}\n\n/* =========\n Padding css\n ========== */\n\n/*\n For padding Top and Bottom and Left and Right\n */\n.qti-padding-0 {\n padding: 0 !important;\n}\n\n.qti-padding-1 {\n padding: 0.25rem !important;\n}\n\n.qti-padding-2 {\n padding: 0.5rem !important;\n}\n\n.qti-padding-3 {\n padding: 1rem !important;\n}\n\n.qti-padding-4 {\n padding: 1.5rem !important;\n}\n\n.qti-padding-5 {\n padding: 3rem !important;\n}\n\n/*\n For padding Left and Right\n */\n.qti-padding-x-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.qti-padding-x-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-x-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-x-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n\n.qti-padding-x-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-x-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n}\n\n/*\n For padding Top and Bottom\n */\n.qti-padding-y-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n\n.qti-padding-y-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-y-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-y-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-y-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-y-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Top\n */\n.qti-padding-t-0 {\n padding-top: 0 !important;\n}\n\n.qti-padding-t-1 {\n padding-top: 0.25rem !important;\n}\n\n.qti-padding-t-2 {\n padding-top: 0.5rem !important;\n}\n\n.qti-padding-t-3 {\n padding-top: 1rem !important;\n}\n\n.qti-padding-t-4 {\n padding-top: 1.5rem !important;\n}\n\n.qti-padding-t-5 {\n padding-top: 3rem !important;\n}\n\n/*\n For padding Bottom\n */\n.qti-padding-b-0 {\n padding-bottom: 0 !important;\n}\n\n.qti-padding-b-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.qti-padding-b-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.qti-padding-b-3 {\n padding-bottom: 1rem !important;\n}\n\n.qti-padding-b-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.qti-padding-b-5 {\n padding-bottom: 3rem !important;\n}\n\n/*\n For padding Start LTR\n */\n.qti-padding-s-0 {\n padding-left: 0 !important;\n}\n\n.qti-padding-s-1 {\n padding-left: 0.25rem !important;\n}\n\n.qti-padding-s-2 {\n padding-left: 0.5rem !important;\n}\n\n.qti-padding-s-3 {\n padding-left: 1rem !important;\n}\n\n.qti-padding-s-4 {\n padding-left: 1.5rem !important;\n}\n\n.qti-padding-s-5 {\n padding-left: 3rem !important;\n}\n\n/*\n For padding End LTR\n */\n.qti-padding-e-0 {\n padding-right: 0 !important;\n}\n\n.qti-padding-e-1 {\n padding-right: 0.25rem !important;\n}\n\n.qti-padding-e-2 {\n padding-right: 0.5rem !important;\n}\n\n.qti-padding-e-3 {\n padding-right: 1rem !important;\n}\n\n.qti-padding-e-4 {\n padding-right: 1.5rem !important;\n}\n\n.qti-padding-e-5 {\n padding-right: 3rem !important;\n}\n\n/* ====================\n Horizontal alignment\n ==================== */\n\n.qti-align-left {\n text-align: left;\n}\n\n.qti-align-center {\n text-align: center;\n}\n\n.qti-align-right {\n text-align: right;\n}\n\n/* ==================\n Vertical alignment\n ================== */\n\n.qti-valign-top {\n vertical-align: top;\n}\n\n.qti-valign-middle {\n vertical-align: middle;\n}\n\n.qti-valign-baseline {\n vertical-align: baseline;\n}\n\n.qti-valign-bottom {\n vertical-align: bottom;\n}\n\n/* =============\n Height styles\n ============= */\n\n.qti-height-0 {\n height: 0;\n}\n\n.qti-height-px {\n height: 1px;\n}\n\n.qti-height-0p5 {\n height: 0.125rem;\n}\n\n.qti-height-1 {\n height: 0.25rem;\n}\n\n.qti-height-1p5 {\n height: 0.375rem;\n}\n\n.qti-height-2 {\n height: 0.5rem;\n}\n\n.qti-height-2p5 {\n height: 0.625rem;\n}\n\n.qti-height-3 {\n height: 0.75rem;\n}\n\n.qti-height-3p5 {\n height: 0.875rem;\n}\n\n.qti-height-4 {\n height: 1rem;\n}\n\n.qti-height-5 {\n height: 1.25rem;\n}\n\n.qti-height-6 {\n height: 1.5rem;\n}\n\n.qti-height-7 {\n height: 1.75rem;\n}\n\n.qti-height-8 {\n height: 2rem;\n}\n\n.qti-height-9 {\n height: 2.25rem;\n}\n\n.qti-height-10 {\n height: 2.5rem;\n}\n\n.qti-height-11 {\n height: 2.75rem;\n}\n\n.qti-height-12 {\n height: 3rem;\n}\n\n.qti-height-14 {\n height: 3.5rem;\n}\n\n.qti-height-16 {\n height: 4rem;\n}\n\n.qti-height-20 {\n height: 5rem;\n}\n\n.qti-height-24 {\n height: 6rem;\n}\n\n.qti-height-28 {\n height: 7rem;\n}\n\n.qti-height-32 {\n height: 8rem;\n}\n\n.qti-height-36 {\n height: 9rem;\n}\n\n.qti-height-40 {\n height: 10rem;\n}\n\n.qti-height-44 {\n height: 11rem;\n}\n\n.qti-height-48 {\n height: 12rem;\n}\n\n.qti-height-52 {\n height: 13rem;\n}\n\n.qti-height-56 {\n height: 14rem;\n}\n\n.qti-height-60 {\n height: 15rem;\n}\n\n.qti-height-64 {\n height: 16rem;\n}\n\n.qti-height-72 {\n height: 18rem;\n}\n\n.qti-height-80 {\n height: 20rem;\n}\n\n.qti-height-96 {\n height: 24rem;\n}\n\n.qti-height-1-2 {\n height: 50%;\n}\n\n.qti-height-1-3 {\n height: 33.3333%;\n}\n\n.qti-height-2-3 {\n height: 66.6667%;\n}\n\n.qti-height-1-4 {\n height: 25%;\n}\n\n.qti-height-2-4 {\n height: 50%;\n}\n\n.qti-height-3-4 {\n height: 75%;\n}\n\n.qti-height-1-5 {\n height: 20%;\n}\n\n.qti-height-2-5 {\n height: 40%;\n}\n\n.qti-height-3-5 {\n height: 60%;\n}\n\n.qti-height-4-5 {\n height: 80%;\n}\n\n.qti-height-1-6 {\n height: 16.6667%;\n}\n\n.qti-height-2-6 {\n height: 33.3333%;\n}\n\n.qti-height-3-6 {\n height: 50%;\n}\n\n.qti-height-4-6 {\n height: 66.6667%;\n}\n\n.qti-height-5-6 {\n height: 83.3333%;\n}\n\n.qti-height-auto {\n height: auto;\n}\n\n.qti-height-full {\n height: 100%;\n}\n\n/* ============\n Width styles\n ============ */\n\n.qti-width-0 {\n width: 0;\n}\n\n.qti-width-px {\n width: 1px;\n}\n\n.qti-width-0p5 {\n width: 0.125rem;\n}\n\n.qti-width-1 {\n width: 0.25rem;\n}\n\n.qti-width-1p5 {\n width: 0.375rem;\n}\n\n.qti-width-2 {\n width: 0.5rem;\n}\n\n.qti-width-2p5 {\n width: 0.625rem;\n}\n\n.qti-width-3 {\n width: 0.75rem;\n}\n\n.qti-width-3p5 {\n width: 0.875rem;\n}\n\n.qti-width-4 {\n width: 1rem;\n}\n\n.qti-width-5 {\n width: 1.25rem;\n}\n\n.qti-width-6 {\n width: 1.5rem;\n}\n\n.qti-width-7 {\n width: 1.75rem;\n}\n\n.qti-width-8 {\n width: 2rem;\n}\n\n.qti-width-9 {\n width: 2.25rem;\n}\n\n.qti-width-10 {\n width: 2.5rem;\n}\n\n.qti-width-11 {\n width: 2.75rem;\n}\n\n.qti-width-12 {\n width: 3rem;\n}\n\n.qti-width-14 {\n width: 3.5rem;\n}\n\n.qti-width-16 {\n width: 4rem;\n}\n\n.qti-width-20 {\n width: 5rem;\n}\n\n.qti-width-24 {\n width: 6rem;\n}\n\n.qti-width-28 {\n width: 7rem;\n}\n\n.qti-width-32 {\n width: 8rem;\n}\n\n.qti-width-36 {\n width: 9rem;\n}\n\n.qti-width-40 {\n width: 10rem;\n}\n\n.qti-width-44 {\n width: 11rem;\n}\n\n.qti-width-48 {\n width: 12rem;\n}\n\n.qti-width-52 {\n width: 13rem;\n}\n\n.qti-width-56 {\n width: 14rem;\n}\n\n.qti-width-60 {\n width: 15rem;\n}\n\n.qti-width-64 {\n width: 16rem;\n}\n\n.qti-width-72 {\n width: 18rem;\n}\n\n.qti-width-80 {\n width: 20rem;\n}\n\n.qti-width-96 {\n width: 24rem;\n}\n\n.qti-width-auto {\n width: auto;\n}\n\n.qti-width-1-2 {\n width: 50%;\n}\n\n.qti-width-1-3 {\n width: 33.3333%;\n}\n\n.qti-width-2-3 {\n width: 66.6667%;\n}\n\n.qti-width-1-4 {\n width: 25%;\n}\n\n.qti-width-2-4 {\n width: 50%;\n}\n\n.qti-width-3-4 {\n width: 75%;\n}\n\n.qti-width-1-5 {\n width: 20%;\n}\n\n.qti-width-2-5 {\n width: 40%;\n}\n\n.qti-width-3-5 {\n width: 60%;\n}\n\n.qti-width-4-5 {\n width: 80%;\n}\n\n.qti-width-1-6 {\n width: 16.6667%;\n}\n\n.qti-width-2-6 {\n width: 33.3333%;\n}\n\n.qti-width-3-6 {\n width: 50%;\n}\n\n.qti-width-4-6 {\n width: 66.6667%;\n}\n\n.qti-width-5-6 {\n width: 83.3333%;\n}\n\n.qti-width-1-12 {\n width: 8.3333%;\n}\n\n.qti-width-2-12 {\n width: 16.6667%;\n}\n\n.qti-width-3-12 {\n width: 25%;\n}\n\n.qti-width-4-12 {\n width: 33.3333%;\n}\n\n.qti-width-5-12 {\n width: 41.6667%;\n}\n\n.qti-width-6-12 {\n width: 50%;\n}\n\n.qti-width-7-12 {\n width: 58.3333%;\n}\n\n.qti-width-8-12 {\n width: 66.6667%;\n}\n\n.qti-width-9-12 {\n width: 75%;\n}\n\n.qti-width-10-12 {\n width: 83.3333%;\n}\n\n.qti-width-11-12 {\n width: 91.6667%;\n}\n\n.qti-width-full,\n.qti-fullwidth {\n width: 100%;\n}\n\n/* ==================\n Text Indent styles\n ================== */\n\n.qti-text-indent-0 {\n text-indent: 0;\n}\n\n.qti-text-indent-px {\n text-indent: 1px;\n}\n\n.qti-text-indent-0p5 {\n text-indent: 0.125rem;\n}\n\n.qti-text-indent-1 {\n text-indent: 0.25rem;\n}\n\n.qti-text-indent-1p5 {\n text-indent: 0.375rem;\n}\n\n.qti-text-indent-2 {\n text-indent: 0.5rem;\n}\n\n.qti-text-indent-2p5 {\n text-indent: 0.625rem;\n}\n\n.qti-text-indent-3 {\n text-indent: 0.75rem;\n}\n\n.qti-text-indent-3p5 {\n text-indent: 0.875rem;\n}\n\n.qti-text-indent-4 {\n text-indent: 1rem;\n}\n\n.qti-text-indent-5 {\n text-indent: 1.25rem;\n}\n\n.qti-text-indent-6 {\n text-indent: 1.5rem;\n}\n\n.qti-text-indent-7 {\n text-indent: 1.75rem;\n}\n\n.qti-text-indent-8 {\n text-indent: 2rem;\n}\n\n.qti-text-indent-12 {\n text-indent: 3rem;\n}\n\n.qti-text-indent-16 {\n text-indent: 4rem;\n}\n\n.qti-text-indent-20 {\n text-indent: 5rem;\n}\n\n.qti-text-indent-24 {\n text-indent: 6rem;\n}\n\n.qti-text-indent-28 {\n text-indent: 7rem;\n}\n\n.qti-text-indent-32 {\n text-indent: 8rem;\n}\n\n/* =================\n List Style styles\n ================= */\n\n.qti-list-style-type-none {\n list-style-type: none;\n}\n\n.qti-list-style-type-disc {\n list-style-type: disc;\n}\n\n.qti-list-style-type-circle {\n list-style-type: circle;\n}\n\n.qti-list-style-type-square {\n list-style-type: square;\n}\n\n.qti-list-style-type-decimal {\n list-style-type: decimal;\n}\n\n.qti-list-style-type-decimal-leading-zero {\n list-style-type: decimal-leading-zero;\n}\n\n.qti-list-style-type-lower-alpha {\n list-style-type: lower-alpha;\n}\n\n.qti-list-style-type-upper-alpha {\n list-style-type: upper-alpha;\n}\n\n.qti-list-style-type-lower-roman {\n list-style-type: lower-roman;\n}\n\n.qti-list-style-type-upper-roman {\n list-style-type: upper-roman;\n}\n\n.qti-list-style-type-lower-latin {\n list-style-type: lower-latin;\n}\n\n.qti-list-style-type-upper-latin {\n list-style-type: upper-latin;\n}\n\n.qti-list-style-type-lower-greek {\n list-style-type: lower-greek;\n}\n\n.qti-list-style-type-arabic-indic {\n list-style-type: arabic-indic;\n}\n\n.qti-list-style-type-armenian {\n list-style-type: armenian;\n}\n\n.qti-list-style-type-lower-armenian {\n list-style-type: lower-armenian;\n}\n\n.qti-list-style-type-upper-armenian {\n list-style-type: upper-armenian;\n}\n\n.qti-list-style-type-bengali {\n list-style-type: bengali;\n}\n\n.qti-list-style-type-cambodian {\n list-style-type: cambodian;\n}\n\n.qti-list-style-type-simp-chinese-formal {\n list-style-type: simp-chinese-formal;\n}\n\n.qti-list-style-type-simp-chinese-informal {\n list-style-type: simp-chinese-informal;\n}\n\n.qti-list-style-type-trad-chinese-formal {\n list-style-type: trad-chinese-formal;\n}\n\n.qti-list-style-type-trad-chinese-informal {\n list-style-type: trad-chinese-informal;\n}\n\n.qti-list-style-type-cjk-ideographic {\n list-style-type: cjk-ideographic;\n}\n\n.qti-list-style-type-cjk-heavenly-stem {\n list-style-type: cjk-heavenly-stem;\n}\n\n.qti-list-style-type-cjk-earthly-branch {\n list-style-type: cjk-earthly-branch;\n}\n\n.qti-list-style-type-devanagari {\n list-style-type: devanagari;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-er {\n list-style-type: ethiopic-halehame-ti-er;\n}\n\n.qti-list-style-type-ethiopic-halehame-ti-et {\n list-style-type: ethiopic-halehame-ti-et;\n}\n\n.qti-list-style-type-ethiopic-halehame-am {\n list-style-type: ethiopic-halehame-am;\n}\n\n.qti-list-style-type-ethiopic-halehame {\n list-style-type: ethiopic-halehame;\n}\n\n.qti-list-style-type-georgian {\n list-style-type: georgian;\n}\n\n.qti-list-style-type-gujarati {\n list-style-type: gujarati;\n}\n\n.qti-list-style-type-gurmukhi {\n list-style-type: gurmukhi;\n}\n\n.qti-list-style-type-hangul {\n list-style-type: hangul;\n}\n\n.qti-list-style-type-hangul-consonant {\n list-style-type: hangul-consonant;\n}\n\n.qti-list-style-type-hebrew {\n list-style-type: hebrew;\n}\n\n.qti-list-style-type-hiragana {\n list-style-type: hiragana;\n}\n\n.qti-list-style-type-hiragana-iroha {\n list-style-type: hiragana-iroha;\n}\n\n.qti-list-style-type-khmer {\n list-style-type: khmer;\n}\n\n.qti-list-style-type-korean-hangul-formal {\n list-style-type: korean-hangul-formal;\n}\n\n.qti-list-style-type-korean-hanja-formal {\n list-style-type: korean-hanja-formal;\n}\n\n.qti-list-style-type-korean-hanja-informal {\n list-style-type: korean-hanja-informal;\n}\n\n.qti-list-style-type-lao {\n list-style-type: lao;\n}\n\n.qti-list-style-type-malayalam {\n list-style-type: malayalam;\n}\n\n.qti-list-style-type-mongolian {\n list-style-type: mongolian;\n}\n\n.qti-list-style-type-myanmar {\n list-style-type: myanmar;\n}\n\n.qti-list-style-type-oriya {\n list-style-type: oriya;\n}\n\n.qti-list-style-type-persian {\n list-style-type: persian;\n}\n\n.qti-list-style-type-thai {\n list-style-type: thai;\n}\n\n.qti-list-style-type-tibetan {\n list-style-type: tibetan;\n}\n\n.qti-list-style-type-telugu {\n list-style-type: telugu;\n}\n\n.qti-list-style-type-urdu {\n list-style-type: urdu;\n}\n\n/* =========================\n Other QTI 3 Presentation Utilities\n ========================= */\n\n.qti-bordered {\n border: 1px solid var(--table-border-color);\n}\n\n.qti-underline {\n text-decoration: underline;\n text-decoration-color: var(--foreground);\n}\n\n.qti-italic {\n font-style: italic;\n}\n\n.qti-well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: var(--well-bg);\n border: var(--well-border);\n border-radius: 4px;\n box-shadow: var(--well-box-shadow);\n}\n\n/* Set writing-mode to vertical-rl \n Typical for CJK vertical text */\n.qti-writing-mode-vertical-rl {\n writing-mode: vertical-rl;\n}\n\n/* Set writing-mode to vertical-lr\n Typical for Mongolian vertical text */\n.qti-writing-mode-vertical-lr {\n writing-mode: vertical-lr;\n}\n\n/* Set writing-mode to horizontal-tb \n Browser default */\n.qti-writing-mode-horizontal-tb {\n writing-mode: horizontal-tb;\n}\n\n/* Float an element left */\n.qti-float-left {\n float: left;\n}\n\n/* Float an element right */\n.qti-float-right {\n float: right;\n}\n\n/* Remove a float */\n.qti-float-none {\n float: none;\n}\n\n/* Clearfix Hack to apply to a container of \n floated content that overflows the container. */\n.qti-float-clearfix::after {\n content: '';\n clear: both;\n display: table;\n}\n\n.qti-float-clear-left\n .qti-float-clear-right\n .qti-float-clear-both\n \n /* Set text-orientation to upright */\n .qti-text-orientation-upright {\n text-orientation: upright;\n}\n}\n\n@layer qti-base {\n\n.qti-layout-row {\n display: flex;\n flex-wrap: wrap;\n width: 100%;\n gap: 2.1276595745%;\n}\n\n.qti-layout-row [class*='qti-layout-col']:not(:empty) {\n box-sizing: border-box;\n}\n\n.qti-layout-row [class*='qti-layout-col']:empty {\n width: 0;\n overflow: hidden; /* to fully collapse if there\u2019s padding or borders */\n}\n\n.qti-layout-col1 {\n width: 6.3829787234%;\n}\n\n.qti-layout-col2 {\n width: 14.8936170213%;\n}\n\n.qti-layout-col3 {\n width: 23.4042553191%;\n}\n\n.qti-layout-col4 {\n width: 31.914893617%;\n}\n\n.qti-layout-col5 {\n width: 40.4255319149%;\n}\n\n.qti-layout-col6 {\n width: 48.9361702128%;\n}\n\n.qti-layout-col7 {\n width: 57.4468085106%;\n}\n\n.qti-layout-col8 {\n width: 65.9574468085%;\n}\n\n.qti-layout-col9 {\n width: 74.4680851064%;\n}\n\n.qti-layout-col10 {\n width: 82.9787234043%;\n}\n\n.qti-layout-col11 {\n width: 91.4893617021%;\n}\n\n.qti-layout-col12 {\n width: 100%;\n}\n\n.qti-layout-offset1 {\n margin-left: 8.5106382979%;\n}\n\n.qti-layout-offset2 {\n margin-left: 17.0212765957%;\n}\n\n.qti-layout-offset3 {\n margin-left: 25.5319148936%;\n}\n\n.qti-layout-offset4 {\n margin-left: 34.0425531915%;\n}\n\n.qti-layout-offset5 {\n margin-left: 42.5531914894%;\n}\n\n.qti-layout-offset6 {\n margin-left: 51.0638297872%;\n}\n\n.qti-layout-offset7 {\n margin-left: 59.5744680851%;\n}\n\n.qti-layout-offset8 {\n margin-left: 68.085106383%;\n}\n\n.qti-layout-offset9 {\n margin-left: 76.5957446809%;\n}\n\n.qti-layout-offset10 {\n margin-left: 85.1063829787%;\n}\n\n.qti-layout-offset11 {\n margin-left: 93.6170212766%;\n}\n\n@media (width <= 767px) {\n [class*='qti-layout-col'] {\n width: 100%;\n }\n}\n}\n";
|
|
8576
|
+
|
|
8517
8577
|
// ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.styles.js
|
|
8518
8578
|
import { css as css26 } from "lit";
|
|
8519
8579
|
var qti_portable_custom_interaction_styles_default = [
|
|
@@ -8531,18 +8591,179 @@ var qti_portable_custom_interaction_styles_default = [
|
|
|
8531
8591
|
`
|
|
8532
8592
|
];
|
|
8533
8593
|
|
|
8594
|
+
// ../interactions/portable-custom-interaction/dist/record-response.js
|
|
8595
|
+
var PAIR_BASE_TYPES = /* @__PURE__ */ new Set(["point", "pair", "directedPair"]);
|
|
8596
|
+
var coerceBaseValue = (value, baseType) => {
|
|
8597
|
+
if (value === null || value === void 0)
|
|
8598
|
+
return value;
|
|
8599
|
+
switch (baseType) {
|
|
8600
|
+
case "integer": {
|
|
8601
|
+
if (typeof value === "number")
|
|
8602
|
+
return value;
|
|
8603
|
+
const parsed = parseInt(String(value), 10);
|
|
8604
|
+
return Number.isNaN(parsed) ? value : parsed;
|
|
8605
|
+
}
|
|
8606
|
+
case "float":
|
|
8607
|
+
case "duration": {
|
|
8608
|
+
if (typeof value === "number")
|
|
8609
|
+
return value;
|
|
8610
|
+
const parsed = parseFloat(String(value));
|
|
8611
|
+
return Number.isNaN(parsed) ? value : parsed;
|
|
8612
|
+
}
|
|
8613
|
+
case "boolean": {
|
|
8614
|
+
if (typeof value === "boolean")
|
|
8615
|
+
return value;
|
|
8616
|
+
if (typeof value === "string") {
|
|
8617
|
+
const lowered = value.toLowerCase();
|
|
8618
|
+
if (lowered === "true")
|
|
8619
|
+
return true;
|
|
8620
|
+
if (lowered === "false")
|
|
8621
|
+
return false;
|
|
8622
|
+
}
|
|
8623
|
+
return value;
|
|
8624
|
+
}
|
|
8625
|
+
case "point": {
|
|
8626
|
+
const parts = Array.isArray(value) ? value : String(value).trim().split(/[\s,]+/);
|
|
8627
|
+
const numbers = parts.map((part) => typeof part === "number" ? part : parseFloat(String(part)));
|
|
8628
|
+
return numbers.length === 2 && numbers.every(Number.isFinite) ? numbers : value;
|
|
8629
|
+
}
|
|
8630
|
+
case "pair":
|
|
8631
|
+
case "directedPair": {
|
|
8632
|
+
const parts = Array.isArray(value) ? value : String(value).trim().split(/\s+/);
|
|
8633
|
+
return parts.length === 2 ? parts.map(String) : value;
|
|
8634
|
+
}
|
|
8635
|
+
case "string":
|
|
8636
|
+
case "identifier":
|
|
8637
|
+
default:
|
|
8638
|
+
return String(value);
|
|
8639
|
+
}
|
|
8640
|
+
};
|
|
8641
|
+
var recordEntryFromValue = (name, entryValue, baseType) => {
|
|
8642
|
+
if (baseType) {
|
|
8643
|
+
if (Array.isArray(entryValue) && !PAIR_BASE_TYPES.has(baseType)) {
|
|
8644
|
+
return { name, list: { [baseType]: entryValue.map((v) => coerceBaseValue(v, baseType)) } };
|
|
8645
|
+
}
|
|
8646
|
+
if (entryValue === null || entryValue === void 0) {
|
|
8647
|
+
return { name, base: null };
|
|
8648
|
+
}
|
|
8649
|
+
return { name, base: { [baseType]: coerceBaseValue(entryValue, baseType) } };
|
|
8650
|
+
}
|
|
8651
|
+
if (Array.isArray(entryValue)) {
|
|
8652
|
+
const filtered = entryValue.filter((v) => v !== null && v !== void 0);
|
|
8653
|
+
if (filtered.length && filtered.every((v) => typeof v === "boolean")) {
|
|
8654
|
+
return { name, list: { boolean: filtered } };
|
|
8655
|
+
}
|
|
8656
|
+
if (filtered.length && filtered.every((v) => typeof v === "number")) {
|
|
8657
|
+
const numbers = filtered;
|
|
8658
|
+
const isIntegers = numbers.every((n) => Number.isInteger(n));
|
|
8659
|
+
return { name, list: { [isIntegers ? "integer" : "float"]: numbers } };
|
|
8660
|
+
}
|
|
8661
|
+
return { name, list: { string: entryValue.map((v) => v === null || v === void 0 ? "" : String(v)) } };
|
|
8662
|
+
}
|
|
8663
|
+
if (typeof entryValue === "boolean") {
|
|
8664
|
+
return { name, base: { boolean: entryValue } };
|
|
8665
|
+
}
|
|
8666
|
+
if (typeof entryValue === "number") {
|
|
8667
|
+
if (Number.isInteger(entryValue))
|
|
8668
|
+
return { name, base: { integer: entryValue } };
|
|
8669
|
+
return { name, base: { float: entryValue } };
|
|
8670
|
+
}
|
|
8671
|
+
if (entryValue === null || entryValue === void 0) {
|
|
8672
|
+
return { name, base: { string: "" } };
|
|
8673
|
+
}
|
|
8674
|
+
if (typeof entryValue === "object") {
|
|
8675
|
+
try {
|
|
8676
|
+
return { name, base: { string: JSON.stringify(entryValue) } };
|
|
8677
|
+
} catch {
|
|
8678
|
+
return { name, base: { string: String(entryValue) } };
|
|
8679
|
+
}
|
|
8680
|
+
}
|
|
8681
|
+
return { name, base: { string: String(entryValue) } };
|
|
8682
|
+
};
|
|
8683
|
+
var recordToQtiVariableJSON = (value, fieldBaseTypes = {}) => {
|
|
8684
|
+
if (!isRecordValue(value)) {
|
|
8685
|
+
return { record: [] };
|
|
8686
|
+
}
|
|
8687
|
+
const recordEntries = [];
|
|
8688
|
+
for (const [name, entryValue] of Object.entries(value)) {
|
|
8689
|
+
recordEntries.push(recordEntryFromValue(name, entryValue, fieldBaseTypes[name]));
|
|
8690
|
+
}
|
|
8691
|
+
return { record: recordEntries };
|
|
8692
|
+
};
|
|
8693
|
+
var recordFieldBaseTypes = (value, declared = {}) => {
|
|
8694
|
+
if (!isRecordValue(value))
|
|
8695
|
+
return { ...declared };
|
|
8696
|
+
const baseTypes = {};
|
|
8697
|
+
for (const [name, entryValue] of Object.entries(value)) {
|
|
8698
|
+
baseTypes[name] = declared[name] ?? inferRecordFieldBaseType(Array.isArray(entryValue) ? entryValue[0] : entryValue);
|
|
8699
|
+
}
|
|
8700
|
+
return baseTypes;
|
|
8701
|
+
};
|
|
8702
|
+
var recordResponseToQtiVariableJSON = (value, declared = {}) => recordToQtiVariableJSON(value, recordFieldBaseTypes(value, declared));
|
|
8703
|
+
var toQtiLiteral = (value) => {
|
|
8704
|
+
if (value === null || value === void 0)
|
|
8705
|
+
return null;
|
|
8706
|
+
if (Array.isArray(value))
|
|
8707
|
+
return value.map(String).join(" ");
|
|
8708
|
+
if (typeof value === "object") {
|
|
8709
|
+
try {
|
|
8710
|
+
return JSON.stringify(value);
|
|
8711
|
+
} catch {
|
|
8712
|
+
return String(value);
|
|
8713
|
+
}
|
|
8714
|
+
}
|
|
8715
|
+
return String(value);
|
|
8716
|
+
};
|
|
8717
|
+
var firstTypedValue = (typed) => {
|
|
8718
|
+
if (!typed)
|
|
8719
|
+
return void 0;
|
|
8720
|
+
for (const key of Object.keys(typed)) {
|
|
8721
|
+
const value = typed[key];
|
|
8722
|
+
if (value !== void 0 && value !== null)
|
|
8723
|
+
return value;
|
|
8724
|
+
}
|
|
8725
|
+
return void 0;
|
|
8726
|
+
};
|
|
8727
|
+
var recordFromQtiVariableJSON = (record) => {
|
|
8728
|
+
const value = {};
|
|
8729
|
+
for (const entry of record) {
|
|
8730
|
+
if (!entry || typeof entry.name !== "string" || !entry.name)
|
|
8731
|
+
continue;
|
|
8732
|
+
if (entry.list) {
|
|
8733
|
+
const items = firstTypedValue(entry.list);
|
|
8734
|
+
value[entry.name] = Array.isArray(items) ? items.map(toQtiLiteral).filter((v) => v !== null) : [];
|
|
8735
|
+
} else {
|
|
8736
|
+
value[entry.name] = toQtiLiteral(firstTypedValue(entry.base));
|
|
8737
|
+
}
|
|
8738
|
+
}
|
|
8739
|
+
return value;
|
|
8740
|
+
};
|
|
8741
|
+
|
|
8742
|
+
// ../interactions/portable-custom-interaction/dist/vendor/require-js.js
|
|
8743
|
+
var require_js_default = `/** vim: et:ts=4:sw=4:sts=4
|
|
8744
|
+
* @license RequireJS 2.3.8 Copyright jQuery Foundation and other contributors.
|
|
8745
|
+
* Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
|
|
8746
|
+
*/var requirejs,require,define;(function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.8",commentRegExp=/\\/\\*[\\s\\S]*?\\*\\/|([^:"'=]|^)\\/\\/.*$/mg,cjsRequireRegExp=/[^.]\\s*require\\s*\\(\\s*["']([^'"\\s]+)["']\\s*\\)/g,jsSuffixRegExp=/\\.js$/,currDirRegExp=/^\\.\\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!!(typeof window<"u"&&typeof navigator<"u"&&window.document),isWebWorker=!isBrowser&&typeof importScripts<"u",readyRegExp=isBrowser&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera=typeof opera<"u"&&opera.toString()==="[object Opera]",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(r,a){return a||""}function isFunction(r){return ostring.call(r)==="[object Function]"}function isArray(r){return ostring.call(r)==="[object Array]"}function each(r,a){if(r){var c;for(c=0;c<r.length&&!(r[c]&&a(r[c],c,r));c+=1);}}function eachReverse(r,a){if(r){var c;for(c=r.length-1;c>-1&&!(r[c]&&a(r[c],c,r));c-=1);}}function hasProp(r,a){return hasOwn.call(r,a)}function getOwn(r,a){return hasProp(r,a)&&r[a]}function eachProp(r,a){var c;for(c in r)if(hasProp(r,c)&&c!=="__proto__"&&c!=="constructor"&&a(r[c],c))break}function mixin(r,a,c,u){return a&&eachProp(a,function(h,q){(c||!hasProp(r,q))&&(u&&typeof h=="object"&&h&&!isArray(h)&&!isFunction(h)&&!(h instanceof RegExp)?(r[q]||(r[q]={}),mixin(r[q],h,c,u)):r[q]=h)}),r}function bind(r,a){return function(){return a.apply(r,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(r){throw r}function getGlobal(r){if(!r)return r;var a=global;return each(r.split("."),function(c){a=a[c]}),a}function makeError(r,a,c,u){var h=new Error(a+\`
|
|
8747
|
+
https://requirejs.org/docs/errors.html#\`+r);return h.requireType=r,h.requireModules=u,c&&(h.originalError=c),h}if(typeof define<"u")return;if(typeof requirejs<"u"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}typeof require<"u"&&!isFunction(require)&&(cfg=require,require=void 0);function newContext(r){var a,c,u,h,q,g={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},v={},B={},I={},M=[],w={},D={},L={},H=1,K=1;function X(e){var i,n;for(i=0;i<e.length;i++)if(n=e[i],n===".")e.splice(i,1),i-=1;else if(n===".."){if(i===0||i===1&&e[2]===".."||e[i-1]==="..")continue;i>0&&(e.splice(i-1,2),i-=2)}}function P(e,i,n){var o,t,f,d,l,p,b,E,m,x,R,A,O=i&&i.split("/"),k=g.map,j=k&&k["*"];if(e&&(e=e.split("/"),b=e.length-1,g.nodeIdCompat&&jsSuffixRegExp.test(e[b])&&(e[b]=e[b].replace(jsSuffixRegExp,"")),e[0].charAt(0)==="."&&O&&(A=O.slice(0,O.length-1),e=A.concat(e)),X(e),e=e.join("/")),n&&k&&(O||j)){f=e.split("/");e:for(d=f.length;d>0;d-=1){if(p=f.slice(0,d).join("/"),O){for(l=O.length;l>0;l-=1)if(t=getOwn(k,O.slice(0,l).join("/")),t&&(t=getOwn(t,p),t)){E=t,m=d;break e}}!x&&j&&getOwn(j,p)&&(x=getOwn(j,p),R=d)}!E&&x&&(E=x,m=R),E&&(f.splice(0,m,E),e=f.join("/"))}return o=getOwn(g.pkgs,e),o||e}function W(e){isBrowser&&each(scripts(),function(i){if(i.getAttribute("data-requiremodule")===e&&i.getAttribute("data-requirecontext")===u.contextName)return i.parentNode.removeChild(i),!0})}function Q(e){var i=getOwn(g.paths,e);if(i&&isArray(i)&&i.length>1)return i.shift(),u.require.undef(e),u.makeRequire(null,{skipMap:!0})([e]),!0}function G(e){var i,n=e?e.indexOf("!"):-1;return n>-1&&(i=e.substring(0,n),e=e.substring(n+1,e.length)),[i,e]}function S(e,i,n,o){var t,f,d,l,p=null,b=i?i.name:null,E=e,m=!0,x="";return e||(m=!1,e="_@r"+(H+=1)),l=G(e),p=l[0],e=l[1],p&&(p=P(p,b,o),f=getOwn(w,p)),e&&(p?n?x=e:f&&f.normalize?x=f.normalize(e,function(R){return P(R,b,o)}):x=e.indexOf("!")===-1?P(e,b,o):e:(x=P(e,b,o),l=G(x),p=l[0],x=l[1],n=!0,t=u.nameToUrl(x))),d=p&&!f&&!n?"_unnormalized"+(K+=1):"",{prefix:p,name:x,parentMap:i,unnormalized:!!d,url:t,originalName:E,isDefine:m,id:(p?p+"!"+x:x)+d}}function T(e){var i=e.id,n=getOwn(v,i);return n||(n=v[i]=new u.Module(e)),n}function C(e,i,n){var o=e.id,t=getOwn(v,o);hasProp(w,o)&&(!t||t.defineEmitComplete)?i==="defined"&&n(w[o]):(t=T(e),t.error&&i==="error"?n(t.error):t.on(i,n))}function y(e,i){var n=e.requireModules,o=!1;i?i(e):(each(n,function(t){var f=getOwn(v,t);f&&(f.error=e,f.events.error&&(o=!0,f.emit("error",e)))}),o||req.onError(e))}function F(){globalDefQueue.length&&(each(globalDefQueue,function(e){var i=e[0];typeof i=="string"&&(u.defQueueMap[i]=!0),M.push(e)}),globalDefQueue=[])}h={require:function(e){return e.require?e.require:e.require=u.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?w[e.map.id]=e.exports:e.exports=w[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(g.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}};function U(e){delete v[e],delete B[e]}function $(e,i,n){var o=e.map.id;e.error?e.emit("error",e.error):(i[o]=!0,each(e.depMaps,function(t,f){var d=t.id,l=getOwn(v,d);l&&!e.depMatched[f]&&!n[d]&&(getOwn(i,d)?(e.defineDep(f,w[d]),e.check()):$(l,i,n))}),n[o]=!0)}function z(){var e,i,n=g.waitSeconds*1e3,o=n&&u.startTime+n<new Date().getTime(),t=[],f=[],d=!1,l=!0;if(!a){if(a=!0,eachProp(B,function(p){var b=p.map,E=b.id;if(p.enabled&&(b.isDefine||f.push(p),!p.error)){if(!p.inited&&o)Q(E)?(i=!0,d=!0):(t.push(E),W(E));else if(!p.inited&&p.fetched&&b.isDefine&&(d=!0,!b.prefix))return l=!1}}),o&&t.length)return e=makeError("timeout","Load timeout for modules: "+t,null,t),e.contextName=u.contextName,y(e);l&&each(f,function(p){$(p,{},{})}),(!o||i)&&d&&(isBrowser||isWebWorker)&&!q&&(q=setTimeout(function(){q=0,z()},50)),a=!1}}c=function(e){this.events=getOwn(I,e.id)||{},this.map=e,this.shim=getOwn(g.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},c.prototype={init:function(e,i,n,o){o=o||{},!this.inited&&(this.factory=i,n?this.on("error",n):this.events.error&&(n=bind(this,function(t){this.emit("error",t)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=o.ignore,o.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,i){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=i)},fetch:function(){if(!this.fetched){this.fetched=!0,u.startTime=new Date().getTime();var e=this.map;if(this.shim)u.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}));else return e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;D[e]||(D[e]=!0,u.load(this.map.id,e))},check:function(){if(!(!this.enabled||this.enabling)){var e,i,n=this.map.id,o=this.depExports,t=this.exports,f=this.factory;if(!this.inited)hasProp(u.defQueueMap,n)||this.fetch();else if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(f)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{t=u.execCb(n,f,o,t)}catch(l){e=l}else t=u.execCb(n,f,o,t);if(this.map.isDefine&&t===void 0&&(i=this.module,i?t=i.exports:this.usingExports&&(t=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",y(this.error=e)}else t=f;if(this.exports=t,this.map.isDefine&&!this.ignore&&(w[n]=t,req.onResourceLoad)){var d=[];each(this.depMaps,function(l){d.push(l.normalizedMap||l)}),req.onResourceLoad(u,this.map,d)}U(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var e=this.map,i=e.id,n=S(e.prefix);this.depMaps.push(n),C(n,"defined",bind(this,function(o){var t,f,d,l=getOwn(L,this.map.id),p=this.map.name,b=this.map.parentMap?this.map.parentMap.name:null,E=u.makeRequire(e.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){o.normalize&&(p=o.normalize(p,function(m){return P(m,b,!0)})||""),f=S(e.prefix+"!"+p,this.map.parentMap,!0),C(f,"defined",bind(this,function(m){this.map.normalizedMap=f,this.init([],function(){return m},null,{enabled:!0,ignore:!0})})),d=getOwn(v,f.id),d&&(this.depMaps.push(f),this.events.error&&d.on("error",bind(this,function(m){this.emit("error",m)})),d.enable());return}if(l){this.map.url=u.nameToUrl(l),this.load();return}t=bind(this,function(m){this.init([],function(){return m},null,{enabled:!0})}),t.error=bind(this,function(m){this.inited=!0,this.error=m,m.requireModules=[i],eachProp(v,function(x){x.map.id.indexOf(i+"_unnormalized")===0&&U(x.map.id)}),y(m)}),t.fromText=bind(this,function(m,x){var R=e.name,A=S(R),O=useInteractive;x&&(m=x),O&&(useInteractive=!1),T(A),hasProp(g.config,i)&&(g.config[R]=g.config[i]);try{req.exec(m)}catch(k){return y(makeError("fromtexteval","fromText eval for "+i+" failed: "+k,k,[i]))}O&&(useInteractive=!0),this.depMaps.push(A),u.completeLoad(R),E([R],t)}),o.load(e.name,E,t,g)})),u.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){B[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,i){var n,o,t;if(typeof e=="string"){if(e=S(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[i]=e,t=getOwn(h,e.id),t){this.depExports[i]=t(this);return}this.depCount+=1,C(e,"defined",bind(this,function(f){this.undefed||(this.defineDep(i,f),this.check())})),this.errback?C(e,"error",bind(this,this.errback)):this.events.error&&C(e,"error",bind(this,function(f){this.emit("error",f)}))}n=e.id,o=v[n],!hasProp(h,n)&&o&&!o.enabled&&u.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var i=getOwn(v,e.id);i&&!i.enabled&&u.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,i){var n=this.events[e];n||(n=this.events[e]=[]),n.push(i)},emit:function(e,i){each(this.events[e],function(n){n(i)}),e==="error"&&delete this.events[e]}};function _(e){hasProp(w,e[0])||T(S(e[0],null,!0)).init(e[1],e[2])}function J(e,i,n,o){e.detachEvent&&!isOpera?o&&e.detachEvent(o,i):e.removeEventListener(n,i,!1)}function V(e){var i=e.currentTarget||e.srcElement;return J(i,u.onScriptLoad,"load","onreadystatechange"),J(i,u.onScriptError,"error"),{node:i,id:i&&i.getAttribute("data-requiremodule")}}function Y(){var e;for(F();M.length;){if(e=M.shift(),e[0]===null)return y(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));_(e)}u.defQueueMap={}}return u={config:g,contextName:r,registry:v,defined:w,urlFetched:D,defQueue:M,defQueueMap:{},Module:c,makeModuleMap:S,nextTick:req.nextTick,onError:y,configure:function(e){if(e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!=="/"&&(e.baseUrl+="/"),typeof e.urlArgs=="string"){var i=e.urlArgs;e.urlArgs=function(t,f){return(f.indexOf("?")===-1?"?":"&")+i}}var n=g.shim,o={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(t,f){o[f]?(g[f]||(g[f]={}),mixin(g[f],t,!0,!0)):g[f]=t}),e.bundles&&eachProp(e.bundles,function(t,f){each(t,function(d){d!==f&&(L[d]=f)})}),e.shim&&(eachProp(e.shim,function(t,f){isArray(t)&&(t={deps:t}),(t.exports||t.init)&&!t.exportsFn&&(t.exportsFn=u.makeShimExports(t)),n[f]=t}),g.shim=n),e.packages&&each(e.packages,function(t){var f,d;t=typeof t=="string"?{name:t}:t,d=t.name,f=t.location,f&&(g.paths[d]=t.location),g.pkgs[d]=t.name+"/"+(t.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(v,function(t,f){!t.inited&&!t.map.unnormalized&&(t.map=S(f,null,!0))}),(e.deps||e.callback)&&u.require(e.deps||[],e.callback)},makeShimExports:function(e){function i(){var n;return e.init&&(n=e.init.apply(global,arguments)),n||e.exports&&getGlobal(e.exports)}return i},makeRequire:function(e,i){i=i||{};function n(o,t,f){var d,l,p;return i.enableBuildCallback&&t&&isFunction(t)&&(t.__requireJsBuild=!0),typeof o=="string"?isFunction(t)?y(makeError("requireargs","Invalid require call"),f):e&&hasProp(h,o)?h[o](v[e.id]):req.get?req.get(u,o,e,n):(l=S(o,e,!1,!0),d=l.id,hasProp(w,d)?w[d]:y(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+r+(e?"":". Use require([])")))):(Y(),u.nextTick(function(){Y(),p=T(S(null,e)),p.skipMap=i.skipMap,p.init(o,t,f,{enabled:!0}),z()}),n)}return mixin(n,{isBrowser,toUrl:function(o){var t,f=o.lastIndexOf("."),d=o.split("/")[0],l=d==="."||d==="..";return f!==-1&&(!l||f>1)&&(t=o.substring(f,o.length),o=o.substring(0,f)),u.nameToUrl(P(o,e&&e.id,!0),t,!0)},defined:function(o){return hasProp(w,S(o,e,!1,!0).id)},specified:function(o){return o=S(o,e,!1,!0).id,hasProp(w,o)||hasProp(v,o)}}),e||(n.undef=function(o){F();var t=S(o,e,!0),f=getOwn(v,o);f.undefed=!0,W(o),delete w[o],delete D[t.url],delete I[o],eachReverse(M,function(d,l){d[0]===o&&M.splice(l,1)}),delete u.defQueueMap[o],f&&(f.events.defined&&(I[o]=f.events),U(o))}),n},enable:function(e){var i=getOwn(v,e.id);i&&T(e).enable()},completeLoad:function(e){var i,n,o,t=getOwn(g.shim,e)||{},f=t.exports;for(F();M.length;){if(n=M.shift(),n[0]===null){if(n[0]=e,i)break;i=!0}else n[0]===e&&(i=!0);_(n)}if(u.defQueueMap={},o=getOwn(v,e),!i&&!hasProp(w,e)&&o&&!o.inited){if(g.enforceDefine&&(!f||!getGlobal(f)))return Q(e)?void 0:y(makeError("nodefine","No define call for "+e,null,[e]));_([e,t.deps||[],t.exportsFn])}z()},nameToUrl:function(e,i,n){var o,t,f,d,l,p,b,E=getOwn(g.pkgs,e);if(E&&(e=E),b=getOwn(L,e),b)return u.nameToUrl(b,i,n);if(req.jsExtRegExp.test(e))l=e+(i||"");else{for(o=g.paths,t=e.split("/"),f=t.length;f>0;f-=1)if(d=t.slice(0,f).join("/"),p=getOwn(o,d),p){isArray(p)&&(p=p[0]),t.splice(0,f,p);break}l=t.join("/"),l+=i||(/^data\\:|^blob\\:|\\?/.test(l)||n?"":".js"),l=(l.charAt(0)==="/"||l.match(/^[\\w\\+\\.\\-]+:/)?"":g.baseUrl)+l}return g.urlArgs&&!/^blob\\:/.test(l)?l+g.urlArgs(e,l):l},load:function(e,i){req.load(u,e,i)},execCb:function(e,i,n,o){return i.apply(o,n)},onScriptLoad:function(e){if(e.type==="load"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var i=V(e);u.completeLoad(i.id)}},onScriptError:function(e){var i=V(e);if(!Q(i.id)){var n=[];return eachProp(v,function(o,t){t.indexOf("_@r")!==0&&each(o.depMaps,function(f){if(f.id===i.id)return n.push(t),!0})}),y(makeError("scripterror",'Script error for "'+i.id+(n.length?'", needed by: '+n.join(", "):'"'),e,[i.id]))}}},u.require=u.makeRequire(),u}req=requirejs=function(r,a,c,u){var h,q,g=defContextName;return!isArray(r)&&typeof r!="string"&&(q=r,isArray(a)?(r=a,a=c,c=u):r=[]),q&&q.context&&(g=q.context),h=getOwn(contexts,g),h||(h=contexts[g]=req.s.newContext(g)),q&&h.configure(q),h.require(r,a,c)},req.config=function(r){return req(r)},req.nextTick=typeof setTimeout<"u"?function(r){setTimeout(r,4)}:function(r){r()},require||(require=req),req.version=version,req.jsExtRegExp=/^\\/|:|\\?|\\.js$/,req.isBrowser=isBrowser,s=req.s={contexts,newContext},req({}),each(["toUrl","undef","defined","specified"],function(r){req[r]=function(){var a=contexts[defContextName];return a.require[r].apply(a,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(r,a,c){var u=r.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return u.type=r.scriptType||"text/javascript",u.charset="utf-8",u.async=!0,u},req.load=function(r,a,c){var u=r&&r.config||{},h;if(isBrowser)return h=req.createNode(u,a,c),h.setAttribute("data-requirecontext",r.contextName),h.setAttribute("data-requiremodule",a),h.attachEvent&&!(h.attachEvent.toString&&h.attachEvent.toString().indexOf("[native code")<0)&&!isOpera?(useInteractive=!0,h.attachEvent("onreadystatechange",r.onScriptLoad)):(h.addEventListener("load",r.onScriptLoad,!1),h.addEventListener("error",r.onScriptError,!1)),h.src=c,u.onNodeCreated&&u.onNodeCreated(h,u,a,c),currentlyAddingScript=h,baseElement?head.insertBefore(h,baseElement):head.appendChild(h),currentlyAddingScript=null,h;if(isWebWorker)try{setTimeout(function(){},0),importScripts(c),r.completeLoad(a)}catch(q){r.onError(makeError("importscripts","importScripts failed for "+a+" at "+c,q,[a]))}};function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState==="interactive"||eachReverse(scripts(),function(r){if(r.readyState==="interactive")return interactiveScript=r}),interactiveScript}isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(r){if(head||(head=r.parentNode),dataMain=r.getAttribute("data-main"),dataMain)return mainScript=dataMain,!cfg.baseUrl&&mainScript.indexOf("!")===-1&&(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(r,a,c){var u,h;typeof r!="string"&&(c=a,a=r,r=null),isArray(a)||(c=a,a=null),!a&&isFunction(c)&&(a=[],c.length&&(c.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(q,g){a.push(g)}),a=(c.length===1?["require"]:["require","exports","module"]).concat(a))),useInteractive&&(u=currentlyAddingScript||getInteractiveScript(),u&&(r||(r=u.getAttribute("data-requiremodule")),h=contexts[u.getAttribute("data-requirecontext")])),h?(h.defQueue.push([r,a,c]),h.defQueueMap[r]=!0):globalDefQueue.push([r,a,c])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this,typeof setTimeout>"u"?void 0:setTimeout);`;
|
|
8748
|
+
|
|
8534
8749
|
// ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.js
|
|
8535
|
-
var
|
|
8750
|
+
var __decorate25 = function(decorators, target, key, desc) {
|
|
8536
8751
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8537
8752
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8538
8753
|
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;
|
|
8539
8754
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8540
8755
|
};
|
|
8756
|
+
var inlineScriptText = (text) => text.replace(/<\/(script)/gi, "<\\/$1");
|
|
8757
|
+
var inlineStyleText = (text) => text.replace(/<\/(style)/gi, "<\\/$1");
|
|
8541
8758
|
var STATUSES_SHOWING_CORRECT_RESPONSE = ["solution", "review"];
|
|
8542
8759
|
function hasCorrectResponseValue(value) {
|
|
8543
8760
|
if (value === null || value === void 0)
|
|
8544
8761
|
return false;
|
|
8545
|
-
|
|
8762
|
+
if (Array.isArray(value))
|
|
8763
|
+
return value.length > 0;
|
|
8764
|
+
if (isRecordValue(value))
|
|
8765
|
+
return Object.keys(value).length > 0;
|
|
8766
|
+
return value !== "";
|
|
8546
8767
|
}
|
|
8547
8768
|
var QtiPortableCustomInteraction = class extends Interaction {
|
|
8548
8769
|
constructor() {
|
|
@@ -8553,7 +8774,7 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8553
8774
|
this._iframeMessageOrigin = null;
|
|
8554
8775
|
this.requirePathsJson = "";
|
|
8555
8776
|
this.requireShimJson = "";
|
|
8556
|
-
this.requireJsUrl = "
|
|
8777
|
+
this.requireJsUrl = "";
|
|
8557
8778
|
this.baseUrl = "";
|
|
8558
8779
|
this.useDefaultPaths = false;
|
|
8559
8780
|
this.status = "interacting";
|
|
@@ -8619,30 +8840,32 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8619
8840
|
this.#pciCustomValidityMessage = pciCustomValidity;
|
|
8620
8841
|
}
|
|
8621
8842
|
const stateRaw = data?.params?.state;
|
|
8622
|
-
let
|
|
8843
|
+
let state15;
|
|
8623
8844
|
if (stateRaw === void 0) {
|
|
8624
|
-
|
|
8845
|
+
state15 = void 0;
|
|
8625
8846
|
} else if (stateRaw === null) {
|
|
8626
|
-
|
|
8847
|
+
state15 = null;
|
|
8627
8848
|
} else if (typeof stateRaw === "string") {
|
|
8628
|
-
|
|
8849
|
+
state15 = stateRaw;
|
|
8629
8850
|
} else {
|
|
8630
8851
|
try {
|
|
8631
|
-
|
|
8852
|
+
state15 = `__qti_json__::${JSON.stringify(stateRaw)}`;
|
|
8632
8853
|
} catch {
|
|
8633
|
-
|
|
8854
|
+
state15 = null;
|
|
8634
8855
|
}
|
|
8635
8856
|
}
|
|
8636
8857
|
if (converted === null) {
|
|
8637
|
-
const
|
|
8858
|
+
const cardinality = this.responseVariable?.cardinality;
|
|
8859
|
+
const emptyResponse = cardinality === "record" ? null : cardinality === "single" ? "" : [];
|
|
8638
8860
|
this.response = emptyResponse;
|
|
8639
8861
|
this.validate();
|
|
8640
|
-
this.saveResponse(emptyResponse,
|
|
8862
|
+
this.saveResponse(emptyResponse, state15);
|
|
8641
8863
|
break;
|
|
8642
8864
|
}
|
|
8643
|
-
|
|
8865
|
+
const response = converted;
|
|
8866
|
+
this.response = response;
|
|
8644
8867
|
this.validate();
|
|
8645
|
-
this.saveResponse(
|
|
8868
|
+
this.saveResponse(response, state15);
|
|
8646
8869
|
break;
|
|
8647
8870
|
}
|
|
8648
8871
|
case "error":
|
|
@@ -8770,9 +8993,13 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8770
8993
|
return this.#getRequireShim();
|
|
8771
8994
|
}
|
|
8772
8995
|
/**
|
|
8773
|
-
* Converts QtiVariableJSON to a string
|
|
8996
|
+
* Converts QtiVariableJSON to a string, a string array, or for a record its field map
|
|
8774
8997
|
*/
|
|
8775
8998
|
#convertQtiVariableJSON(input) {
|
|
8999
|
+
if (input && Array.isArray(input.record)) {
|
|
9000
|
+
const record = recordFromQtiVariableJSON(input.record);
|
|
9001
|
+
return Object.keys(record).length ? record : null;
|
|
9002
|
+
}
|
|
8776
9003
|
for (const topLevelKey in input) {
|
|
8777
9004
|
if (input.hasOwnProperty(topLevelKey)) {
|
|
8778
9005
|
const nestedObject = input[topLevelKey];
|
|
@@ -8799,44 +9026,6 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8799
9026
|
const needle = tagName.toLowerCase();
|
|
8800
9027
|
return Array.from(this.children).filter((child) => child.tagName.toLowerCase() === needle);
|
|
8801
9028
|
}
|
|
8802
|
-
/**
|
|
8803
|
-
* Coerce a scalar value to the expected base-type when possible
|
|
8804
|
-
*/
|
|
8805
|
-
coerceBaseValue(value, baseType) {
|
|
8806
|
-
if (value === null || value === void 0)
|
|
8807
|
-
return value;
|
|
8808
|
-
switch (baseType) {
|
|
8809
|
-
case "integer": {
|
|
8810
|
-
if (typeof value === "number")
|
|
8811
|
-
return value;
|
|
8812
|
-
const parsed = parseInt(String(value), 10);
|
|
8813
|
-
return Number.isNaN(parsed) ? value : parsed;
|
|
8814
|
-
}
|
|
8815
|
-
case "float":
|
|
8816
|
-
case "duration": {
|
|
8817
|
-
if (typeof value === "number")
|
|
8818
|
-
return value;
|
|
8819
|
-
const parsed = parseFloat(String(value));
|
|
8820
|
-
return Number.isNaN(parsed) ? value : parsed;
|
|
8821
|
-
}
|
|
8822
|
-
case "boolean": {
|
|
8823
|
-
if (typeof value === "boolean")
|
|
8824
|
-
return value;
|
|
8825
|
-
if (typeof value === "string") {
|
|
8826
|
-
const lowered = value.toLowerCase();
|
|
8827
|
-
if (lowered === "true")
|
|
8828
|
-
return true;
|
|
8829
|
-
if (lowered === "false")
|
|
8830
|
-
return false;
|
|
8831
|
-
}
|
|
8832
|
-
return value;
|
|
8833
|
-
}
|
|
8834
|
-
case "string":
|
|
8835
|
-
case "identifier":
|
|
8836
|
-
default:
|
|
8837
|
-
return String(value);
|
|
8838
|
-
}
|
|
8839
|
-
}
|
|
8840
9029
|
/**
|
|
8841
9030
|
* Normalize an input into a list form
|
|
8842
9031
|
*/
|
|
@@ -8850,62 +9039,13 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8850
9039
|
*/
|
|
8851
9040
|
variableToQtiVariableJSON(value, cardinality, baseType) {
|
|
8852
9041
|
if (cardinality === "record" || baseType === "record") {
|
|
8853
|
-
return
|
|
9042
|
+
return recordToQtiVariableJSON(value);
|
|
8854
9043
|
}
|
|
8855
9044
|
if (cardinality !== "single") {
|
|
8856
|
-
const listValues = this.normalizeListValue(value).map((v) =>
|
|
9045
|
+
const listValues = this.normalizeListValue(value).map((v) => coerceBaseValue(v, baseType));
|
|
8857
9046
|
return { list: { [baseType]: listValues } };
|
|
8858
9047
|
}
|
|
8859
|
-
return { base: { [baseType]:
|
|
8860
|
-
}
|
|
8861
|
-
/**
|
|
8862
|
-
* Convert a record object into QtiVariableJSON
|
|
8863
|
-
*/
|
|
8864
|
-
recordToQtiVariableJSON(value) {
|
|
8865
|
-
if (!value || typeof value !== "object") {
|
|
8866
|
-
return { record: [] };
|
|
8867
|
-
}
|
|
8868
|
-
const recordEntries = [];
|
|
8869
|
-
for (const [name, entryValue] of Object.entries(value)) {
|
|
8870
|
-
recordEntries.push(this.recordEntryFromValue(name, entryValue));
|
|
8871
|
-
}
|
|
8872
|
-
return { record: recordEntries };
|
|
8873
|
-
}
|
|
8874
|
-
/**
|
|
8875
|
-
* Build a record entry from an arbitrary value
|
|
8876
|
-
*/
|
|
8877
|
-
recordEntryFromValue(name, entryValue) {
|
|
8878
|
-
if (Array.isArray(entryValue)) {
|
|
8879
|
-
const filtered = entryValue.filter((v) => v !== null && v !== void 0);
|
|
8880
|
-
if (filtered.length && filtered.every((v) => typeof v === "boolean")) {
|
|
8881
|
-
return { name, list: { boolean: filtered } };
|
|
8882
|
-
}
|
|
8883
|
-
if (filtered.length && filtered.every((v) => typeof v === "number")) {
|
|
8884
|
-
const numbers = filtered;
|
|
8885
|
-
const isIntegers = numbers.every((n) => Number.isInteger(n));
|
|
8886
|
-
return { name, list: { [isIntegers ? "integer" : "float"]: numbers } };
|
|
8887
|
-
}
|
|
8888
|
-
return { name, list: { string: entryValue.map((v) => v === null || v === void 0 ? "" : String(v)) } };
|
|
8889
|
-
}
|
|
8890
|
-
if (typeof entryValue === "boolean") {
|
|
8891
|
-
return { name, base: { boolean: entryValue } };
|
|
8892
|
-
}
|
|
8893
|
-
if (typeof entryValue === "number") {
|
|
8894
|
-
if (Number.isInteger(entryValue))
|
|
8895
|
-
return { name, base: { integer: entryValue } };
|
|
8896
|
-
return { name, base: { float: entryValue } };
|
|
8897
|
-
}
|
|
8898
|
-
if (entryValue === null || entryValue === void 0) {
|
|
8899
|
-
return { name, base: { string: "" } };
|
|
8900
|
-
}
|
|
8901
|
-
if (typeof entryValue === "object") {
|
|
8902
|
-
try {
|
|
8903
|
-
return { name, base: { string: JSON.stringify(entryValue) } };
|
|
8904
|
-
} catch {
|
|
8905
|
-
return { name, base: { string: String(entryValue) } };
|
|
8906
|
-
}
|
|
8907
|
-
}
|
|
8908
|
-
return { name, base: { string: String(entryValue) } };
|
|
9048
|
+
return { base: { [baseType]: coerceBaseValue(value, baseType) } };
|
|
8909
9049
|
}
|
|
8910
9050
|
/**
|
|
8911
9051
|
* Extract default QTI_CONTEXT values from qti-context-declaration elements
|
|
@@ -8920,15 +9060,10 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8920
9060
|
const defaultValueElement = declaration.querySelector("qti-default-value");
|
|
8921
9061
|
if (!defaultValueElement)
|
|
8922
9062
|
return;
|
|
8923
|
-
const
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
return;
|
|
8928
|
-
const baseType = valueElement.getAttribute("base-type") || "string";
|
|
8929
|
-
const textContent = valueElement.textContent?.trim() || "";
|
|
8930
|
-
defaults[fieldIdentifier] = this.coerceBaseValue(textContent, baseType);
|
|
8931
|
-
});
|
|
9063
|
+
const { value, baseTypes } = readRecordFieldValues(defaultValueElement.querySelectorAll("qti-value"));
|
|
9064
|
+
for (const [fieldIdentifier, textContent] of Object.entries(value)) {
|
|
9065
|
+
defaults[fieldIdentifier] = coerceBaseValue(textContent, baseTypes[fieldIdentifier] ?? "string");
|
|
9066
|
+
}
|
|
8932
9067
|
});
|
|
8933
9068
|
return defaults;
|
|
8934
9069
|
}
|
|
@@ -8947,7 +9082,7 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8947
9082
|
environmentIdentifier: merged.environmentIdentifier ?? "",
|
|
8948
9083
|
...merged
|
|
8949
9084
|
};
|
|
8950
|
-
return
|
|
9085
|
+
return recordToQtiVariableJSON(normalized);
|
|
8951
9086
|
}
|
|
8952
9087
|
/**
|
|
8953
9088
|
* Collect template variables referenced by qti-template-variable children
|
|
@@ -9040,7 +9175,10 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9040
9175
|
/**
|
|
9041
9176
|
* Converts response variables to QtiVariableJSON
|
|
9042
9177
|
*/
|
|
9043
|
-
responseVariablesToQtiVariableJSON(input, cardinality, baseType) {
|
|
9178
|
+
responseVariablesToQtiVariableJSON(input, cardinality, baseType, fieldBaseTypes) {
|
|
9179
|
+
if (cardinality === "record") {
|
|
9180
|
+
return recordResponseToQtiVariableJSON(input, fieldBaseTypes);
|
|
9181
|
+
}
|
|
9044
9182
|
if (cardinality !== "single") {
|
|
9045
9183
|
const list = { list: {} };
|
|
9046
9184
|
list.list[baseType] = input;
|
|
@@ -9054,6 +9192,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9054
9192
|
#hasNonEmptyResponse() {
|
|
9055
9193
|
if (this.response === null || this.response === void 0)
|
|
9056
9194
|
return false;
|
|
9195
|
+
if (isRecordValue(this.response)) {
|
|
9196
|
+
return Object.values(this.response).some((v) => v !== "" && v !== null && v !== void 0);
|
|
9197
|
+
}
|
|
9057
9198
|
if (Array.isArray(this.response)) {
|
|
9058
9199
|
if (this.response.length === 0)
|
|
9059
9200
|
return false;
|
|
@@ -9081,6 +9222,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9081
9222
|
get value() {
|
|
9082
9223
|
if (this.#value === null || this.#value === void 0)
|
|
9083
9224
|
return null;
|
|
9225
|
+
if (isRecordValue(this.#value))
|
|
9226
|
+
return JSON.stringify(this.#value);
|
|
9084
9227
|
return Array.isArray(this.#value) ? this.#value.join(",") : String(this.#value);
|
|
9085
9228
|
}
|
|
9086
9229
|
set boundTo(newValue) {
|
|
@@ -9095,10 +9238,11 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9095
9238
|
const responseVariable = {};
|
|
9096
9239
|
const variable = this.context?.variables?.find((v) => v.identifier === this.responseIdentifier);
|
|
9097
9240
|
if (variable) {
|
|
9098
|
-
const cardinality =
|
|
9099
|
-
const baseType =
|
|
9100
|
-
const value =
|
|
9101
|
-
const
|
|
9241
|
+
const cardinality = variable.cardinality || "single";
|
|
9242
|
+
const baseType = variable.baseType || "string";
|
|
9243
|
+
const value = variable.value || null;
|
|
9244
|
+
const fieldBaseTypes = variable.fieldBaseTypes;
|
|
9245
|
+
const responseVal = this.responseVariablesToQtiVariableJSON(value, cardinality, baseType, fieldBaseTypes);
|
|
9102
9246
|
responseVariable[this.responseIdentifier] = responseVal;
|
|
9103
9247
|
}
|
|
9104
9248
|
return responseVariable;
|
|
@@ -9268,11 +9412,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9268
9412
|
const iframeBaseUrl = this.dataset.baseUrl ? this.dataset.baseUrl.startsWith("/") ? `${window.location.origin}${this.dataset.baseUrl}` : this.dataset.baseUrl : "";
|
|
9269
9413
|
const iframeBaseHref = iframeBaseUrl ? iframeBaseUrl.endsWith("/") ? iframeBaseUrl : `${iframeBaseUrl}/` : `${window.location.origin}/`;
|
|
9270
9414
|
const forwardConsole = this.dataset.forwardConsole === "true";
|
|
9271
|
-
const
|
|
9272
|
-
const
|
|
9273
|
-
const
|
|
9274
|
-
const componentsCdnUrl = this.dataset.componentsCdnUrl || defaultComponentsCdnUrl;
|
|
9275
|
-
const componentsCssUrl = this.dataset.componentsCssUrl || defaultComponentsCssUrl;
|
|
9415
|
+
const componentsCdnUrl = this.dataset.componentsCdnUrl;
|
|
9416
|
+
const componentsCssUrl = this.dataset.componentsCssUrl;
|
|
9417
|
+
const requireJsTag = this.requireJsUrl ? `<script src="${this.requireJsUrl}"></script>` : `<script>${inlineScriptText(require_js_default)}</script>`;
|
|
9276
9418
|
const fontStyles = `
|
|
9277
9419
|
font-family: ${parentStyles.getPropertyValue("font-family")};
|
|
9278
9420
|
font-size: ${parentStyles.getPropertyValue("font-size")};
|
|
@@ -9280,17 +9422,18 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9280
9422
|
font-weight: ${parentStyles.getPropertyValue("font-weight")};
|
|
9281
9423
|
color: ${parentStyles.getPropertyValue("color")};
|
|
9282
9424
|
`;
|
|
9425
|
+
const langHost = this.closest("[lang], [xml\\:lang]");
|
|
9426
|
+
const iframeLang = [langHost?.getAttribute("lang"), langHost?.getAttribute("xml:lang"), document.documentElement.lang].map((l) => (l ?? "").trim()).find((l) => /^[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*$/.test(l)) ?? "en";
|
|
9283
9427
|
return (
|
|
9284
9428
|
/* html */
|
|
9285
9429
|
`<!DOCTYPE html>
|
|
9286
|
-
<html lang="
|
|
9430
|
+
<html lang="${iframeLang}">
|
|
9287
9431
|
<head>
|
|
9288
9432
|
<meta charset="utf-8" />
|
|
9289
9433
|
<title>QTI PCI Container</title>
|
|
9290
9434
|
<base href="${iframeBaseHref}" />
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
</script>
|
|
9435
|
+
${componentsCdnUrl ? `<script type="module">import '${componentsCdnUrl}';</script>` : ""}
|
|
9436
|
+
<style>${inlineStyleText(native_css_default)}</style>
|
|
9294
9437
|
<style>
|
|
9295
9438
|
body, html {
|
|
9296
9439
|
margin: 0;
|
|
@@ -9314,8 +9457,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9314
9457
|
min-height: 50px;
|
|
9315
9458
|
}
|
|
9316
9459
|
</style>
|
|
9317
|
-
|
|
9318
|
-
|
|
9460
|
+
${componentsCssUrl ? `<link href="${componentsCssUrl}" rel="stylesheet" />` : ""}
|
|
9461
|
+
${requireJsTag}
|
|
9319
9462
|
<script>
|
|
9320
9463
|
const forwardConsole = ${forwardConsole ? "true" : "false"};
|
|
9321
9464
|
if (forwardConsole) {
|
|
@@ -10230,42 +10373,42 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
10230
10373
|
`;
|
|
10231
10374
|
}
|
|
10232
10375
|
};
|
|
10233
|
-
|
|
10376
|
+
__decorate25([
|
|
10234
10377
|
property23({ type: String, attribute: "module" })
|
|
10235
10378
|
], QtiPortableCustomInteraction.prototype, "module", void 0);
|
|
10236
|
-
|
|
10379
|
+
__decorate25([
|
|
10237
10380
|
property23({ type: String, attribute: "custom-interaction-type-identifier" })
|
|
10238
10381
|
], QtiPortableCustomInteraction.prototype, "customInteractionTypeIdentifier", void 0);
|
|
10239
|
-
|
|
10382
|
+
__decorate25([
|
|
10240
10383
|
property23({ type: String, attribute: "data-require-paths" })
|
|
10241
10384
|
], QtiPortableCustomInteraction.prototype, "requirePathsJson", void 0);
|
|
10242
|
-
|
|
10385
|
+
__decorate25([
|
|
10243
10386
|
property23({ type: String, attribute: "data-require-shim" })
|
|
10244
10387
|
], QtiPortableCustomInteraction.prototype, "requireShimJson", void 0);
|
|
10245
|
-
|
|
10388
|
+
__decorate25([
|
|
10246
10389
|
property23({ type: String, attribute: "data-require-js-url" })
|
|
10247
10390
|
], QtiPortableCustomInteraction.prototype, "requireJsUrl", void 0);
|
|
10248
|
-
|
|
10391
|
+
__decorate25([
|
|
10249
10392
|
property23({ type: String, attribute: "data-base-url" })
|
|
10250
10393
|
], QtiPortableCustomInteraction.prototype, "baseUrl", void 0);
|
|
10251
|
-
|
|
10394
|
+
__decorate25([
|
|
10252
10395
|
property23({ type: Boolean, attribute: "data-use-default-paths" })
|
|
10253
10396
|
], QtiPortableCustomInteraction.prototype, "useDefaultPaths", void 0);
|
|
10254
|
-
|
|
10397
|
+
__decorate25([
|
|
10255
10398
|
property23({ type: String, attribute: "data-status" })
|
|
10256
10399
|
], QtiPortableCustomInteraction.prototype, "status", void 0);
|
|
10257
|
-
|
|
10258
|
-
|
|
10400
|
+
__decorate25([
|
|
10401
|
+
state13()
|
|
10259
10402
|
], QtiPortableCustomInteraction.prototype, "_errorMessage", void 0);
|
|
10260
|
-
|
|
10403
|
+
__decorate25([
|
|
10261
10404
|
consume6({ context: itemContext, subscribe: true }),
|
|
10262
|
-
|
|
10405
|
+
state13()
|
|
10263
10406
|
], QtiPortableCustomInteraction.prototype, "context", void 0);
|
|
10264
|
-
|
|
10407
|
+
__decorate25([
|
|
10265
10408
|
consume6({ context: qtiContext, subscribe: true }),
|
|
10266
|
-
|
|
10409
|
+
state13()
|
|
10267
10410
|
], QtiPortableCustomInteraction.prototype, "qtiContext", void 0);
|
|
10268
|
-
|
|
10411
|
+
__decorate25([
|
|
10269
10412
|
property23({ attribute: "response", reflect: false, converter: responseAttributeConverter({ emptyAs: null }) })
|
|
10270
10413
|
], QtiPortableCustomInteraction.prototype, "response", void 0);
|
|
10271
10414
|
|
|
@@ -10362,7 +10505,7 @@ var QtiPositionObjectStage = class extends LitElement13 {
|
|
|
10362
10505
|
|
|
10363
10506
|
// ../interactions/select-point-interaction/dist/qti-select-point-interaction.js
|
|
10364
10507
|
import { html as html29, nothing as nothing4 } from "lit";
|
|
10365
|
-
import { property as property24, state as
|
|
10508
|
+
import { property as property24, state as state14 } from "lit/decorators.js";
|
|
10366
10509
|
import { repeat as repeat7 } from "lit/directives/repeat.js";
|
|
10367
10510
|
import { styleMap } from "lit/directives/style-map.js";
|
|
10368
10511
|
|
|
@@ -10409,7 +10552,7 @@ var qti_select_point_interaction_styles_default = [
|
|
|
10409
10552
|
];
|
|
10410
10553
|
|
|
10411
10554
|
// ../interactions/select-point-interaction/dist/qti-select-point-interaction.js
|
|
10412
|
-
var
|
|
10555
|
+
var __decorate26 = function(decorators, target, key, desc) {
|
|
10413
10556
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10414
10557
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10415
10558
|
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;
|
|
@@ -10603,19 +10746,19 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
10603
10746
|
}
|
|
10604
10747
|
}
|
|
10605
10748
|
};
|
|
10606
|
-
|
|
10749
|
+
__decorate26([
|
|
10607
10750
|
property24({
|
|
10608
10751
|
type: Number,
|
|
10609
10752
|
attribute: "max-choices"
|
|
10610
10753
|
})
|
|
10611
10754
|
], QtiSelectPointInteraction.prototype, "maxChoices", void 0);
|
|
10612
|
-
|
|
10755
|
+
__decorate26([
|
|
10613
10756
|
property24({
|
|
10614
10757
|
type: Number,
|
|
10615
10758
|
attribute: "min-choices"
|
|
10616
10759
|
})
|
|
10617
10760
|
], QtiSelectPointInteraction.prototype, "minChoices", void 0);
|
|
10618
|
-
|
|
10761
|
+
__decorate26([
|
|
10619
10762
|
property24({
|
|
10620
10763
|
attribute: "response",
|
|
10621
10764
|
reflect: false,
|
|
@@ -10632,13 +10775,13 @@ __decorate25([
|
|
|
10632
10775
|
}
|
|
10633
10776
|
})
|
|
10634
10777
|
], QtiSelectPointInteraction.prototype, "response", void 0);
|
|
10635
|
-
|
|
10778
|
+
__decorate26([
|
|
10636
10779
|
property24({ attribute: "area-mappings" })
|
|
10637
10780
|
], QtiSelectPointInteraction.prototype, "areaMappings", void 0);
|
|
10638
|
-
|
|
10639
|
-
|
|
10781
|
+
__decorate26([
|
|
10782
|
+
state14()
|
|
10640
10783
|
], QtiSelectPointInteraction.prototype, "_areaEntries", void 0);
|
|
10641
|
-
|
|
10784
|
+
__decorate26([
|
|
10642
10785
|
watch("areaMappings")
|
|
10643
10786
|
], QtiSelectPointInteraction.prototype, "_handleAreaMappingsChange", void 0);
|
|
10644
10787
|
|
|
@@ -10722,7 +10865,7 @@ var qti_slider_interaction_styles_default = [
|
|
|
10722
10865
|
];
|
|
10723
10866
|
|
|
10724
10867
|
// ../interactions/slider-interaction/dist/qti-slider-interaction.js
|
|
10725
|
-
var
|
|
10868
|
+
var __decorate27 = function(decorators, target, key, desc) {
|
|
10726
10869
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10727
10870
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10728
10871
|
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;
|
|
@@ -10862,19 +11005,19 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
10862
11005
|
this.dispatchEvent(new Event("change", { bubbles: true }));
|
|
10863
11006
|
}
|
|
10864
11007
|
};
|
|
10865
|
-
|
|
11008
|
+
__decorate27([
|
|
10866
11009
|
query2("#rail")
|
|
10867
11010
|
], QtiSliderInteraction.prototype, "_rail", void 0);
|
|
10868
|
-
|
|
11011
|
+
__decorate27([
|
|
10869
11012
|
property25({ type: Number, attribute: "lower-bound" })
|
|
10870
11013
|
], QtiSliderInteraction.prototype, "min", void 0);
|
|
10871
|
-
|
|
11014
|
+
__decorate27([
|
|
10872
11015
|
property25({ type: Number, attribute: "upper-bound" })
|
|
10873
11016
|
], QtiSliderInteraction.prototype, "max", void 0);
|
|
10874
|
-
|
|
11017
|
+
__decorate27([
|
|
10875
11018
|
property25({ type: Number, attribute: "step" })
|
|
10876
11019
|
], QtiSliderInteraction.prototype, "step", void 0);
|
|
10877
|
-
|
|
11020
|
+
__decorate27([
|
|
10878
11021
|
property25({ attribute: "response", reflect: false, noAccessor: true })
|
|
10879
11022
|
], QtiSliderInteraction.prototype, "response", null);
|
|
10880
11023
|
|
|
@@ -10981,7 +11124,7 @@ var qti_text_entry_interaction_styles_default = [
|
|
|
10981
11124
|
];
|
|
10982
11125
|
|
|
10983
11126
|
// ../interactions/text-entry-interaction/dist/qti-text-entry-interaction.js
|
|
10984
|
-
var
|
|
11127
|
+
var __decorate28 = function(decorators, target, key, desc) {
|
|
10985
11128
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10986
11129
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10987
11130
|
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;
|
|
@@ -11088,25 +11231,25 @@ var QtiTextEntryInteraction = class extends Interaction {
|
|
|
11088
11231
|
this.response = "";
|
|
11089
11232
|
}
|
|
11090
11233
|
};
|
|
11091
|
-
|
|
11234
|
+
__decorate28([
|
|
11092
11235
|
property26({ type: Number, attribute: "expected-length" })
|
|
11093
11236
|
], QtiTextEntryInteraction.prototype, "expectedLength", void 0);
|
|
11094
|
-
|
|
11237
|
+
__decorate28([
|
|
11095
11238
|
property26({ type: String, attribute: "pattern-mask" })
|
|
11096
11239
|
], QtiTextEntryInteraction.prototype, "patternMask", void 0);
|
|
11097
|
-
|
|
11240
|
+
__decorate28([
|
|
11098
11241
|
property26({ type: String, attribute: "placeholder-text" })
|
|
11099
11242
|
], QtiTextEntryInteraction.prototype, "placeholderText", void 0);
|
|
11100
|
-
|
|
11243
|
+
__decorate28([
|
|
11101
11244
|
property26({ type: String, attribute: "data-patternmask-message" })
|
|
11102
11245
|
], QtiTextEntryInteraction.prototype, "dataPatternmaskMessage", void 0);
|
|
11103
|
-
|
|
11246
|
+
__decorate28([
|
|
11104
11247
|
property26({ type: String, attribute: "response", reflect: false })
|
|
11105
11248
|
], QtiTextEntryInteraction.prototype, "response", void 0);
|
|
11106
|
-
|
|
11249
|
+
__decorate28([
|
|
11107
11250
|
query3("input")
|
|
11108
11251
|
], QtiTextEntryInteraction.prototype, "_input", void 0);
|
|
11109
|
-
|
|
11252
|
+
__decorate28([
|
|
11110
11253
|
watch("response", { waitUntilFirstUpdate: true })
|
|
11111
11254
|
], QtiTextEntryInteraction.prototype, "_handleValueChange", void 0);
|
|
11112
11255
|
|
|
@@ -11815,6 +11958,8 @@ export {
|
|
|
11815
11958
|
elements24 as elements14,
|
|
11816
11959
|
QtiOrderInteraction,
|
|
11817
11960
|
elements25 as elements15,
|
|
11961
|
+
inlineScriptText,
|
|
11962
|
+
inlineStyleText,
|
|
11818
11963
|
QtiPortableCustomInteraction,
|
|
11819
11964
|
elements26 as elements16,
|
|
11820
11965
|
QtiPositionObjectInteraction,
|
|
@@ -11830,4 +11975,4 @@ export {
|
|
|
11830
11975
|
elements31 as elements21,
|
|
11831
11976
|
qtiInteractionElements
|
|
11832
11977
|
};
|
|
11833
|
-
//# sourceMappingURL=chunk-
|
|
11978
|
+
//# sourceMappingURL=chunk-LOKULHVY.js.map
|