@citolab/qti-components 10.0.0-next.0 → 10.0.0-next.10
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 +1975 -361
- package/dist/base.d.ts +10 -10
- package/dist/base.js +7 -1
- package/dist/{chunk-F7R7GSWL.js → chunk-3TUGZHKB.js} +3 -3
- package/dist/{chunk-CNFVA3AA.js → chunk-AHULN3UB.js} +390 -243
- package/dist/chunk-AHULN3UB.js.map +1 -0
- package/dist/{chunk-GPNWMLLA.js → chunk-CQ3WU35R.js} +2 -2
- package/dist/{chunk-3BAQWO5C.js → chunk-LCGPLQLE.js} +40 -4
- package/dist/chunk-LCGPLQLE.js.map +1 -0
- package/dist/{chunk-ACRN7YJM.js → chunk-M7X6TWSX.js} +2 -2
- package/dist/{chunk-WNAOVXXN.js → chunk-Q3C7XFVS.js} +2 -2
- package/dist/chunk-QVZLJY75.js +7 -0
- package/dist/chunk-QVZLJY75.js.map +1 -0
- package/dist/{chunk-EUKU5QKV.js → chunk-RRMCWCSA.js} +2520 -2071
- package/dist/chunk-RRMCWCSA.js.map +1 -0
- package/dist/{chunk-SVYHZIJ7.js → chunk-RWMY7KRT.js} +2 -2
- package/dist/{chunk-R7MMMDP7.js → chunk-T7YSBBAA.js} +56 -2
- package/dist/chunk-T7YSBBAA.js.map +1 -0
- package/dist/{chunk-QD3Y6UK3.js → chunk-WPILS3CW.js} +2 -2
- package/dist/{chunk-AWTQKBC4.js → chunk-YOCOLMGB.js} +40 -5
- package/dist/{chunk-AWTQKBC4.js.map → chunk-YOCOLMGB.js.map} +1 -1
- package/dist/{chunk-EPSUZIWL.js → chunk-YYZCTIZY.js} +6 -6
- package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-IXACuBr7.d.ts} +10 -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 +11 -11
- package/dist/index.js +41 -19
- 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 +1065 -774
- package/dist/{qti-condition-expression.d-L7yb3Rzy.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
- package/dist/{qti-expression.d-CuaLjZ6g.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +8 -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-B1gffYCL.d.ts} +1 -1
- package/dist/{qti-test.d-_THYXPzd.d.ts → qti-test.d-D-RYWphm.d.ts} +242 -99
- package/dist/{qti-text-entry-interaction.d-q8u5BiVK.d.ts → qti-text-entry-interaction.d-utFyp1DH.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-DW09Lrie.d.ts} +7 -1
- package/dist/test.d.ts +117 -9
- package/dist/test.js +23 -11
- package/package.json +9 -9
- package/dist/chunk-3BAQWO5C.js.map +0 -1
- package/dist/chunk-CNFVA3AA.js.map +0 -1
- package/dist/chunk-EUKU5QKV.js.map +0 -1
- package/dist/chunk-R7MMMDP7.js.map +0 -1
- package/dist/chunk-ZP6QQYSU.js +0 -7
- package/dist/chunk-ZP6QQYSU.js.map +0 -1
- /package/dist/{chunk-F7R7GSWL.js.map → chunk-3TUGZHKB.js.map} +0 -0
- /package/dist/{chunk-GPNWMLLA.js.map → chunk-CQ3WU35R.js.map} +0 -0
- /package/dist/{chunk-ACRN7YJM.js.map → chunk-M7X6TWSX.js.map} +0 -0
- /package/dist/{chunk-WNAOVXXN.js.map → chunk-Q3C7XFVS.js.map} +0 -0
- /package/dist/{chunk-SVYHZIJ7.js.map → chunk-RWMY7KRT.js.map} +0 -0
- /package/dist/{chunk-QD3Y6UK3.js.map → chunk-WPILS3CW.js.map} +0 -0
- /package/dist/{chunk-EPSUZIWL.js.map → chunk-YYZCTIZY.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-T7YSBBAA.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() {
|
|
@@ -6473,6 +6485,7 @@ __decorate19([
|
|
|
6473
6485
|
|
|
6474
6486
|
// ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.js
|
|
6475
6487
|
import { html as html18 } from "lit";
|
|
6488
|
+
import { state as state9 } from "lit/decorators.js";
|
|
6476
6489
|
|
|
6477
6490
|
// ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.styles.js
|
|
6478
6491
|
import { css as css17 } from "lit";
|
|
@@ -6568,15 +6581,34 @@ var qti_graphic_gap_match_interaction_styles_default = [
|
|
|
6568
6581
|
];
|
|
6569
6582
|
|
|
6570
6583
|
// ../interactions/graphic-gap-match-interaction/dist/qti-graphic-gap-match-interaction.js
|
|
6584
|
+
var __decorate20 = function(decorators, target, key, desc) {
|
|
6585
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6586
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6587
|
+
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;
|
|
6588
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6589
|
+
};
|
|
6571
6590
|
var SlottedBase2 = DragDropSlottedMixin(Interaction, "qti-gap-img, qti-gap-text", "qti-associable-hotspot", `slot[part~='drags']`);
|
|
6572
6591
|
var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(SlottedBase2, '[qti-draggable="true"]') {
|
|
6592
|
+
constructor() {
|
|
6593
|
+
super(...arguments);
|
|
6594
|
+
this.autoSizeDropzones = false;
|
|
6595
|
+
this._graphicScale = 1;
|
|
6596
|
+
this.#graphicObserver = null;
|
|
6597
|
+
this.#observedGraphic = null;
|
|
6598
|
+
this.#positionHotspotOnRegister = (e) => {
|
|
6599
|
+
this.#positionHotspot(e.target);
|
|
6600
|
+
};
|
|
6601
|
+
}
|
|
6573
6602
|
static {
|
|
6574
6603
|
this.styles = qti_graphic_gap_match_interaction_styles_default;
|
|
6575
6604
|
}
|
|
6605
|
+
#graphicObserver;
|
|
6606
|
+
#observedGraphic;
|
|
6576
6607
|
render() {
|
|
6608
|
+
const scale = `--qti-graphic-scale: ${this._graphicScale}`;
|
|
6577
6609
|
return html18` <slot name="prompt"></slot>
|
|
6578
|
-
<slot part="image"></slot>
|
|
6579
|
-
<slot part="drags" name="drags" class="hover-border"></slot>
|
|
6610
|
+
<slot part="image" style=${scale}></slot>
|
|
6611
|
+
<slot part="drags" name="drags" class="hover-border" style=${scale}></slot>
|
|
6580
6612
|
<div role="alert" part="message" id="validation-message"></div>`;
|
|
6581
6613
|
}
|
|
6582
6614
|
shouldReturnToInventoryOnInventoryDrop() {
|
|
@@ -6624,11 +6656,30 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
6624
6656
|
if (!graphic || !coords || !shape)
|
|
6625
6657
|
return;
|
|
6626
6658
|
this.#keepDeclaredRatio(graphic);
|
|
6659
|
+
this.#observeGraphic(graphic);
|
|
6627
6660
|
positionShapes(shape, coords.split(",").map((s) => parseFloat(s)), graphic, hotspot);
|
|
6628
6661
|
}
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6662
|
+
/**
|
|
6663
|
+
* Tracks the graphic's rendered width. The authored chip sizes live in the same coordinate space
|
|
6664
|
+
* as the `coords` — an item that draws a 275x126 hotspot for a 275x126 tile means the tile to fill
|
|
6665
|
+
* it — so the chips scale by the same factor as the drop areas.
|
|
6666
|
+
*/
|
|
6667
|
+
#observeGraphic(graphic) {
|
|
6668
|
+
if (this.#observedGraphic === graphic)
|
|
6669
|
+
return;
|
|
6670
|
+
this.#graphicObserver?.disconnect();
|
|
6671
|
+
this.#observedGraphic = graphic;
|
|
6672
|
+
this.#graphicObserver = new ResizeObserver(() => {
|
|
6673
|
+
const declared = parseFloat(graphic.getAttribute("width") ?? "");
|
|
6674
|
+
const rendered = graphic.getBoundingClientRect().width;
|
|
6675
|
+
const scale = declared > 0 && rendered > 0 ? Math.min(1, rendered / declared) : 1;
|
|
6676
|
+
const rounded = Math.round(scale * 1e3) / 1e3;
|
|
6677
|
+
if (rounded !== this._graphicScale)
|
|
6678
|
+
this._graphicScale = rounded;
|
|
6679
|
+
});
|
|
6680
|
+
this.#graphicObserver.observe(graphic);
|
|
6681
|
+
}
|
|
6682
|
+
#positionHotspotOnRegister;
|
|
6632
6683
|
connectedCallback() {
|
|
6633
6684
|
super.connectedCallback();
|
|
6634
6685
|
this.addEventListener("qti-register-hotspot", this.#positionHotspotOnRegister);
|
|
@@ -6637,8 +6688,14 @@ var QtiGraphicGapMatchInteraction = class extends DragDropSlottedSortableMixin(S
|
|
|
6637
6688
|
disconnectedCallback() {
|
|
6638
6689
|
super.disconnectedCallback();
|
|
6639
6690
|
this.removeEventListener("qti-register-hotspot", this.#positionHotspotOnRegister);
|
|
6691
|
+
this.#graphicObserver?.disconnect();
|
|
6692
|
+
this.#graphicObserver = null;
|
|
6693
|
+
this.#observedGraphic = null;
|
|
6640
6694
|
}
|
|
6641
6695
|
};
|
|
6696
|
+
__decorate20([
|
|
6697
|
+
state9()
|
|
6698
|
+
], QtiGraphicGapMatchInteraction.prototype, "_graphicScale", void 0);
|
|
6642
6699
|
|
|
6643
6700
|
// ../interactions/graphic-order-interaction/dist/qti-graphic-order-interaction.js
|
|
6644
6701
|
import { html as html19 } from "lit";
|
|
@@ -6691,7 +6748,7 @@ var qti_graphic_order_interaction_styles_default = [
|
|
|
6691
6748
|
];
|
|
6692
6749
|
|
|
6693
6750
|
// ../interactions/graphic-order-interaction/dist/qti-graphic-order-interaction.js
|
|
6694
|
-
var
|
|
6751
|
+
var __decorate21 = function(decorators, target, key, desc) {
|
|
6695
6752
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6696
6753
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
6697
6754
|
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;
|
|
@@ -6826,10 +6883,10 @@ var QtiGraphicOrderInteraction = class _QtiGraphicOrderInteraction extends Choic
|
|
|
6826
6883
|
this.removeEventListener("register-qti-hotspot-choice", this.#positionHotspotOnRegister);
|
|
6827
6884
|
}
|
|
6828
6885
|
};
|
|
6829
|
-
|
|
6886
|
+
__decorate21([
|
|
6830
6887
|
property19({ type: Number, attribute: "max-choices" })
|
|
6831
6888
|
], QtiGraphicOrderInteraction.prototype, "maxChoices", void 0);
|
|
6832
|
-
|
|
6889
|
+
__decorate21([
|
|
6833
6890
|
watch("response")
|
|
6834
6891
|
], QtiGraphicOrderInteraction.prototype, "handleOrderedResponseChange", null);
|
|
6835
6892
|
|
|
@@ -6974,7 +7031,7 @@ var QtiHottextInteraction = class extends ChoicesMixin(Interaction, "qti-hottext
|
|
|
6974
7031
|
|
|
6975
7032
|
// ../interactions/inline-choice-interaction/dist/qti-inline-choice-interaction.js
|
|
6976
7033
|
import { html as html22 } from "lit";
|
|
6977
|
-
import { property as property20, state as
|
|
7034
|
+
import { property as property20, state as state10 } from "lit/decorators.js";
|
|
6978
7035
|
import { consume as consume5 } from "@lit/context";
|
|
6979
7036
|
|
|
6980
7037
|
// ../interactions/core/dist/mixins/menu-auto-size/menu-auto-size.mixin.js
|
|
@@ -7349,7 +7406,7 @@ var styles2 = own;
|
|
|
7349
7406
|
var qti_inline_choice_interaction_styles_default = styles2;
|
|
7350
7407
|
|
|
7351
7408
|
// ../interactions/inline-choice-interaction/dist/qti-inline-choice-interaction.js
|
|
7352
|
-
var
|
|
7409
|
+
var __decorate22 = function(decorators, target, key, desc) {
|
|
7353
7410
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7354
7411
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7355
7412
|
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;
|
|
@@ -7719,23 +7776,23 @@ var QtiInlineChoiceInteraction = class extends MenuAutoSizeMixin(Interaction) {
|
|
|
7719
7776
|
return [...promptOption ? [promptOption] : [], ...slottedChoices];
|
|
7720
7777
|
}
|
|
7721
7778
|
};
|
|
7722
|
-
|
|
7723
|
-
|
|
7779
|
+
__decorate22([
|
|
7780
|
+
state10()
|
|
7724
7781
|
], QtiInlineChoiceInteraction.prototype, "options", void 0);
|
|
7725
|
-
|
|
7726
|
-
|
|
7782
|
+
__decorate22([
|
|
7783
|
+
state10()
|
|
7727
7784
|
], QtiInlineChoiceInteraction.prototype, "_dropdownOpen", void 0);
|
|
7728
|
-
|
|
7785
|
+
__decorate22([
|
|
7729
7786
|
consume5({ context: configContext, subscribe: true }),
|
|
7730
7787
|
property20({ attribute: false })
|
|
7731
7788
|
], QtiInlineChoiceInteraction.prototype, "configContext", void 0);
|
|
7732
|
-
|
|
7789
|
+
__decorate22([
|
|
7733
7790
|
property20({ type: String, attribute: "data-prompt" })
|
|
7734
7791
|
], QtiInlineChoiceInteraction.prototype, "dataPrompt", void 0);
|
|
7735
|
-
|
|
7792
|
+
__decorate22([
|
|
7736
7793
|
watch("dataPrompt", { waitUntilFirstUpdate: true })
|
|
7737
7794
|
], QtiInlineChoiceInteraction.prototype, "_handleDataPromptChange", void 0);
|
|
7738
|
-
|
|
7795
|
+
__decorate22([
|
|
7739
7796
|
property20({
|
|
7740
7797
|
type: Boolean,
|
|
7741
7798
|
reflect: true,
|
|
@@ -7746,19 +7803,19 @@ __decorate21([
|
|
|
7746
7803
|
}
|
|
7747
7804
|
})
|
|
7748
7805
|
], QtiInlineChoiceInteraction.prototype, "required", void 0);
|
|
7749
|
-
|
|
7806
|
+
__decorate22([
|
|
7750
7807
|
property20({ type: Number, attribute: "min-choices" })
|
|
7751
7808
|
], QtiInlineChoiceInteraction.prototype, "minChoices", void 0);
|
|
7752
|
-
|
|
7809
|
+
__decorate22([
|
|
7753
7810
|
watch(["required", "minChoices"], { waitUntilFirstUpdate: true })
|
|
7754
7811
|
], QtiInlineChoiceInteraction.prototype, "_handleRequiredChange", void 0);
|
|
7755
|
-
|
|
7812
|
+
__decorate22([
|
|
7756
7813
|
property20({ attribute: "response", reflect: false, noAccessor: true })
|
|
7757
7814
|
], QtiInlineChoiceInteraction.prototype, "response", null);
|
|
7758
7815
|
|
|
7759
7816
|
// ../interactions/match-interaction/dist/qti-match-interaction.js
|
|
7760
7817
|
import { html as html23, nothing as nothing3 } from "lit";
|
|
7761
|
-
import { property as property21, state as
|
|
7818
|
+
import { property as property21, state as state11 } from "lit/decorators.js";
|
|
7762
7819
|
|
|
7763
7820
|
// ../interactions/match-interaction/dist/qti-match-interaction.styles.js
|
|
7764
7821
|
import { css as css22 } from "lit";
|
|
@@ -7938,7 +7995,7 @@ var qti_match_interaction_tabular_styles_default = [
|
|
|
7938
7995
|
];
|
|
7939
7996
|
|
|
7940
7997
|
// ../interactions/match-interaction/dist/qti-match-interaction.js
|
|
7941
|
-
var
|
|
7998
|
+
var __decorate23 = function(decorators, target, key, desc) {
|
|
7942
7999
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7943
8000
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7944
8001
|
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;
|
|
@@ -8141,13 +8198,13 @@ var QtiMatchInteraction = class extends DragDropSlottedSortableMixin(DragDropSlo
|
|
|
8141
8198
|
`;
|
|
8142
8199
|
}
|
|
8143
8200
|
};
|
|
8144
|
-
|
|
8201
|
+
__decorate23([
|
|
8145
8202
|
property21({ type: String })
|
|
8146
8203
|
], QtiMatchInteraction.prototype, "class", void 0);
|
|
8147
|
-
|
|
8148
|
-
|
|
8204
|
+
__decorate23([
|
|
8205
|
+
state11()
|
|
8149
8206
|
], QtiMatchInteraction.prototype, "_response", void 0);
|
|
8150
|
-
|
|
8207
|
+
__decorate23([
|
|
8151
8208
|
property21({ type: String, attribute: "response-identifier" })
|
|
8152
8209
|
], QtiMatchInteraction.prototype, "responseIdentifier", void 0);
|
|
8153
8210
|
|
|
@@ -8225,7 +8282,7 @@ var QtiMediaInteraction = class extends Interaction {
|
|
|
8225
8282
|
// ../interactions/order-interaction/dist/qti-order-interaction.js
|
|
8226
8283
|
import { html as html25 } from "lit";
|
|
8227
8284
|
import { repeat as repeat6 } from "lit/directives/repeat.js";
|
|
8228
|
-
import { property as property22, state as
|
|
8285
|
+
import { property as property22, state as state12 } from "lit/decorators.js";
|
|
8229
8286
|
|
|
8230
8287
|
// ../interactions/order-interaction/dist/qti-order-interaction.styles.js
|
|
8231
8288
|
import { css as css25 } from "lit";
|
|
@@ -8447,7 +8504,7 @@ var qti_order_interaction_styles_default = [
|
|
|
8447
8504
|
];
|
|
8448
8505
|
|
|
8449
8506
|
// ../interactions/order-interaction/dist/qti-order-interaction.js
|
|
8450
|
-
var
|
|
8507
|
+
var __decorate24 = function(decorators, target, key, desc) {
|
|
8451
8508
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8452
8509
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8453
8510
|
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;
|
|
@@ -8506,18 +8563,21 @@ var QtiOrderInteraction = class extends DragDropSlottedSortableMixin(SlottedBase
|
|
|
8506
8563
|
this.childrenMap = Array.from(this.querySelectorAll("qti-simple-choice"));
|
|
8507
8564
|
}
|
|
8508
8565
|
};
|
|
8509
|
-
|
|
8510
|
-
|
|
8566
|
+
__decorate24([
|
|
8567
|
+
state12()
|
|
8511
8568
|
], QtiOrderInteraction.prototype, "nrChoices", void 0);
|
|
8512
|
-
|
|
8569
|
+
__decorate24([
|
|
8513
8570
|
property22({ type: String })
|
|
8514
8571
|
], QtiOrderInteraction.prototype, "orientation", void 0);
|
|
8515
8572
|
|
|
8516
8573
|
// ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.js
|
|
8517
8574
|
import { css as css27, html as html26 } from "lit";
|
|
8518
|
-
import { property as property23, state as
|
|
8575
|
+
import { property as property23, state as state13 } from "lit/decorators.js";
|
|
8519
8576
|
import { consume as consume6 } from "@lit/context";
|
|
8520
8577
|
|
|
8578
|
+
// ../qti-theme/dist/native-css.js
|
|
8579
|
+
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";
|
|
8580
|
+
|
|
8521
8581
|
// ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.styles.js
|
|
8522
8582
|
import { css as css26 } from "lit";
|
|
8523
8583
|
var qti_portable_custom_interaction_styles_default = [
|
|
@@ -8535,18 +8595,179 @@ var qti_portable_custom_interaction_styles_default = [
|
|
|
8535
8595
|
`
|
|
8536
8596
|
];
|
|
8537
8597
|
|
|
8598
|
+
// ../interactions/portable-custom-interaction/dist/record-response.js
|
|
8599
|
+
var PAIR_BASE_TYPES = /* @__PURE__ */ new Set(["point", "pair", "directedPair"]);
|
|
8600
|
+
var coerceBaseValue = (value, baseType) => {
|
|
8601
|
+
if (value === null || value === void 0)
|
|
8602
|
+
return value;
|
|
8603
|
+
switch (baseType) {
|
|
8604
|
+
case "integer": {
|
|
8605
|
+
if (typeof value === "number")
|
|
8606
|
+
return value;
|
|
8607
|
+
const parsed = parseInt(String(value), 10);
|
|
8608
|
+
return Number.isNaN(parsed) ? value : parsed;
|
|
8609
|
+
}
|
|
8610
|
+
case "float":
|
|
8611
|
+
case "duration": {
|
|
8612
|
+
if (typeof value === "number")
|
|
8613
|
+
return value;
|
|
8614
|
+
const parsed = parseFloat(String(value));
|
|
8615
|
+
return Number.isNaN(parsed) ? value : parsed;
|
|
8616
|
+
}
|
|
8617
|
+
case "boolean": {
|
|
8618
|
+
if (typeof value === "boolean")
|
|
8619
|
+
return value;
|
|
8620
|
+
if (typeof value === "string") {
|
|
8621
|
+
const lowered = value.toLowerCase();
|
|
8622
|
+
if (lowered === "true")
|
|
8623
|
+
return true;
|
|
8624
|
+
if (lowered === "false")
|
|
8625
|
+
return false;
|
|
8626
|
+
}
|
|
8627
|
+
return value;
|
|
8628
|
+
}
|
|
8629
|
+
case "point": {
|
|
8630
|
+
const parts = Array.isArray(value) ? value : String(value).trim().split(/[\s,]+/);
|
|
8631
|
+
const numbers = parts.map((part) => typeof part === "number" ? part : parseFloat(String(part)));
|
|
8632
|
+
return numbers.length === 2 && numbers.every(Number.isFinite) ? numbers : value;
|
|
8633
|
+
}
|
|
8634
|
+
case "pair":
|
|
8635
|
+
case "directedPair": {
|
|
8636
|
+
const parts = Array.isArray(value) ? value : String(value).trim().split(/\s+/);
|
|
8637
|
+
return parts.length === 2 ? parts.map(String) : value;
|
|
8638
|
+
}
|
|
8639
|
+
case "string":
|
|
8640
|
+
case "identifier":
|
|
8641
|
+
default:
|
|
8642
|
+
return String(value);
|
|
8643
|
+
}
|
|
8644
|
+
};
|
|
8645
|
+
var recordEntryFromValue = (name, entryValue, baseType) => {
|
|
8646
|
+
if (baseType) {
|
|
8647
|
+
if (Array.isArray(entryValue) && !PAIR_BASE_TYPES.has(baseType)) {
|
|
8648
|
+
return { name, list: { [baseType]: entryValue.map((v) => coerceBaseValue(v, baseType)) } };
|
|
8649
|
+
}
|
|
8650
|
+
if (entryValue === null || entryValue === void 0) {
|
|
8651
|
+
return { name, base: null };
|
|
8652
|
+
}
|
|
8653
|
+
return { name, base: { [baseType]: coerceBaseValue(entryValue, baseType) } };
|
|
8654
|
+
}
|
|
8655
|
+
if (Array.isArray(entryValue)) {
|
|
8656
|
+
const filtered = entryValue.filter((v) => v !== null && v !== void 0);
|
|
8657
|
+
if (filtered.length && filtered.every((v) => typeof v === "boolean")) {
|
|
8658
|
+
return { name, list: { boolean: filtered } };
|
|
8659
|
+
}
|
|
8660
|
+
if (filtered.length && filtered.every((v) => typeof v === "number")) {
|
|
8661
|
+
const numbers = filtered;
|
|
8662
|
+
const isIntegers = numbers.every((n) => Number.isInteger(n));
|
|
8663
|
+
return { name, list: { [isIntegers ? "integer" : "float"]: numbers } };
|
|
8664
|
+
}
|
|
8665
|
+
return { name, list: { string: entryValue.map((v) => v === null || v === void 0 ? "" : String(v)) } };
|
|
8666
|
+
}
|
|
8667
|
+
if (typeof entryValue === "boolean") {
|
|
8668
|
+
return { name, base: { boolean: entryValue } };
|
|
8669
|
+
}
|
|
8670
|
+
if (typeof entryValue === "number") {
|
|
8671
|
+
if (Number.isInteger(entryValue))
|
|
8672
|
+
return { name, base: { integer: entryValue } };
|
|
8673
|
+
return { name, base: { float: entryValue } };
|
|
8674
|
+
}
|
|
8675
|
+
if (entryValue === null || entryValue === void 0) {
|
|
8676
|
+
return { name, base: { string: "" } };
|
|
8677
|
+
}
|
|
8678
|
+
if (typeof entryValue === "object") {
|
|
8679
|
+
try {
|
|
8680
|
+
return { name, base: { string: JSON.stringify(entryValue) } };
|
|
8681
|
+
} catch {
|
|
8682
|
+
return { name, base: { string: String(entryValue) } };
|
|
8683
|
+
}
|
|
8684
|
+
}
|
|
8685
|
+
return { name, base: { string: String(entryValue) } };
|
|
8686
|
+
};
|
|
8687
|
+
var recordToQtiVariableJSON = (value, fieldBaseTypes = {}) => {
|
|
8688
|
+
if (!isRecordValue(value)) {
|
|
8689
|
+
return { record: [] };
|
|
8690
|
+
}
|
|
8691
|
+
const recordEntries = [];
|
|
8692
|
+
for (const [name, entryValue] of Object.entries(value)) {
|
|
8693
|
+
recordEntries.push(recordEntryFromValue(name, entryValue, fieldBaseTypes[name]));
|
|
8694
|
+
}
|
|
8695
|
+
return { record: recordEntries };
|
|
8696
|
+
};
|
|
8697
|
+
var recordFieldBaseTypes = (value, declared = {}) => {
|
|
8698
|
+
if (!isRecordValue(value))
|
|
8699
|
+
return { ...declared };
|
|
8700
|
+
const baseTypes = {};
|
|
8701
|
+
for (const [name, entryValue] of Object.entries(value)) {
|
|
8702
|
+
baseTypes[name] = declared[name] ?? inferRecordFieldBaseType(Array.isArray(entryValue) ? entryValue[0] : entryValue);
|
|
8703
|
+
}
|
|
8704
|
+
return baseTypes;
|
|
8705
|
+
};
|
|
8706
|
+
var recordResponseToQtiVariableJSON = (value, declared = {}) => recordToQtiVariableJSON(value, recordFieldBaseTypes(value, declared));
|
|
8707
|
+
var toQtiLiteral = (value) => {
|
|
8708
|
+
if (value === null || value === void 0)
|
|
8709
|
+
return null;
|
|
8710
|
+
if (Array.isArray(value))
|
|
8711
|
+
return value.map(String).join(" ");
|
|
8712
|
+
if (typeof value === "object") {
|
|
8713
|
+
try {
|
|
8714
|
+
return JSON.stringify(value);
|
|
8715
|
+
} catch {
|
|
8716
|
+
return String(value);
|
|
8717
|
+
}
|
|
8718
|
+
}
|
|
8719
|
+
return String(value);
|
|
8720
|
+
};
|
|
8721
|
+
var firstTypedValue = (typed) => {
|
|
8722
|
+
if (!typed)
|
|
8723
|
+
return void 0;
|
|
8724
|
+
for (const key of Object.keys(typed)) {
|
|
8725
|
+
const value = typed[key];
|
|
8726
|
+
if (value !== void 0 && value !== null)
|
|
8727
|
+
return value;
|
|
8728
|
+
}
|
|
8729
|
+
return void 0;
|
|
8730
|
+
};
|
|
8731
|
+
var recordFromQtiVariableJSON = (record) => {
|
|
8732
|
+
const value = {};
|
|
8733
|
+
for (const entry of record) {
|
|
8734
|
+
if (!entry || typeof entry.name !== "string" || !entry.name)
|
|
8735
|
+
continue;
|
|
8736
|
+
if (entry.list) {
|
|
8737
|
+
const items = firstTypedValue(entry.list);
|
|
8738
|
+
value[entry.name] = Array.isArray(items) ? items.map(toQtiLiteral).filter((v) => v !== null) : [];
|
|
8739
|
+
} else {
|
|
8740
|
+
value[entry.name] = toQtiLiteral(firstTypedValue(entry.base));
|
|
8741
|
+
}
|
|
8742
|
+
}
|
|
8743
|
+
return value;
|
|
8744
|
+
};
|
|
8745
|
+
|
|
8746
|
+
// ../interactions/portable-custom-interaction/dist/vendor/require-js.js
|
|
8747
|
+
var require_js_default = `/** vim: et:ts=4:sw=4:sts=4
|
|
8748
|
+
* @license RequireJS 2.3.8 Copyright jQuery Foundation and other contributors.
|
|
8749
|
+
* Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
|
|
8750
|
+
*/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+\`
|
|
8751
|
+
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);`;
|
|
8752
|
+
|
|
8538
8753
|
// ../interactions/portable-custom-interaction/dist/qti-portable-custom-interaction.js
|
|
8539
|
-
var
|
|
8754
|
+
var __decorate25 = function(decorators, target, key, desc) {
|
|
8540
8755
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8541
8756
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
8542
8757
|
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;
|
|
8543
8758
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8544
8759
|
};
|
|
8760
|
+
var inlineScriptText = (text) => text.replace(/<\/(script)/gi, "<\\/$1");
|
|
8761
|
+
var inlineStyleText = (text) => text.replace(/<\/(style)/gi, "<\\/$1");
|
|
8545
8762
|
var STATUSES_SHOWING_CORRECT_RESPONSE = ["solution", "review"];
|
|
8546
8763
|
function hasCorrectResponseValue(value) {
|
|
8547
8764
|
if (value === null || value === void 0)
|
|
8548
8765
|
return false;
|
|
8549
|
-
|
|
8766
|
+
if (Array.isArray(value))
|
|
8767
|
+
return value.length > 0;
|
|
8768
|
+
if (isRecordValue(value))
|
|
8769
|
+
return Object.keys(value).length > 0;
|
|
8770
|
+
return value !== "";
|
|
8550
8771
|
}
|
|
8551
8772
|
var QtiPortableCustomInteraction = class extends Interaction {
|
|
8552
8773
|
constructor() {
|
|
@@ -8557,7 +8778,7 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8557
8778
|
this._iframeMessageOrigin = null;
|
|
8558
8779
|
this.requirePathsJson = "";
|
|
8559
8780
|
this.requireShimJson = "";
|
|
8560
|
-
this.requireJsUrl = "
|
|
8781
|
+
this.requireJsUrl = "";
|
|
8561
8782
|
this.baseUrl = "";
|
|
8562
8783
|
this.useDefaultPaths = false;
|
|
8563
8784
|
this.status = "interacting";
|
|
@@ -8596,7 +8817,6 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8596
8817
|
case "resize":
|
|
8597
8818
|
if (typeof data.height === "number" && this.iframe) {
|
|
8598
8819
|
this.iframe.style.height = `${data.height}px`;
|
|
8599
|
-
this.iframe.style.width = `${data.width}px`;
|
|
8600
8820
|
}
|
|
8601
8821
|
break;
|
|
8602
8822
|
case "console":
|
|
@@ -8623,30 +8843,32 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8623
8843
|
this.#pciCustomValidityMessage = pciCustomValidity;
|
|
8624
8844
|
}
|
|
8625
8845
|
const stateRaw = data?.params?.state;
|
|
8626
|
-
let
|
|
8846
|
+
let state15;
|
|
8627
8847
|
if (stateRaw === void 0) {
|
|
8628
|
-
|
|
8848
|
+
state15 = void 0;
|
|
8629
8849
|
} else if (stateRaw === null) {
|
|
8630
|
-
|
|
8850
|
+
state15 = null;
|
|
8631
8851
|
} else if (typeof stateRaw === "string") {
|
|
8632
|
-
|
|
8852
|
+
state15 = stateRaw;
|
|
8633
8853
|
} else {
|
|
8634
8854
|
try {
|
|
8635
|
-
|
|
8855
|
+
state15 = `__qti_json__::${JSON.stringify(stateRaw)}`;
|
|
8636
8856
|
} catch {
|
|
8637
|
-
|
|
8857
|
+
state15 = null;
|
|
8638
8858
|
}
|
|
8639
8859
|
}
|
|
8640
8860
|
if (converted === null) {
|
|
8641
|
-
const
|
|
8861
|
+
const cardinality = this.responseVariable?.cardinality;
|
|
8862
|
+
const emptyResponse = cardinality === "record" ? null : cardinality === "single" ? "" : [];
|
|
8642
8863
|
this.response = emptyResponse;
|
|
8643
8864
|
this.validate();
|
|
8644
|
-
this.saveResponse(emptyResponse,
|
|
8865
|
+
this.saveResponse(emptyResponse, state15);
|
|
8645
8866
|
break;
|
|
8646
8867
|
}
|
|
8647
|
-
|
|
8868
|
+
const response = converted;
|
|
8869
|
+
this.response = response;
|
|
8648
8870
|
this.validate();
|
|
8649
|
-
this.saveResponse(
|
|
8871
|
+
this.saveResponse(response, state15);
|
|
8650
8872
|
break;
|
|
8651
8873
|
}
|
|
8652
8874
|
case "error":
|
|
@@ -8774,9 +8996,13 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8774
8996
|
return this.#getRequireShim();
|
|
8775
8997
|
}
|
|
8776
8998
|
/**
|
|
8777
|
-
* Converts QtiVariableJSON to a string
|
|
8999
|
+
* Converts QtiVariableJSON to a string, a string array, or for a record its field map
|
|
8778
9000
|
*/
|
|
8779
9001
|
#convertQtiVariableJSON(input) {
|
|
9002
|
+
if (input && Array.isArray(input.record)) {
|
|
9003
|
+
const record = recordFromQtiVariableJSON(input.record);
|
|
9004
|
+
return Object.keys(record).length ? record : null;
|
|
9005
|
+
}
|
|
8780
9006
|
for (const topLevelKey in input) {
|
|
8781
9007
|
if (input.hasOwnProperty(topLevelKey)) {
|
|
8782
9008
|
const nestedObject = input[topLevelKey];
|
|
@@ -8803,44 +9029,6 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8803
9029
|
const needle = tagName.toLowerCase();
|
|
8804
9030
|
return Array.from(this.children).filter((child) => child.tagName.toLowerCase() === needle);
|
|
8805
9031
|
}
|
|
8806
|
-
/**
|
|
8807
|
-
* Coerce a scalar value to the expected base-type when possible
|
|
8808
|
-
*/
|
|
8809
|
-
coerceBaseValue(value, baseType) {
|
|
8810
|
-
if (value === null || value === void 0)
|
|
8811
|
-
return value;
|
|
8812
|
-
switch (baseType) {
|
|
8813
|
-
case "integer": {
|
|
8814
|
-
if (typeof value === "number")
|
|
8815
|
-
return value;
|
|
8816
|
-
const parsed = parseInt(String(value), 10);
|
|
8817
|
-
return Number.isNaN(parsed) ? value : parsed;
|
|
8818
|
-
}
|
|
8819
|
-
case "float":
|
|
8820
|
-
case "duration": {
|
|
8821
|
-
if (typeof value === "number")
|
|
8822
|
-
return value;
|
|
8823
|
-
const parsed = parseFloat(String(value));
|
|
8824
|
-
return Number.isNaN(parsed) ? value : parsed;
|
|
8825
|
-
}
|
|
8826
|
-
case "boolean": {
|
|
8827
|
-
if (typeof value === "boolean")
|
|
8828
|
-
return value;
|
|
8829
|
-
if (typeof value === "string") {
|
|
8830
|
-
const lowered = value.toLowerCase();
|
|
8831
|
-
if (lowered === "true")
|
|
8832
|
-
return true;
|
|
8833
|
-
if (lowered === "false")
|
|
8834
|
-
return false;
|
|
8835
|
-
}
|
|
8836
|
-
return value;
|
|
8837
|
-
}
|
|
8838
|
-
case "string":
|
|
8839
|
-
case "identifier":
|
|
8840
|
-
default:
|
|
8841
|
-
return String(value);
|
|
8842
|
-
}
|
|
8843
|
-
}
|
|
8844
9032
|
/**
|
|
8845
9033
|
* Normalize an input into a list form
|
|
8846
9034
|
*/
|
|
@@ -8854,62 +9042,13 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8854
9042
|
*/
|
|
8855
9043
|
variableToQtiVariableJSON(value, cardinality, baseType) {
|
|
8856
9044
|
if (cardinality === "record" || baseType === "record") {
|
|
8857
|
-
return
|
|
9045
|
+
return recordToQtiVariableJSON(value);
|
|
8858
9046
|
}
|
|
8859
9047
|
if (cardinality !== "single") {
|
|
8860
|
-
const listValues = this.normalizeListValue(value).map((v) =>
|
|
9048
|
+
const listValues = this.normalizeListValue(value).map((v) => coerceBaseValue(v, baseType));
|
|
8861
9049
|
return { list: { [baseType]: listValues } };
|
|
8862
9050
|
}
|
|
8863
|
-
return { base: { [baseType]:
|
|
8864
|
-
}
|
|
8865
|
-
/**
|
|
8866
|
-
* Convert a record object into QtiVariableJSON
|
|
8867
|
-
*/
|
|
8868
|
-
recordToQtiVariableJSON(value) {
|
|
8869
|
-
if (!value || typeof value !== "object") {
|
|
8870
|
-
return { record: [] };
|
|
8871
|
-
}
|
|
8872
|
-
const recordEntries = [];
|
|
8873
|
-
for (const [name, entryValue] of Object.entries(value)) {
|
|
8874
|
-
recordEntries.push(this.recordEntryFromValue(name, entryValue));
|
|
8875
|
-
}
|
|
8876
|
-
return { record: recordEntries };
|
|
8877
|
-
}
|
|
8878
|
-
/**
|
|
8879
|
-
* Build a record entry from an arbitrary value
|
|
8880
|
-
*/
|
|
8881
|
-
recordEntryFromValue(name, entryValue) {
|
|
8882
|
-
if (Array.isArray(entryValue)) {
|
|
8883
|
-
const filtered = entryValue.filter((v) => v !== null && v !== void 0);
|
|
8884
|
-
if (filtered.length && filtered.every((v) => typeof v === "boolean")) {
|
|
8885
|
-
return { name, list: { boolean: filtered } };
|
|
8886
|
-
}
|
|
8887
|
-
if (filtered.length && filtered.every((v) => typeof v === "number")) {
|
|
8888
|
-
const numbers = filtered;
|
|
8889
|
-
const isIntegers = numbers.every((n) => Number.isInteger(n));
|
|
8890
|
-
return { name, list: { [isIntegers ? "integer" : "float"]: numbers } };
|
|
8891
|
-
}
|
|
8892
|
-
return { name, list: { string: entryValue.map((v) => v === null || v === void 0 ? "" : String(v)) } };
|
|
8893
|
-
}
|
|
8894
|
-
if (typeof entryValue === "boolean") {
|
|
8895
|
-
return { name, base: { boolean: entryValue } };
|
|
8896
|
-
}
|
|
8897
|
-
if (typeof entryValue === "number") {
|
|
8898
|
-
if (Number.isInteger(entryValue))
|
|
8899
|
-
return { name, base: { integer: entryValue } };
|
|
8900
|
-
return { name, base: { float: entryValue } };
|
|
8901
|
-
}
|
|
8902
|
-
if (entryValue === null || entryValue === void 0) {
|
|
8903
|
-
return { name, base: { string: "" } };
|
|
8904
|
-
}
|
|
8905
|
-
if (typeof entryValue === "object") {
|
|
8906
|
-
try {
|
|
8907
|
-
return { name, base: { string: JSON.stringify(entryValue) } };
|
|
8908
|
-
} catch {
|
|
8909
|
-
return { name, base: { string: String(entryValue) } };
|
|
8910
|
-
}
|
|
8911
|
-
}
|
|
8912
|
-
return { name, base: { string: String(entryValue) } };
|
|
9051
|
+
return { base: { [baseType]: coerceBaseValue(value, baseType) } };
|
|
8913
9052
|
}
|
|
8914
9053
|
/**
|
|
8915
9054
|
* Extract default QTI_CONTEXT values from qti-context-declaration elements
|
|
@@ -8924,15 +9063,10 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8924
9063
|
const defaultValueElement = declaration.querySelector("qti-default-value");
|
|
8925
9064
|
if (!defaultValueElement)
|
|
8926
9065
|
return;
|
|
8927
|
-
const
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
return;
|
|
8932
|
-
const baseType = valueElement.getAttribute("base-type") || "string";
|
|
8933
|
-
const textContent = valueElement.textContent?.trim() || "";
|
|
8934
|
-
defaults[fieldIdentifier] = this.coerceBaseValue(textContent, baseType);
|
|
8935
|
-
});
|
|
9066
|
+
const { value, baseTypes } = readRecordFieldValues(defaultValueElement.querySelectorAll("qti-value"));
|
|
9067
|
+
for (const [fieldIdentifier, textContent] of Object.entries(value)) {
|
|
9068
|
+
defaults[fieldIdentifier] = coerceBaseValue(textContent, baseTypes[fieldIdentifier] ?? "string");
|
|
9069
|
+
}
|
|
8936
9070
|
});
|
|
8937
9071
|
return defaults;
|
|
8938
9072
|
}
|
|
@@ -8951,7 +9085,7 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
8951
9085
|
environmentIdentifier: merged.environmentIdentifier ?? "",
|
|
8952
9086
|
...merged
|
|
8953
9087
|
};
|
|
8954
|
-
return
|
|
9088
|
+
return recordToQtiVariableJSON(normalized);
|
|
8955
9089
|
}
|
|
8956
9090
|
/**
|
|
8957
9091
|
* Collect template variables referenced by qti-template-variable children
|
|
@@ -9044,7 +9178,10 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9044
9178
|
/**
|
|
9045
9179
|
* Converts response variables to QtiVariableJSON
|
|
9046
9180
|
*/
|
|
9047
|
-
responseVariablesToQtiVariableJSON(input, cardinality, baseType) {
|
|
9181
|
+
responseVariablesToQtiVariableJSON(input, cardinality, baseType, fieldBaseTypes) {
|
|
9182
|
+
if (cardinality === "record") {
|
|
9183
|
+
return recordResponseToQtiVariableJSON(input, fieldBaseTypes);
|
|
9184
|
+
}
|
|
9048
9185
|
if (cardinality !== "single") {
|
|
9049
9186
|
const list = { list: {} };
|
|
9050
9187
|
list.list[baseType] = input;
|
|
@@ -9058,6 +9195,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9058
9195
|
#hasNonEmptyResponse() {
|
|
9059
9196
|
if (this.response === null || this.response === void 0)
|
|
9060
9197
|
return false;
|
|
9198
|
+
if (isRecordValue(this.response)) {
|
|
9199
|
+
return Object.values(this.response).some((v) => v !== "" && v !== null && v !== void 0);
|
|
9200
|
+
}
|
|
9061
9201
|
if (Array.isArray(this.response)) {
|
|
9062
9202
|
if (this.response.length === 0)
|
|
9063
9203
|
return false;
|
|
@@ -9085,6 +9225,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9085
9225
|
get value() {
|
|
9086
9226
|
if (this.#value === null || this.#value === void 0)
|
|
9087
9227
|
return null;
|
|
9228
|
+
if (isRecordValue(this.#value))
|
|
9229
|
+
return JSON.stringify(this.#value);
|
|
9088
9230
|
return Array.isArray(this.#value) ? this.#value.join(",") : String(this.#value);
|
|
9089
9231
|
}
|
|
9090
9232
|
set boundTo(newValue) {
|
|
@@ -9099,10 +9241,11 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9099
9241
|
const responseVariable = {};
|
|
9100
9242
|
const variable = this.context?.variables?.find((v) => v.identifier === this.responseIdentifier);
|
|
9101
9243
|
if (variable) {
|
|
9102
|
-
const cardinality =
|
|
9103
|
-
const baseType =
|
|
9104
|
-
const value =
|
|
9105
|
-
const
|
|
9244
|
+
const cardinality = variable.cardinality || "single";
|
|
9245
|
+
const baseType = variable.baseType || "string";
|
|
9246
|
+
const value = variable.value || null;
|
|
9247
|
+
const fieldBaseTypes = variable.fieldBaseTypes;
|
|
9248
|
+
const responseVal = this.responseVariablesToQtiVariableJSON(value, cardinality, baseType, fieldBaseTypes);
|
|
9106
9249
|
responseVariable[this.responseIdentifier] = responseVal;
|
|
9107
9250
|
}
|
|
9108
9251
|
return responseVariable;
|
|
@@ -9272,11 +9415,9 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9272
9415
|
const iframeBaseUrl = this.dataset.baseUrl ? this.dataset.baseUrl.startsWith("/") ? `${window.location.origin}${this.dataset.baseUrl}` : this.dataset.baseUrl : "";
|
|
9273
9416
|
const iframeBaseHref = iframeBaseUrl ? iframeBaseUrl.endsWith("/") ? iframeBaseUrl : `${iframeBaseUrl}/` : `${window.location.origin}/`;
|
|
9274
9417
|
const forwardConsole = this.dataset.forwardConsole === "true";
|
|
9275
|
-
const
|
|
9276
|
-
const
|
|
9277
|
-
const
|
|
9278
|
-
const componentsCdnUrl = this.dataset.componentsCdnUrl || defaultComponentsCdnUrl;
|
|
9279
|
-
const componentsCssUrl = this.dataset.componentsCssUrl || defaultComponentsCssUrl;
|
|
9418
|
+
const componentsCdnUrl = this.dataset.componentsCdnUrl;
|
|
9419
|
+
const componentsCssUrl = this.dataset.componentsCssUrl;
|
|
9420
|
+
const requireJsTag = this.requireJsUrl ? `<script src="${this.requireJsUrl}"></script>` : `<script>${inlineScriptText(require_js_default)}</script>`;
|
|
9280
9421
|
const fontStyles = `
|
|
9281
9422
|
font-family: ${parentStyles.getPropertyValue("font-family")};
|
|
9282
9423
|
font-size: ${parentStyles.getPropertyValue("font-size")};
|
|
@@ -9284,17 +9425,18 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9284
9425
|
font-weight: ${parentStyles.getPropertyValue("font-weight")};
|
|
9285
9426
|
color: ${parentStyles.getPropertyValue("color")};
|
|
9286
9427
|
`;
|
|
9428
|
+
const langHost = this.closest("[lang], [xml\\:lang]");
|
|
9429
|
+
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";
|
|
9287
9430
|
return (
|
|
9288
9431
|
/* html */
|
|
9289
9432
|
`<!DOCTYPE html>
|
|
9290
|
-
<html lang="
|
|
9433
|
+
<html lang="${iframeLang}">
|
|
9291
9434
|
<head>
|
|
9292
9435
|
<meta charset="utf-8" />
|
|
9293
9436
|
<title>QTI PCI Container</title>
|
|
9294
9437
|
<base href="${iframeBaseHref}" />
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
</script>
|
|
9438
|
+
${componentsCdnUrl ? `<script type="module">import '${componentsCdnUrl}';</script>` : ""}
|
|
9439
|
+
<style>${inlineStyleText(native_css_default)}</style>
|
|
9298
9440
|
<style>
|
|
9299
9441
|
body, html {
|
|
9300
9442
|
margin: 0;
|
|
@@ -9311,6 +9453,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9311
9453
|
}
|
|
9312
9454
|
#pci-container {
|
|
9313
9455
|
width: 100%;
|
|
9456
|
+
/* Keeps the first and last child's margins inside, so scrollHeight is the full height. */
|
|
9457
|
+
display: flow-root;
|
|
9314
9458
|
}
|
|
9315
9459
|
qti-interaction-markup {
|
|
9316
9460
|
display: block;
|
|
@@ -9318,8 +9462,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
9318
9462
|
min-height: 50px;
|
|
9319
9463
|
}
|
|
9320
9464
|
</style>
|
|
9321
|
-
|
|
9322
|
-
|
|
9465
|
+
${componentsCssUrl ? `<link href="${componentsCssUrl}" rel="stylesheet" />` : ""}
|
|
9466
|
+
${requireJsTag}
|
|
9323
9467
|
<script>
|
|
9324
9468
|
const forwardConsole = ${forwardConsole ? "true" : "false"};
|
|
9325
9469
|
if (forwardConsole) {
|
|
@@ -10064,7 +10208,8 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
10064
10208
|
let previousHeight = 0;
|
|
10065
10209
|
const notifyResize = () => {
|
|
10066
10210
|
const container = document.getElementById('pci-container');
|
|
10067
|
-
|
|
10211
|
+
// The content's own height (subpixel, rounded up) or what overflows it, e.g. an open popup.
|
|
10212
|
+
const newHeight = Math.max(Math.ceil(container.getBoundingClientRect().height), container.scrollHeight);
|
|
10068
10213
|
if (newHeight !== previousHeight) {
|
|
10069
10214
|
previousHeight = newHeight;
|
|
10070
10215
|
clearTimeout(resizeTimeout);
|
|
@@ -10234,42 +10379,42 @@ var QtiPortableCustomInteraction = class extends Interaction {
|
|
|
10234
10379
|
`;
|
|
10235
10380
|
}
|
|
10236
10381
|
};
|
|
10237
|
-
|
|
10382
|
+
__decorate25([
|
|
10238
10383
|
property23({ type: String, attribute: "module" })
|
|
10239
10384
|
], QtiPortableCustomInteraction.prototype, "module", void 0);
|
|
10240
|
-
|
|
10385
|
+
__decorate25([
|
|
10241
10386
|
property23({ type: String, attribute: "custom-interaction-type-identifier" })
|
|
10242
10387
|
], QtiPortableCustomInteraction.prototype, "customInteractionTypeIdentifier", void 0);
|
|
10243
|
-
|
|
10388
|
+
__decorate25([
|
|
10244
10389
|
property23({ type: String, attribute: "data-require-paths" })
|
|
10245
10390
|
], QtiPortableCustomInteraction.prototype, "requirePathsJson", void 0);
|
|
10246
|
-
|
|
10391
|
+
__decorate25([
|
|
10247
10392
|
property23({ type: String, attribute: "data-require-shim" })
|
|
10248
10393
|
], QtiPortableCustomInteraction.prototype, "requireShimJson", void 0);
|
|
10249
|
-
|
|
10394
|
+
__decorate25([
|
|
10250
10395
|
property23({ type: String, attribute: "data-require-js-url" })
|
|
10251
10396
|
], QtiPortableCustomInteraction.prototype, "requireJsUrl", void 0);
|
|
10252
|
-
|
|
10397
|
+
__decorate25([
|
|
10253
10398
|
property23({ type: String, attribute: "data-base-url" })
|
|
10254
10399
|
], QtiPortableCustomInteraction.prototype, "baseUrl", void 0);
|
|
10255
|
-
|
|
10400
|
+
__decorate25([
|
|
10256
10401
|
property23({ type: Boolean, attribute: "data-use-default-paths" })
|
|
10257
10402
|
], QtiPortableCustomInteraction.prototype, "useDefaultPaths", void 0);
|
|
10258
|
-
|
|
10403
|
+
__decorate25([
|
|
10259
10404
|
property23({ type: String, attribute: "data-status" })
|
|
10260
10405
|
], QtiPortableCustomInteraction.prototype, "status", void 0);
|
|
10261
|
-
|
|
10262
|
-
|
|
10406
|
+
__decorate25([
|
|
10407
|
+
state13()
|
|
10263
10408
|
], QtiPortableCustomInteraction.prototype, "_errorMessage", void 0);
|
|
10264
|
-
|
|
10409
|
+
__decorate25([
|
|
10265
10410
|
consume6({ context: itemContext, subscribe: true }),
|
|
10266
|
-
|
|
10411
|
+
state13()
|
|
10267
10412
|
], QtiPortableCustomInteraction.prototype, "context", void 0);
|
|
10268
|
-
|
|
10413
|
+
__decorate25([
|
|
10269
10414
|
consume6({ context: qtiContext, subscribe: true }),
|
|
10270
|
-
|
|
10415
|
+
state13()
|
|
10271
10416
|
], QtiPortableCustomInteraction.prototype, "qtiContext", void 0);
|
|
10272
|
-
|
|
10417
|
+
__decorate25([
|
|
10273
10418
|
property23({ attribute: "response", reflect: false, converter: responseAttributeConverter({ emptyAs: null }) })
|
|
10274
10419
|
], QtiPortableCustomInteraction.prototype, "response", void 0);
|
|
10275
10420
|
|
|
@@ -10366,7 +10511,7 @@ var QtiPositionObjectStage = class extends LitElement13 {
|
|
|
10366
10511
|
|
|
10367
10512
|
// ../interactions/select-point-interaction/dist/qti-select-point-interaction.js
|
|
10368
10513
|
import { html as html29, nothing as nothing4 } from "lit";
|
|
10369
|
-
import { property as property24, state as
|
|
10514
|
+
import { property as property24, state as state14 } from "lit/decorators.js";
|
|
10370
10515
|
import { repeat as repeat7 } from "lit/directives/repeat.js";
|
|
10371
10516
|
import { styleMap } from "lit/directives/style-map.js";
|
|
10372
10517
|
|
|
@@ -10413,7 +10558,7 @@ var qti_select_point_interaction_styles_default = [
|
|
|
10413
10558
|
];
|
|
10414
10559
|
|
|
10415
10560
|
// ../interactions/select-point-interaction/dist/qti-select-point-interaction.js
|
|
10416
|
-
var
|
|
10561
|
+
var __decorate26 = function(decorators, target, key, desc) {
|
|
10417
10562
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10418
10563
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10419
10564
|
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;
|
|
@@ -10607,19 +10752,19 @@ var QtiSelectPointInteraction = class extends Interaction {
|
|
|
10607
10752
|
}
|
|
10608
10753
|
}
|
|
10609
10754
|
};
|
|
10610
|
-
|
|
10755
|
+
__decorate26([
|
|
10611
10756
|
property24({
|
|
10612
10757
|
type: Number,
|
|
10613
10758
|
attribute: "max-choices"
|
|
10614
10759
|
})
|
|
10615
10760
|
], QtiSelectPointInteraction.prototype, "maxChoices", void 0);
|
|
10616
|
-
|
|
10761
|
+
__decorate26([
|
|
10617
10762
|
property24({
|
|
10618
10763
|
type: Number,
|
|
10619
10764
|
attribute: "min-choices"
|
|
10620
10765
|
})
|
|
10621
10766
|
], QtiSelectPointInteraction.prototype, "minChoices", void 0);
|
|
10622
|
-
|
|
10767
|
+
__decorate26([
|
|
10623
10768
|
property24({
|
|
10624
10769
|
attribute: "response",
|
|
10625
10770
|
reflect: false,
|
|
@@ -10636,13 +10781,13 @@ __decorate25([
|
|
|
10636
10781
|
}
|
|
10637
10782
|
})
|
|
10638
10783
|
], QtiSelectPointInteraction.prototype, "response", void 0);
|
|
10639
|
-
|
|
10784
|
+
__decorate26([
|
|
10640
10785
|
property24({ attribute: "area-mappings" })
|
|
10641
10786
|
], QtiSelectPointInteraction.prototype, "areaMappings", void 0);
|
|
10642
|
-
|
|
10643
|
-
|
|
10787
|
+
__decorate26([
|
|
10788
|
+
state14()
|
|
10644
10789
|
], QtiSelectPointInteraction.prototype, "_areaEntries", void 0);
|
|
10645
|
-
|
|
10790
|
+
__decorate26([
|
|
10646
10791
|
watch("areaMappings")
|
|
10647
10792
|
], QtiSelectPointInteraction.prototype, "_handleAreaMappingsChange", void 0);
|
|
10648
10793
|
|
|
@@ -10726,7 +10871,7 @@ var qti_slider_interaction_styles_default = [
|
|
|
10726
10871
|
];
|
|
10727
10872
|
|
|
10728
10873
|
// ../interactions/slider-interaction/dist/qti-slider-interaction.js
|
|
10729
|
-
var
|
|
10874
|
+
var __decorate27 = function(decorators, target, key, desc) {
|
|
10730
10875
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10731
10876
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10732
10877
|
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;
|
|
@@ -10866,19 +11011,19 @@ var QtiSliderInteraction = class extends Interaction {
|
|
|
10866
11011
|
this.dispatchEvent(new Event("change", { bubbles: true }));
|
|
10867
11012
|
}
|
|
10868
11013
|
};
|
|
10869
|
-
|
|
11014
|
+
__decorate27([
|
|
10870
11015
|
query2("#rail")
|
|
10871
11016
|
], QtiSliderInteraction.prototype, "_rail", void 0);
|
|
10872
|
-
|
|
11017
|
+
__decorate27([
|
|
10873
11018
|
property25({ type: Number, attribute: "lower-bound" })
|
|
10874
11019
|
], QtiSliderInteraction.prototype, "min", void 0);
|
|
10875
|
-
|
|
11020
|
+
__decorate27([
|
|
10876
11021
|
property25({ type: Number, attribute: "upper-bound" })
|
|
10877
11022
|
], QtiSliderInteraction.prototype, "max", void 0);
|
|
10878
|
-
|
|
11023
|
+
__decorate27([
|
|
10879
11024
|
property25({ type: Number, attribute: "step" })
|
|
10880
11025
|
], QtiSliderInteraction.prototype, "step", void 0);
|
|
10881
|
-
|
|
11026
|
+
__decorate27([
|
|
10882
11027
|
property25({ attribute: "response", reflect: false, noAccessor: true })
|
|
10883
11028
|
], QtiSliderInteraction.prototype, "response", null);
|
|
10884
11029
|
|
|
@@ -10985,7 +11130,7 @@ var qti_text_entry_interaction_styles_default = [
|
|
|
10985
11130
|
];
|
|
10986
11131
|
|
|
10987
11132
|
// ../interactions/text-entry-interaction/dist/qti-text-entry-interaction.js
|
|
10988
|
-
var
|
|
11133
|
+
var __decorate28 = function(decorators, target, key, desc) {
|
|
10989
11134
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10990
11135
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10991
11136
|
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;
|
|
@@ -11092,25 +11237,25 @@ var QtiTextEntryInteraction = class extends Interaction {
|
|
|
11092
11237
|
this.response = "";
|
|
11093
11238
|
}
|
|
11094
11239
|
};
|
|
11095
|
-
|
|
11240
|
+
__decorate28([
|
|
11096
11241
|
property26({ type: Number, attribute: "expected-length" })
|
|
11097
11242
|
], QtiTextEntryInteraction.prototype, "expectedLength", void 0);
|
|
11098
|
-
|
|
11243
|
+
__decorate28([
|
|
11099
11244
|
property26({ type: String, attribute: "pattern-mask" })
|
|
11100
11245
|
], QtiTextEntryInteraction.prototype, "patternMask", void 0);
|
|
11101
|
-
|
|
11246
|
+
__decorate28([
|
|
11102
11247
|
property26({ type: String, attribute: "placeholder-text" })
|
|
11103
11248
|
], QtiTextEntryInteraction.prototype, "placeholderText", void 0);
|
|
11104
|
-
|
|
11249
|
+
__decorate28([
|
|
11105
11250
|
property26({ type: String, attribute: "data-patternmask-message" })
|
|
11106
11251
|
], QtiTextEntryInteraction.prototype, "dataPatternmaskMessage", void 0);
|
|
11107
|
-
|
|
11252
|
+
__decorate28([
|
|
11108
11253
|
property26({ type: String, attribute: "response", reflect: false })
|
|
11109
11254
|
], QtiTextEntryInteraction.prototype, "response", void 0);
|
|
11110
|
-
|
|
11255
|
+
__decorate28([
|
|
11111
11256
|
query3("input")
|
|
11112
11257
|
], QtiTextEntryInteraction.prototype, "_input", void 0);
|
|
11113
|
-
|
|
11258
|
+
__decorate28([
|
|
11114
11259
|
watch("response", { waitUntilFirstUpdate: true })
|
|
11115
11260
|
], QtiTextEntryInteraction.prototype, "_handleValueChange", void 0);
|
|
11116
11261
|
|
|
@@ -11819,6 +11964,8 @@ export {
|
|
|
11819
11964
|
elements24 as elements14,
|
|
11820
11965
|
QtiOrderInteraction,
|
|
11821
11966
|
elements25 as elements15,
|
|
11967
|
+
inlineScriptText,
|
|
11968
|
+
inlineStyleText,
|
|
11822
11969
|
QtiPortableCustomInteraction,
|
|
11823
11970
|
elements26 as elements16,
|
|
11824
11971
|
QtiPositionObjectInteraction,
|
|
@@ -11834,4 +11981,4 @@ export {
|
|
|
11834
11981
|
elements31 as elements21,
|
|
11835
11982
|
qtiInteractionElements
|
|
11836
11983
|
};
|
|
11837
|
-
//# sourceMappingURL=chunk-
|
|
11984
|
+
//# sourceMappingURL=chunk-AHULN3UB.js.map
|