@citolab/qti-components 9.4.0 → 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +1876 -272
- package/dist/base.d.ts +10 -10
- package/dist/base.js +7 -1
- package/dist/{chunk-GNTO3IFM.js → chunk-EAQOUBXA.js} +717 -417
- package/dist/chunk-EAQOUBXA.js.map +1 -0
- package/dist/{chunk-B5XHZI2P.js → chunk-H72OXVRF.js} +2 -2
- package/dist/{chunk-B74SYQB2.js → chunk-I7ACMH74.js} +3 -3
- package/dist/{chunk-MSGYZE6L.js → chunk-LOKULHVY.js} +504 -283
- package/dist/chunk-LOKULHVY.js.map +1 -0
- package/dist/{chunk-ACRN7YJM.js → chunk-QOFGUIYE.js} +2 -2
- package/dist/{chunk-R7MMMDP7.js → chunk-QUTM5TT6.js} +56 -2
- package/dist/chunk-QUTM5TT6.js.map +1 -0
- package/dist/chunk-QVZLJY75.js +7 -0
- package/dist/chunk-QVZLJY75.js.map +1 -0
- package/dist/{chunk-BMXG7D2N.js → chunk-RV7ADJ33.js} +2 -2
- package/dist/{chunk-JHPQJDAV.js → chunk-TBJT7AGB.js} +2 -2
- package/dist/{chunk-LKHRHFXO.js → chunk-TC4257SG.js} +6 -6
- package/dist/{chunk-XEWGFAS4.js → chunk-TFQAUWCM.js} +105 -30
- package/dist/chunk-TFQAUWCM.js.map +1 -0
- package/dist/{chunk-3BAQWO5C.js → chunk-V3NKEAQY.js} +40 -4
- package/dist/chunk-V3NKEAQY.js.map +1 -0
- package/dist/{chunk-C3JPUV36.js → chunk-YS6CBO45.js} +2 -2
- package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-SsTm3ieP.d.ts} +1 -1
- package/dist/corrections.d.ts +9 -9
- package/dist/corrections.js +8 -8
- package/dist/elements.d.ts +65 -3
- package/dist/elements.js +15 -5
- package/dist/index.d.ts +11 -11
- package/dist/index.js +40 -14
- package/dist/interactions.d.ts +4 -4
- package/dist/interactions.js +7 -3
- package/dist/item.css +12 -0
- 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 +273 -213
- 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-DjWvKbfL.d.ts} +1 -1
- package/dist/{qti-test.d-Cud5Gvy0.d.ts → qti-test.d-DOWT6YNa.d.ts} +109 -12
- package/dist/{qti-text-entry-interaction.d-DKvz9ncv.d.ts → qti-text-entry-interaction.d-h5UZ8Qvp.d.ts} +34 -19
- package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
- package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-Cw8GcziG.d.ts} +1 -1
- package/dist/test.d.ts +7 -7
- package/dist/test.js +11 -5
- package/package.json +6 -6
- package/dist/chunk-3BAQWO5C.js.map +0 -1
- package/dist/chunk-A32YH4H5.js +0 -7
- package/dist/chunk-A32YH4H5.js.map +0 -1
- package/dist/chunk-GNTO3IFM.js.map +0 -1
- package/dist/chunk-MSGYZE6L.js.map +0 -1
- package/dist/chunk-R7MMMDP7.js.map +0 -1
- package/dist/chunk-XEWGFAS4.js.map +0 -1
- /package/dist/{chunk-B5XHZI2P.js.map → chunk-H72OXVRF.js.map} +0 -0
- /package/dist/{chunk-B74SYQB2.js.map → chunk-I7ACMH74.js.map} +0 -0
- /package/dist/{chunk-ACRN7YJM.js.map → chunk-QOFGUIYE.js.map} +0 -0
- /package/dist/{chunk-BMXG7D2N.js.map → chunk-RV7ADJ33.js.map} +0 -0
- /package/dist/{chunk-JHPQJDAV.js.map → chunk-TBJT7AGB.js.map} +0 -0
- /package/dist/{chunk-LKHRHFXO.js.map → chunk-TC4257SG.js.map} +0 -0
- /package/dist/{chunk-C3JPUV36.js.map → chunk-YS6CBO45.js.map} +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
QtiModalFeedback
|
|
3
|
-
|
|
2
|
+
QtiModalFeedback,
|
|
3
|
+
dispatchDeclared,
|
|
4
|
+
listenDeclared,
|
|
5
|
+
listenPublic
|
|
6
|
+
} from "./chunk-TFQAUWCM.js";
|
|
4
7
|
import {
|
|
5
8
|
item_css_default
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QVZLJY75.js";
|
|
7
10
|
import {
|
|
8
11
|
watch
|
|
9
12
|
} from "./chunk-4DB4SC5K.js";
|
|
@@ -21,7 +24,7 @@ import {
|
|
|
21
24
|
qtiContext,
|
|
22
25
|
sessionContext,
|
|
23
26
|
testContext
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-QUTM5TT6.js";
|
|
25
28
|
|
|
26
29
|
// ../qti-test/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js
|
|
27
30
|
import { LitElement, nothing as nothing2 } from "lit";
|
|
@@ -633,18 +636,18 @@ var EvalAstFactory = class {
|
|
|
633
636
|
}
|
|
634
637
|
const value = this.right.evaluate(scope);
|
|
635
638
|
let receiver = void 0;
|
|
636
|
-
let
|
|
639
|
+
let property22;
|
|
637
640
|
if (this.left.type === "Getter") {
|
|
638
641
|
receiver = this.left.receiver.evaluate(scope);
|
|
639
|
-
|
|
642
|
+
property22 = this.left.name;
|
|
640
643
|
} else if (this.left.type === "Index") {
|
|
641
644
|
receiver = this.left.receiver.evaluate(scope);
|
|
642
|
-
|
|
645
|
+
property22 = this.left.argument.evaluate(scope);
|
|
643
646
|
} else if (this.left.type === "ID") {
|
|
644
647
|
receiver = scope;
|
|
645
|
-
|
|
648
|
+
property22 = this.left.value;
|
|
646
649
|
}
|
|
647
|
-
return receiver === void 0 ? void 0 : receiver[
|
|
650
|
+
return receiver === void 0 ? void 0 : receiver[property22] = value;
|
|
648
651
|
}
|
|
649
652
|
return f(this.left.evaluate(scope), this.right.evaluate(scope));
|
|
650
653
|
},
|
|
@@ -1100,6 +1103,33 @@ var makeLitTemplate = (template) => {
|
|
|
1100
1103
|
import { createContext } from "@lit/context";
|
|
1101
1104
|
var testHostContext = createContext(/* @__PURE__ */ Symbol("testHost"));
|
|
1102
1105
|
|
|
1106
|
+
// ../qti-test/dist/public-events.js
|
|
1107
|
+
var PUBLIC_EVENTS = {
|
|
1108
|
+
"cito-test-navigate": { kind: "request", scope: "test", deprecated: "qti-request-navigation" },
|
|
1109
|
+
"cito-test-end-attempt": { kind: "request", scope: "test", deprecated: "test-end-attempt" },
|
|
1110
|
+
"cito-test-update-outcome": { kind: "request", scope: "test", deprecated: "test-update-outcome-variable" },
|
|
1111
|
+
"cito-test-switch-view": { kind: "request", scope: "test", deprecated: "on-test-switch-view" },
|
|
1112
|
+
"cito-test-navigated": { kind: "notification", scope: "test" },
|
|
1113
|
+
"cito-test-navigation-started": {
|
|
1114
|
+
kind: "notification",
|
|
1115
|
+
scope: "test",
|
|
1116
|
+
deprecated: "qti-navigation-loading-started"
|
|
1117
|
+
},
|
|
1118
|
+
"cito-test-navigation-failed": { kind: "notification", scope: "test", deprecated: "qti-navigation-error" },
|
|
1119
|
+
"cito-test-rendered": { kind: "notification", scope: "test", deprecated: "qti-test-loaded" },
|
|
1120
|
+
"cito-test-loaded": { kind: "notification", scope: "test", deprecated: "qti-assessment-test-connected" },
|
|
1121
|
+
"cito-test-state-changed": { kind: "notification", scope: "test", deprecated: "qti-state-changed" },
|
|
1122
|
+
"cito-test-items-skipped": { kind: "notification", scope: "test" },
|
|
1123
|
+
"cito-test-end-reached": { kind: "notification", scope: "test" },
|
|
1124
|
+
"cito-item-ref-connected": { kind: "notification", scope: "item", deprecated: "qti-assessment-item-ref-connected" }
|
|
1125
|
+
};
|
|
1126
|
+
function dispatchPublic(target, name, detail) {
|
|
1127
|
+
dispatchDeclared(target, PUBLIC_EVENTS, name, detail);
|
|
1128
|
+
}
|
|
1129
|
+
function listenPublic2(target, name, handler) {
|
|
1130
|
+
listenDeclared(target, PUBLIC_EVENTS, name, handler);
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1103
1133
|
// ../qti-test/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js
|
|
1104
1134
|
var __decorate = function(decorators, target, key, desc) {
|
|
1105
1135
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1161,11 +1191,11 @@ var QtiAssessmentItemRef = class extends LitElement {
|
|
|
1161
1191
|
this.myTemplate = templateElement ? prepareTemplate(templateElement) : null;
|
|
1162
1192
|
this.requestUpdate();
|
|
1163
1193
|
await this.updateComplete;
|
|
1164
|
-
this
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
})
|
|
1194
|
+
dispatchPublic(this, "cito-item-ref-connected", {
|
|
1195
|
+
identifier: this.identifier,
|
|
1196
|
+
href: this.href,
|
|
1197
|
+
category: this.category
|
|
1198
|
+
});
|
|
1169
1199
|
}
|
|
1170
1200
|
#computedItem() {
|
|
1171
1201
|
for (const testPart of this.computedContext?.testParts ?? []) {
|
|
@@ -1326,11 +1356,7 @@ var QtiAssessmentTest = class extends LitElement3 {
|
|
|
1326
1356
|
async connectedCallback() {
|
|
1327
1357
|
super.connectedCallback();
|
|
1328
1358
|
await this.updateComplete;
|
|
1329
|
-
this
|
|
1330
|
-
detail: this,
|
|
1331
|
-
bubbles: true,
|
|
1332
|
-
composed: true
|
|
1333
|
-
}));
|
|
1359
|
+
dispatchPublic(this, "cito-test-loaded", this);
|
|
1334
1360
|
}
|
|
1335
1361
|
render() {
|
|
1336
1362
|
return html2` <slot></slot>`;
|
|
@@ -1346,15 +1372,75 @@ __decorate3([
|
|
|
1346
1372
|
consume3({ context: testContext, subscribe: true })
|
|
1347
1373
|
], QtiAssessmentTest.prototype, "_testContext", void 0);
|
|
1348
1374
|
|
|
1349
|
-
// ../qti-test/dist/components/qti-
|
|
1350
|
-
import { html as html3, LitElement as LitElement4 } from "lit";
|
|
1375
|
+
// ../qti-test/dist/components/qti-branch-rule/qti-branch-rule.js
|
|
1376
|
+
import { css, html as html3, LitElement as LitElement4 } from "lit";
|
|
1351
1377
|
import { property as property4 } from "lit/decorators.js";
|
|
1378
|
+
|
|
1379
|
+
// ../qti-test/dist/internal/evaluate-condition.js
|
|
1380
|
+
function evaluateBooleanChild(element, onError) {
|
|
1381
|
+
const expression = element.firstElementChild;
|
|
1382
|
+
if (!expression || typeof expression.calculate !== "function") {
|
|
1383
|
+
console.warn(`<${element.localName}> has no evaluable expression child`, element);
|
|
1384
|
+
return onError;
|
|
1385
|
+
}
|
|
1386
|
+
try {
|
|
1387
|
+
const result = expression.calculate();
|
|
1388
|
+
return result === true || result === "true";
|
|
1389
|
+
} catch (error) {
|
|
1390
|
+
console.warn(`<${element.localName}> could not evaluate its expression`, error);
|
|
1391
|
+
return onError;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
// ../qti-test/dist/components/qti-branch-rule/qti-branch-rule.js
|
|
1352
1396
|
var __decorate4 = function(decorators, target, key, desc) {
|
|
1353
1397
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1354
1398
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1355
1399
|
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;
|
|
1356
1400
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1357
1401
|
};
|
|
1402
|
+
var QtiBranchRule = class extends LitElement4 {
|
|
1403
|
+
constructor() {
|
|
1404
|
+
super(...arguments);
|
|
1405
|
+
this.target = "";
|
|
1406
|
+
}
|
|
1407
|
+
static {
|
|
1408
|
+
this.EXIT_SECTION = "EXIT_SECTION";
|
|
1409
|
+
}
|
|
1410
|
+
static {
|
|
1411
|
+
this.EXIT_TESTPART = "EXIT_TESTPART";
|
|
1412
|
+
}
|
|
1413
|
+
static {
|
|
1414
|
+
this.EXIT_TEST = "EXIT_TEST";
|
|
1415
|
+
}
|
|
1416
|
+
static {
|
|
1417
|
+
this.styles = css`
|
|
1418
|
+
:host {
|
|
1419
|
+
display: none;
|
|
1420
|
+
}
|
|
1421
|
+
`;
|
|
1422
|
+
}
|
|
1423
|
+
/** `true` when the test should jump to `target`. */
|
|
1424
|
+
evaluate() {
|
|
1425
|
+
return evaluateBooleanChild(this, false);
|
|
1426
|
+
}
|
|
1427
|
+
render() {
|
|
1428
|
+
return html3`<slot></slot>`;
|
|
1429
|
+
}
|
|
1430
|
+
};
|
|
1431
|
+
__decorate4([
|
|
1432
|
+
property4({ type: String })
|
|
1433
|
+
], QtiBranchRule.prototype, "target", void 0);
|
|
1434
|
+
|
|
1435
|
+
// ../qti-test/dist/components/qti-item-session-control/qti-item-session-control.js
|
|
1436
|
+
import { html as html4, LitElement as LitElement5 } from "lit";
|
|
1437
|
+
import { property as property5 } from "lit/decorators.js";
|
|
1438
|
+
var __decorate5 = function(decorators, target, key, desc) {
|
|
1439
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1440
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1441
|
+
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;
|
|
1442
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1443
|
+
};
|
|
1358
1444
|
var stringToBooleanConverter3 = {
|
|
1359
1445
|
fromAttribute(value) {
|
|
1360
1446
|
return value === "true";
|
|
@@ -1363,7 +1449,7 @@ var stringToBooleanConverter3 = {
|
|
|
1363
1449
|
return value ? "true" : "false";
|
|
1364
1450
|
}
|
|
1365
1451
|
};
|
|
1366
|
-
var QtiItemSessionControl = class extends
|
|
1452
|
+
var QtiItemSessionControl = class extends LitElement5 {
|
|
1367
1453
|
constructor() {
|
|
1368
1454
|
super(...arguments);
|
|
1369
1455
|
this.maxAttempts = 1;
|
|
@@ -1384,31 +1470,34 @@ var QtiItemSessionControl = class extends LitElement4 {
|
|
|
1384
1470
|
}));
|
|
1385
1471
|
}
|
|
1386
1472
|
render() {
|
|
1387
|
-
return
|
|
1473
|
+
return html4`<slot></slot>`;
|
|
1388
1474
|
}
|
|
1389
1475
|
};
|
|
1390
|
-
|
|
1391
|
-
|
|
1476
|
+
__decorate5([
|
|
1477
|
+
property5({ type: Number, attribute: "max-attempts" })
|
|
1392
1478
|
], QtiItemSessionControl.prototype, "maxAttempts", void 0);
|
|
1393
|
-
|
|
1394
|
-
|
|
1479
|
+
__decorate5([
|
|
1480
|
+
property5({ type: Boolean, converter: stringToBooleanConverter3, attribute: "show-feedback" })
|
|
1395
1481
|
], QtiItemSessionControl.prototype, "showFeedback", void 0);
|
|
1396
|
-
|
|
1397
|
-
|
|
1482
|
+
__decorate5([
|
|
1483
|
+
property5({ type: Boolean, converter: stringToBooleanConverter3, attribute: "allow-review" })
|
|
1398
1484
|
], QtiItemSessionControl.prototype, "allowReview", void 0);
|
|
1399
|
-
|
|
1400
|
-
|
|
1485
|
+
__decorate5([
|
|
1486
|
+
property5({ type: Boolean, converter: stringToBooleanConverter3, attribute: "show-solution" })
|
|
1401
1487
|
], QtiItemSessionControl.prototype, "showSolution", void 0);
|
|
1402
|
-
|
|
1403
|
-
|
|
1488
|
+
__decorate5([
|
|
1489
|
+
property5({ type: Boolean, converter: stringToBooleanConverter3, attribute: "allow-comment" })
|
|
1404
1490
|
], QtiItemSessionControl.prototype, "allowComment", void 0);
|
|
1405
|
-
|
|
1406
|
-
|
|
1491
|
+
__decorate5([
|
|
1492
|
+
property5({ type: Boolean, converter: stringToBooleanConverter3, attribute: "allow-skipping" })
|
|
1407
1493
|
], QtiItemSessionControl.prototype, "allowSkipping", void 0);
|
|
1408
|
-
|
|
1409
|
-
|
|
1494
|
+
__decorate5([
|
|
1495
|
+
property5({ type: Boolean, converter: stringToBooleanConverter3, attribute: "validate-responses" })
|
|
1410
1496
|
], QtiItemSessionControl.prototype, "validateResponses", void 0);
|
|
1411
1497
|
|
|
1498
|
+
// ../qti-test/dist/components/qti-number-presented/qti-number-presented.js
|
|
1499
|
+
import { consume as consume4 } from "@lit/context";
|
|
1500
|
+
|
|
1412
1501
|
// ../qti-test/dist/internal/item-ref-selection.js
|
|
1413
1502
|
var categoryList = (value) => value?.split(/\s+/).filter(Boolean) ?? [];
|
|
1414
1503
|
var selectionFrom = (element) => ({
|
|
@@ -1434,12 +1523,49 @@ var selectItemRefs = (testElement, { sectionIdentifier, includeCategories, exclu
|
|
|
1434
1523
|
});
|
|
1435
1524
|
};
|
|
1436
1525
|
|
|
1526
|
+
// ../qti-test/dist/components/qti-number-presented/qti-number-presented.js
|
|
1527
|
+
var __decorate6 = function(decorators, target, key, desc) {
|
|
1528
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1529
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1530
|
+
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;
|
|
1531
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1532
|
+
};
|
|
1533
|
+
var QtiNumberPresented = class extends QtiExpression {
|
|
1534
|
+
#connectedTest = null;
|
|
1535
|
+
constructor() {
|
|
1536
|
+
super();
|
|
1537
|
+
listenPublic2(this, "cito-test-loaded", (e) => this.#connectedTest = e.detail);
|
|
1538
|
+
}
|
|
1539
|
+
/** The test this expression is in: handed over by a test harness, or found up the tree in a real document. */
|
|
1540
|
+
get #testElement() {
|
|
1541
|
+
return this.#connectedTest ?? this.closest("qti-assessment-test");
|
|
1542
|
+
}
|
|
1543
|
+
getResult() {
|
|
1544
|
+
const testElement = this.#testElement;
|
|
1545
|
+
if (!testElement) {
|
|
1546
|
+
console.warn("qti-number-presented: no enclosing qti-assessment-test, nothing to count");
|
|
1547
|
+
return 0;
|
|
1548
|
+
}
|
|
1549
|
+
const presented = new Set((this._testContext?.items ?? []).filter((item) => {
|
|
1550
|
+
const status = item.variables?.find((v) => v.identifier === "completionStatus")?.value;
|
|
1551
|
+
return status != null && status !== "not_attempted";
|
|
1552
|
+
}).map((item) => item.identifier));
|
|
1553
|
+
return selectItemRefs(testElement, selectionFrom(this)).filter((itemRef) => presented.has(itemRef.identifier)).length;
|
|
1554
|
+
}
|
|
1555
|
+
calculate() {
|
|
1556
|
+
return this.getResult();
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
__decorate6([
|
|
1560
|
+
consume4({ context: testContext, subscribe: true })
|
|
1561
|
+
], QtiNumberPresented.prototype, "_testContext", void 0);
|
|
1562
|
+
|
|
1437
1563
|
// ../qti-test/dist/components/qti-number-selected/qti-number-selected.js
|
|
1438
1564
|
var QtiNumberSelected = class extends QtiExpression {
|
|
1439
1565
|
#connectedTest = null;
|
|
1440
1566
|
constructor() {
|
|
1441
1567
|
super();
|
|
1442
|
-
this
|
|
1568
|
+
listenPublic2(this, "cito-test-loaded", (e) => this.#connectedTest = e.detail);
|
|
1443
1569
|
}
|
|
1444
1570
|
/**
|
|
1445
1571
|
* `qti-assessment-test-connected` bubbles *up* from the test element, and this
|
|
@@ -1463,12 +1589,31 @@ var QtiNumberSelected = class extends QtiExpression {
|
|
|
1463
1589
|
}
|
|
1464
1590
|
};
|
|
1465
1591
|
|
|
1592
|
+
// ../qti-test/dist/components/qti-pre-condition/qti-pre-condition.js
|
|
1593
|
+
import { css as css2, html as html5, LitElement as LitElement6 } from "lit";
|
|
1594
|
+
var QtiPreCondition = class extends LitElement6 {
|
|
1595
|
+
static {
|
|
1596
|
+
this.styles = css2`
|
|
1597
|
+
:host {
|
|
1598
|
+
display: none;
|
|
1599
|
+
}
|
|
1600
|
+
`;
|
|
1601
|
+
}
|
|
1602
|
+
/** `true` when the parent may be presented. */
|
|
1603
|
+
evaluate() {
|
|
1604
|
+
return evaluateBooleanChild(this, true);
|
|
1605
|
+
}
|
|
1606
|
+
render() {
|
|
1607
|
+
return html5`<slot></slot>`;
|
|
1608
|
+
}
|
|
1609
|
+
};
|
|
1610
|
+
|
|
1466
1611
|
// ../qti-test/dist/components/qti-outcome-processing/qti-outcome-processing.js
|
|
1467
|
-
import { css, html as
|
|
1468
|
-
var QtiOutcomeProcessing = class extends
|
|
1612
|
+
import { css as css3, html as html6, LitElement as LitElement7 } from "lit";
|
|
1613
|
+
var QtiOutcomeProcessing = class extends LitElement7 {
|
|
1469
1614
|
static {
|
|
1470
1615
|
this.styles = [
|
|
1471
|
-
|
|
1616
|
+
css3`
|
|
1472
1617
|
:host {
|
|
1473
1618
|
display: none;
|
|
1474
1619
|
}
|
|
@@ -1476,7 +1621,7 @@ var QtiOutcomeProcessing = class extends LitElement5 {
|
|
|
1476
1621
|
];
|
|
1477
1622
|
}
|
|
1478
1623
|
render() {
|
|
1479
|
-
return
|
|
1624
|
+
return html6`<slot></slot>`;
|
|
1480
1625
|
}
|
|
1481
1626
|
process() {
|
|
1482
1627
|
const logic = new QtiOutcomeProcessingProcessor();
|
|
@@ -1498,30 +1643,52 @@ var QtiOutcomeProcessingProcessor = class {
|
|
|
1498
1643
|
};
|
|
1499
1644
|
|
|
1500
1645
|
// ../qti-test/dist/components/qti-test-feedback/qti-test-feedback.js
|
|
1501
|
-
import { css as
|
|
1646
|
+
import { css as css4, html as html7 } from "lit";
|
|
1647
|
+
import { property as property6 } from "lit/decorators.js";
|
|
1648
|
+
var __decorate7 = function(decorators, target, key, desc) {
|
|
1649
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1650
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1651
|
+
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;
|
|
1652
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1653
|
+
};
|
|
1502
1654
|
var QtiTestFeedback = class extends QtiModalFeedback {
|
|
1655
|
+
constructor() {
|
|
1656
|
+
super(...arguments);
|
|
1657
|
+
this.access = "atEnd";
|
|
1658
|
+
}
|
|
1503
1659
|
static {
|
|
1504
|
-
this.styles =
|
|
1660
|
+
this.styles = css4`
|
|
1505
1661
|
:host {
|
|
1506
1662
|
color: gray;
|
|
1507
1663
|
}
|
|
1508
1664
|
`;
|
|
1509
1665
|
}
|
|
1666
|
+
/**
|
|
1667
|
+
* Whether this feedback applies for a value of its `outcome-identifier`: with `show-hide="show"`
|
|
1668
|
+
* when the value is (or, for a container, holds) its `identifier`; with `hide` when it is not.
|
|
1669
|
+
*/
|
|
1670
|
+
matches(value) {
|
|
1671
|
+
const found = Array.isArray(value) ? value.includes(this.identifier) : value != null && value === this.identifier;
|
|
1672
|
+
return this.showHide === "hide" ? !found : found;
|
|
1673
|
+
}
|
|
1510
1674
|
render() {
|
|
1511
|
-
return
|
|
1675
|
+
return html7``;
|
|
1512
1676
|
}
|
|
1513
1677
|
};
|
|
1678
|
+
__decorate7([
|
|
1679
|
+
property6({ type: String })
|
|
1680
|
+
], QtiTestFeedback.prototype, "access", void 0);
|
|
1514
1681
|
|
|
1515
1682
|
// ../qti-test/dist/components/qti-test-part/qti-test-part.js
|
|
1516
|
-
import { html as
|
|
1517
|
-
import { property as
|
|
1518
|
-
var
|
|
1683
|
+
import { html as html8, LitElement as LitElement8 } from "lit";
|
|
1684
|
+
import { property as property7 } from "lit/decorators.js";
|
|
1685
|
+
var __decorate8 = function(decorators, target, key, desc) {
|
|
1519
1686
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1520
1687
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1521
1688
|
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;
|
|
1522
1689
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1523
1690
|
};
|
|
1524
|
-
var QtiTestPart = class extends
|
|
1691
|
+
var QtiTestPart = class extends LitElement8 {
|
|
1525
1692
|
constructor() {
|
|
1526
1693
|
super(...arguments);
|
|
1527
1694
|
this.identifier = "";
|
|
@@ -1548,25 +1715,25 @@ var QtiTestPart = class extends LitElement6 {
|
|
|
1548
1715
|
}));
|
|
1549
1716
|
}
|
|
1550
1717
|
render() {
|
|
1551
|
-
return
|
|
1718
|
+
return html8` <slot></slot>`;
|
|
1552
1719
|
}
|
|
1553
1720
|
};
|
|
1554
|
-
|
|
1555
|
-
|
|
1721
|
+
__decorate8([
|
|
1722
|
+
property7({ type: String })
|
|
1556
1723
|
], QtiTestPart.prototype, "identifier", void 0);
|
|
1557
|
-
|
|
1558
|
-
|
|
1724
|
+
__decorate8([
|
|
1725
|
+
property7({ type: String })
|
|
1559
1726
|
], QtiTestPart.prototype, "class", void 0);
|
|
1560
|
-
|
|
1561
|
-
|
|
1727
|
+
__decorate8([
|
|
1728
|
+
property7({ type: String, attribute: "navigation-mode" })
|
|
1562
1729
|
], QtiTestPart.prototype, "navigationMode", void 0);
|
|
1563
|
-
|
|
1564
|
-
|
|
1730
|
+
__decorate8([
|
|
1731
|
+
property7({ type: String, attribute: "submission-mode" })
|
|
1565
1732
|
], QtiTestPart.prototype, "submissionMode", void 0);
|
|
1566
1733
|
|
|
1567
1734
|
// ../qti-test/dist/components/qti-test-variables/qti-test-variables.js
|
|
1568
|
-
import { consume as
|
|
1569
|
-
var
|
|
1735
|
+
import { consume as consume5 } from "@lit/context";
|
|
1736
|
+
var __decorate9 = function(decorators, target, key, desc) {
|
|
1570
1737
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1571
1738
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1572
1739
|
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;
|
|
@@ -1576,7 +1743,7 @@ var QtiTestVariables = class extends QtiExpression {
|
|
|
1576
1743
|
#connectedTest = null;
|
|
1577
1744
|
constructor() {
|
|
1578
1745
|
super();
|
|
1579
|
-
this
|
|
1746
|
+
listenPublic2(this, "cito-test-loaded", (e) => this.#connectedTest = e.detail);
|
|
1580
1747
|
}
|
|
1581
1748
|
/**
|
|
1582
1749
|
* `qti-assessment-test-connected` bubbles *up* from the test element, and this
|
|
@@ -1607,8 +1774,8 @@ var QtiTestVariables = class extends QtiExpression {
|
|
|
1607
1774
|
return this.getResult();
|
|
1608
1775
|
}
|
|
1609
1776
|
};
|
|
1610
|
-
|
|
1611
|
-
|
|
1777
|
+
__decorate9([
|
|
1778
|
+
consume5({ context: testContext, subscribe: true })
|
|
1612
1779
|
], QtiTestVariables.prototype, "_testContext", void 0);
|
|
1613
1780
|
var QtiTestVariablesExpression = class {
|
|
1614
1781
|
constructor(testContext2, itemVariable, includedItems) {
|
|
@@ -1641,12 +1808,104 @@ var QTI_TEST_STATE_VERSION = 1;
|
|
|
1641
1808
|
|
|
1642
1809
|
// ../qti-test/dist/components/qti-test/qti-test.js
|
|
1643
1810
|
import { ContextProvider, provide as provide2 } from "@lit/context";
|
|
1644
|
-
import { html as
|
|
1811
|
+
import { html as html9, LitElement as LitElement10 } from "lit";
|
|
1645
1812
|
import { state as state2 } from "lit/decorators.js";
|
|
1646
1813
|
|
|
1647
1814
|
// ../qti-test/dist/mixins/test-navigation.mixin.js
|
|
1648
|
-
import { property as
|
|
1649
|
-
|
|
1815
|
+
import { property as property8 } from "lit/decorators.js";
|
|
1816
|
+
|
|
1817
|
+
// ../qti-test/dist/internal/item-sequencing.js
|
|
1818
|
+
var SECTION = "qti-assessment-section";
|
|
1819
|
+
var TEST_PART = "qti-test-part";
|
|
1820
|
+
var idOf = (ref) => ref.identifier || ref.getAttribute("identifier") || "";
|
|
1821
|
+
function resolveNextItem(refs, current) {
|
|
1822
|
+
const from = refs[current];
|
|
1823
|
+
let start = current + 1;
|
|
1824
|
+
const rule = firstFiringBranchRule(from, refs, current);
|
|
1825
|
+
if (rule) {
|
|
1826
|
+
const target = branchTargetIndex(rule, refs, current);
|
|
1827
|
+
if (target === null)
|
|
1828
|
+
return { id: null, skipped: refs.slice(current + 1).map(idOf) };
|
|
1829
|
+
if (target > current)
|
|
1830
|
+
start = target;
|
|
1831
|
+
else
|
|
1832
|
+
console.warn(`qti-branch-rule target "${rule.target}" is not ahead of "${idOf(from)}", ignored`);
|
|
1833
|
+
}
|
|
1834
|
+
const skipped = refs.slice(current + 1, start).map(idOf);
|
|
1835
|
+
for (let i = start; i < refs.length; i++) {
|
|
1836
|
+
if (preConditionsPass(refs[i], from))
|
|
1837
|
+
return { id: idOf(refs[i]), skipped };
|
|
1838
|
+
skipped.push(idOf(refs[i]));
|
|
1839
|
+
}
|
|
1840
|
+
return { id: null, skipped };
|
|
1841
|
+
}
|
|
1842
|
+
function resolveFirstItem(refs) {
|
|
1843
|
+
const skipped = [];
|
|
1844
|
+
for (const ref of refs) {
|
|
1845
|
+
if (preConditionsPass(ref, null))
|
|
1846
|
+
return { id: idOf(ref), skipped };
|
|
1847
|
+
skipped.push(idOf(ref));
|
|
1848
|
+
}
|
|
1849
|
+
return { id: null, skipped };
|
|
1850
|
+
}
|
|
1851
|
+
function firstFiringBranchRule(itemRef, refs, current) {
|
|
1852
|
+
const owners = [itemRef];
|
|
1853
|
+
for (let el = itemRef.parentElement; el && (el.localName === SECTION || el.localName === TEST_PART); el = el.parentElement) {
|
|
1854
|
+
if (el.contains(refs[current + 1] ?? null))
|
|
1855
|
+
break;
|
|
1856
|
+
owners.push(el);
|
|
1857
|
+
}
|
|
1858
|
+
for (const owner of owners) {
|
|
1859
|
+
for (const rule of owner.querySelectorAll(":scope > qti-branch-rule")) {
|
|
1860
|
+
if (rule.evaluate?.())
|
|
1861
|
+
return rule;
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
return null;
|
|
1865
|
+
}
|
|
1866
|
+
function branchTargetIndex(rule, refs, current) {
|
|
1867
|
+
const owner = rule.parentElement;
|
|
1868
|
+
const firstAfter = (container) => {
|
|
1869
|
+
if (!container)
|
|
1870
|
+
return null;
|
|
1871
|
+
const last = refs.findLastIndex((ref) => container.contains(ref));
|
|
1872
|
+
return last + 1 < refs.length ? last + 1 : null;
|
|
1873
|
+
};
|
|
1874
|
+
switch (rule.target) {
|
|
1875
|
+
case QtiBranchRule.EXIT_TEST:
|
|
1876
|
+
return null;
|
|
1877
|
+
case QtiBranchRule.EXIT_TESTPART:
|
|
1878
|
+
return firstAfter(owner.closest(TEST_PART));
|
|
1879
|
+
case QtiBranchRule.EXIT_SECTION: {
|
|
1880
|
+
const section = owner.localName === SECTION ? owner : owner.closest(SECTION);
|
|
1881
|
+
return firstAfter(section ?? owner);
|
|
1882
|
+
}
|
|
1883
|
+
default: {
|
|
1884
|
+
const byRef = refs.findIndex((ref) => idOf(ref) === rule.target);
|
|
1885
|
+
if (byRef >= 0)
|
|
1886
|
+
return byRef;
|
|
1887
|
+
const container = [
|
|
1888
|
+
...owner.closest("qti-assessment-test")?.querySelectorAll(`${SECTION}, ${TEST_PART}`) ?? []
|
|
1889
|
+
].find((el) => el.getAttribute("identifier") === rule.target);
|
|
1890
|
+
const inside = container ? refs.findIndex((ref) => container.contains(ref)) : -1;
|
|
1891
|
+
if (inside >= 0)
|
|
1892
|
+
return inside;
|
|
1893
|
+
console.warn(`qti-branch-rule target "${rule.target}" not found`);
|
|
1894
|
+
return current + 1;
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
function preConditionsPass(itemRef, from) {
|
|
1899
|
+
const owners = [itemRef];
|
|
1900
|
+
for (let el = itemRef.parentElement; el && (el.localName === SECTION || el.localName === TEST_PART); el = el.parentElement) {
|
|
1901
|
+
if (!from || !el.contains(from))
|
|
1902
|
+
owners.push(el);
|
|
1903
|
+
}
|
|
1904
|
+
return owners.every((owner) => [...owner.querySelectorAll(":scope > qti-pre-condition")].every((condition) => condition.evaluate?.() ?? true));
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
// ../qti-test/dist/mixins/test-navigation.mixin.js
|
|
1908
|
+
var __decorate10 = function(decorators, target, key, desc) {
|
|
1650
1909
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1651
1910
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1652
1911
|
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;
|
|
@@ -1685,19 +1944,15 @@ var TestNavigationMixin = (superClass) => {
|
|
|
1685
1944
|
navigateTo(type, id) {
|
|
1686
1945
|
const targetId = id || this._getDefaultNavigationId(type);
|
|
1687
1946
|
if (targetId) {
|
|
1688
|
-
this
|
|
1689
|
-
detail: { type, id: targetId },
|
|
1690
|
-
bubbles: true,
|
|
1691
|
-
composed: true
|
|
1692
|
-
}));
|
|
1947
|
+
dispatchPublic(this, "cito-test-navigate", { type, id: targetId });
|
|
1693
1948
|
}
|
|
1694
1949
|
}
|
|
1695
1950
|
// ===========================================
|
|
1696
1951
|
// EVENT HANDLER SETUP
|
|
1697
1952
|
// ===========================================
|
|
1698
1953
|
_bindEventHandlers() {
|
|
1699
|
-
this
|
|
1700
|
-
this
|
|
1954
|
+
listenPublic2(this, "cito-test-navigate", this._handleNavigationRequest.bind(this));
|
|
1955
|
+
listenPublic2(this, "cito-test-loaded", this._handleTestConnected.bind(this));
|
|
1701
1956
|
this.addEventListener("qti-assessment-item-connected", this._handleItemConnected.bind(this));
|
|
1702
1957
|
this.addEventListener("qti-assessment-stimulus-ref-connected", this._handleStimulusRefConnected.bind(this));
|
|
1703
1958
|
}
|
|
@@ -1768,7 +2023,20 @@ var TestNavigationMixin = (superClass) => {
|
|
|
1768
2023
|
_initializeNavigation() {
|
|
1769
2024
|
if (!this.navigate)
|
|
1770
2025
|
return;
|
|
1771
|
-
|
|
2026
|
+
let id = this._getDefaultNavigationId(this.navigate);
|
|
2027
|
+
if (this.navigate === "item" && this._testElement && !this.sessionContext?.navItemRefId) {
|
|
2028
|
+
const refs = [...this._testElement.querySelectorAll("qti-assessment-item-ref")];
|
|
2029
|
+
if (refs[0]?.closest("qti-test-part")?.getAttribute("navigation-mode") === "linear") {
|
|
2030
|
+
const first = resolveFirstItem(refs);
|
|
2031
|
+
if (first.skipped.length)
|
|
2032
|
+
dispatchPublic(this, "cito-test-items-skipped", { ids: first.skipped });
|
|
2033
|
+
if (first.id === null) {
|
|
2034
|
+
dispatchPublic(this, "cito-test-end-reached", {});
|
|
2035
|
+
return;
|
|
2036
|
+
}
|
|
2037
|
+
id = first.id;
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
1772
2040
|
if (id) {
|
|
1773
2041
|
this.navigateTo(this.navigate, id);
|
|
1774
2042
|
}
|
|
@@ -1797,13 +2065,43 @@ var TestNavigationMixin = (superClass) => {
|
|
|
1797
2065
|
}
|
|
1798
2066
|
return true;
|
|
1799
2067
|
}
|
|
2068
|
+
/**
|
|
2069
|
+
* A "next" step in a linear test part (a request for item i+1 while item i is active) goes
|
|
2070
|
+
* through the branch rules and pre-conditions. Deep links, item links and nonlinear parts are
|
|
2071
|
+
* left alone: the spec ignores both in nonlinear mode.
|
|
2072
|
+
*
|
|
2073
|
+
* @returns the item to present instead, `null` when the test has no eligible item left, or
|
|
2074
|
+
* `undefined` when the request is not a "next" step.
|
|
2075
|
+
*/
|
|
2076
|
+
_resolveLinearNext(type, id) {
|
|
2077
|
+
if (type !== "item" || !this._testElement)
|
|
2078
|
+
return void 0;
|
|
2079
|
+
const refs = [...this._testElement.querySelectorAll("qti-assessment-item-ref")];
|
|
2080
|
+
const current = refs.findIndex((ref) => idOf(ref) === this.sessionContext?.navItemRefId);
|
|
2081
|
+
if (current < 0 || !refs[current + 1] || idOf(refs[current + 1]) !== id)
|
|
2082
|
+
return void 0;
|
|
2083
|
+
if (refs[current].closest("qti-test-part")?.getAttribute("navigation-mode") !== "linear")
|
|
2084
|
+
return void 0;
|
|
2085
|
+
const next = resolveNextItem(refs, current);
|
|
2086
|
+
if (next.id === id)
|
|
2087
|
+
return void 0;
|
|
2088
|
+
return next;
|
|
2089
|
+
}
|
|
1800
2090
|
/**
|
|
1801
2091
|
* Main navigation request handler with proper lifecycle management
|
|
1802
2092
|
*/
|
|
1803
2093
|
async _handleNavigationRequest({ detail }) {
|
|
1804
2094
|
if (!detail?.id)
|
|
1805
2095
|
return;
|
|
1806
|
-
|
|
2096
|
+
const resolved = this._resolveLinearNext(detail.type, detail.id);
|
|
2097
|
+
if (resolved?.id === null) {
|
|
2098
|
+
if (resolved.skipped.length)
|
|
2099
|
+
dispatchPublic(this, "cito-test-items-skipped", { ids: resolved.skipped });
|
|
2100
|
+
dispatchPublic(this, "cito-test-end-reached", {});
|
|
2101
|
+
return;
|
|
2102
|
+
}
|
|
2103
|
+
const target = resolved?.id ?? detail.id;
|
|
2104
|
+
if (!resolved && this._isLinearNavigationRestricted(detail.type, target)) {
|
|
1807
2105
|
this._handleNavigationError(new Error("Navigation restricted in linear mode"), detail.type, detail.id);
|
|
1808
2106
|
return;
|
|
1809
2107
|
}
|
|
@@ -1811,16 +2109,19 @@ var TestNavigationMixin = (superClass) => {
|
|
|
1811
2109
|
const navigationId = ++this._navigationId;
|
|
1812
2110
|
const controller = new AbortController();
|
|
1813
2111
|
try {
|
|
1814
|
-
this._dispatchLoadingStarted(detail.type,
|
|
2112
|
+
this._dispatchLoadingStarted(detail.type, target);
|
|
1815
2113
|
this._activeController = controller;
|
|
1816
|
-
await this._executeNavigation(detail.type,
|
|
2114
|
+
await this._executeNavigation(detail.type, target, navigationId, controller);
|
|
2115
|
+
if (resolved?.skipped.length && navigationId === this._navigationId && !controller.signal.aborted) {
|
|
2116
|
+
dispatchPublic(this, "cito-test-items-skipped", { ids: resolved.skipped });
|
|
2117
|
+
}
|
|
1817
2118
|
} catch (error) {
|
|
1818
|
-
this._handleNavigationError(error, detail.type,
|
|
2119
|
+
this._handleNavigationError(error, detail.type, target);
|
|
1819
2120
|
} finally {
|
|
1820
2121
|
if (this._activeController === controller) {
|
|
1821
2122
|
this._activeController = null;
|
|
1822
2123
|
}
|
|
1823
|
-
this._dispatchLoadingEnded(detail.type,
|
|
2124
|
+
this._dispatchLoadingEnded(detail.type, target);
|
|
1824
2125
|
}
|
|
1825
2126
|
}
|
|
1826
2127
|
_handleNavigationError(error, type, id) {
|
|
@@ -1847,7 +2148,7 @@ var TestNavigationMixin = (superClass) => {
|
|
|
1847
2148
|
await this._waitForLoadingComplete(navigationId, controller);
|
|
1848
2149
|
if (this._isStaleNavigation(navigationId, controller))
|
|
1849
2150
|
return;
|
|
1850
|
-
this._dispatchTestLoaded(this._loadResults);
|
|
2151
|
+
this._dispatchTestLoaded(this._loadResults, "item", itemId);
|
|
1851
2152
|
}
|
|
1852
2153
|
/**
|
|
1853
2154
|
* Navigate to section with simple state tracking
|
|
@@ -1868,7 +2169,7 @@ var TestNavigationMixin = (superClass) => {
|
|
|
1868
2169
|
await this._waitForLoadingComplete(navigationId, controller);
|
|
1869
2170
|
if (this._isStaleNavigation(navigationId, controller))
|
|
1870
2171
|
return;
|
|
1871
|
-
this._dispatchTestLoaded(this._loadResults);
|
|
2172
|
+
this._dispatchTestLoaded(this._loadResults, "section", sectionId);
|
|
1872
2173
|
}
|
|
1873
2174
|
// ===========================================
|
|
1874
2175
|
// LOADING STATE MANAGEMENT
|
|
@@ -2089,11 +2390,7 @@ var TestNavigationMixin = (superClass) => {
|
|
|
2089
2390
|
// EVENT DISPATCHING
|
|
2090
2391
|
// ===========================================
|
|
2091
2392
|
_dispatchLoadingStarted(type, id) {
|
|
2092
|
-
this
|
|
2093
|
-
detail: { type, id },
|
|
2094
|
-
bubbles: true,
|
|
2095
|
-
composed: true
|
|
2096
|
-
}));
|
|
2393
|
+
dispatchPublic(this, "cito-test-navigation-started", { type, id });
|
|
2097
2394
|
}
|
|
2098
2395
|
_dispatchLoadingEnded(type, id) {
|
|
2099
2396
|
this.dispatchEvent(new CustomEvent("qti-navigation-loading-ended", {
|
|
@@ -2103,36 +2400,30 @@ var TestNavigationMixin = (superClass) => {
|
|
|
2103
2400
|
}));
|
|
2104
2401
|
}
|
|
2105
2402
|
_dispatchError(error) {
|
|
2106
|
-
this
|
|
2107
|
-
detail: error,
|
|
2108
|
-
bubbles: true,
|
|
2109
|
-
composed: true
|
|
2110
|
-
}));
|
|
2403
|
+
dispatchPublic(this, "cito-test-navigation-failed", error);
|
|
2111
2404
|
}
|
|
2112
|
-
|
|
2405
|
+
/** The items are in the DOM: tell hosts the new position rendered (`cito-test-navigated`) and which items it holds. */
|
|
2406
|
+
_dispatchTestLoaded(results, type, id) {
|
|
2113
2407
|
requestAnimationFrame(() => {
|
|
2114
|
-
this
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
bubbles: true,
|
|
2120
|
-
composed: true
|
|
2121
|
-
}));
|
|
2408
|
+
dispatchPublic(this, "cito-test-rendered", results.map(({ itemRef }) => ({
|
|
2409
|
+
identifier: itemRef?.identifier,
|
|
2410
|
+
element: itemRef
|
|
2411
|
+
})));
|
|
2412
|
+
dispatchPublic(this, "cito-test-navigated", { type, id });
|
|
2122
2413
|
});
|
|
2123
2414
|
}
|
|
2124
2415
|
}
|
|
2125
|
-
|
|
2126
|
-
|
|
2416
|
+
__decorate10([
|
|
2417
|
+
property8({ type: String })
|
|
2127
2418
|
], TestNavigationClass.prototype, "navigate", void 0);
|
|
2128
|
-
|
|
2129
|
-
|
|
2419
|
+
__decorate10([
|
|
2420
|
+
property8({ type: Number })
|
|
2130
2421
|
], TestNavigationClass.prototype, "requestTimeout", void 0);
|
|
2131
|
-
|
|
2132
|
-
|
|
2422
|
+
__decorate10([
|
|
2423
|
+
property8({ attribute: false })
|
|
2133
2424
|
], TestNavigationClass.prototype, "postLoadTransformCallback", void 0);
|
|
2134
|
-
|
|
2135
|
-
|
|
2425
|
+
__decorate10([
|
|
2426
|
+
property8({ attribute: false })
|
|
2136
2427
|
], TestNavigationClass.prototype, "postLoadTestTransformCallback", void 0);
|
|
2137
2428
|
return TestNavigationClass;
|
|
2138
2429
|
};
|
|
@@ -2143,11 +2434,11 @@ var TestViewMixin = (superClass) => {
|
|
|
2143
2434
|
constructor(...args) {
|
|
2144
2435
|
super(...args);
|
|
2145
2436
|
this.sessionContext = { ...this.sessionContext, view: "candidate" };
|
|
2146
|
-
this
|
|
2437
|
+
listenPublic2(this, "cito-test-switch-view", (e) => {
|
|
2147
2438
|
this.sessionContext = { ...this.sessionContext, view: e.detail };
|
|
2148
2439
|
this._updateElementView();
|
|
2149
2440
|
});
|
|
2150
|
-
this
|
|
2441
|
+
listenPublic2(this, "cito-test-loaded", () => {
|
|
2151
2442
|
this._updateElementView();
|
|
2152
2443
|
});
|
|
2153
2444
|
this.addEventListener("qti-assessment-item-connected", (e) => {
|
|
@@ -2187,9 +2478,9 @@ var TestViewMixin = (superClass) => {
|
|
|
2187
2478
|
|
|
2188
2479
|
// ../qti-test/dist/mixins/test-base.js
|
|
2189
2480
|
import { provide } from "@lit/context";
|
|
2190
|
-
import { LitElement as
|
|
2191
|
-
import { property as
|
|
2192
|
-
var
|
|
2481
|
+
import { LitElement as LitElement9 } from "lit";
|
|
2482
|
+
import { property as property9 } from "lit/decorators.js";
|
|
2483
|
+
var __decorate11 = function(decorators, target, key, desc) {
|
|
2193
2484
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2194
2485
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2195
2486
|
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;
|
|
@@ -2215,6 +2506,8 @@ var TestBaseMixin = (superClass) => {
|
|
|
2215
2506
|
} else {
|
|
2216
2507
|
const newVariables = [...assessmentItem.variables];
|
|
2217
2508
|
for (const variable of itemContext.variables) {
|
|
2509
|
+
if (variable.identifier === "completionStatus" && variable.value === "not_attempted")
|
|
2510
|
+
continue;
|
|
2218
2511
|
const currentVariable = newVariables.find((v) => v.identifier === variable.identifier);
|
|
2219
2512
|
if (currentVariable) {
|
|
2220
2513
|
currentVariable.value = variable.value;
|
|
@@ -2223,6 +2516,7 @@ var TestBaseMixin = (superClass) => {
|
|
|
2223
2516
|
}
|
|
2224
2517
|
}
|
|
2225
2518
|
assessmentItem.variables = newVariables;
|
|
2519
|
+
this.#leaveNotAttempted(identifier, newVariables.find((v) => v.identifier === "completionStatus")?.value);
|
|
2226
2520
|
if (itemContext.state) {
|
|
2227
2521
|
assessmentItem.state = itemContext.state;
|
|
2228
2522
|
}
|
|
@@ -2277,7 +2571,7 @@ var TestBaseMixin = (superClass) => {
|
|
|
2277
2571
|
this.testContext = INITIAL_TEST_CONTEXT;
|
|
2278
2572
|
this.sessionContext = INITIAL_SESSION_CONTEXT;
|
|
2279
2573
|
});
|
|
2280
|
-
this
|
|
2574
|
+
listenPublic2(this, "cito-test-loaded", (e) => {
|
|
2281
2575
|
this._testElement = e.detail;
|
|
2282
2576
|
const items = Array.from(this._testElement.querySelectorAll("qti-assessment-item-ref")).map((itemRef) => {
|
|
2283
2577
|
return {
|
|
@@ -2329,18 +2623,34 @@ var TestBaseMixin = (superClass) => {
|
|
|
2329
2623
|
};
|
|
2330
2624
|
this.dispatchEvent(new CustomEvent("qti-test-context-updated", { detail: this.testContext, bubbles: false, composed: false }));
|
|
2331
2625
|
}
|
|
2626
|
+
/** Write the presented item's own status over a `not_attempted` the test context still holds for it. */
|
|
2627
|
+
#leaveNotAttempted(identifier, status) {
|
|
2628
|
+
if (typeof status !== "string" || status === "not_attempted")
|
|
2629
|
+
return;
|
|
2630
|
+
const item = this.testContext.items.find((i) => i.identifier === identifier);
|
|
2631
|
+
const current = item?.variables.find((v) => v.identifier === "completionStatus");
|
|
2632
|
+
if (current?.value !== "not_attempted")
|
|
2633
|
+
return;
|
|
2634
|
+
this.testContext = {
|
|
2635
|
+
...this.testContext,
|
|
2636
|
+
items: this.testContext.items.map((i) => i.identifier !== identifier ? i : {
|
|
2637
|
+
...i,
|
|
2638
|
+
variables: i.variables.map((v) => v.identifier === "completionStatus" ? { ...v, value: status } : v)
|
|
2639
|
+
})
|
|
2640
|
+
};
|
|
2641
|
+
}
|
|
2332
2642
|
}
|
|
2333
|
-
|
|
2334
|
-
|
|
2643
|
+
__decorate11([
|
|
2644
|
+
property9({ attribute: false, type: Object }),
|
|
2335
2645
|
provide({ context: testContext })
|
|
2336
2646
|
], TestBaseClass.prototype, "testContext", void 0);
|
|
2337
|
-
|
|
2338
|
-
|
|
2647
|
+
__decorate11([
|
|
2648
|
+
property9({ attribute: false, type: Object }),
|
|
2339
2649
|
provide({ context: sessionContext })
|
|
2340
2650
|
], TestBaseClass.prototype, "sessionContext", void 0);
|
|
2341
2651
|
return TestBaseClass;
|
|
2342
2652
|
};
|
|
2343
|
-
var TestBase = class extends TestBaseMixin(
|
|
2653
|
+
var TestBase = class extends TestBaseMixin(LitElement9) {
|
|
2344
2654
|
};
|
|
2345
2655
|
|
|
2346
2656
|
// ../qti-test/dist/mixins/test-state.mixin.js
|
|
@@ -2386,7 +2696,7 @@ var TestStateMixin = (superClass) => {
|
|
|
2386
2696
|
this.#ready = false;
|
|
2387
2697
|
this.#lastEmitted = null;
|
|
2388
2698
|
});
|
|
2389
|
-
this
|
|
2699
|
+
listenPublic2(this, "cito-test-loaded", () => {
|
|
2390
2700
|
if (this.#pending) {
|
|
2391
2701
|
this.#apply(this.#pending);
|
|
2392
2702
|
this.#pending = null;
|
|
@@ -2424,7 +2734,7 @@ var TestStateMixin = (superClass) => {
|
|
|
2424
2734
|
if (serialized === this.#lastEmitted)
|
|
2425
2735
|
return;
|
|
2426
2736
|
this.#lastEmitted = serialized;
|
|
2427
|
-
this
|
|
2737
|
+
dispatchPublic(this, "cito-test-state-changed", state9);
|
|
2428
2738
|
}
|
|
2429
2739
|
#apply(state9) {
|
|
2430
2740
|
for (const saved of state9.test.items)
|
|
@@ -2446,7 +2756,7 @@ var TestStateMixin = (superClass) => {
|
|
|
2446
2756
|
};
|
|
2447
2757
|
}
|
|
2448
2758
|
#requestNavigation(type, id) {
|
|
2449
|
-
this
|
|
2759
|
+
dispatchPublic(this, "cito-test-navigate", { type, id });
|
|
2450
2760
|
}
|
|
2451
2761
|
}
|
|
2452
2762
|
return TestStateClass;
|
|
@@ -2477,6 +2787,15 @@ var TestProcessingMixin = (superClass) => {
|
|
|
2477
2787
|
outcomeProcessor?.process();
|
|
2478
2788
|
return true;
|
|
2479
2789
|
}
|
|
2790
|
+
/**
|
|
2791
|
+
* The `qti-test-feedback` elements that apply now, read from the test outcomes: run
|
|
2792
|
+
* `outcomeProcessing()` first. `access` narrows them to the end of the test (`atEnd`) or to
|
|
2793
|
+
* while it runs (`during`); without it, both.
|
|
2794
|
+
*/
|
|
2795
|
+
getTestFeedback(access) {
|
|
2796
|
+
const feedback = Array.from((this._testElement ?? this).querySelectorAll("qti-test-feedback") ?? []);
|
|
2797
|
+
return feedback.filter((fb) => (!access || fb.access === access) && fb.matches(this.getOutcome(fb.outcomeIdentifier)?.value));
|
|
2798
|
+
}
|
|
2480
2799
|
/* --------------------------- ENABLED WHEN UNIT TESTING OUTCOME PROCESSING ------------------------------------ */
|
|
2481
2800
|
updateOutcomeVariable(identifier, value) {
|
|
2482
2801
|
const outcomeVariable = this.getOutcome(identifier);
|
|
@@ -2508,13 +2827,13 @@ var TestProcessingMixin = (superClass) => {
|
|
|
2508
2827
|
};
|
|
2509
2828
|
|
|
2510
2829
|
// ../qti-test/dist/components/qti-test/qti-test.js
|
|
2511
|
-
var
|
|
2830
|
+
var __decorate12 = function(decorators, target, key, desc) {
|
|
2512
2831
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2513
2832
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2514
2833
|
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;
|
|
2515
2834
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2516
2835
|
};
|
|
2517
|
-
var QtiTest = class extends TestNavigationMixin(TestViewMixin(TestProcessingMixin(TestStateMixin(TestBaseMixin(
|
|
2836
|
+
var QtiTest = class extends TestNavigationMixin(TestViewMixin(TestProcessingMixin(TestStateMixin(TestBaseMixin(LitElement10))))) {
|
|
2518
2837
|
// TODO: Properly implement IQtiTest interface
|
|
2519
2838
|
// export class QtiTest extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {
|
|
2520
2839
|
constructor() {
|
|
@@ -2539,25 +2858,25 @@ var QtiTest = class extends TestNavigationMixin(TestViewMixin(TestProcessingMixi
|
|
|
2539
2858
|
this.dispatchEvent(new CustomEvent("qti-test-connected", { detail: this }));
|
|
2540
2859
|
}
|
|
2541
2860
|
render() {
|
|
2542
|
-
return
|
|
2861
|
+
return html9`<slot></slot>`;
|
|
2543
2862
|
}
|
|
2544
2863
|
};
|
|
2545
|
-
|
|
2864
|
+
__decorate12([
|
|
2546
2865
|
state2(),
|
|
2547
2866
|
provide2({ context: configContext })
|
|
2548
2867
|
], QtiTest.prototype, "configContext", void 0);
|
|
2549
|
-
|
|
2868
|
+
__decorate12([
|
|
2550
2869
|
state2(),
|
|
2551
2870
|
provide2({ context: qtiContext })
|
|
2552
2871
|
], QtiTest.prototype, "qtiContext", void 0);
|
|
2553
2872
|
|
|
2554
2873
|
// ../qti-test/dist/components/test-check-item/test-check-item.js
|
|
2555
|
-
import { consume as
|
|
2556
|
-
import { css as
|
|
2874
|
+
import { consume as consume6 } from "@lit/context";
|
|
2875
|
+
import { css as css6, html as html10, LitElement as LitElement11 } from "lit";
|
|
2557
2876
|
|
|
2558
2877
|
// ../qti-test/dist/components/styles.js
|
|
2559
|
-
import { css as
|
|
2560
|
-
var form =
|
|
2878
|
+
import { css as css5 } from "lit";
|
|
2879
|
+
var form = css5`
|
|
2561
2880
|
display: inline-flex;
|
|
2562
2881
|
align-items: center;
|
|
2563
2882
|
justify-content: center;
|
|
@@ -2571,39 +2890,39 @@ var form = css3`
|
|
|
2571
2890
|
user-select: none;
|
|
2572
2891
|
border-radius: var(--test-button-border-radius, var(--qti-component-border-radius, 0.2rem));
|
|
2573
2892
|
`;
|
|
2574
|
-
var btn =
|
|
2893
|
+
var btn = css5`
|
|
2575
2894
|
${form};
|
|
2576
2895
|
background-color: var(--test-button-background-color, var(--qti-component-background-color, #fff));
|
|
2577
2896
|
color: var(--test-button-color, var(--qti-component-color, inherit));
|
|
2578
2897
|
border: var(--qti-component-border-width, 1px) var(--qti-component-border-style, solid)
|
|
2579
2898
|
var(--test-button-border-color, var(--qti-component-border-color, #0175aa));
|
|
2580
2899
|
`;
|
|
2581
|
-
var btnInteractive =
|
|
2900
|
+
var btnInteractive = css5`
|
|
2582
2901
|
background-color: var(--test-button-hover-background-color, var(--qti-bg-active, #f2f8fb));
|
|
2583
2902
|
`;
|
|
2584
|
-
var focusRing =
|
|
2903
|
+
var focusRing = css5`
|
|
2585
2904
|
outline: var(--qti-focus-border-width, 2px) solid var(--qti-focus-color, #007ac3);
|
|
2586
2905
|
outline-offset: 2px;
|
|
2587
2906
|
`;
|
|
2588
|
-
var dis =
|
|
2907
|
+
var dis = css5`
|
|
2589
2908
|
cursor: not-allowed;
|
|
2590
2909
|
opacity: 0.45;
|
|
2591
2910
|
`;
|
|
2592
|
-
var ind =
|
|
2911
|
+
var ind = css5`
|
|
2593
2912
|
${form};
|
|
2594
2913
|
border: 1px solid gray;
|
|
2595
2914
|
`;
|
|
2596
2915
|
|
|
2597
2916
|
// ../qti-test/dist/components/test-check-item/test-check-item.js
|
|
2598
|
-
var
|
|
2917
|
+
var __decorate13 = function(decorators, target, key, desc) {
|
|
2599
2918
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2600
2919
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2601
2920
|
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;
|
|
2602
2921
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2603
2922
|
};
|
|
2604
|
-
var TestCheckItem = class extends
|
|
2923
|
+
var TestCheckItem = class extends LitElement11 {
|
|
2605
2924
|
static {
|
|
2606
|
-
this.styles =
|
|
2925
|
+
this.styles = css6`
|
|
2607
2926
|
:host {
|
|
2608
2927
|
${btn};
|
|
2609
2928
|
}
|
|
@@ -2621,7 +2940,7 @@ var TestCheckItem = class extends LitElement9 {
|
|
|
2621
2940
|
constructor() {
|
|
2622
2941
|
super();
|
|
2623
2942
|
this.addEventListener("click", () => {
|
|
2624
|
-
this
|
|
2943
|
+
dispatchPublic(this, "cito-test-end-attempt", {});
|
|
2625
2944
|
const testContainer = this.testHost?.querySelector("test-container");
|
|
2626
2945
|
if (!testContainer)
|
|
2627
2946
|
return;
|
|
@@ -2632,25 +2951,25 @@ var TestCheckItem = class extends LitElement9 {
|
|
|
2632
2951
|
});
|
|
2633
2952
|
}
|
|
2634
2953
|
render() {
|
|
2635
|
-
return
|
|
2954
|
+
return html10` <slot></slot> `;
|
|
2636
2955
|
}
|
|
2637
2956
|
};
|
|
2638
|
-
|
|
2639
|
-
|
|
2957
|
+
__decorate13([
|
|
2958
|
+
consume6({ context: testHostContext, subscribe: true })
|
|
2640
2959
|
], TestCheckItem.prototype, "testHost", void 0);
|
|
2641
2960
|
|
|
2642
2961
|
// ../qti-test/dist/components/test-container/test-container.js
|
|
2643
|
-
import { consume as
|
|
2644
|
-
import { LitElement as
|
|
2645
|
-
import { property as
|
|
2962
|
+
import { consume as consume7 } from "@lit/context";
|
|
2963
|
+
import { LitElement as LitElement12, html as html11 } from "lit";
|
|
2964
|
+
import { property as property10, state as state3 } from "lit/decorators.js";
|
|
2646
2965
|
import { until } from "lit/directives/until.js";
|
|
2647
|
-
var
|
|
2966
|
+
var __decorate14 = function(decorators, target, key, desc) {
|
|
2648
2967
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2649
2968
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2650
2969
|
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;
|
|
2651
2970
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2652
2971
|
};
|
|
2653
|
-
var TestContainer = class extends
|
|
2972
|
+
var TestContainer = class extends LitElement12 {
|
|
2654
2973
|
constructor() {
|
|
2655
2974
|
super(...arguments);
|
|
2656
2975
|
this.customElementRegistry = null;
|
|
@@ -2735,7 +3054,7 @@ var TestContainer = class extends LitElement10 {
|
|
|
2735
3054
|
}
|
|
2736
3055
|
#initializeTemplateContent() {
|
|
2737
3056
|
const template = this.querySelector("template");
|
|
2738
|
-
this.#templateContent = template ? template.content :
|
|
3057
|
+
this.#templateContent = template ? template.content : html11``;
|
|
2739
3058
|
}
|
|
2740
3059
|
#applyStyles() {
|
|
2741
3060
|
const sheet = new CSSStyleSheet();
|
|
@@ -2743,57 +3062,57 @@ var TestContainer = class extends LitElement10 {
|
|
|
2743
3062
|
this.shadowRoot.adoptedStyleSheets = [sheet];
|
|
2744
3063
|
}
|
|
2745
3064
|
render() {
|
|
2746
|
-
return
|
|
3065
|
+
return html11`
|
|
2747
3066
|
${this.#templateContent}
|
|
2748
3067
|
<slot></slot>
|
|
2749
|
-
${until(this.testDoc,
|
|
3068
|
+
${until(this.testDoc, html11`<span>Loading...</span>`)}
|
|
2750
3069
|
`;
|
|
2751
3070
|
}
|
|
2752
3071
|
};
|
|
2753
|
-
|
|
2754
|
-
|
|
3072
|
+
__decorate14([
|
|
3073
|
+
property10({ attribute: false })
|
|
2755
3074
|
], TestContainer.prototype, "customElementRegistry", void 0);
|
|
2756
|
-
|
|
2757
|
-
|
|
3075
|
+
__decorate14([
|
|
3076
|
+
property10({ type: String, attribute: "test-url" })
|
|
2758
3077
|
], TestContainer.prototype, "testURL", void 0);
|
|
2759
|
-
|
|
3078
|
+
__decorate14([
|
|
2760
3079
|
state3()
|
|
2761
3080
|
], TestContainer.prototype, "testDoc", void 0);
|
|
2762
|
-
|
|
3081
|
+
__decorate14([
|
|
2763
3082
|
state3()
|
|
2764
3083
|
], TestContainer.prototype, "testXML", void 0);
|
|
2765
|
-
|
|
2766
|
-
|
|
3084
|
+
__decorate14([
|
|
3085
|
+
consume7({ context: testHostContext, subscribe: true })
|
|
2767
3086
|
], TestContainer.prototype, "testHost", void 0);
|
|
2768
|
-
|
|
3087
|
+
__decorate14([
|
|
2769
3088
|
state3(),
|
|
2770
|
-
|
|
3089
|
+
consume7({ context: qtiContext, subscribe: true })
|
|
2771
3090
|
], TestContainer.prototype, "qtiContext", void 0);
|
|
2772
|
-
|
|
3091
|
+
__decorate14([
|
|
2773
3092
|
watch("testURL", { waitUntilFirstUpdate: true })
|
|
2774
3093
|
], TestContainer.prototype, "handleTestURLChange", null);
|
|
2775
|
-
|
|
3094
|
+
__decorate14([
|
|
2776
3095
|
watch("testXML", { waitUntilFirstUpdate: true })
|
|
2777
3096
|
], TestContainer.prototype, "handleTestXMLChange", null);
|
|
2778
3097
|
|
|
2779
3098
|
// ../qti-test/dist/components/test-end-attempt/test-end-attempt.js
|
|
2780
|
-
import { css as
|
|
2781
|
-
import { property as
|
|
2782
|
-
import { consume as
|
|
2783
|
-
var
|
|
3099
|
+
import { css as css7, html as html12, LitElement as LitElement13 } from "lit";
|
|
3100
|
+
import { property as property11 } from "lit/decorators.js";
|
|
3101
|
+
import { consume as consume8 } from "@lit/context";
|
|
3102
|
+
var __decorate15 = function(decorators, target, key, desc) {
|
|
2784
3103
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2785
3104
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2786
3105
|
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;
|
|
2787
3106
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2788
3107
|
};
|
|
2789
|
-
var TestEndAttempt = class extends
|
|
3108
|
+
var TestEndAttempt = class extends LitElement13 {
|
|
2790
3109
|
_handleTestElementChange(_oldValue, newValue) {
|
|
2791
3110
|
if (newValue) {
|
|
2792
3111
|
this.requestUpdate();
|
|
2793
3112
|
}
|
|
2794
3113
|
}
|
|
2795
3114
|
static {
|
|
2796
|
-
this.styles =
|
|
3115
|
+
this.styles = css7`
|
|
2797
3116
|
:host {
|
|
2798
3117
|
${btn};
|
|
2799
3118
|
}
|
|
@@ -2814,7 +3133,7 @@ var TestEndAttempt = class extends LitElement11 {
|
|
|
2814
3133
|
this.addEventListener("click", (e) => {
|
|
2815
3134
|
e.preventDefault();
|
|
2816
3135
|
if (!this._internalDisabled) {
|
|
2817
|
-
this
|
|
3136
|
+
dispatchPublic(this, "cito-test-end-attempt", {});
|
|
2818
3137
|
}
|
|
2819
3138
|
});
|
|
2820
3139
|
}
|
|
@@ -2838,6 +3157,10 @@ var TestEndAttempt = class extends LitElement11 {
|
|
|
2838
3157
|
this._internalDisabled = true;
|
|
2839
3158
|
return;
|
|
2840
3159
|
}
|
|
3160
|
+
if (activeItem.adaptive && activeItem.completionStatus === "completed") {
|
|
3161
|
+
this._internalDisabled = true;
|
|
3162
|
+
return;
|
|
3163
|
+
}
|
|
2841
3164
|
if (!activeItem.adaptive && maxAttempts > 0 && numAttempts >= maxAttempts) {
|
|
2842
3165
|
this._internalDisabled = true;
|
|
2843
3166
|
return;
|
|
@@ -2849,32 +3172,32 @@ var TestEndAttempt = class extends LitElement11 {
|
|
|
2849
3172
|
}
|
|
2850
3173
|
}
|
|
2851
3174
|
render() {
|
|
2852
|
-
return
|
|
3175
|
+
return html12` <slot></slot> `;
|
|
2853
3176
|
}
|
|
2854
3177
|
};
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
3178
|
+
__decorate15([
|
|
3179
|
+
consume8({ context: computedContext, subscribe: true }),
|
|
3180
|
+
property11({ attribute: false })
|
|
2858
3181
|
], TestEndAttempt.prototype, "computedContext", void 0);
|
|
2859
|
-
|
|
2860
|
-
|
|
3182
|
+
__decorate15([
|
|
3183
|
+
property11({ type: Boolean, reflect: true, attribute: "disabled" })
|
|
2861
3184
|
], TestEndAttempt.prototype, "_internalDisabled", void 0);
|
|
2862
|
-
|
|
3185
|
+
__decorate15([
|
|
2863
3186
|
watch("computedContext")
|
|
2864
3187
|
], TestEndAttempt.prototype, "_handleTestElementChange", null);
|
|
2865
3188
|
|
|
2866
3189
|
// ../qti-test/dist/components/test-item-link/test-item-link.js
|
|
2867
|
-
import { css as
|
|
2868
|
-
import { property as
|
|
2869
|
-
var
|
|
3190
|
+
import { css as css8, html as html13, LitElement as LitElement14 } from "lit";
|
|
3191
|
+
import { property as property12 } from "lit/decorators.js";
|
|
3192
|
+
var __decorate16 = function(decorators, target, key, desc) {
|
|
2870
3193
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2871
3194
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2872
3195
|
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;
|
|
2873
3196
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2874
3197
|
};
|
|
2875
|
-
var TestItemLink = class extends
|
|
3198
|
+
var TestItemLink = class extends LitElement14 {
|
|
2876
3199
|
static {
|
|
2877
|
-
this.styles =
|
|
3200
|
+
this.styles = css8`
|
|
2878
3201
|
:host {
|
|
2879
3202
|
${btn};
|
|
2880
3203
|
}
|
|
@@ -2895,29 +3218,22 @@ var TestItemLink = class extends LitElement12 {
|
|
|
2895
3218
|
this.addEventListener("click", () => this._requestItem(this.itemId));
|
|
2896
3219
|
}
|
|
2897
3220
|
_requestItem(identifier) {
|
|
2898
|
-
this
|
|
2899
|
-
composed: true,
|
|
2900
|
-
bubbles: true,
|
|
2901
|
-
detail: {
|
|
2902
|
-
type: "item",
|
|
2903
|
-
id: identifier
|
|
2904
|
-
}
|
|
2905
|
-
}));
|
|
3221
|
+
dispatchPublic(this, "cito-test-navigate", { type: "item", id: identifier });
|
|
2906
3222
|
}
|
|
2907
3223
|
render() {
|
|
2908
|
-
return
|
|
3224
|
+
return html13` <slot></slot> `;
|
|
2909
3225
|
}
|
|
2910
3226
|
};
|
|
2911
|
-
|
|
2912
|
-
|
|
3227
|
+
__decorate16([
|
|
3228
|
+
property12({ type: String, attribute: "item-id" })
|
|
2913
3229
|
], TestItemLink.prototype, "itemId", void 0);
|
|
2914
3230
|
|
|
2915
3231
|
// ../qti-test/dist/components/test-item-to-speech/test-item-to-speech.js
|
|
2916
|
-
import { html as
|
|
2917
|
-
import { consume as
|
|
2918
|
-
import { property as
|
|
3232
|
+
import { html as html14, LitElement as LitElement15, css as css9 } from "lit";
|
|
3233
|
+
import { consume as consume9, provide as provide3, createContext as createContext2 } from "@lit/context";
|
|
3234
|
+
import { property as property13, state as state4 } from "lit/decorators.js";
|
|
2919
3235
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
2920
|
-
var
|
|
3236
|
+
var __decorate17 = function(decorators, target, key, desc) {
|
|
2921
3237
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2922
3238
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2923
3239
|
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;
|
|
@@ -2946,14 +3262,14 @@ var ICONS = {
|
|
|
2946
3262
|
pick: "M5 3l13 7-5.5 1.6 3.4 6.6-2.4 1.3-3.4-6.7L6 17z"
|
|
2947
3263
|
};
|
|
2948
3264
|
var iconContent = (icon, label) => {
|
|
2949
|
-
const svg =
|
|
3265
|
+
const svg = html14`<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
2950
3266
|
<path d="${ICONS[icon]}"></path>
|
|
2951
3267
|
</svg>`;
|
|
2952
|
-
return
|
|
3268
|
+
return html14`${svg}<span class="label">${label}</span>`;
|
|
2953
3269
|
};
|
|
2954
|
-
var TtsButtonBase = class extends
|
|
3270
|
+
var TtsButtonBase = class extends LitElement15 {
|
|
2955
3271
|
static {
|
|
2956
|
-
this.styles =
|
|
3272
|
+
this.styles = css9`
|
|
2957
3273
|
:host {
|
|
2958
3274
|
display: inline-flex;
|
|
2959
3275
|
}
|
|
@@ -3017,15 +3333,15 @@ var TtsButtonBase = class extends LitElement13 {
|
|
|
3017
3333
|
this.#internals.states.add("picking");
|
|
3018
3334
|
}
|
|
3019
3335
|
};
|
|
3020
|
-
|
|
3021
|
-
|
|
3336
|
+
__decorate17([
|
|
3337
|
+
property13({ type: String })
|
|
3022
3338
|
], TtsButtonBase.prototype, "label", void 0);
|
|
3023
|
-
|
|
3024
|
-
|
|
3339
|
+
__decorate17([
|
|
3340
|
+
consume9({ context: ttsContext, subscribe: true })
|
|
3025
3341
|
], TtsButtonBase.prototype, "_tts", void 0);
|
|
3026
|
-
var TestItemToSpeech = class extends
|
|
3342
|
+
var TestItemToSpeech = class extends LitElement15 {
|
|
3027
3343
|
static {
|
|
3028
|
-
this.styles =
|
|
3344
|
+
this.styles = css9`
|
|
3029
3345
|
:host {
|
|
3030
3346
|
display: inline-flex;
|
|
3031
3347
|
flex-wrap: wrap;
|
|
@@ -3155,6 +3471,7 @@ var TestItemToSpeech = class extends LitElement13 {
|
|
|
3155
3471
|
this.#eventHost = this.#itemRef ?? this.closest("test-navigation") ?? this.testHost ?? this.getRootNode();
|
|
3156
3472
|
this.#eventHost.addEventListener("qti-assessment-item-connected", this.#boundHandleItemConnected);
|
|
3157
3473
|
if (!this.#itemRef) {
|
|
3474
|
+
this.#eventHost.addEventListener("cito-test-navigate", this.#boundHandleNavigation);
|
|
3158
3475
|
this.#eventHost.addEventListener("qti-request-navigation", this.#boundHandleNavigation);
|
|
3159
3476
|
}
|
|
3160
3477
|
}
|
|
@@ -3167,6 +3484,7 @@ var TestItemToSpeech = class extends LitElement13 {
|
|
|
3167
3484
|
this.#stopPicking();
|
|
3168
3485
|
this.#clearAllHighlights();
|
|
3169
3486
|
this.#eventHost?.removeEventListener("qti-assessment-item-connected", this.#boundHandleItemConnected);
|
|
3487
|
+
this.#eventHost?.removeEventListener("cito-test-navigate", this.#boundHandleNavigation);
|
|
3170
3488
|
this.#eventHost?.removeEventListener("qti-request-navigation", this.#boundHandleNavigation);
|
|
3171
3489
|
this.#eventHost = null;
|
|
3172
3490
|
this.#itemRef = null;
|
|
@@ -3176,7 +3494,7 @@ var TestItemToSpeech = class extends LitElement13 {
|
|
|
3176
3494
|
this.#contentMode = false;
|
|
3177
3495
|
}
|
|
3178
3496
|
render() {
|
|
3179
|
-
return
|
|
3497
|
+
return html14`<slot></slot>`;
|
|
3180
3498
|
}
|
|
3181
3499
|
/**
|
|
3182
3500
|
* An item (re)rendered. If it is ours — e.g. after navigating to the item already shown — the
|
|
@@ -3613,16 +3931,16 @@ var TestItemToSpeech = class extends LitElement13 {
|
|
|
3613
3931
|
}
|
|
3614
3932
|
}
|
|
3615
3933
|
};
|
|
3616
|
-
|
|
3617
|
-
|
|
3934
|
+
__decorate17([
|
|
3935
|
+
property13({ type: String })
|
|
3618
3936
|
], TestItemToSpeech.prototype, "language", void 0);
|
|
3619
|
-
|
|
3620
|
-
|
|
3937
|
+
__decorate17([
|
|
3938
|
+
consume9({ context: sessionContext, subscribe: true })
|
|
3621
3939
|
], TestItemToSpeech.prototype, "_sessionContext", void 0);
|
|
3622
|
-
|
|
3623
|
-
|
|
3940
|
+
__decorate17([
|
|
3941
|
+
consume9({ context: testHostContext, subscribe: true })
|
|
3624
3942
|
], TestItemToSpeech.prototype, "testHost", void 0);
|
|
3625
|
-
|
|
3943
|
+
__decorate17([
|
|
3626
3944
|
state4(),
|
|
3627
3945
|
provide3({ context: ttsContext })
|
|
3628
3946
|
], TestItemToSpeech.prototype, "_ttsContext", void 0);
|
|
@@ -3639,19 +3957,19 @@ var TestTtsPlay = class extends TtsButtonBase {
|
|
|
3639
3957
|
}
|
|
3640
3958
|
render() {
|
|
3641
3959
|
const playing = this._tts?.state === "playing";
|
|
3642
|
-
return
|
|
3960
|
+
return html14`
|
|
3643
3961
|
<button part="button" aria-label=${ifDefined(playing ? this.pauseLabel : this.label)} @click=${this.#toggle}>
|
|
3644
|
-
${playing ?
|
|
3962
|
+
${playing ? html14`<slot name="pause">${iconContent("pause", this.pauseLabel ?? "Pause")}</slot>` : html14`<slot name="play">${iconContent("play", this.label ?? "Play")}</slot>`}
|
|
3645
3963
|
</button>
|
|
3646
3964
|
`;
|
|
3647
3965
|
}
|
|
3648
3966
|
};
|
|
3649
|
-
|
|
3650
|
-
|
|
3967
|
+
__decorate17([
|
|
3968
|
+
property13({ type: String, attribute: "pause-label" })
|
|
3651
3969
|
], TestTtsPlay.prototype, "pauseLabel", void 0);
|
|
3652
3970
|
var TestTtsPause = class extends TtsButtonBase {
|
|
3653
3971
|
render() {
|
|
3654
|
-
return
|
|
3972
|
+
return html14`
|
|
3655
3973
|
<button
|
|
3656
3974
|
part="button"
|
|
3657
3975
|
aria-label=${ifDefined(this.label)}
|
|
@@ -3665,7 +3983,7 @@ var TestTtsPause = class extends TtsButtonBase {
|
|
|
3665
3983
|
};
|
|
3666
3984
|
var TestTtsResume = class extends TtsButtonBase {
|
|
3667
3985
|
render() {
|
|
3668
|
-
return
|
|
3986
|
+
return html14`
|
|
3669
3987
|
<button
|
|
3670
3988
|
part="button"
|
|
3671
3989
|
aria-label=${ifDefined(this.label)}
|
|
@@ -3680,7 +3998,7 @@ var TestTtsResume = class extends TtsButtonBase {
|
|
|
3680
3998
|
var TestTtsStop = class extends TtsButtonBase {
|
|
3681
3999
|
render() {
|
|
3682
4000
|
const idle = this._tts?.state === "idle" && !this._tts?.picking;
|
|
3683
|
-
return
|
|
4001
|
+
return html14`
|
|
3684
4002
|
<button part="button" aria-label=${ifDefined(this.label)} ?disabled=${idle} @click=${() => this._tts?.stop()}>
|
|
3685
4003
|
<slot>${iconContent("stop", this.label ?? "Stop")}</slot>
|
|
3686
4004
|
</button>
|
|
@@ -3691,7 +4009,7 @@ var TestTtsPrev = class extends TtsButtonBase {
|
|
|
3691
4009
|
render() {
|
|
3692
4010
|
const collected = (this._tts?.elementCount ?? 0) > 0;
|
|
3693
4011
|
const atStart = (this._tts?.currentElementIndex ?? 0) === 0;
|
|
3694
|
-
return
|
|
4012
|
+
return html14`
|
|
3695
4013
|
<button
|
|
3696
4014
|
part="button"
|
|
3697
4015
|
aria-label=${ifDefined(this.label)}
|
|
@@ -3707,7 +4025,7 @@ var TestTtsNext = class extends TtsButtonBase {
|
|
|
3707
4025
|
render() {
|
|
3708
4026
|
const count = this._tts?.elementCount ?? 0;
|
|
3709
4027
|
const atEnd = count > 0 && (this._tts?.currentElementIndex ?? 0) >= count - 1;
|
|
3710
|
-
return
|
|
4028
|
+
return html14`
|
|
3711
4029
|
<button
|
|
3712
4030
|
part="button"
|
|
3713
4031
|
aria-label=${ifDefined(this.label)}
|
|
@@ -3721,7 +4039,7 @@ var TestTtsNext = class extends TtsButtonBase {
|
|
|
3721
4039
|
};
|
|
3722
4040
|
var TestTtsPick = class extends TtsButtonBase {
|
|
3723
4041
|
render() {
|
|
3724
|
-
return
|
|
4042
|
+
return html14`
|
|
3725
4043
|
<button
|
|
3726
4044
|
part="button"
|
|
3727
4045
|
aria-label=${ifDefined(this.label)}
|
|
@@ -3735,10 +4053,10 @@ var TestTtsPick = class extends TtsButtonBase {
|
|
|
3735
4053
|
};
|
|
3736
4054
|
|
|
3737
4055
|
// ../qti-test/dist/components/test-navigation/test-navigation.js
|
|
3738
|
-
import { ContextConsumer, consume as
|
|
3739
|
-
import { html as
|
|
3740
|
-
import { property as
|
|
3741
|
-
var
|
|
4056
|
+
import { ContextConsumer, consume as consume10, provide as provide4 } from "@lit/context";
|
|
4057
|
+
import { html as html15, LitElement as LitElement16 } from "lit";
|
|
4058
|
+
import { property as property14, state as state5 } from "lit/decorators.js";
|
|
4059
|
+
var __decorate18 = function(decorators, target, key, desc) {
|
|
3742
4060
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3743
4061
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
3744
4062
|
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;
|
|
@@ -3747,7 +4065,7 @@ var __decorate15 = function(decorators, target, key, desc) {
|
|
|
3747
4065
|
var newQtiContext = () => ({
|
|
3748
4066
|
QTI_CONTEXT: { testIdentifier: "", candidateIdentifier: "", environmentIdentifier: "default" }
|
|
3749
4067
|
});
|
|
3750
|
-
var TestNavigation = class extends
|
|
4068
|
+
var TestNavigation = class extends LitElement16 {
|
|
3751
4069
|
/**
|
|
3752
4070
|
* @deprecated Set `qtiContext` on `qti-test`, which provides it. This is an alias for the
|
|
3753
4071
|
* enclosing test's: reading returns it, writing replaces it, so a host that has always set the
|
|
@@ -3810,12 +4128,12 @@ var TestNavigation = class extends LitElement14 {
|
|
|
3810
4128
|
this.configContext = {};
|
|
3811
4129
|
this.autoScoreItems = false;
|
|
3812
4130
|
this.#optimality = /* @__PURE__ */ new Map();
|
|
3813
|
-
this
|
|
4131
|
+
listenPublic2(this, "cito-test-loaded", this.#handleTestConnected.bind(this));
|
|
3814
4132
|
this.addEventListener("qti-assessment-item-connected", this.#handleItemConnected.bind(this));
|
|
3815
|
-
this
|
|
4133
|
+
listenPublic(this, "cito-item-response-changed", this.#handleInteractionChanged.bind(this));
|
|
3816
4134
|
this.addEventListener("qti-item-context-updated", this.#handleItemContextUpdated.bind(this));
|
|
3817
|
-
this
|
|
3818
|
-
this
|
|
4135
|
+
listenPublic2(this, "cito-test-end-attempt", this.#handleTestEndAttempt.bind(this));
|
|
4136
|
+
listenPublic2(this, "cito-test-update-outcome", this.#handleTestUpdateOutcomeVariable.bind(this));
|
|
3819
4137
|
}
|
|
3820
4138
|
/**
|
|
3821
4139
|
* Latch whether an item reached its optimal outcome whenever it has just ended
|
|
@@ -3834,7 +4152,8 @@ var TestNavigation = class extends LitElement14 {
|
|
|
3834
4152
|
this.#optimality.set(itemContext.identifier, optimality);
|
|
3835
4153
|
const computedItem = this.computedItemFor(itemContext.identifier);
|
|
3836
4154
|
const numAttempts = Number(itemContext.variables?.find((v) => v.identifier === "numAttempts")?.value) || 0;
|
|
3837
|
-
|
|
4155
|
+
const completionStatus = itemContext.variables?.find((v) => v.identifier === "completionStatus")?.value;
|
|
4156
|
+
this.afterAttemptEnded(event.composedPath()[0]?.closest("qti-assessment-item"), computedItem, this.#isItemDone(numAttempts, optimality, computedItem?.maxAttempts, computedItem?.adaptive, completionStatus));
|
|
3838
4157
|
}
|
|
3839
4158
|
/**
|
|
3840
4159
|
* Extension point for presentation packages reacting to an ended attempt.
|
|
@@ -3893,7 +4212,7 @@ var TestNavigation = class extends LitElement14 {
|
|
|
3893
4212
|
}
|
|
3894
4213
|
}
|
|
3895
4214
|
render() {
|
|
3896
|
-
return
|
|
4215
|
+
return html15`<slot></slot>`;
|
|
3897
4216
|
}
|
|
3898
4217
|
/* PK: on test connected we can build the computed context */
|
|
3899
4218
|
#handleTestConnected(event) {
|
|
@@ -4137,7 +4456,7 @@ var TestNavigation = class extends LitElement14 {
|
|
|
4137
4456
|
if (numAttempts > 0)
|
|
4138
4457
|
this.#optimality.set(computedItem.identifier, optimality);
|
|
4139
4458
|
}
|
|
4140
|
-
const done = this.#isItemDone(numAttempts, optimality, computedItem.maxAttempts);
|
|
4459
|
+
const done = this.#isItemDone(numAttempts, optimality, computedItem.maxAttempts, computedItem.adaptive, completionStatus);
|
|
4141
4460
|
return {
|
|
4142
4461
|
...computedItem,
|
|
4143
4462
|
completionStatus,
|
|
@@ -4185,10 +4504,17 @@ var TestNavigation = class extends LitElement14 {
|
|
|
4185
4504
|
* `optimality` reflects the last *ended attempt* (see #optimality), not the
|
|
4186
4505
|
* live selection — so a freshly-picked optimal answer doesn't count as done
|
|
4187
4506
|
* until test-end-attempt evaluates it.
|
|
4507
|
+
*
|
|
4508
|
+
* Adaptive items decide this themselves: max-attempts does not apply to them
|
|
4509
|
+
* (QTI 3, itemSessionControl), and a wrong attempt may be the step that leads
|
|
4510
|
+
* on to the next part of the item. They are done once their response
|
|
4511
|
+
* processing sets completionStatus to 'completed'.
|
|
4188
4512
|
*/
|
|
4189
|
-
#isItemDone(numAttempts, optimality, maxAttempts) {
|
|
4513
|
+
#isItemDone(numAttempts, optimality, maxAttempts, adaptive, completionStatus) {
|
|
4190
4514
|
if (numAttempts === 0)
|
|
4191
4515
|
return false;
|
|
4516
|
+
if (adaptive)
|
|
4517
|
+
return completionStatus === "completed";
|
|
4192
4518
|
if (optimality !== "suboptimal")
|
|
4193
4519
|
return true;
|
|
4194
4520
|
const max = maxAttempts ?? 1;
|
|
@@ -4248,50 +4574,50 @@ var TestNavigation = class extends LitElement14 {
|
|
|
4248
4574
|
return Number.isNaN(parsed) ? null : parsed;
|
|
4249
4575
|
}
|
|
4250
4576
|
};
|
|
4251
|
-
|
|
4252
|
-
|
|
4577
|
+
__decorate18([
|
|
4578
|
+
property14({ type: String })
|
|
4253
4579
|
], TestNavigation.prototype, "identifier", void 0);
|
|
4254
|
-
|
|
4580
|
+
__decorate18([
|
|
4255
4581
|
state5()
|
|
4256
4582
|
], TestNavigation.prototype, "initContext", void 0);
|
|
4257
|
-
|
|
4583
|
+
__decorate18([
|
|
4258
4584
|
state5(),
|
|
4259
|
-
|
|
4585
|
+
consume10({ context: configContext, subscribe: true })
|
|
4260
4586
|
], TestNavigation.prototype, "configContext", void 0);
|
|
4261
|
-
|
|
4587
|
+
__decorate18([
|
|
4262
4588
|
state5(),
|
|
4263
|
-
|
|
4589
|
+
consume10({ context: testContext, subscribe: true })
|
|
4264
4590
|
], TestNavigation.prototype, "_testContext", void 0);
|
|
4265
|
-
|
|
4591
|
+
__decorate18([
|
|
4266
4592
|
state5(),
|
|
4267
|
-
|
|
4593
|
+
consume10({ context: sessionContext, subscribe: true })
|
|
4268
4594
|
], TestNavigation.prototype, "_sessionContext", void 0);
|
|
4269
|
-
|
|
4595
|
+
__decorate18([
|
|
4270
4596
|
state5(),
|
|
4271
4597
|
provide4({ context: computedContext })
|
|
4272
4598
|
], TestNavigation.prototype, "computedContext", void 0);
|
|
4273
|
-
|
|
4274
|
-
|
|
4599
|
+
__decorate18([
|
|
4600
|
+
property14({ type: Boolean, attribute: "auto-score-items" })
|
|
4275
4601
|
], TestNavigation.prototype, "autoScoreItems", void 0);
|
|
4276
4602
|
|
|
4277
4603
|
// ../qti-test/dist/components/test-next/test-next.js
|
|
4278
|
-
import { css as
|
|
4279
|
-
import { property as
|
|
4280
|
-
import { consume as
|
|
4281
|
-
var
|
|
4604
|
+
import { css as css10, html as html16, LitElement as LitElement17 } from "lit";
|
|
4605
|
+
import { property as property15 } from "lit/decorators.js";
|
|
4606
|
+
import { consume as consume11 } from "@lit/context";
|
|
4607
|
+
var __decorate19 = function(decorators, target, key, desc) {
|
|
4282
4608
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4283
4609
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4284
4610
|
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;
|
|
4285
4611
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4286
4612
|
};
|
|
4287
|
-
var TestNext = class extends
|
|
4613
|
+
var TestNext = class extends LitElement17 {
|
|
4288
4614
|
_handleTestElementChange(_oldValue, newValue) {
|
|
4289
4615
|
if (newValue) {
|
|
4290
4616
|
this.requestUpdate();
|
|
4291
4617
|
}
|
|
4292
4618
|
}
|
|
4293
4619
|
static {
|
|
4294
|
-
this.styles =
|
|
4620
|
+
this.styles = css10`
|
|
4295
4621
|
:host {
|
|
4296
4622
|
${btn};
|
|
4297
4623
|
}
|
|
@@ -4345,39 +4671,32 @@ var TestNext = class extends LitElement15 {
|
|
|
4345
4671
|
this._internalDisabled = !this.computedContext || this.itemIndex < 0 || this.itemIndex >= (this.sectionItems?.length ?? 0) - 1 || isLinearIndividual && !activeItem?.done;
|
|
4346
4672
|
}
|
|
4347
4673
|
_requestItem(identifier) {
|
|
4348
|
-
this
|
|
4349
|
-
composed: true,
|
|
4350
|
-
bubbles: true,
|
|
4351
|
-
detail: {
|
|
4352
|
-
type: "item",
|
|
4353
|
-
id: identifier
|
|
4354
|
-
}
|
|
4355
|
-
}));
|
|
4674
|
+
dispatchPublic(this, "cito-test-navigate", { type: "item", id: identifier });
|
|
4356
4675
|
}
|
|
4357
4676
|
render() {
|
|
4358
|
-
return
|
|
4677
|
+
return html16`<slot></slot>`;
|
|
4359
4678
|
}
|
|
4360
4679
|
};
|
|
4361
|
-
|
|
4362
|
-
|
|
4680
|
+
__decorate19([
|
|
4681
|
+
property15({ type: Boolean, reflect: true, attribute: "disabled" })
|
|
4363
4682
|
], TestNext.prototype, "_internalDisabled", void 0);
|
|
4364
|
-
|
|
4365
|
-
|
|
4683
|
+
__decorate19([
|
|
4684
|
+
consume11({ context: computedContext, subscribe: true })
|
|
4366
4685
|
], TestNext.prototype, "computedContext", void 0);
|
|
4367
|
-
|
|
4686
|
+
__decorate19([
|
|
4368
4687
|
watch("computedContext")
|
|
4369
4688
|
], TestNext.prototype, "_handleTestElementChange", null);
|
|
4370
4689
|
|
|
4371
4690
|
// ../qti-test/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js
|
|
4372
|
-
import { html as
|
|
4373
|
-
import { consume as
|
|
4374
|
-
var
|
|
4691
|
+
import { html as html17, LitElement as LitElement18 } from "lit";
|
|
4692
|
+
import { consume as consume12 } from "@lit/context";
|
|
4693
|
+
var __decorate20 = function(decorators, target, key, desc) {
|
|
4375
4694
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4376
4695
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4377
4696
|
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;
|
|
4378
4697
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4379
4698
|
};
|
|
4380
|
-
var TestPagingButtonsStamp = class extends
|
|
4699
|
+
var TestPagingButtonsStamp = class extends LitElement18 {
|
|
4381
4700
|
#internals;
|
|
4382
4701
|
createRenderRoot() {
|
|
4383
4702
|
return this;
|
|
@@ -4394,33 +4713,33 @@ var TestPagingButtonsStamp = class extends LitElement16 {
|
|
|
4394
4713
|
}
|
|
4395
4714
|
render() {
|
|
4396
4715
|
if (!this.computedContext)
|
|
4397
|
-
return
|
|
4716
|
+
return html17``;
|
|
4398
4717
|
const items = this.computedContext.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items));
|
|
4399
|
-
return
|
|
4718
|
+
return html17` ${items.map((item) => this.myTemplate({ item, view: this.computedContext.view }))} `;
|
|
4400
4719
|
}
|
|
4401
4720
|
};
|
|
4402
|
-
|
|
4403
|
-
|
|
4721
|
+
__decorate20([
|
|
4722
|
+
consume12({ context: computedContext, subscribe: true })
|
|
4404
4723
|
], TestPagingButtonsStamp.prototype, "computedContext", void 0);
|
|
4405
4724
|
|
|
4406
4725
|
// ../qti-test/dist/components/test-prev/test-prev.js
|
|
4407
|
-
import { css as
|
|
4408
|
-
import { property as
|
|
4409
|
-
import { consume as
|
|
4410
|
-
var
|
|
4726
|
+
import { css as css11, html as html18, LitElement as LitElement19 } from "lit";
|
|
4727
|
+
import { property as property16 } from "lit/decorators.js";
|
|
4728
|
+
import { consume as consume13 } from "@lit/context";
|
|
4729
|
+
var __decorate21 = function(decorators, target, key, desc) {
|
|
4411
4730
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4412
4731
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4413
4732
|
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;
|
|
4414
4733
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4415
4734
|
};
|
|
4416
|
-
var TestPrev = class extends
|
|
4735
|
+
var TestPrev = class extends LitElement19 {
|
|
4417
4736
|
_handleTestElementChange(_oldValue, newValue) {
|
|
4418
4737
|
if (newValue) {
|
|
4419
4738
|
this.requestUpdate();
|
|
4420
4739
|
}
|
|
4421
4740
|
}
|
|
4422
4741
|
static {
|
|
4423
|
-
this.styles =
|
|
4742
|
+
this.styles = css11`
|
|
4424
4743
|
:host {
|
|
4425
4744
|
${btn};
|
|
4426
4745
|
}
|
|
@@ -4461,61 +4780,54 @@ var TestPrev = class extends LitElement17 {
|
|
|
4461
4780
|
this._internalDisabled = navigationMode === "linear" || !this.computedContext || this.itemIndex === 0 || this.itemIndex === -1;
|
|
4462
4781
|
}
|
|
4463
4782
|
_requestItem(identifier) {
|
|
4464
|
-
this
|
|
4465
|
-
composed: true,
|
|
4466
|
-
bubbles: true,
|
|
4467
|
-
detail: {
|
|
4468
|
-
type: "item",
|
|
4469
|
-
id: identifier
|
|
4470
|
-
}
|
|
4471
|
-
}));
|
|
4783
|
+
dispatchPublic(this, "cito-test-navigate", { type: "item", id: identifier });
|
|
4472
4784
|
}
|
|
4473
4785
|
render() {
|
|
4474
|
-
return
|
|
4786
|
+
return html18`<slot></slot>`;
|
|
4475
4787
|
}
|
|
4476
4788
|
};
|
|
4477
|
-
|
|
4478
|
-
|
|
4789
|
+
__decorate21([
|
|
4790
|
+
property16({ type: Boolean, reflect: true, attribute: "disabled" })
|
|
4479
4791
|
], TestPrev.prototype, "_internalDisabled", void 0);
|
|
4480
|
-
|
|
4481
|
-
|
|
4792
|
+
__decorate21([
|
|
4793
|
+
consume13({ context: computedContext, subscribe: true })
|
|
4482
4794
|
], TestPrev.prototype, "computedContext", void 0);
|
|
4483
|
-
|
|
4795
|
+
__decorate21([
|
|
4484
4796
|
watch("computedContext")
|
|
4485
4797
|
], TestPrev.prototype, "_handleTestElementChange", null);
|
|
4486
4798
|
|
|
4487
4799
|
// ../qti-test/dist/components/test-print-context/test-print-context.js
|
|
4488
|
-
import { html as
|
|
4489
|
-
import { consume as
|
|
4800
|
+
import { html as html19, LitElement as LitElement20 } from "lit";
|
|
4801
|
+
import { consume as consume14 } from "@lit/context";
|
|
4490
4802
|
import { state as state6 } from "lit/decorators.js";
|
|
4491
|
-
var
|
|
4803
|
+
var __decorate22 = function(decorators, target, key, desc) {
|
|
4492
4804
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4493
4805
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4494
4806
|
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;
|
|
4495
4807
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4496
4808
|
};
|
|
4497
|
-
var TestPrintContext = class extends
|
|
4809
|
+
var TestPrintContext = class extends LitElement20 {
|
|
4498
4810
|
render() {
|
|
4499
|
-
return
|
|
4811
|
+
return html19` <small><pre>${JSON.stringify(this.computedContext, null, 2)}</pre></small> `;
|
|
4500
4812
|
}
|
|
4501
4813
|
};
|
|
4502
|
-
|
|
4814
|
+
__decorate22([
|
|
4503
4815
|
state6(),
|
|
4504
|
-
|
|
4816
|
+
consume14({ context: computedContext, subscribe: true })
|
|
4505
4817
|
], TestPrintContext.prototype, "computedContext", void 0);
|
|
4506
4818
|
|
|
4507
4819
|
// ../qti-test/dist/components/test-print-item-variables/test-print-item-variables.js
|
|
4508
|
-
import { html as
|
|
4509
|
-
import { consume as
|
|
4510
|
-
var
|
|
4820
|
+
import { html as html20, css as css12, LitElement as LitElement21 } from "lit";
|
|
4821
|
+
import { consume as consume15 } from "@lit/context";
|
|
4822
|
+
var __decorate23 = function(decorators, target, key, desc) {
|
|
4511
4823
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4512
4824
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4513
4825
|
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;
|
|
4514
4826
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4515
4827
|
};
|
|
4516
|
-
var TestPrintVariables = class extends
|
|
4828
|
+
var TestPrintVariables = class extends LitElement21 {
|
|
4517
4829
|
static {
|
|
4518
|
-
this.styles =
|
|
4830
|
+
this.styles = css12`
|
|
4519
4831
|
table {
|
|
4520
4832
|
width: 100%;
|
|
4521
4833
|
border-collapse: collapse;
|
|
@@ -4541,10 +4853,10 @@ var TestPrintVariables = class extends LitElement19 {
|
|
|
4541
4853
|
render() {
|
|
4542
4854
|
const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
|
|
4543
4855
|
if (!activeItem || !activeItem.variables)
|
|
4544
|
-
return
|
|
4856
|
+
return html20``;
|
|
4545
4857
|
const responseVariables = activeItem.variables.filter((v) => v.type === "response");
|
|
4546
4858
|
const outcomeVariables = activeItem.variables.filter((v) => v.type === "outcome");
|
|
4547
|
-
const renderTable = (variables, title) =>
|
|
4859
|
+
const renderTable = (variables, title) => html20`
|
|
4548
4860
|
<h3>${title}</h3>
|
|
4549
4861
|
<table>
|
|
4550
4862
|
<thead>
|
|
@@ -4561,7 +4873,7 @@ var TestPrintVariables = class extends LitElement19 {
|
|
|
4561
4873
|
const correctResponse = v.correctResponse ? Array.isArray(v.correctResponse) ? v.correctResponse.join(", ") : v.correctResponse : "";
|
|
4562
4874
|
const mapEntries = v.mapping?.mapEntries?.map((m) => `${m.mapKey}=${m.mappedValue}pt`).join(", ") || "";
|
|
4563
4875
|
const areaMapEntries = v.areaMapping?.areaMapEntries?.map((m) => `${m.shape}(${m.coords})=${m.mappedValue}pt`).join(", ") || "";
|
|
4564
|
-
return
|
|
4876
|
+
return html20`
|
|
4565
4877
|
<tr>
|
|
4566
4878
|
<td>${v.identifier}</td>
|
|
4567
4879
|
<td>${Array.isArray(v.value) ? v.value.join(", ") : v.value}</td>
|
|
@@ -4574,26 +4886,26 @@ var TestPrintVariables = class extends LitElement19 {
|
|
|
4574
4886
|
</tbody>
|
|
4575
4887
|
</table>
|
|
4576
4888
|
`;
|
|
4577
|
-
return
|
|
4889
|
+
return html20`
|
|
4578
4890
|
${renderTable(responseVariables, "Response Variables")} ${renderTable(outcomeVariables, "Outcome Variables")}
|
|
4579
4891
|
`;
|
|
4580
4892
|
}
|
|
4581
4893
|
};
|
|
4582
|
-
|
|
4583
|
-
|
|
4894
|
+
__decorate23([
|
|
4895
|
+
consume15({ context: computedContext, subscribe: true })
|
|
4584
4896
|
], TestPrintVariables.prototype, "computedContext", void 0);
|
|
4585
4897
|
|
|
4586
4898
|
// ../qti-test/dist/components/test-scoring-buttons/test-scoring-buttons.js
|
|
4587
|
-
import { html as
|
|
4588
|
-
import { consume as
|
|
4589
|
-
import { property as
|
|
4590
|
-
var
|
|
4899
|
+
import { html as html21, LitElement as LitElement22, nothing as nothing3 } from "lit";
|
|
4900
|
+
import { consume as consume16 } from "@lit/context";
|
|
4901
|
+
import { property as property17 } from "lit/decorators.js";
|
|
4902
|
+
var __decorate24 = function(decorators, target, key, desc) {
|
|
4591
4903
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4592
4904
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4593
4905
|
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;
|
|
4594
4906
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4595
4907
|
};
|
|
4596
|
-
var TestScoringButtons = class extends
|
|
4908
|
+
var TestScoringButtons = class extends LitElement22 {
|
|
4597
4909
|
createRenderRoot() {
|
|
4598
4910
|
return this;
|
|
4599
4911
|
}
|
|
@@ -4610,19 +4922,16 @@ var TestScoringButtons = class extends LitElement20 {
|
|
|
4610
4922
|
const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
|
|
4611
4923
|
const sectionItems = testPart.sections.flatMap((section) => section.items);
|
|
4612
4924
|
const currentItemIdentifier = sectionItems.find((item) => item.active)?.identifier;
|
|
4613
|
-
this
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
},
|
|
4619
|
-
bubbles: true
|
|
4620
|
-
}));
|
|
4925
|
+
dispatchPublic(this, "cito-test-update-outcome", {
|
|
4926
|
+
assessmentItemRefId: currentItemIdentifier,
|
|
4927
|
+
outcomeVariableId: "SCORE",
|
|
4928
|
+
value
|
|
4929
|
+
});
|
|
4621
4930
|
}
|
|
4622
4931
|
render() {
|
|
4623
4932
|
const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
|
|
4624
4933
|
if (!activeItem || !activeItem.variables)
|
|
4625
|
-
return
|
|
4934
|
+
return html21``;
|
|
4626
4935
|
const maxScore = activeItem.variables.find((vr) => vr.identifier == "MAXSCORE")?.value;
|
|
4627
4936
|
const scoreOutcome = activeItem.variables.find((vr) => vr.identifier == "SCORE");
|
|
4628
4937
|
const score = scoreOutcome?.value;
|
|
@@ -4630,7 +4939,7 @@ var TestScoringButtons = class extends LitElement20 {
|
|
|
4630
4939
|
if (!maxScore || !scoreOutcome)
|
|
4631
4940
|
return nothing3;
|
|
4632
4941
|
const scores = [...Array(Number(maxScore) + 1).keys()];
|
|
4633
|
-
return
|
|
4942
|
+
return html21`${this.myTemplate ? this.myTemplate({ scores, score, disabled }) : nothing3}`;
|
|
4634
4943
|
}
|
|
4635
4944
|
constructor() {
|
|
4636
4945
|
super();
|
|
@@ -4646,27 +4955,27 @@ var TestScoringButtons = class extends LitElement20 {
|
|
|
4646
4955
|
});
|
|
4647
4956
|
}
|
|
4648
4957
|
};
|
|
4649
|
-
|
|
4650
|
-
|
|
4958
|
+
__decorate24([
|
|
4959
|
+
property17({ type: String, attribute: "view" })
|
|
4651
4960
|
], TestScoringButtons.prototype, "view", void 0);
|
|
4652
|
-
|
|
4653
|
-
|
|
4961
|
+
__decorate24([
|
|
4962
|
+
property17({ type: Boolean })
|
|
4654
4963
|
], TestScoringButtons.prototype, "disabled", void 0);
|
|
4655
|
-
|
|
4656
|
-
|
|
4964
|
+
__decorate24([
|
|
4965
|
+
consume16({ context: computedContext, subscribe: true })
|
|
4657
4966
|
], TestScoringButtons.prototype, "computedContext", void 0);
|
|
4658
4967
|
|
|
4659
4968
|
// ../qti-test/dist/components/test-scoring-feedback/test-scoring-feedback.js
|
|
4660
|
-
import { consume as
|
|
4661
|
-
import { html as
|
|
4662
|
-
import { property as
|
|
4663
|
-
var
|
|
4969
|
+
import { consume as consume17 } from "@lit/context";
|
|
4970
|
+
import { html as html22, LitElement as LitElement23 } from "lit";
|
|
4971
|
+
import { property as property18 } from "lit/decorators.js";
|
|
4972
|
+
var __decorate25 = function(decorators, target, key, desc) {
|
|
4664
4973
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4665
4974
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4666
4975
|
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;
|
|
4667
4976
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4668
4977
|
};
|
|
4669
|
-
var TestScoringFeedback = class extends
|
|
4978
|
+
var TestScoringFeedback = class extends LitElement23 {
|
|
4670
4979
|
constructor() {
|
|
4671
4980
|
super(...arguments);
|
|
4672
4981
|
this.view = null;
|
|
@@ -4674,9 +4983,9 @@ var TestScoringFeedback = class extends LitElement21 {
|
|
|
4674
4983
|
render() {
|
|
4675
4984
|
const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
|
|
4676
4985
|
if (!activeItem || !activeItem.variables)
|
|
4677
|
-
return
|
|
4986
|
+
return html22``;
|
|
4678
4987
|
if (activeItem["category"] === "dep-informational")
|
|
4679
|
-
return
|
|
4988
|
+
return html22`<div>${this.dataset.informational}</div>`;
|
|
4680
4989
|
const completionStatus = activeItem?.variables.find((v) => v.identifier === "completionStatus")?.value;
|
|
4681
4990
|
const scoreOutcome = activeItem?.variables.find((vr) => vr.identifier == "SCORE");
|
|
4682
4991
|
const score = parseFloat(scoreOutcome?.value);
|
|
@@ -4696,26 +5005,26 @@ var TestScoringFeedback = class extends LitElement21 {
|
|
|
4696
5005
|
}
|
|
4697
5006
|
return this.dataset.inProgress;
|
|
4698
5007
|
};
|
|
4699
|
-
return
|
|
5008
|
+
return html22`<div>${feedbackText()}</div>`;
|
|
4700
5009
|
}
|
|
4701
5010
|
};
|
|
4702
|
-
|
|
4703
|
-
|
|
5011
|
+
__decorate25([
|
|
5012
|
+
consume17({ context: computedContext, subscribe: true })
|
|
4704
5013
|
], TestScoringFeedback.prototype, "computedContext", void 0);
|
|
4705
|
-
|
|
4706
|
-
|
|
5014
|
+
__decorate25([
|
|
5015
|
+
property18({ type: String, attribute: "view" })
|
|
4707
5016
|
], TestScoringFeedback.prototype, "view", void 0);
|
|
4708
5017
|
|
|
4709
5018
|
// ../qti-test/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js
|
|
4710
|
-
import { html as
|
|
4711
|
-
import { consume as
|
|
4712
|
-
var
|
|
5019
|
+
import { html as html23, LitElement as LitElement24 } from "lit";
|
|
5020
|
+
import { consume as consume18 } from "@lit/context";
|
|
5021
|
+
var __decorate26 = function(decorators, target, key, desc) {
|
|
4713
5022
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4714
5023
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4715
5024
|
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;
|
|
4716
5025
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4717
5026
|
};
|
|
4718
|
-
var TestSectionButtonsStamp = class extends
|
|
5027
|
+
var TestSectionButtonsStamp = class extends LitElement24 {
|
|
4719
5028
|
#internals;
|
|
4720
5029
|
createRenderRoot() {
|
|
4721
5030
|
return this;
|
|
@@ -4732,27 +5041,27 @@ var TestSectionButtonsStamp = class extends LitElement22 {
|
|
|
4732
5041
|
}
|
|
4733
5042
|
render() {
|
|
4734
5043
|
if (!this.computedContext)
|
|
4735
|
-
return
|
|
5044
|
+
return html23``;
|
|
4736
5045
|
const sections = this.computedContext.testParts.flatMap((testPart) => testPart.sections);
|
|
4737
|
-
return
|
|
5046
|
+
return html23` ${sections.map((item) => this.myTemplate({ item }))} `;
|
|
4738
5047
|
}
|
|
4739
5048
|
};
|
|
4740
|
-
|
|
4741
|
-
|
|
5049
|
+
__decorate26([
|
|
5050
|
+
consume18({ context: computedContext, subscribe: true })
|
|
4742
5051
|
], TestSectionButtonsStamp.prototype, "computedContext", void 0);
|
|
4743
5052
|
|
|
4744
5053
|
// ../qti-test/dist/components/test-section-link/test-section-link.js
|
|
4745
|
-
import { css as
|
|
4746
|
-
import { property as
|
|
4747
|
-
var
|
|
5054
|
+
import { css as css13, html as html24, LitElement as LitElement25 } from "lit";
|
|
5055
|
+
import { property as property19 } from "lit/decorators.js";
|
|
5056
|
+
var __decorate27 = function(decorators, target, key, desc) {
|
|
4748
5057
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4749
5058
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4750
5059
|
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;
|
|
4751
5060
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4752
5061
|
};
|
|
4753
|
-
var TestSectionLink = class extends
|
|
5062
|
+
var TestSectionLink = class extends LitElement25 {
|
|
4754
5063
|
static {
|
|
4755
|
-
this.styles =
|
|
5064
|
+
this.styles = css13`
|
|
4756
5065
|
:host {
|
|
4757
5066
|
${btn};
|
|
4758
5067
|
}
|
|
@@ -4768,14 +5077,7 @@ var TestSectionLink = class extends LitElement23 {
|
|
|
4768
5077
|
`;
|
|
4769
5078
|
}
|
|
4770
5079
|
#requestItem(identifier) {
|
|
4771
|
-
this
|
|
4772
|
-
composed: true,
|
|
4773
|
-
bubbles: true,
|
|
4774
|
-
detail: {
|
|
4775
|
-
type: "section",
|
|
4776
|
-
id: identifier
|
|
4777
|
-
}
|
|
4778
|
-
}));
|
|
5080
|
+
dispatchPublic(this, "cito-test-navigate", { type: "section", id: identifier });
|
|
4779
5081
|
}
|
|
4780
5082
|
constructor() {
|
|
4781
5083
|
super();
|
|
@@ -4783,24 +5085,24 @@ var TestSectionLink = class extends LitElement23 {
|
|
|
4783
5085
|
this.addEventListener("click", () => this.#requestItem(this.sectionId));
|
|
4784
5086
|
}
|
|
4785
5087
|
render() {
|
|
4786
|
-
return
|
|
5088
|
+
return html24` <slot></slot> `;
|
|
4787
5089
|
}
|
|
4788
5090
|
};
|
|
4789
|
-
|
|
4790
|
-
|
|
5091
|
+
__decorate27([
|
|
5092
|
+
property19({ type: String, attribute: "section-id" })
|
|
4791
5093
|
], TestSectionLink.prototype, "sectionId", void 0);
|
|
4792
5094
|
|
|
4793
5095
|
// ../qti-test/dist/components/test-stamp/test-stamp.js
|
|
4794
|
-
import { html as
|
|
4795
|
-
import { property as
|
|
4796
|
-
import { consume as
|
|
4797
|
-
var
|
|
5096
|
+
import { html as html25, LitElement as LitElement26, nothing as nothing4 } from "lit";
|
|
5097
|
+
import { property as property20, state as state7 } from "lit/decorators.js";
|
|
5098
|
+
import { consume as consume19 } from "@lit/context";
|
|
5099
|
+
var __decorate28 = function(decorators, target, key, desc) {
|
|
4798
5100
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4799
5101
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4800
5102
|
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;
|
|
4801
5103
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4802
5104
|
};
|
|
4803
|
-
var TestStamp = class extends
|
|
5105
|
+
var TestStamp = class extends LitElement26 {
|
|
4804
5106
|
constructor() {
|
|
4805
5107
|
super(...arguments);
|
|
4806
5108
|
this.debug = false;
|
|
@@ -4863,33 +5165,33 @@ var TestStamp = class extends LitElement24 {
|
|
|
4863
5165
|
}));
|
|
4864
5166
|
}
|
|
4865
5167
|
render() {
|
|
4866
|
-
return
|
|
5168
|
+
return html25` ${this.debug ? html25`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing4}
|
|
4867
5169
|
${this.myTemplate ? this.myTemplate(this.stampContext) : nothing4}`;
|
|
4868
5170
|
}
|
|
4869
5171
|
};
|
|
4870
|
-
|
|
4871
|
-
|
|
5172
|
+
__decorate28([
|
|
5173
|
+
property20({ type: Boolean, reflect: true })
|
|
4872
5174
|
], TestStamp.prototype, "debug", void 0);
|
|
4873
|
-
|
|
5175
|
+
__decorate28([
|
|
4874
5176
|
state7(),
|
|
4875
|
-
|
|
5177
|
+
consume19({ context: computedContext, subscribe: true })
|
|
4876
5178
|
], TestStamp.prototype, "computedContext", void 0);
|
|
4877
|
-
|
|
5179
|
+
__decorate28([
|
|
4878
5180
|
state7()
|
|
4879
5181
|
], TestStamp.prototype, "stampContext", void 0);
|
|
4880
5182
|
|
|
4881
5183
|
// ../qti-test/dist/components/test-view-toggle/test-view.js
|
|
4882
|
-
import { html as
|
|
4883
|
-
import { property as
|
|
4884
|
-
import { consume as
|
|
4885
|
-
var
|
|
5184
|
+
import { html as html26, LitElement as LitElement27 } from "lit";
|
|
5185
|
+
import { property as property21, state as state8 } from "lit/decorators.js";
|
|
5186
|
+
import { consume as consume20 } from "@lit/context";
|
|
5187
|
+
var __decorate29 = function(decorators, target, key, desc) {
|
|
4886
5188
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4887
5189
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4888
5190
|
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;
|
|
4889
5191
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4890
5192
|
};
|
|
4891
5193
|
var _a;
|
|
4892
|
-
var TestView = class extends
|
|
5194
|
+
var TestView = class extends LitElement27 {
|
|
4893
5195
|
constructor() {
|
|
4894
5196
|
super(...arguments);
|
|
4895
5197
|
this.label = "view";
|
|
@@ -4914,14 +5216,10 @@ var TestView = class extends LitElement25 {
|
|
|
4914
5216
|
}
|
|
4915
5217
|
}
|
|
4916
5218
|
_switchView(view) {
|
|
4917
|
-
this
|
|
4918
|
-
composed: true,
|
|
4919
|
-
bubbles: true,
|
|
4920
|
-
detail: view
|
|
4921
|
-
}));
|
|
5219
|
+
dispatchPublic(this, "cito-test-switch-view", view);
|
|
4922
5220
|
}
|
|
4923
5221
|
render() {
|
|
4924
|
-
return
|
|
5222
|
+
return html26`
|
|
4925
5223
|
<label part="label" for="viewSelect">${this.label}</label>
|
|
4926
5224
|
<select
|
|
4927
5225
|
part="select"
|
|
@@ -4931,38 +5229,38 @@ var TestView = class extends LitElement25 {
|
|
|
4931
5229
|
this._switchView(el.value);
|
|
4932
5230
|
}}
|
|
4933
5231
|
>
|
|
4934
|
-
${this._viewOptions.map((v) =>
|
|
5232
|
+
${this._viewOptions.map((v) => html26`<option value="${v}" ?selected=${v === this.sessionContext.view}>${v}</option>`)}
|
|
4935
5233
|
</select>
|
|
4936
5234
|
`;
|
|
4937
5235
|
}
|
|
4938
5236
|
};
|
|
4939
5237
|
_a = TestView;
|
|
4940
|
-
|
|
4941
|
-
|
|
5238
|
+
__decorate29([
|
|
5239
|
+
consume20({ context: sessionContext, subscribe: true })
|
|
4942
5240
|
], TestView.prototype, "sessionContext", void 0);
|
|
4943
|
-
|
|
4944
|
-
|
|
5241
|
+
__decorate29([
|
|
5242
|
+
property21({ type: String })
|
|
4945
5243
|
], TestView.prototype, "label", void 0);
|
|
4946
|
-
|
|
4947
|
-
|
|
5244
|
+
__decorate29([
|
|
5245
|
+
property21({ type: String, attribute: "view-options" })
|
|
4948
5246
|
], TestView.prototype, "viewOptions", void 0);
|
|
4949
|
-
|
|
5247
|
+
__decorate29([
|
|
4950
5248
|
watch("viewOptions", { waitUntilFirstUpdate: true })
|
|
4951
5249
|
], TestView.prototype, "_handleViewOptionsChange", void 0);
|
|
4952
|
-
|
|
5250
|
+
__decorate29([
|
|
4953
5251
|
state8()
|
|
4954
5252
|
], TestView.prototype, "_viewOptions", void 0);
|
|
4955
5253
|
|
|
4956
5254
|
// ../qti-test/dist/components/test-view-toggle/test-view-toggle.js
|
|
4957
|
-
import { consume as
|
|
4958
|
-
import { html as
|
|
4959
|
-
var
|
|
5255
|
+
import { consume as consume21 } from "@lit/context";
|
|
5256
|
+
import { html as html27, LitElement as LitElement28, nothing as nothing5 } from "lit";
|
|
5257
|
+
var __decorate30 = function(decorators, target, key, desc) {
|
|
4960
5258
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4961
5259
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4962
5260
|
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;
|
|
4963
5261
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4964
5262
|
};
|
|
4965
|
-
var TestViewToggle = class extends
|
|
5263
|
+
var TestViewToggle = class extends LitElement28 {
|
|
4966
5264
|
createRenderRoot() {
|
|
4967
5265
|
return this;
|
|
4968
5266
|
}
|
|
@@ -4976,11 +5274,7 @@ var TestViewToggle = class extends LitElement26 {
|
|
|
4976
5274
|
this.myTemplate = prepareTemplate(templateElement);
|
|
4977
5275
|
}
|
|
4978
5276
|
_switchView(view) {
|
|
4979
|
-
this
|
|
4980
|
-
composed: true,
|
|
4981
|
-
bubbles: true,
|
|
4982
|
-
detail: view
|
|
4983
|
-
}));
|
|
5277
|
+
dispatchPublic(this, "cito-test-switch-view", view);
|
|
4984
5278
|
}
|
|
4985
5279
|
firstUpdated(_changedProperties) {
|
|
4986
5280
|
this.addEventListener("click", () => {
|
|
@@ -4992,13 +5286,13 @@ var TestViewToggle = class extends LitElement26 {
|
|
|
4992
5286
|
});
|
|
4993
5287
|
}
|
|
4994
5288
|
render() {
|
|
4995
|
-
return
|
|
5289
|
+
return html27`${this.myTemplate ? this.myTemplate({
|
|
4996
5290
|
view: this.sessionContext?.view
|
|
4997
5291
|
}) : nothing5}`;
|
|
4998
5292
|
}
|
|
4999
5293
|
};
|
|
5000
|
-
|
|
5001
|
-
|
|
5294
|
+
__decorate30([
|
|
5295
|
+
consume21({ context: sessionContext, subscribe: true })
|
|
5002
5296
|
], TestViewToggle.prototype, "sessionContext", void 0);
|
|
5003
5297
|
|
|
5004
5298
|
// ../qti-test/dist/elements.js
|
|
@@ -5006,9 +5300,12 @@ var qtiTestElements = [
|
|
|
5006
5300
|
{ tag: "qti-assessment-item-ref", ctor: QtiAssessmentItemRef },
|
|
5007
5301
|
{ tag: "qti-assessment-section", ctor: QtiAssessmentSection },
|
|
5008
5302
|
{ tag: "qti-assessment-test", ctor: QtiAssessmentTest },
|
|
5303
|
+
{ tag: "qti-branch-rule", ctor: QtiBranchRule },
|
|
5009
5304
|
{ tag: "qti-item-session-control", ctor: QtiItemSessionControl },
|
|
5305
|
+
{ tag: "qti-number-presented", ctor: QtiNumberPresented },
|
|
5010
5306
|
{ tag: "qti-number-selected", ctor: QtiNumberSelected },
|
|
5011
5307
|
{ tag: "qti-outcome-processing", ctor: QtiOutcomeProcessing },
|
|
5308
|
+
{ tag: "qti-pre-condition", ctor: QtiPreCondition },
|
|
5012
5309
|
{ tag: "qti-test", ctor: QtiTest },
|
|
5013
5310
|
{ tag: "qti-test-feedback", ctor: QtiTestFeedback },
|
|
5014
5311
|
{ tag: "qti-test-part", ctor: QtiTestPart },
|
|
@@ -5044,8 +5341,11 @@ export {
|
|
|
5044
5341
|
QtiAssessmentItemRef,
|
|
5045
5342
|
QtiAssessmentSection,
|
|
5046
5343
|
QtiAssessmentTest,
|
|
5344
|
+
QtiBranchRule,
|
|
5047
5345
|
QtiItemSessionControl,
|
|
5346
|
+
QtiNumberPresented,
|
|
5048
5347
|
QtiNumberSelected,
|
|
5348
|
+
QtiPreCondition,
|
|
5049
5349
|
QtiOutcomeProcessing,
|
|
5050
5350
|
QtiOutcomeProcessingProcessor,
|
|
5051
5351
|
QtiTestFeedback,
|
|
@@ -5094,4 +5394,4 @@ export {
|
|
|
5094
5394
|
* Portions Copyright (c) 2013, the Dart project authors.
|
|
5095
5395
|
*)
|
|
5096
5396
|
*/
|
|
5097
|
-
//# sourceMappingURL=chunk-
|
|
5397
|
+
//# sourceMappingURL=chunk-EAQOUBXA.js.map
|