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