@citolab/qti-components 10.0.0-next.12 → 10.0.0-next.13
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 +227 -176
- package/dist/base.d.ts +2 -2
- package/dist/base.js +1 -1
- package/dist/{chunk-YOCOLMGB.js → chunk-AKX4YMWU.js} +2 -2
- package/dist/chunk-DVLSXMXD.js +7 -0
- package/dist/chunk-DVLSXMXD.js.map +1 -0
- package/dist/{chunk-PLP3YX6C.js → chunk-EIBGCCXH.js} +2 -2
- package/dist/{chunk-RWMY7KRT.js → chunk-FLAD6SC6.js} +2 -2
- package/dist/{chunk-AVZRY5SQ.js → chunk-G6LTYTJR.js} +2 -2
- package/dist/{chunk-OHRAG2UM.js → chunk-H3GITIPE.js} +36 -15
- package/dist/chunk-H3GITIPE.js.map +1 -0
- package/dist/{chunk-O76BOKAP.js → chunk-HOGJ5ZNW.js} +8 -6
- package/dist/{chunk-O76BOKAP.js.map → chunk-HOGJ5ZNW.js.map} +1 -1
- package/dist/{chunk-AJ5U5KXR.js → chunk-K4WLYVDT.js} +2 -2
- package/dist/{chunk-LCGPLQLE.js → chunk-MDBNEEPH.js} +2 -2
- package/dist/{chunk-M7X6TWSX.js → chunk-PHRHLDQB.js} +2 -2
- package/dist/{chunk-XXJAE6AP.js → chunk-PYHKCIYN.js} +3 -3
- package/dist/{chunk-T7YSBBAA.js → chunk-WUIA4OOX.js} +1 -1
- package/dist/chunk-WUIA4OOX.js.map +1 -0
- package/dist/{chunk-5K5JO7OG.js → chunk-Y5DZTCDP.js} +179 -103
- package/dist/chunk-Y5DZTCDP.js.map +1 -0
- package/dist/{config.context.d-BvU9r-Mg.d.ts → config.context.d-BniMHSBB.d.ts} +3 -2
- package/dist/corrections.d.ts +16 -6
- package/dist/corrections.js +8 -8
- package/dist/elements.js +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +15 -13
- package/dist/interactions.d.ts +4 -4
- package/dist/interactions.js +3 -3
- package/dist/item.css +36 -16
- package/dist/item.d.ts +2 -2
- package/dist/item.js +4 -4
- package/dist/processing.js +3 -3
- package/dist/qti-components-jsx.d.ts +78 -11
- package/dist/{qti-item.d-B1gffYCL.d.ts → qti-item.d-BqWYBdV2.d.ts} +1 -1
- package/dist/{qti-test.d-D5C7W8Lg.d.ts → qti-test.d-B6AGSQlk.d.ts} +29 -3
- package/dist/{qti-text-entry-interaction.d-CU-fAAD1.d.ts → qti-text-entry-interaction.d-B44Z3qUG.d.ts} +6 -4
- package/dist/{record.d-wB9uYs-j.d.ts → record.d-C6m0Y4xr.d.ts} +1 -1
- package/dist/test.d.ts +7 -4
- package/dist/test.js +7 -5
- package/package.json +9 -9
- package/dist/chunk-5K5JO7OG.js.map +0 -1
- package/dist/chunk-OHRAG2UM.js.map +0 -1
- package/dist/chunk-T7YSBBAA.js.map +0 -1
- package/dist/chunk-YKXVAXSI.js +0 -7
- package/dist/chunk-YKXVAXSI.js.map +0 -1
- /package/dist/{chunk-YOCOLMGB.js.map → chunk-AKX4YMWU.js.map} +0 -0
- /package/dist/{chunk-PLP3YX6C.js.map → chunk-EIBGCCXH.js.map} +0 -0
- /package/dist/{chunk-RWMY7KRT.js.map → chunk-FLAD6SC6.js.map} +0 -0
- /package/dist/{chunk-AVZRY5SQ.js.map → chunk-G6LTYTJR.js.map} +0 -0
- /package/dist/{chunk-AJ5U5KXR.js.map → chunk-K4WLYVDT.js.map} +0 -0
- /package/dist/{chunk-LCGPLQLE.js.map → chunk-MDBNEEPH.js.map} +0 -0
- /package/dist/{chunk-M7X6TWSX.js.map → chunk-PHRHLDQB.js.map} +0 -0
- /package/dist/{chunk-XXJAE6AP.js.map → chunk-PYHKCIYN.js.map} +0 -0
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
dispatchDeclared,
|
|
4
4
|
listenDeclared,
|
|
5
5
|
listenPublic
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AKX4YMWU.js";
|
|
7
7
|
import {
|
|
8
8
|
item_css_default
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DVLSXMXD.js";
|
|
10
10
|
import {
|
|
11
11
|
watch
|
|
12
12
|
} from "./chunk-4DB4SC5K.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
qtiContext,
|
|
26
26
|
sessionContext,
|
|
27
27
|
testContext
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-WUIA4OOX.js";
|
|
29
29
|
|
|
30
30
|
// ../qti-test/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js
|
|
31
31
|
import { LitElement, nothing as nothing2 } from "lit";
|
|
@@ -2542,7 +2542,7 @@ var TestBaseMixin = (superClass) => {
|
|
|
2542
2542
|
* @param itemRefID The `qti-assessment-item-ref` identifier, not the item's own identifier.
|
|
2543
2543
|
* @param state Opaque per-interaction state keyed by response identifier, e.g. a PCI's `getState()`.
|
|
2544
2544
|
*/
|
|
2545
|
-
updateItemVariables(itemRefID, values,
|
|
2545
|
+
updateItemVariables(itemRefID, values, state10) {
|
|
2546
2546
|
this.testContext = {
|
|
2547
2547
|
...this.testContext,
|
|
2548
2548
|
items: this.testContext.items.map((item) => {
|
|
@@ -2562,15 +2562,15 @@ var TestBaseMixin = (superClass) => {
|
|
|
2562
2562
|
else
|
|
2563
2563
|
variables.push(updated);
|
|
2564
2564
|
}
|
|
2565
|
-
return { ...item, variables, ...
|
|
2565
|
+
return { ...item, variables, ...state10 ? { state: { ...state10 } } : {} };
|
|
2566
2566
|
})
|
|
2567
2567
|
};
|
|
2568
2568
|
const assessmentItem = this._testElement?.querySelector(`qti-assessment-item-ref[identifier="${CSS.escape(itemRefID)}"]`)?.assessmentItem;
|
|
2569
2569
|
if (!assessmentItem)
|
|
2570
2570
|
return;
|
|
2571
2571
|
assessmentItem.variables = [...this.testContext.items.find((i) => i.identifier === itemRefID)?.variables ?? []];
|
|
2572
|
-
if (
|
|
2573
|
-
assessmentItem.state =
|
|
2572
|
+
if (state10)
|
|
2573
|
+
assessmentItem.state = state10;
|
|
2574
2574
|
}
|
|
2575
2575
|
_initializeEventListeners() {
|
|
2576
2576
|
this.addEventListener("qti-testdoc-loaded", () => {
|
|
@@ -2607,7 +2607,7 @@ var TestBaseMixin = (superClass) => {
|
|
|
2607
2607
|
this._updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail.itemContext.variables, e.detail.itemContext.state, e.detail.itemContext.valid);
|
|
2608
2608
|
});
|
|
2609
2609
|
}
|
|
2610
|
-
_updateItemVariablesInTestContext(identifier, variables,
|
|
2610
|
+
_updateItemVariablesInTestContext(identifier, variables, state10, valid) {
|
|
2611
2611
|
this.testContext = {
|
|
2612
2612
|
...this.testContext,
|
|
2613
2613
|
// Spread existing test context properties
|
|
@@ -2622,7 +2622,7 @@ var TestBaseMixin = (superClass) => {
|
|
|
2622
2622
|
const matchingVariable = itemContext.variables.find((v) => v.identifier === variable.identifier);
|
|
2623
2623
|
return matchingVariable ? { ...matchingVariable, ...variable } : variable;
|
|
2624
2624
|
}),
|
|
2625
|
-
...
|
|
2625
|
+
...state10 !== void 0 ? { state: state10 ? { ...state10 } : void 0 } : {},
|
|
2626
2626
|
...valid !== void 0 ? { valid } : {}
|
|
2627
2627
|
};
|
|
2628
2628
|
})
|
|
@@ -2662,8 +2662,8 @@ var TestBase = class extends TestBaseMixin(LitElement9) {
|
|
|
2662
2662
|
// ../qti-test/dist/mixins/test-state.mixin.js
|
|
2663
2663
|
var copy = (value) => Array.isArray(value) ? [...value] : value ?? null;
|
|
2664
2664
|
var isQtiTestState = (value) => {
|
|
2665
|
-
const
|
|
2666
|
-
return
|
|
2665
|
+
const state10 = value;
|
|
2666
|
+
return state10?.version === QTI_TEST_STATE_VERSION && Array.isArray(state10.test?.items) && Array.isArray(state10.test?.outcomes) && typeof state10.session === "object" && state10.session !== null;
|
|
2667
2667
|
};
|
|
2668
2668
|
var toState = (test, session) => ({
|
|
2669
2669
|
version: QTI_TEST_STATE_VERSION,
|
|
@@ -2753,25 +2753,25 @@ var TestStateMixin = (superClass) => {
|
|
|
2753
2753
|
super.updated(changed);
|
|
2754
2754
|
if (!this.#ready || !(changed.has("testContext") || changed.has("sessionContext")))
|
|
2755
2755
|
return;
|
|
2756
|
-
const
|
|
2757
|
-
const serialized = JSON.stringify(
|
|
2756
|
+
const state10 = this.state;
|
|
2757
|
+
const serialized = JSON.stringify(state10);
|
|
2758
2758
|
if (serialized === this.#lastEmitted)
|
|
2759
2759
|
return;
|
|
2760
2760
|
this.#lastEmitted = serialized;
|
|
2761
|
-
dispatchPublic(this, "cito-test-state-changed",
|
|
2761
|
+
dispatchPublic(this, "cito-test-state-changed", state10);
|
|
2762
2762
|
}
|
|
2763
|
-
#apply(
|
|
2764
|
-
for (const saved of
|
|
2763
|
+
#apply(state10) {
|
|
2764
|
+
for (const saved of state10.test.items)
|
|
2765
2765
|
this.updateItemVariables(saved.identifier, saved.variables, saved.state);
|
|
2766
|
-
const savedOutcomes = new Map(
|
|
2766
|
+
const savedOutcomes = new Map(state10.test.outcomes.map((outcome) => [outcome.identifier, outcome.value]));
|
|
2767
2767
|
this.testContext = {
|
|
2768
2768
|
...this.testContext,
|
|
2769
2769
|
testOutcomeVariables: this.testContext.testOutcomeVariables?.map((v) => savedOutcomes.has(v.identifier) ? { ...v, value: copy(savedOutcomes.get(v.identifier)) } : v)
|
|
2770
2770
|
};
|
|
2771
2771
|
this.sessionContext = {
|
|
2772
2772
|
...this.sessionContext,
|
|
2773
|
-
...this.#validSession(
|
|
2774
|
-
plugins:
|
|
2773
|
+
...this.#validSession(state10.session),
|
|
2774
|
+
plugins: state10.session.plugins && typeof state10.session.plugins === "object" ? { ...state10.session.plugins } : {}
|
|
2775
2775
|
};
|
|
2776
2776
|
}
|
|
2777
2777
|
/** A stored position may point at an item or section a revised test no longer has. */
|
|
@@ -4320,17 +4320,91 @@ __decorate23([
|
|
|
4320
4320
|
consume13({ context: computedContext, subscribe: true })
|
|
4321
4321
|
], TestPrintVariables.prototype, "computedContext", void 0);
|
|
4322
4322
|
|
|
4323
|
+
// ../qti-test/dist/components/test-print-state/test-print-state.js
|
|
4324
|
+
import { css as css14, html as html21, LitElement as LitElement22, nothing as nothing3 } from "lit";
|
|
4325
|
+
import { state as state6 } from "lit/decorators.js";
|
|
4326
|
+
var __decorate24 = function(decorators, target, key, desc) {
|
|
4327
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4328
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4329
|
+
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;
|
|
4330
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4331
|
+
};
|
|
4332
|
+
var TestPrintState = class extends LitElement22 {
|
|
4333
|
+
#test = null;
|
|
4334
|
+
static {
|
|
4335
|
+
this.styles = css14`
|
|
4336
|
+
:host {
|
|
4337
|
+
display: block;
|
|
4338
|
+
}
|
|
4339
|
+
ul {
|
|
4340
|
+
list-style: none;
|
|
4341
|
+
margin: 0;
|
|
4342
|
+
padding-inline-start: 1rem;
|
|
4343
|
+
}
|
|
4344
|
+
summary {
|
|
4345
|
+
cursor: pointer;
|
|
4346
|
+
}
|
|
4347
|
+
[part~='count'] {
|
|
4348
|
+
opacity: 0.7;
|
|
4349
|
+
}
|
|
4350
|
+
`;
|
|
4351
|
+
}
|
|
4352
|
+
#onStateChanged = (event) => {
|
|
4353
|
+
this.testState = event.detail;
|
|
4354
|
+
};
|
|
4355
|
+
connectedCallback() {
|
|
4356
|
+
super.connectedCallback();
|
|
4357
|
+
this.#test = this.closest("qti-test");
|
|
4358
|
+
this.#test?.addEventListener("cito-test-state-changed", this.#onStateChanged);
|
|
4359
|
+
this.testState = this.#test?.state;
|
|
4360
|
+
}
|
|
4361
|
+
disconnectedCallback() {
|
|
4362
|
+
super.disconnectedCallback();
|
|
4363
|
+
this.#test?.removeEventListener("cito-test-state-changed", this.#onStateChanged);
|
|
4364
|
+
this.#test = null;
|
|
4365
|
+
}
|
|
4366
|
+
render() {
|
|
4367
|
+
if (!this.testState)
|
|
4368
|
+
return nothing3;
|
|
4369
|
+
return html21`<ul>
|
|
4370
|
+
${this.#renderNode("state", this.testState, 0)}
|
|
4371
|
+
</ul>`;
|
|
4372
|
+
}
|
|
4373
|
+
#renderNode(label, value, depth) {
|
|
4374
|
+
if (value === null || typeof value !== "object") {
|
|
4375
|
+
return html21`<li><span part="key">${label}</span>: <span part="value">${JSON.stringify(value)}</span></li>`;
|
|
4376
|
+
}
|
|
4377
|
+
const entries = Array.isArray(value) ? value.map((entry, index) => [entryLabel(entry, index), entry]) : Object.entries(value);
|
|
4378
|
+
const count = Array.isArray(value) ? `[${entries.length}]` : `{${entries.length}}`;
|
|
4379
|
+
return html21`<li>
|
|
4380
|
+
<details ?open=${depth < 2}>
|
|
4381
|
+
<summary><span part="key">${label}</span> <span part="count">${count}</span></summary>
|
|
4382
|
+
<ul>
|
|
4383
|
+
${entries.map(([key, entry]) => this.#renderNode(key, entry, depth + 1))}
|
|
4384
|
+
</ul>
|
|
4385
|
+
</details>
|
|
4386
|
+
</li>`;
|
|
4387
|
+
}
|
|
4388
|
+
};
|
|
4389
|
+
__decorate24([
|
|
4390
|
+
state6()
|
|
4391
|
+
], TestPrintState.prototype, "testState", void 0);
|
|
4392
|
+
var entryLabel = (entry, index) => {
|
|
4393
|
+
const identifier = entry?.identifier;
|
|
4394
|
+
return typeof identifier === "string" ? `${index} \xB7 ${identifier}` : String(index);
|
|
4395
|
+
};
|
|
4396
|
+
|
|
4323
4397
|
// ../qti-test/dist/components/test-scoring-buttons/test-scoring-buttons.js
|
|
4324
|
-
import { html as
|
|
4398
|
+
import { html as html22, LitElement as LitElement23, nothing as nothing4 } from "lit";
|
|
4325
4399
|
import { consume as consume14 } from "@lit/context";
|
|
4326
4400
|
import { property as property19 } from "lit/decorators.js";
|
|
4327
|
-
var
|
|
4401
|
+
var __decorate25 = function(decorators, target, key, desc) {
|
|
4328
4402
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4329
4403
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4330
4404
|
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;
|
|
4331
4405
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4332
4406
|
};
|
|
4333
|
-
var TestScoringButtons = class extends
|
|
4407
|
+
var TestScoringButtons = class extends LitElement23 {
|
|
4334
4408
|
createRenderRoot() {
|
|
4335
4409
|
return this;
|
|
4336
4410
|
}
|
|
@@ -4356,15 +4430,15 @@ var TestScoringButtons = class extends LitElement22 {
|
|
|
4356
4430
|
render() {
|
|
4357
4431
|
const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
|
|
4358
4432
|
if (!activeItem || !activeItem.variables)
|
|
4359
|
-
return
|
|
4433
|
+
return html22``;
|
|
4360
4434
|
const maxScore = activeItem.variables.find((vr) => vr.identifier == "MAXSCORE")?.value;
|
|
4361
4435
|
const scoreOutcome = activeItem.variables.find((vr) => vr.identifier == "SCORE");
|
|
4362
4436
|
const score = scoreOutcome?.value;
|
|
4363
4437
|
const disabled = !(scoreOutcome?.externalScored === "human");
|
|
4364
4438
|
if (!maxScore || !scoreOutcome)
|
|
4365
|
-
return
|
|
4439
|
+
return nothing4;
|
|
4366
4440
|
const scores = [...Array(Number(maxScore) + 1).keys()];
|
|
4367
|
-
return
|
|
4441
|
+
return html22`${this.myTemplate ? this.myTemplate({ scores, score, disabled }) : nothing4}`;
|
|
4368
4442
|
}
|
|
4369
4443
|
constructor() {
|
|
4370
4444
|
super();
|
|
@@ -4380,27 +4454,27 @@ var TestScoringButtons = class extends LitElement22 {
|
|
|
4380
4454
|
});
|
|
4381
4455
|
}
|
|
4382
4456
|
};
|
|
4383
|
-
|
|
4457
|
+
__decorate25([
|
|
4384
4458
|
property19({ type: String, attribute: "view" })
|
|
4385
4459
|
], TestScoringButtons.prototype, "view", void 0);
|
|
4386
|
-
|
|
4460
|
+
__decorate25([
|
|
4387
4461
|
property19({ type: Boolean })
|
|
4388
4462
|
], TestScoringButtons.prototype, "disabled", void 0);
|
|
4389
|
-
|
|
4463
|
+
__decorate25([
|
|
4390
4464
|
consume14({ context: computedContext, subscribe: true })
|
|
4391
4465
|
], TestScoringButtons.prototype, "computedContext", void 0);
|
|
4392
4466
|
|
|
4393
4467
|
// ../qti-test/dist/components/test-scoring-feedback/test-scoring-feedback.js
|
|
4394
4468
|
import { consume as consume15 } from "@lit/context";
|
|
4395
|
-
import { html as
|
|
4469
|
+
import { html as html23, LitElement as LitElement24 } from "lit";
|
|
4396
4470
|
import { property as property20 } from "lit/decorators.js";
|
|
4397
|
-
var
|
|
4471
|
+
var __decorate26 = function(decorators, target, key, desc) {
|
|
4398
4472
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4399
4473
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4400
4474
|
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;
|
|
4401
4475
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4402
4476
|
};
|
|
4403
|
-
var TestScoringFeedback = class extends
|
|
4477
|
+
var TestScoringFeedback = class extends LitElement24 {
|
|
4404
4478
|
constructor() {
|
|
4405
4479
|
super(...arguments);
|
|
4406
4480
|
this.view = null;
|
|
@@ -4408,9 +4482,9 @@ var TestScoringFeedback = class extends LitElement23 {
|
|
|
4408
4482
|
render() {
|
|
4409
4483
|
const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
|
|
4410
4484
|
if (!activeItem || !activeItem.variables)
|
|
4411
|
-
return
|
|
4485
|
+
return html23``;
|
|
4412
4486
|
if (activeItem["category"] === "dep-informational")
|
|
4413
|
-
return
|
|
4487
|
+
return html23`<div>${this.dataset.informational}</div>`;
|
|
4414
4488
|
const completionStatus = activeItem?.variables.find((v) => v.identifier === "completionStatus")?.value;
|
|
4415
4489
|
const scoreOutcome = activeItem?.variables.find((vr) => vr.identifier == "SCORE");
|
|
4416
4490
|
const score = parseFloat(scoreOutcome?.value);
|
|
@@ -4430,27 +4504,27 @@ var TestScoringFeedback = class extends LitElement23 {
|
|
|
4430
4504
|
}
|
|
4431
4505
|
return this.dataset.inProgress;
|
|
4432
4506
|
};
|
|
4433
|
-
return
|
|
4507
|
+
return html23`<div>${feedbackText()}</div>`;
|
|
4434
4508
|
}
|
|
4435
4509
|
};
|
|
4436
|
-
|
|
4510
|
+
__decorate26([
|
|
4437
4511
|
consume15({ context: computedContext, subscribe: true })
|
|
4438
4512
|
], TestScoringFeedback.prototype, "computedContext", void 0);
|
|
4439
|
-
|
|
4513
|
+
__decorate26([
|
|
4440
4514
|
property20({ type: String, attribute: "view" })
|
|
4441
4515
|
], TestScoringFeedback.prototype, "view", void 0);
|
|
4442
4516
|
|
|
4443
4517
|
// ../qti-test/dist/components/test-stamp/test-stamp.js
|
|
4444
|
-
import { html as
|
|
4445
|
-
import { property as property21, state as
|
|
4518
|
+
import { html as html24, LitElement as LitElement25, nothing as nothing5 } from "lit";
|
|
4519
|
+
import { property as property21, state as state7 } from "lit/decorators.js";
|
|
4446
4520
|
import { consume as consume16 } from "@lit/context";
|
|
4447
|
-
var
|
|
4521
|
+
var __decorate27 = function(decorators, target, key, desc) {
|
|
4448
4522
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4449
4523
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4450
4524
|
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;
|
|
4451
4525
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4452
4526
|
};
|
|
4453
|
-
var TestStamp = class extends
|
|
4527
|
+
var TestStamp = class extends LitElement25 {
|
|
4454
4528
|
constructor() {
|
|
4455
4529
|
super(...arguments);
|
|
4456
4530
|
this.debug = false;
|
|
@@ -4516,26 +4590,26 @@ var TestStamp = class extends LitElement24 {
|
|
|
4516
4590
|
}));
|
|
4517
4591
|
}
|
|
4518
4592
|
render() {
|
|
4519
|
-
return
|
|
4520
|
-
${this.myTemplate ? this.myTemplate(this.stampContext) :
|
|
4593
|
+
return html24` ${this.debug ? html24`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing5}
|
|
4594
|
+
${this.myTemplate ? this.myTemplate(this.stampContext) : nothing5}`;
|
|
4521
4595
|
}
|
|
4522
4596
|
};
|
|
4523
|
-
|
|
4597
|
+
__decorate27([
|
|
4524
4598
|
property21({ type: Boolean, reflect: true })
|
|
4525
4599
|
], TestStamp.prototype, "debug", void 0);
|
|
4526
|
-
|
|
4527
|
-
|
|
4600
|
+
__decorate27([
|
|
4601
|
+
state7(),
|
|
4528
4602
|
consume16({ context: computedContext, subscribe: true })
|
|
4529
4603
|
], TestStamp.prototype, "computedContext", void 0);
|
|
4530
|
-
|
|
4531
|
-
|
|
4604
|
+
__decorate27([
|
|
4605
|
+
state7()
|
|
4532
4606
|
], TestStamp.prototype, "stampContext", void 0);
|
|
4533
4607
|
|
|
4534
4608
|
// ../qti-test/dist/components/test-submit/test-submit.js
|
|
4535
|
-
import { css as
|
|
4536
|
-
var TestSubmit = class extends
|
|
4609
|
+
import { css as css15, html as html25, LitElement as LitElement26 } from "lit";
|
|
4610
|
+
var TestSubmit = class extends LitElement26 {
|
|
4537
4611
|
static {
|
|
4538
|
-
this.styles =
|
|
4612
|
+
this.styles = css15`
|
|
4539
4613
|
:host {
|
|
4540
4614
|
${btn};
|
|
4541
4615
|
}
|
|
@@ -4560,22 +4634,22 @@ var TestSubmit = class extends LitElement25 {
|
|
|
4560
4634
|
this.addEventListener("click", () => dispatchPublic(this, "cito-test-submit", {}));
|
|
4561
4635
|
}
|
|
4562
4636
|
render() {
|
|
4563
|
-
return
|
|
4637
|
+
return html25` <slot></slot> `;
|
|
4564
4638
|
}
|
|
4565
4639
|
};
|
|
4566
4640
|
|
|
4567
4641
|
// ../qti-test/dist/components/test-view-toggle/test-view.js
|
|
4568
|
-
import { html as
|
|
4569
|
-
import { property as property22, state as
|
|
4642
|
+
import { html as html26, LitElement as LitElement27 } from "lit";
|
|
4643
|
+
import { property as property22, state as state8 } from "lit/decorators.js";
|
|
4570
4644
|
import { consume as consume17 } from "@lit/context";
|
|
4571
|
-
var
|
|
4645
|
+
var __decorate28 = function(decorators, target, key, desc) {
|
|
4572
4646
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4573
4647
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4574
4648
|
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;
|
|
4575
4649
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4576
4650
|
};
|
|
4577
4651
|
var _a;
|
|
4578
|
-
var TestView = class extends
|
|
4652
|
+
var TestView = class extends LitElement27 {
|
|
4579
4653
|
constructor() {
|
|
4580
4654
|
super(...arguments);
|
|
4581
4655
|
this.label = "view";
|
|
@@ -4603,7 +4677,7 @@ var TestView = class extends LitElement26 {
|
|
|
4603
4677
|
dispatchPublic(this, "cito-test-switch-view", view);
|
|
4604
4678
|
}
|
|
4605
4679
|
render() {
|
|
4606
|
-
return
|
|
4680
|
+
return html26`
|
|
4607
4681
|
<label part="label" for="viewSelect">${this.label}</label>
|
|
4608
4682
|
<select
|
|
4609
4683
|
part="select"
|
|
@@ -4613,38 +4687,38 @@ var TestView = class extends LitElement26 {
|
|
|
4613
4687
|
this._switchView(el.value);
|
|
4614
4688
|
}}
|
|
4615
4689
|
>
|
|
4616
|
-
${this._viewOptions.map((v) =>
|
|
4690
|
+
${this._viewOptions.map((v) => html26`<option value="${v}" ?selected=${v === this.sessionContext.view}>${v}</option>`)}
|
|
4617
4691
|
</select>
|
|
4618
4692
|
`;
|
|
4619
4693
|
}
|
|
4620
4694
|
};
|
|
4621
4695
|
_a = TestView;
|
|
4622
|
-
|
|
4696
|
+
__decorate28([
|
|
4623
4697
|
consume17({ context: sessionContext, subscribe: true })
|
|
4624
4698
|
], TestView.prototype, "sessionContext", void 0);
|
|
4625
|
-
|
|
4699
|
+
__decorate28([
|
|
4626
4700
|
property22({ type: String })
|
|
4627
4701
|
], TestView.prototype, "label", void 0);
|
|
4628
|
-
|
|
4702
|
+
__decorate28([
|
|
4629
4703
|
property22({ type: String, attribute: "view-options" })
|
|
4630
4704
|
], TestView.prototype, "viewOptions", void 0);
|
|
4631
|
-
|
|
4705
|
+
__decorate28([
|
|
4632
4706
|
watch("viewOptions", { waitUntilFirstUpdate: true })
|
|
4633
4707
|
], TestView.prototype, "_handleViewOptionsChange", void 0);
|
|
4634
|
-
|
|
4635
|
-
|
|
4708
|
+
__decorate28([
|
|
4709
|
+
state8()
|
|
4636
4710
|
], TestView.prototype, "_viewOptions", void 0);
|
|
4637
4711
|
|
|
4638
4712
|
// ../qti-test/dist/components/test-view-toggle/test-view-toggle.js
|
|
4639
4713
|
import { consume as consume18 } from "@lit/context";
|
|
4640
|
-
import { html as
|
|
4641
|
-
var
|
|
4714
|
+
import { html as html27, LitElement as LitElement28, nothing as nothing6 } from "lit";
|
|
4715
|
+
var __decorate29 = function(decorators, target, key, desc) {
|
|
4642
4716
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4643
4717
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4644
4718
|
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;
|
|
4645
4719
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4646
4720
|
};
|
|
4647
|
-
var TestViewToggle = class extends
|
|
4721
|
+
var TestViewToggle = class extends LitElement28 {
|
|
4648
4722
|
createRenderRoot() {
|
|
4649
4723
|
return this;
|
|
4650
4724
|
}
|
|
@@ -4670,21 +4744,21 @@ var TestViewToggle = class extends LitElement27 {
|
|
|
4670
4744
|
});
|
|
4671
4745
|
}
|
|
4672
4746
|
render() {
|
|
4673
|
-
return
|
|
4747
|
+
return html27`${this.myTemplate ? this.myTemplate({
|
|
4674
4748
|
view: this.sessionContext?.view
|
|
4675
|
-
}) :
|
|
4749
|
+
}) : nothing6}`;
|
|
4676
4750
|
}
|
|
4677
4751
|
};
|
|
4678
|
-
|
|
4752
|
+
__decorate29([
|
|
4679
4753
|
consume18({ context: sessionContext, subscribe: true })
|
|
4680
4754
|
], TestViewToggle.prototype, "sessionContext", void 0);
|
|
4681
4755
|
|
|
4682
4756
|
// ../qti-test/dist/tts/test-item-to-speech.js
|
|
4683
|
-
import { html as
|
|
4757
|
+
import { html as html28, LitElement as LitElement29, css as css16 } from "lit";
|
|
4684
4758
|
import { consume as consume19, provide as provide4, createContext as createContext2 } from "@lit/context";
|
|
4685
|
-
import { property as property23, state as
|
|
4759
|
+
import { property as property23, state as state9 } from "lit/decorators.js";
|
|
4686
4760
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
4687
|
-
var
|
|
4761
|
+
var __decorate30 = function(decorators, target, key, desc) {
|
|
4688
4762
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4689
4763
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4690
4764
|
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;
|
|
@@ -4719,14 +4793,14 @@ var ICONS = {
|
|
|
4719
4793
|
pick: "M5 3l13 7-5.5 1.6 3.4 6.6-2.4 1.3-3.4-6.7L6 17z"
|
|
4720
4794
|
};
|
|
4721
4795
|
var iconContent = (icon, label) => {
|
|
4722
|
-
const svg =
|
|
4796
|
+
const svg = html28`<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
4723
4797
|
<path d="${ICONS[icon]}"></path>
|
|
4724
4798
|
</svg>`;
|
|
4725
|
-
return
|
|
4799
|
+
return html28`${svg}<span class="label">${label}</span>`;
|
|
4726
4800
|
};
|
|
4727
|
-
var TtsButtonBase = class extends
|
|
4801
|
+
var TtsButtonBase = class extends LitElement29 {
|
|
4728
4802
|
static {
|
|
4729
|
-
this.styles =
|
|
4803
|
+
this.styles = css16`
|
|
4730
4804
|
:host {
|
|
4731
4805
|
display: inline-flex;
|
|
4732
4806
|
}
|
|
@@ -4782,28 +4856,28 @@ var TtsButtonBase = class extends LitElement28 {
|
|
|
4782
4856
|
#mirroredState;
|
|
4783
4857
|
#mirroredPicking = false;
|
|
4784
4858
|
updated(_changed) {
|
|
4785
|
-
const
|
|
4859
|
+
const state10 = this._tts?.state;
|
|
4786
4860
|
const picking = this._tts?.picking ?? false;
|
|
4787
|
-
if (
|
|
4861
|
+
if (state10 === this.#mirroredState && picking === this.#mirroredPicking)
|
|
4788
4862
|
return;
|
|
4789
|
-
this.#mirroredState =
|
|
4863
|
+
this.#mirroredState = state10;
|
|
4790
4864
|
this.#mirroredPicking = picking;
|
|
4791
4865
|
this.#internals.states.clear();
|
|
4792
|
-
if (
|
|
4793
|
-
this.#internals.states.add(
|
|
4866
|
+
if (state10)
|
|
4867
|
+
this.#internals.states.add(state10);
|
|
4794
4868
|
if (picking)
|
|
4795
4869
|
this.#internals.states.add("picking");
|
|
4796
4870
|
}
|
|
4797
4871
|
};
|
|
4798
|
-
|
|
4872
|
+
__decorate30([
|
|
4799
4873
|
property23({ type: String })
|
|
4800
4874
|
], TtsButtonBase.prototype, "label", void 0);
|
|
4801
|
-
|
|
4875
|
+
__decorate30([
|
|
4802
4876
|
consume19({ context: ttsContext, subscribe: true })
|
|
4803
4877
|
], TtsButtonBase.prototype, "_tts", void 0);
|
|
4804
|
-
var TestItemToSpeech = class extends
|
|
4878
|
+
var TestItemToSpeech = class extends LitElement29 {
|
|
4805
4879
|
static {
|
|
4806
|
-
this.styles =
|
|
4880
|
+
this.styles = css16`
|
|
4807
4881
|
:host {
|
|
4808
4882
|
display: inline-flex;
|
|
4809
4883
|
flex-wrap: wrap;
|
|
@@ -4961,7 +5035,7 @@ var TestItemToSpeech = class extends LitElement28 {
|
|
|
4961
5035
|
this.#contentMode = false;
|
|
4962
5036
|
}
|
|
4963
5037
|
render() {
|
|
4964
|
-
return
|
|
5038
|
+
return html28`<slot></slot>`;
|
|
4965
5039
|
}
|
|
4966
5040
|
/** Item-ref mode: our item rendered again, so the elements collected earlier are detached. */
|
|
4967
5041
|
#handleItemConnected() {
|
|
@@ -5036,12 +5110,12 @@ var TestItemToSpeech = class extends LitElement28 {
|
|
|
5036
5110
|
return item ? this._computedContext?.itemElement?.(item) ?? null : null;
|
|
5037
5111
|
}
|
|
5038
5112
|
/** Update speech state on both the context (notifies children) and the host's CSS custom states. */
|
|
5039
|
-
#setSpeechState(
|
|
5040
|
-
this._ttsContext = { ...this._ttsContext, state:
|
|
5113
|
+
#setSpeechState(state10) {
|
|
5114
|
+
this._ttsContext = { ...this._ttsContext, state: state10 };
|
|
5041
5115
|
this.#internals.states.delete("idle");
|
|
5042
5116
|
this.#internals.states.delete("playing");
|
|
5043
5117
|
this.#internals.states.delete("paused");
|
|
5044
|
-
this.#internals.states.add(
|
|
5118
|
+
this.#internals.states.add(state10);
|
|
5045
5119
|
}
|
|
5046
5120
|
/** Push currentElementIndex and elementCount into context so children can react. */
|
|
5047
5121
|
#updateContext() {
|
|
@@ -5370,14 +5444,14 @@ var TestItemToSpeech = class extends LitElement28 {
|
|
|
5370
5444
|
}
|
|
5371
5445
|
}
|
|
5372
5446
|
};
|
|
5373
|
-
|
|
5447
|
+
__decorate30([
|
|
5374
5448
|
property23({ type: String })
|
|
5375
5449
|
], TestItemToSpeech.prototype, "language", void 0);
|
|
5376
|
-
|
|
5450
|
+
__decorate30([
|
|
5377
5451
|
consume19({ context: computedContext, subscribe: true })
|
|
5378
5452
|
], TestItemToSpeech.prototype, "_computedContext", void 0);
|
|
5379
|
-
|
|
5380
|
-
|
|
5453
|
+
__decorate30([
|
|
5454
|
+
state9(),
|
|
5381
5455
|
provide4({ context: ttsContext })
|
|
5382
5456
|
], TestItemToSpeech.prototype, "_ttsContext", void 0);
|
|
5383
5457
|
var TestTtsPlay = class extends TtsButtonBase {
|
|
@@ -5393,19 +5467,19 @@ var TestTtsPlay = class extends TtsButtonBase {
|
|
|
5393
5467
|
}
|
|
5394
5468
|
render() {
|
|
5395
5469
|
const playing = this._tts?.state === "playing";
|
|
5396
|
-
return
|
|
5470
|
+
return html28`
|
|
5397
5471
|
<button part="button" aria-label=${ifDefined(playing ? this.pauseLabel : this.label)} @click=${this.#toggle}>
|
|
5398
|
-
${playing ?
|
|
5472
|
+
${playing ? html28`<slot name="pause">${iconContent("pause", this.pauseLabel ?? "Pause")}</slot>` : html28`<slot name="play">${iconContent("play", this.label ?? "Play")}</slot>`}
|
|
5399
5473
|
</button>
|
|
5400
5474
|
`;
|
|
5401
5475
|
}
|
|
5402
5476
|
};
|
|
5403
|
-
|
|
5477
|
+
__decorate30([
|
|
5404
5478
|
property23({ type: String, attribute: "pause-label" })
|
|
5405
5479
|
], TestTtsPlay.prototype, "pauseLabel", void 0);
|
|
5406
5480
|
var TestTtsPause = class extends TtsButtonBase {
|
|
5407
5481
|
render() {
|
|
5408
|
-
return
|
|
5482
|
+
return html28`
|
|
5409
5483
|
<button
|
|
5410
5484
|
part="button"
|
|
5411
5485
|
aria-label=${ifDefined(this.label)}
|
|
@@ -5419,7 +5493,7 @@ var TestTtsPause = class extends TtsButtonBase {
|
|
|
5419
5493
|
};
|
|
5420
5494
|
var TestTtsResume = class extends TtsButtonBase {
|
|
5421
5495
|
render() {
|
|
5422
|
-
return
|
|
5496
|
+
return html28`
|
|
5423
5497
|
<button
|
|
5424
5498
|
part="button"
|
|
5425
5499
|
aria-label=${ifDefined(this.label)}
|
|
@@ -5434,7 +5508,7 @@ var TestTtsResume = class extends TtsButtonBase {
|
|
|
5434
5508
|
var TestTtsStop = class extends TtsButtonBase {
|
|
5435
5509
|
render() {
|
|
5436
5510
|
const idle = this._tts?.state === "idle" && !this._tts?.picking;
|
|
5437
|
-
return
|
|
5511
|
+
return html28`
|
|
5438
5512
|
<button part="button" aria-label=${ifDefined(this.label)} ?disabled=${idle} @click=${() => this._tts?.stop()}>
|
|
5439
5513
|
<slot>${iconContent("stop", this.label ?? "Stop")}</slot>
|
|
5440
5514
|
</button>
|
|
@@ -5445,7 +5519,7 @@ var TestTtsPrev = class extends TtsButtonBase {
|
|
|
5445
5519
|
render() {
|
|
5446
5520
|
const collected = (this._tts?.elementCount ?? 0) > 0;
|
|
5447
5521
|
const atStart = (this._tts?.currentElementIndex ?? 0) === 0;
|
|
5448
|
-
return
|
|
5522
|
+
return html28`
|
|
5449
5523
|
<button
|
|
5450
5524
|
part="button"
|
|
5451
5525
|
aria-label=${ifDefined(this.label)}
|
|
@@ -5461,7 +5535,7 @@ var TestTtsNext = class extends TtsButtonBase {
|
|
|
5461
5535
|
render() {
|
|
5462
5536
|
const count = this._tts?.elementCount ?? 0;
|
|
5463
5537
|
const atEnd = count > 0 && (this._tts?.currentElementIndex ?? 0) >= count - 1;
|
|
5464
|
-
return
|
|
5538
|
+
return html28`
|
|
5465
5539
|
<button
|
|
5466
5540
|
part="button"
|
|
5467
5541
|
aria-label=${ifDefined(this.label)}
|
|
@@ -5475,7 +5549,7 @@ var TestTtsNext = class extends TtsButtonBase {
|
|
|
5475
5549
|
};
|
|
5476
5550
|
var TestTtsPick = class extends TtsButtonBase {
|
|
5477
5551
|
render() {
|
|
5478
|
-
return
|
|
5552
|
+
return html28`
|
|
5479
5553
|
<button
|
|
5480
5554
|
part="button"
|
|
5481
5555
|
aria-label=${ifDefined(this.label)}
|
|
@@ -5506,6 +5580,7 @@ var pluginElements = [
|
|
|
5506
5580
|
{ tag: "test-bookmark", ctor: TestBookmark },
|
|
5507
5581
|
{ tag: "test-print-context", ctor: TestPrintContext },
|
|
5508
5582
|
{ tag: "test-print-item-variables", ctor: TestPrintVariables },
|
|
5583
|
+
{ tag: "test-print-state", ctor: TestPrintState },
|
|
5509
5584
|
{ tag: "test-scoring-buttons", ctor: TestScoringButtons },
|
|
5510
5585
|
{ tag: "test-scoring-feedback", ctor: TestScoringFeedback },
|
|
5511
5586
|
{ tag: "test-stamp", ctor: TestStamp },
|
|
@@ -5570,6 +5645,7 @@ export {
|
|
|
5570
5645
|
TestCheckItem,
|
|
5571
5646
|
TestPrintContext,
|
|
5572
5647
|
TestPrintVariables,
|
|
5648
|
+
TestPrintState,
|
|
5573
5649
|
TestScoringButtons,
|
|
5574
5650
|
TestScoringFeedback,
|
|
5575
5651
|
TestStamp,
|
|
@@ -5600,4 +5676,4 @@ export {
|
|
|
5600
5676
|
* Portions Copyright (c) 2013, the Dart project authors.
|
|
5601
5677
|
*)
|
|
5602
5678
|
*/
|
|
5603
|
-
//# sourceMappingURL=chunk-
|
|
5679
|
+
//# sourceMappingURL=chunk-Y5DZTCDP.js.map
|