@citolab/qti-components 7.0.6-beta.3 → 7.0.6-beta.4

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 (113) hide show
  1. package/cdn/chunks/{chunk-MJMONWKB.js → chunk-4ILXLVT5.js} +8 -2
  2. package/cdn/chunks/chunk-4PEUIMDK.js +8 -0
  3. package/cdn/chunks/chunk-H2V2RXUW.js +11 -0
  4. package/cdn/chunks/chunk-IQZ7AOCQ.js +8 -0
  5. package/cdn/chunks/chunk-J3JSSCM6.js +5 -0
  6. package/cdn/chunks/chunk-LARBLB7K.js +8 -0
  7. package/cdn/chunks/chunk-PPWEIKLT.js +1 -0
  8. package/cdn/chunks/{chunk-N5OHGRGG.js → chunk-PT523RSK.js} +2 -2
  9. package/cdn/chunks/chunk-QTK4CPHP.js +8 -0
  10. package/cdn/chunks/{chunk-TVDTF6P6.js → chunk-SXM25YH3.js} +89 -89
  11. package/cdn/chunks/{chunk-6S4CDN3T.js → chunk-YHWMZAZD.js} +2 -2
  12. package/cdn/chunks/{chunk-TQBDBMWL.js → chunk-YWH4TGMA.js} +1 -1
  13. package/cdn/index.global.js +1 -1
  14. package/cdn/index.js +1 -1
  15. package/cdn/qti-components/index.js +1 -1
  16. package/cdn/qti-item/core/index.js +1 -1
  17. package/cdn/qti-test/components/index.js +1 -1
  18. package/cdn/qti-test/components/test-component.abstract.js +1 -1
  19. package/cdn/qti-test/components/test-end-attempt.js +1 -0
  20. package/cdn/qti-test/components/test-item-link.js +1 -1
  21. package/cdn/qti-test/components/test-next.js +1 -1
  22. package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -1
  23. package/cdn/qti-test/components/test-prev.js +1 -1
  24. package/cdn/qti-test/components/test-show-correct-response.js +1 -0
  25. package/cdn/qti-test/components/test-view.js +1 -1
  26. package/cdn/qti-test/core/index.js +1 -1
  27. package/dist/chunks/{chunk-GSWZT6N2.js → chunk-4MQV5IRV.js} +12 -3
  28. package/dist/chunks/chunk-4MQV5IRV.js.map +1 -0
  29. package/dist/chunks/{chunk-6JXR63MH.js → chunk-5RTLOB3Q.js} +12 -3
  30. package/dist/chunks/chunk-5RTLOB3Q.js.map +1 -0
  31. package/dist/chunks/{chunk-UFYWCLXF.js → chunk-AUWATZ65.js} +1 -1
  32. package/dist/chunks/{chunk-UFYWCLXF.js.map → chunk-AUWATZ65.js.map} +1 -1
  33. package/dist/chunks/{chunk-7QMCKYDR.js → chunk-CEXAR7BF.js} +13 -4
  34. package/dist/chunks/chunk-CEXAR7BF.js.map +1 -0
  35. package/dist/chunks/chunk-DNHDFXTV.js +59 -0
  36. package/dist/chunks/chunk-DNHDFXTV.js.map +1 -0
  37. package/dist/chunks/chunk-GQ5P3NWC.js +46 -0
  38. package/dist/chunks/chunk-GQ5P3NWC.js.map +1 -0
  39. package/dist/chunks/chunk-HOTNM5DT.js +1 -0
  40. package/dist/chunks/{chunk-ZHAJ3CMP.js → chunk-MEQM6M67.js} +89 -117
  41. package/dist/chunks/chunk-MEQM6M67.js.map +1 -0
  42. package/dist/chunks/{chunk-3EU75IUF.js → chunk-MLT7V47R.js} +3 -21
  43. package/dist/chunks/chunk-MLT7V47R.js.map +1 -0
  44. package/dist/chunks/chunk-NHA53UTY.js +52 -0
  45. package/dist/chunks/chunk-NHA53UTY.js.map +1 -0
  46. package/dist/chunks/{chunk-J2SHENRN.js → chunk-NZQKGIJP.js} +9 -3
  47. package/dist/chunks/{chunk-J2SHENRN.js.map → chunk-NZQKGIJP.js.map} +1 -1
  48. package/dist/chunks/chunk-RX3BRYYI.js +59 -0
  49. package/dist/chunks/chunk-RX3BRYYI.js.map +1 -0
  50. package/dist/chunks/chunk-VAPB5TN4.js +46 -0
  51. package/dist/chunks/chunk-VAPB5TN4.js.map +1 -0
  52. package/dist/chunks/chunk-W4272Q5U.js +46 -0
  53. package/dist/chunks/chunk-W4272Q5U.js.map +1 -0
  54. package/dist/chunks/{chunk-A24F75DB.js → chunk-WWN5AD6V.js} +11 -2
  55. package/dist/chunks/chunk-WWN5AD6V.js.map +1 -0
  56. package/dist/chunks/{chunk-HHVRU3AJ.js → chunk-XCHS3RTZ.js} +2 -2
  57. package/dist/chunks/{chunk-KYAIMBP5.js → chunk-YQB6YLNW.js} +3 -3
  58. package/dist/chunks/chunk-YQB6YLNW.js.map +1 -0
  59. package/dist/chunks/chunk-Z5THRO6Z.js +46 -0
  60. package/dist/chunks/chunk-Z5THRO6Z.js.map +1 -0
  61. package/dist/chunks/{chunk-4GNVYCBN.js → chunk-ZQXZ6PK7.js} +92 -70
  62. package/dist/chunks/chunk-ZQXZ6PK7.js.map +1 -0
  63. package/dist/index.d.ts +4 -2
  64. package/dist/index.js +20 -12
  65. package/dist/item.css +8 -2
  66. package/dist/qti-components/index.d.ts +2 -2
  67. package/dist/qti-components/index.js +1 -1
  68. package/dist/qti-components-jsx.d.ts +62 -46
  69. package/dist/qti-item/core/index.js +2 -2
  70. package/dist/qti-loader/index.d.ts +1 -1
  71. package/dist/{qti-response-declaration-DAeBp8HH.d.ts → qti-response-declaration-Di9CsqiJ.d.ts} +4 -0
  72. package/dist/qti-test/components/index.d.ts +4 -2
  73. package/dist/qti-test/components/index.js +16 -8
  74. package/dist/qti-test/components/test-component.abstract.d.ts +2 -4
  75. package/dist/qti-test/components/test-component.abstract.js +2 -2
  76. package/dist/qti-test/components/test-end-attempt.d.ts +26 -0
  77. package/dist/qti-test/components/test-end-attempt.js +13 -0
  78. package/dist/qti-test/components/test-end-attempt.js.map +1 -0
  79. package/dist/qti-test/components/test-item-link.d.ts +3 -2
  80. package/dist/qti-test/components/test-item-link.js +3 -3
  81. package/dist/qti-test/components/test-next.d.ts +3 -2
  82. package/dist/qti-test/components/test-next.js +3 -3
  83. package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +2 -2
  84. package/dist/qti-test/components/test-paging-buttons-stamp.js +3 -3
  85. package/dist/qti-test/components/test-prev.d.ts +3 -2
  86. package/dist/qti-test/components/test-prev.js +3 -3
  87. package/dist/qti-test/components/test-show-correct-response.d.ts +26 -0
  88. package/dist/qti-test/components/test-show-correct-response.js +13 -0
  89. package/dist/qti-test/components/test-show-correct-response.js.map +1 -0
  90. package/dist/qti-test/components/test-view.d.ts +3 -2
  91. package/dist/qti-test/components/test-view.js +3 -3
  92. package/dist/qti-test/core/index.d.ts +6 -6
  93. package/dist/qti-test/core/index.js +3 -3
  94. package/dist/{test.context-CaENAJNk.d.ts → test.context-CmsDQ8k2.d.ts} +3 -5
  95. package/dist/vscode.html-custom-data.json +36 -17
  96. package/package.json +1 -1
  97. package/cdn/chunks/chunk-5P7CTN7Q.js +0 -11
  98. package/cdn/chunks/chunk-DZCKF45D.js +0 -5
  99. package/cdn/chunks/chunk-IMJOPCFR.js +0 -1
  100. package/cdn/chunks/chunk-NDHSIO2G.js +0 -8
  101. package/cdn/chunks/chunk-QV6I5NVQ.js +0 -8
  102. package/dist/chunks/chunk-3EU75IUF.js.map +0 -1
  103. package/dist/chunks/chunk-4GNVYCBN.js.map +0 -1
  104. package/dist/chunks/chunk-6JXR63MH.js.map +0 -1
  105. package/dist/chunks/chunk-7QMCKYDR.js.map +0 -1
  106. package/dist/chunks/chunk-A24F75DB.js.map +0 -1
  107. package/dist/chunks/chunk-GSWZT6N2.js.map +0 -1
  108. package/dist/chunks/chunk-KYAIMBP5.js.map +0 -1
  109. package/dist/chunks/chunk-UN2IFSGC.js +0 -1
  110. package/dist/chunks/chunk-ZHAJ3CMP.js.map +0 -1
  111. /package/cdn/chunks/{chunk-3GO57DNP.js → chunk-6PW2L463.js} +0 -0
  112. /package/dist/chunks/{chunk-UN2IFSGC.js.map → chunk-HOTNM5DT.js.map} +0 -0
  113. /package/dist/chunks/{chunk-HHVRU3AJ.js.map → chunk-XCHS3RTZ.js.map} +0 -0
@@ -0,0 +1,59 @@
1
+ import {
2
+ TestComponent
3
+ } from "./chunk-MLT7V47R.js";
4
+ import {
5
+ btn,
6
+ dis
7
+ } from "./chunk-4O5F7WV7.js";
8
+ import {
9
+ __decorateClass
10
+ } from "./chunk-H2JE6IVU.js";
11
+
12
+ // src/lib/qti-test/components/test-next.ts
13
+ import { css, html } from "lit";
14
+ import { customElement } from "lit/decorators.js";
15
+ var TestNext = class extends TestComponent {
16
+ constructor() {
17
+ super();
18
+ this._internals.role = "button";
19
+ this._internals.ariaLabel = "Next item";
20
+ this.addEventListener("click", (e) => {
21
+ e.preventDefault();
22
+ if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);
23
+ });
24
+ }
25
+ willUpdate(changedProperties) {
26
+ super.willUpdate(changedProperties);
27
+ if (changedProperties.has("_testContext")) {
28
+ this.disabled = !this._testElement || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;
29
+ }
30
+ }
31
+ _requestItem(identifier) {
32
+ this.dispatchEvent(
33
+ new CustomEvent("qti-request-test-item", {
34
+ composed: true,
35
+ bubbles: true,
36
+ detail: identifier
37
+ })
38
+ );
39
+ }
40
+ render() {
41
+ return html`<slot></slot>`;
42
+ }
43
+ };
44
+ TestNext.styles = css`
45
+ :host {
46
+ ${btn};
47
+ }
48
+ :host([disabled]) {
49
+ ${dis};
50
+ }
51
+ `;
52
+ TestNext = __decorateClass([
53
+ customElement("test-next")
54
+ ], TestNext);
55
+
56
+ export {
57
+ TestNext
58
+ };
59
+ //# sourceMappingURL=chunk-RX3BRYYI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-test/components/test-next.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n/**\n * Represents a custom element for navigating to the next test item.\n *\n * @remarks\n * This element provides functionality for navigating to the next test item.\n *\n * @example\n * ```html\n * <test-next></test-next>\n * ```\n */\n@customElement('test-next')\nexport class TestNext extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;\n }\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-next': TestNext;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,qBAAqB;AAgBvB,IAAM,WAAN,cAAuB,cAAc;AAAA,EAU1C,cAAc;AACZ,UAAM;AACN,SAAK,WAAW,OAAO;AACvB,SAAK,WAAW,YAAY;AAE5B,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,SAAU,MAAK,aAAa,KAAK,MAAM,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACjF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,mBAA2D;AACpE,UAAM,WAAW,iBAAiB;AAClC,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,WAAK,WAAW,CAAC,KAAK,gBAAgB,KAAK,YAAY,KAAK,KAAK,aAAa,KAAK,MAAM,SAAS;AAAA,IACpG;AAAA,EACF;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,yBAAyB;AAAA,QACvC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAzCa,SACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
@@ -0,0 +1,46 @@
1
+ import {
2
+ btn,
3
+ dis
4
+ } from "./chunk-4O5F7WV7.js";
5
+ import {
6
+ TestComponent
7
+ } from "./chunk-MLT7V47R.js";
8
+ import {
9
+ __decorateClass
10
+ } from "./chunk-H2JE6IVU.js";
11
+
12
+ // src/lib/qti-test/components/test-end-attempt.ts
13
+ import { css, html } from "lit";
14
+ import { customElement } from "lit/decorators.js";
15
+ var TestEndAttempt = class extends TestComponent {
16
+ _processResponse() {
17
+ const qtiItemEl = this._testElement.querySelector(
18
+ `qti-assessment-item-ref[identifier="${this._testContext.navItemId}"]`
19
+ );
20
+ const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
21
+ qtiAssessmentItemEl.processResponse();
22
+ }
23
+ constructor() {
24
+ super();
25
+ this.addEventListener("click", () => this._processResponse());
26
+ }
27
+ render() {
28
+ return html` <slot></slot> `;
29
+ }
30
+ };
31
+ TestEndAttempt.styles = css`
32
+ :host {
33
+ ${btn};
34
+ }
35
+ :host([disabled]) {
36
+ ${dis};
37
+ }
38
+ `;
39
+ TestEndAttempt = __decorateClass([
40
+ customElement("test-end-attempt")
41
+ ], TestEndAttempt);
42
+
43
+ export {
44
+ TestEndAttempt
45
+ };
46
+ //# sourceMappingURL=chunk-VAPB5TN4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-test/components/test-end-attempt.ts"],"sourcesContent":["import { css, html } from 'lit';\n\nimport { customElement } from 'lit/decorators.js';\nimport type { QtiAssessmentItemRef } from '../core';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n@customElement('test-end-attempt')\nexport class TestEndAttempt extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n _processResponse() {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${this._testContext.navItemId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n qtiAssessmentItemEl.processResponse();\n }\n\n constructor() {\n super();\n this.addEventListener('click', () => this._processResponse());\n }\n\n render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-end-attempt': TestEndAttempt;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAE1B,SAAS,qBAAqB;AAMvB,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAUhD,mBAAmB;AACjB,UAAM,YAAY,KAAK,aAAa;AAAA,MAClC,uCAAuC,KAAK,aAAa,SAAS;AAAA,IACpE;AACA,UAAM,sBAAsB,UAAU;AACtC,wBAAoB,gBAAgB;AAAA,EACtC;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,iBAAiB,SAAS,MAAM,KAAK,iBAAiB,CAAC;AAAA,EAC9D;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AA1Ba,eACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,iBAAN;AAAA,EADN,cAAc,kBAAkB;AAAA,GACpB;","names":[]}
@@ -0,0 +1,46 @@
1
+ import {
2
+ TestComponent
3
+ } from "./chunk-MLT7V47R.js";
4
+ import {
5
+ btn,
6
+ dis
7
+ } from "./chunk-4O5F7WV7.js";
8
+ import {
9
+ __decorateClass
10
+ } from "./chunk-H2JE6IVU.js";
11
+
12
+ // src/lib/qti-test/components/test-end-attempt.ts
13
+ import { css, html } from "lit";
14
+ import { customElement } from "lit/decorators.js";
15
+ var TestEndAttempt = class extends TestComponent {
16
+ _processResponse() {
17
+ const qtiItemEl = this._testElement.querySelector(
18
+ `qti-assessment-item-ref[identifier="${this._testContext.navItemId}"]`
19
+ );
20
+ const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
21
+ qtiAssessmentItemEl.processResponse();
22
+ }
23
+ constructor() {
24
+ super();
25
+ this.addEventListener("click", () => this._processResponse());
26
+ }
27
+ render() {
28
+ return html` <slot></slot> `;
29
+ }
30
+ };
31
+ TestEndAttempt.styles = css`
32
+ :host {
33
+ ${btn};
34
+ }
35
+ :host([disabled]) {
36
+ ${dis};
37
+ }
38
+ `;
39
+ TestEndAttempt = __decorateClass([
40
+ customElement("test-end-attempt")
41
+ ], TestEndAttempt);
42
+
43
+ export {
44
+ TestEndAttempt
45
+ };
46
+ //# sourceMappingURL=chunk-W4272Q5U.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-test/components/test-end-attempt.ts"],"sourcesContent":["import { css, html } from 'lit';\n\nimport { customElement } from 'lit/decorators.js';\nimport type { QtiAssessmentItemRef } from '../core';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n@customElement('test-end-attempt')\nexport class TestEndAttempt extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n _processResponse() {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${this._testContext.navItemId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n qtiAssessmentItemEl.processResponse();\n }\n\n constructor() {\n super();\n this.addEventListener('click', () => this._processResponse());\n }\n\n render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-end-attempt': TestEndAttempt;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAE1B,SAAS,qBAAqB;AAMvB,IAAM,iBAAN,cAA6B,cAAc;AAAA,EAUhD,mBAAmB;AACjB,UAAM,YAAY,KAAK,aAAa;AAAA,MAClC,uCAAuC,KAAK,aAAa,SAAS;AAAA,IACpE;AACA,UAAM,sBAAsB,UAAU;AACtC,wBAAoB,gBAAgB;AAAA,EACtC;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,iBAAiB,SAAS,MAAM,KAAK,iBAAiB,CAAC;AAAA,EAC9D;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AA1Ba,eACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,iBAAN;AAAA,EADN,cAAc,kBAAkB;AAAA,GACpB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TestComponent
3
- } from "./chunk-3EU75IUF.js";
3
+ } from "./chunk-MLT7V47R.js";
4
4
  import {
5
5
  watch
6
6
  } from "./chunk-ELDMXTUQ.js";
@@ -32,6 +32,15 @@ var TestView = class extends TestComponent {
32
32
  this._viewOptions = TestView.DEFAULT_VIEW_OPTIONS;
33
33
  }
34
34
  }
35
+ _switchView(view) {
36
+ this.dispatchEvent(
37
+ new CustomEvent("on-test-switch-view", {
38
+ composed: true,
39
+ bubbles: true,
40
+ detail: view
41
+ })
42
+ );
43
+ }
35
44
  render() {
36
45
  return html`
37
46
  <label part="label" for="viewSelect">${this.label}</label>
@@ -69,4 +78,4 @@ TestView = __decorateClass([
69
78
  export {
70
79
  TestView
71
80
  };
72
- //# sourceMappingURL=chunk-A24F75DB.js.map
81
+ //# sourceMappingURL=chunk-WWN5AD6V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-test/components/test-view.ts"],"sourcesContent":["import { html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport { watch } from '../../decorators/watch';\n\n@customElement('test-view')\nexport class TestView extends TestComponent {\n static DEFAULT_VIEW_OPTIONS = ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'];\n\n /** label accompanying the select view dropdown */\n @property({ type: String })\n label = 'view';\n\n /** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */\n @property({ type: String, attribute: 'view-options' }) viewOptions;\n @watch('viewOptions', { waitUntilFirstUpdate: true })\n protected _handleViewOptionsChange = () => {\n this.updateViewOptions();\n };\n\n connectedCallback(): void {\n super.connectedCallback();\n this.updateViewOptions();\n }\n\n @state()\n private _viewOptions: string[] = TestView.DEFAULT_VIEW_OPTIONS;\n\n private updateViewOptions() {\n if (this.viewOptions) {\n const options = this.viewOptions.split(',').map(opt => opt.trim());\n this._viewOptions = options.filter(opt => TestView.DEFAULT_VIEW_OPTIONS.includes(opt));\n } else {\n this._viewOptions = TestView.DEFAULT_VIEW_OPTIONS;\n }\n }\n\n protected _switchView(view: string) {\n this.dispatchEvent(\n new CustomEvent('on-test-switch-view', {\n composed: true,\n bubbles: true,\n detail: view\n })\n );\n }\n\n render() {\n return html`\n <label part=\"label\" for=\"viewSelect\">${this.label}</label>\n <select\n part=\"select\"\n id=\"viewSelect\"\n .disabled=${this.disabled}\n @change=${(e: Event) => {\n const el = e.target as HTMLSelectElement;\n this._switchView(el.value);\n }}\n >\n ${this._viewOptions.map(v => html`<option value=\"${v}\" ?selected=${v === this.view}>${v}</option>`)}\n </select>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-view': TestView;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,eAAe,UAAU,aAAa;AAKxC,IAAM,WAAN,cAAuB,cAAc;AAAA,EAArC;AAAA;AAKL,iBAAQ;AAKR,SAAU,2BAA2B,MAAM;AACzC,WAAK,kBAAkB;AAAA,IACzB;AAQA,SAAQ,eAAyB,SAAS;AAAA;AAAA,EAN1C,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,SAAK,kBAAkB;AAAA,EACzB;AAAA,EAKQ,oBAAoB;AAC1B,QAAI,KAAK,aAAa;AACpB,YAAM,UAAU,KAAK,YAAY,MAAM,GAAG,EAAE,IAAI,SAAO,IAAI,KAAK,CAAC;AACjE,WAAK,eAAe,QAAQ,OAAO,SAAO,SAAS,qBAAqB,SAAS,GAAG,CAAC;AAAA,IACvF,OAAO;AACL,WAAK,eAAe,SAAS;AAAA,IAC/B;AAAA,EACF;AAAA,EAEU,YAAY,MAAc;AAClC,SAAK;AAAA,MACH,IAAI,YAAY,uBAAuB;AAAA,QACrC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,6CACkC,KAAK,KAAK;AAAA;AAAA;AAAA;AAAA,oBAInC,KAAK,QAAQ;AAAA,kBACf,CAAC,MAAa;AACtB,YAAM,KAAK,EAAE;AACb,WAAK,YAAY,GAAG,KAAK;AAAA,IAC3B,CAAC;AAAA;AAAA,UAEC,KAAK,aAAa,IAAI,OAAK,sBAAsB,CAAC,eAAe,MAAM,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC;AAAA;AAAA;AAAA,EAGzG;AACF;AAzDa,SACJ,uBAAuB,CAAC,UAAU,aAAa,WAAW,UAAU,mBAAmB,OAAO;AAIrG;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAJf,SAKX;AAGuD;AAAA,EAAtD,SAAS,EAAE,MAAM,QAAQ,WAAW,eAAe,CAAC;AAAA,GAR1C,SAQ4C;AAE7C;AAAA,EADT,MAAM,eAAe,EAAE,sBAAsB,KAAK,CAAC;AAAA,GATzC,SAUD;AAUF;AAAA,EADP,MAAM;AAAA,GAnBI,SAoBH;AApBG,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  item_default
3
- } from "./chunk-J2SHENRN.js";
3
+ } from "./chunk-NZQKGIJP.js";
4
4
  import {
5
5
  qtiTransformItem
6
6
  } from "./chunk-XDMSEAYC.js";
@@ -104,4 +104,4 @@ export {
104
104
  ItemContainer,
105
105
  QtiItem
106
106
  };
107
- //# sourceMappingURL=chunk-HHVRU3AJ.js.map
107
+ //# sourceMappingURL=chunk-XCHS3RTZ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TestComponent
3
- } from "./chunk-3EU75IUF.js";
3
+ } from "./chunk-MLT7V47R.js";
4
4
  import {
5
5
  __decorateClass
6
6
  } from "./chunk-H2JE6IVU.js";
@@ -12,7 +12,7 @@ import { prepareTemplate } from "stampino";
12
12
  var TestPagingButtonsStamp = class extends TestComponent {
13
13
  constructor() {
14
14
  super();
15
- this.maxDisplayedItems = 2;
15
+ this.maxDisplayedItems = 20;
16
16
  this.skipOnCategory = "dep-informational";
17
17
  this._internals.ariaLabel = "pagination";
18
18
  }
@@ -75,4 +75,4 @@ TestPagingButtonsStamp = __decorateClass([
75
75
  export {
76
76
  TestPagingButtonsStamp
77
77
  };
78
- //# sourceMappingURL=chunk-KYAIMBP5.js.map
78
+ //# sourceMappingURL=chunk-YQB6YLNW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-test/components/test-paging-buttons-stamp.ts"],"sourcesContent":["import { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { TestComponent } from './test-component.abstract';\nimport { prepareTemplate } from 'stampino';\n\n@customElement('test-paging-buttons-stamp')\nexport class TestPagingButtonsStamp extends TestComponent {\n @property({ type: Number, attribute: 'max-displayed-items' })\n private maxDisplayedItems = 20;\n\n @property({ type: String, attribute: 'skip-on-category' })\n private skipOnCategory = 'dep-informational';\n\n protected createRenderRoot() {\n return this;\n }\n\n constructor() {\n super();\n this._internals.ariaLabel = 'pagination';\n }\n\n render() {\n const items = this._testContext.items.reduce(\n (acc, item) => {\n const isDepInfoItem = item.category?.split(' ').includes(this.skipOnCategory);\n const newIndex = isDepInfoItem ? 'i' : acc.counter++;\n acc.result.push({\n ...item,\n newIndex // Assign the new index, which only increments for non-info items\n });\n return acc;\n },\n { counter: 0, result: [] }\n ).result;\n\n // Get the index of the current item\n const itemIndex = items.findIndex(item => item.identifier === this._testContext.navItemId);\n\n // Calculate the start and end range based on maxDisplayedItems\n const start = Math.max(0, itemIndex - this.maxDisplayedItems);\n const end = Math.min(items.length, itemIndex + this.maxDisplayedItems + 1);\n\n // console.log('start', start, 'end', end);\n // Adjust the items array to only include the clamped range\n const clampedItems = items.slice(start, end);\n\n return html`\n ${clampedItems.map(item => {\n const rawscore = item.variables.find(vr => vr.identifier == 'SCORE');\n const score = parseInt(rawscore?.value?.toString());\n const completionStatus = item.variables.find(v => v.identifier === 'completionStatus')?.value;\n const type = item.category !== this.skipOnCategory ? 'regular' : 'info'; // rounded-full\n const active = this._testContext.navItemId === item.identifier; // !border-sky-600\n const correct =\n this._testContext.view === 'scorer' && type == 'regular' && score !== undefined && !isNaN(score) && score > 0; // bg-green-100 border-green-400\n const incorrect =\n this._testContext.view === 'scorer' &&\n type == 'regular' &&\n score !== undefined &&\n !isNaN(score) &&\n score <= 0; // bg-red-100 border-red-400\n const answered =\n this._testContext.view === 'candidate' &&\n completionStatus === 'completed' &&\n item.category !== this.skipOnCategory; // bg-slate-300 shadow-sm\n\n const computedItem = {\n ...item,\n type,\n active,\n correct,\n incorrect,\n answered\n };\n\n const templateElement = this.firstElementChild as HTMLTemplateElement;\n const myTemplate = prepareTemplate(templateElement);\n return myTemplate({ item: computedItem });\n })}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-paging-buttons-stamp': TestPagingButtonsStamp;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,eAAe,gBAAgB;AAGxC,SAAS,uBAAuB;AAGzB,IAAM,yBAAN,cAAqC,cAAc;AAAA,EAWxD,cAAc;AACZ,UAAM;AAVR,SAAQ,oBAAoB;AAG5B,SAAQ,iBAAiB;AAQvB,SAAK,WAAW,YAAY;AAAA,EAC9B;AAAA,EAPU,mBAAmB;AAC3B,WAAO;AAAA,EACT;AAAA,EAOA,SAAS;AACP,UAAM,QAAQ,KAAK,aAAa,MAAM;AAAA,MACpC,CAAC,KAAK,SAAS;AACb,cAAM,gBAAgB,KAAK,UAAU,MAAM,GAAG,EAAE,SAAS,KAAK,cAAc;AAC5E,cAAM,WAAW,gBAAgB,MAAM,IAAI;AAC3C,YAAI,OAAO,KAAK;AAAA,UACd,GAAG;AAAA,UACH;AAAA;AAAA,QACF,CAAC;AACD,eAAO;AAAA,MACT;AAAA,MACA,EAAE,SAAS,GAAG,QAAQ,CAAC,EAAE;AAAA,IAC3B,EAAE;AAGF,UAAM,YAAY,MAAM,UAAU,UAAQ,KAAK,eAAe,KAAK,aAAa,SAAS;AAGzF,UAAM,QAAQ,KAAK,IAAI,GAAG,YAAY,KAAK,iBAAiB;AAC5D,UAAM,MAAM,KAAK,IAAI,MAAM,QAAQ,YAAY,KAAK,oBAAoB,CAAC;AAIzE,UAAM,eAAe,MAAM,MAAM,OAAO,GAAG;AAE3C,WAAO;AAAA,QACH,aAAa,IAAI,UAAQ;AACzB,YAAM,WAAW,KAAK,UAAU,KAAK,QAAM,GAAG,cAAc,OAAO;AACnE,YAAM,QAAQ,SAAS,UAAU,OAAO,SAAS,CAAC;AAClD,YAAM,mBAAmB,KAAK,UAAU,KAAK,OAAK,EAAE,eAAe,kBAAkB,GAAG;AACxF,YAAM,OAAO,KAAK,aAAa,KAAK,iBAAiB,YAAY;AACjE,YAAM,SAAS,KAAK,aAAa,cAAc,KAAK;AACpD,YAAM,UACJ,KAAK,aAAa,SAAS,YAAY,QAAQ,aAAa,UAAU,UAAa,CAAC,MAAM,KAAK,KAAK,QAAQ;AAC9G,YAAM,YACJ,KAAK,aAAa,SAAS,YAC3B,QAAQ,aACR,UAAU,UACV,CAAC,MAAM,KAAK,KACZ,SAAS;AACX,YAAM,WACJ,KAAK,aAAa,SAAS,eAC3B,qBAAqB,eACrB,KAAK,aAAa,KAAK;AAEzB,YAAM,eAAe;AAAA,QACnB,GAAG;AAAA,QACH;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,YAAM,kBAAkB,KAAK;AAC7B,YAAM,aAAa,gBAAgB,eAAe;AAClD,aAAO,WAAW,EAAE,MAAM,aAAa,CAAC;AAAA,IAC1C,CAAC,CAAC;AAAA;AAAA,EAEN;AACF;AA1EU;AAAA,EADP,SAAS,EAAE,MAAM,QAAQ,WAAW,sBAAsB,CAAC;AAAA,GADjD,uBAEH;AAGA;AAAA,EADP,SAAS,EAAE,MAAM,QAAQ,WAAW,mBAAmB,CAAC;AAAA,GAJ9C,uBAKH;AALG,yBAAN;AAAA,EADN,cAAc,2BAA2B;AAAA,GAC7B;","names":[]}
@@ -0,0 +1,46 @@
1
+ import {
2
+ btn,
3
+ dis
4
+ } from "./chunk-4O5F7WV7.js";
5
+ import {
6
+ TestComponent
7
+ } from "./chunk-MLT7V47R.js";
8
+ import {
9
+ __decorateClass
10
+ } from "./chunk-H2JE6IVU.js";
11
+
12
+ // src/lib/qti-test/components/test-show-correct-response.ts
13
+ import { css, html } from "lit";
14
+ import { customElement } from "lit/decorators.js";
15
+ var TestShowCorrectResponse = class extends TestComponent {
16
+ _processResponse() {
17
+ const qtiItemEl = this._testElement.querySelector(
18
+ `qti-assessment-item-ref[identifier="${this._testContext.navItemId}"]`
19
+ );
20
+ const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
21
+ qtiAssessmentItemEl.showCorrectResponse(true);
22
+ }
23
+ constructor() {
24
+ super();
25
+ this.addEventListener("click", () => this._processResponse());
26
+ }
27
+ render() {
28
+ return html` <slot></slot> `;
29
+ }
30
+ };
31
+ TestShowCorrectResponse.styles = css`
32
+ :host {
33
+ ${btn};
34
+ }
35
+ :host([disabled]) {
36
+ ${dis};
37
+ }
38
+ `;
39
+ TestShowCorrectResponse = __decorateClass([
40
+ customElement("test-show-correct-response")
41
+ ], TestShowCorrectResponse);
42
+
43
+ export {
44
+ TestShowCorrectResponse
45
+ };
46
+ //# sourceMappingURL=chunk-Z5THRO6Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-test/components/test-show-correct-response.ts"],"sourcesContent":["import { css, html } from 'lit';\n\nimport { customElement } from 'lit/decorators.js';\nimport type { QtiAssessmentItemRef } from '../core';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n@customElement('test-show-correct-response')\nexport class TestShowCorrectResponse extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n _processResponse() {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${this._testContext.navItemId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n qtiAssessmentItemEl.showCorrectResponse(true);\n }\n\n constructor() {\n super();\n this.addEventListener('click', () => this._processResponse());\n }\n\n render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-show-correct-response': TestShowCorrectResponse;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAE1B,SAAS,qBAAqB;AAMvB,IAAM,0BAAN,cAAsC,cAAc;AAAA,EAUzD,mBAAmB;AACjB,UAAM,YAAY,KAAK,aAAa;AAAA,MAClC,uCAAuC,KAAK,aAAa,SAAS;AAAA,IACpE;AACA,UAAM,sBAAsB,UAAU;AACtC,wBAAoB,oBAAoB,IAAI;AAAA,EAC9C;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,iBAAiB,SAAS,MAAM,KAAK,iBAAiB,CAAC;AAAA,EAC9D;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AA1Ba,wBACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,0BAAN;AAAA,EADN,cAAc,4BAA4B;AAAA,GAC9B;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  item_default
3
- } from "./chunk-J2SHENRN.js";
3
+ } from "./chunk-NZQKGIJP.js";
4
4
  import {
5
5
  qtiTransformItem,
6
6
  qtiTransformTest
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  testContext,
10
10
  testElement
11
- } from "./chunk-UFYWCLXF.js";
11
+ } from "./chunk-AUWATZ65.js";
12
12
  import {
13
13
  watch
14
14
  } from "./chunk-ELDMXTUQ.js";
@@ -98,28 +98,55 @@ import { html as html2 } from "lit";
98
98
  import { customElement as customElement2 } from "lit/decorators.js";
99
99
 
100
100
  // src/lib/qti-test/core/mixins/test-loader.mixin.ts
101
+ import { property as property2 } from "lit/decorators.js";
102
+ var setSessionData = (key, value) => sessionStorage.setItem(key, JSON.stringify(value));
103
+ var getSessionData = (key) => sessionStorage.getItem(key) ? JSON.parse(sessionStorage.getItem(key)) : null;
101
104
  var TestLoaderMixin = (superClass) => {
102
105
  class TestLoaderClass extends superClass {
103
- // private testURL = '';
104
106
  constructor(...args) {
105
107
  super(...args);
106
- this.addEventListener("qti-assessment-test-connected", () => {
108
+ this.autoScoreItems = false;
109
+ this.autoStoreRestoreContext = false;
110
+ this.addEventListener("qti-test-connected", () => {
111
+ if (this.autoStoreRestoreContext) {
112
+ this.context = getSessionData(`testcontext`);
113
+ }
107
114
  });
108
115
  this.addEventListener("qti-load-item-request", ({ detail }) => {
109
116
  detail.promise = (async () => {
110
- const api = await qtiTransformItem().load(
111
- `${detail.href}`,
112
- detail.cancelPreviousRequest
113
- );
117
+ const api = await qtiTransformItem().load(`${detail.href}`, detail.cancelPreviousRequest);
114
118
  return api.htmlDoc();
115
119
  })();
116
120
  });
117
- this.addEventListener("qti-interaction-changed", (_e) => {
118
- });
119
- this.addEventListener("qti-outcome-changed", () => {
121
+ this.addEventListener("qti-interaction-changed", (e) => {
122
+ if (this.autoScoreItems) {
123
+ const qtiItemEl = this.testElement.querySelector(
124
+ `qti-assessment-item-ref[identifier="${this.context.navItemId}"]`
125
+ );
126
+ const qtiAssessmentItem = qtiItemEl.assessmentItem;
127
+ const scoreOutcomeIdentifier = qtiAssessmentItem.variables.find(
128
+ (v) => v.identifier === "SCORE"
129
+ );
130
+ if (scoreOutcomeIdentifier.externalScored === null && qtiAssessmentItem.adaptive === "false") {
131
+ qtiAssessmentItem.processResponse();
132
+ if (this.autoStoreRestoreContext) {
133
+ setSessionData(`testcontext`, this.context);
134
+ }
135
+ }
136
+ } else {
137
+ if (this.autoStoreRestoreContext) {
138
+ setSessionData(`testcontext`, this.context);
139
+ }
140
+ }
120
141
  });
121
142
  }
122
143
  }
144
+ __decorateClass([
145
+ property2({ type: Boolean, attribute: "auto-score-items" })
146
+ ], TestLoaderClass.prototype, "autoScoreItems", 2);
147
+ __decorateClass([
148
+ property2({ type: Boolean, attribute: "auto-store-restore" })
149
+ ], TestLoaderClass.prototype, "autoStoreRestoreContext", 2);
123
150
  return TestLoaderClass;
124
151
  };
125
152
 
@@ -131,7 +158,7 @@ var TestNavigationMixin = (superClass) => {
131
158
  this.addEventListener("qti-request-test-item", ({ detail: navItemId }) => {
132
159
  if (!navItemId) return;
133
160
  this._clearLoadedItems();
134
- const itemRefEl = this.testElement.el.querySelector(
161
+ const itemRefEl = this.testElement.querySelector(
135
162
  `qti-assessment-item-ref[identifier="${navItemId}"]`
136
163
  );
137
164
  const promise = this._loadItemRequest(itemRefEl.href, false);
@@ -153,7 +180,7 @@ var TestNavigationMixin = (superClass) => {
153
180
  this.addEventListener("qti-assessment-test-connected", () => {
154
181
  let navItemId = this._testContext.navItemId;
155
182
  if (!navItemId) {
156
- const itemRefEl = this.testElement.el.querySelector("qti-assessment-item-ref");
183
+ const itemRefEl = this.testElement.querySelector("qti-assessment-item-ref");
157
184
  navItemId = itemRefEl.identifier;
158
185
  }
159
186
  this.dispatchEvent(
@@ -162,7 +189,7 @@ var TestNavigationMixin = (superClass) => {
162
189
  });
163
190
  }
164
191
  _clearLoadedItems() {
165
- const itemRefEls = this.testElement.el.querySelectorAll(`qti-assessment-test qti-assessment-item-ref`);
192
+ const itemRefEls = this.testElement.querySelectorAll(`qti-assessment-test qti-assessment-item-ref`);
166
193
  Array.from(itemRefEls).forEach((itemElement) => {
167
194
  itemElement.xmlDoc = null;
168
195
  });
@@ -210,12 +237,12 @@ var TestViewMixin = (superClass) => {
210
237
  }
211
238
  // Method to handle view updates for elements based on the current context view
212
239
  _updateElementView() {
213
- if (this.testElement && this.testElement.el) {
214
- const viewElements = Array.from(this.testElement.el.querySelectorAll("[view]"));
240
+ if (this.testElement && this.testElement) {
241
+ const viewElements = Array.from(this.testElement.querySelectorAll("[view]"));
215
242
  viewElements.forEach((element) => {
216
243
  element.classList.toggle("show", element.getAttribute("view") === this._testContext.view);
217
244
  });
218
- const assessmentItem = this.testElement.el.querySelector(
245
+ const assessmentItem = this.testElement.querySelector(
219
246
  `qti-assessment-item[identifier="${this._testContext.navItemId}"]`
220
247
  );
221
248
  if (assessmentItem) {
@@ -239,7 +266,7 @@ var TestBase = class extends LitElement2 {
239
266
  constructor() {
240
267
  super();
241
268
  this._testContext = { items: [], testOutcomeVariables: [] };
242
- this.testElement = { el: null };
269
+ this.testElement = null;
243
270
  /**
244
271
  * Updates the variables of an assessment item in the test context.
245
272
  * - Matches the assessment item with the corresponding test context item.
@@ -264,15 +291,24 @@ var TestBase = class extends LitElement2 {
264
291
  };
265
292
  this.addEventListener("qti-assessment-test-connected", (e) => {
266
293
  const qtiAssessmentTest = e.detail;
267
- const items = Array.from(qtiAssessmentTest.querySelectorAll("qti-assessment-item-ref")).map(
268
- (itemRef) => ({
269
- href: itemRef.href,
270
- identifier: itemRef.identifier,
271
- category: itemRef.category,
272
- variables: [{ identifier: "completionStatus", value: "not_attempted", type: "outcome" }]
273
- })
274
- );
275
- this.testElement = { el: qtiAssessmentTest };
294
+ this.testElement = qtiAssessmentTest;
295
+ const items = Array.from(qtiAssessmentTest.querySelectorAll("qti-assessment-item-ref")).map((itemRef) => {
296
+ const existingItem = this._testContext.items.find((item) => item.identifier === itemRef.identifier);
297
+ return {
298
+ ...existingItem,
299
+ // Spread all existing properties
300
+ href: existingItem?.href || itemRef.href,
301
+ identifier: existingItem?.identifier || itemRef.identifier,
302
+ category: existingItem?.category || itemRef.category,
303
+ variables: existingItem?.variables || [
304
+ {
305
+ identifier: "completionStatus",
306
+ value: "not_attempted",
307
+ type: "outcome"
308
+ }
309
+ ]
310
+ };
311
+ });
276
312
  this._testContext = { ...this._testContext, items };
277
313
  });
278
314
  this.addEventListener("qti-assessment-item-connected", (e) => {
@@ -318,25 +354,6 @@ var TestBase = class extends LitElement2 {
318
354
  })
319
355
  };
320
356
  }
321
- // private _addItemToTestContext(
322
- // e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }
323
- // ): void {
324
- // const { href, identifier, category } = e.detail;
325
- // // Update test context items, adding a new item if the identifier is not already in the list
326
- // if (!this._testContext.items.some(item => item.identifier === identifier)) {
327
- // this._testContext.items.push({
328
- // href,
329
- // identifier,
330
- // category,
331
- // variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]
332
- // // category: e.target.category
333
- // });
334
- // }
335
- // }
336
- connectedCallback() {
337
- super.connectedCallback();
338
- this.setAttribute("qti-test", "");
339
- }
340
357
  };
341
358
  __decorateClass([
342
359
  state2(),
@@ -411,6 +428,11 @@ var QtiTest = class extends TestLoaderMixin(TestProcessingMixin(TestNavigationMi
411
428
  * Renders the component's template.
412
429
  * Provides a default `<slot>` for content projection.
413
430
  */
431
+ async connectedCallback() {
432
+ super.connectedCallback();
433
+ await this.updateComplete;
434
+ this.dispatchEvent(new CustomEvent("qti-test-connected", { detail: this }));
435
+ }
414
436
  render() {
415
437
  return html2`<slot></slot>`;
416
438
  }
@@ -422,7 +444,7 @@ QtiTest = __decorateClass([
422
444
  // src/lib/qti-test/core/qti-assessment-test/qti-assessment-item-ref.ts
423
445
  import { consume } from "@lit/context";
424
446
  import { html as html3, LitElement as LitElement3 } from "lit";
425
- import { property as property2 } from "lit/decorators.js";
447
+ import { property as property3 } from "lit/decorators.js";
426
448
  var stringToBooleanConverter = {
427
449
  fromAttribute(value) {
428
450
  return value === "true";
@@ -459,25 +481,25 @@ var QtiAssessmentItemRef = class extends LitElement3 {
459
481
  }
460
482
  };
461
483
  __decorateClass([
462
- property2({ type: String })
484
+ property3({ type: String })
463
485
  ], QtiAssessmentItemRef.prototype, "category", 2);
464
486
  __decorateClass([
465
- property2({ type: String })
487
+ property3({ type: String })
466
488
  ], QtiAssessmentItemRef.prototype, "identifier", 2);
467
489
  __decorateClass([
468
- property2({ type: Boolean, converter: stringToBooleanConverter })
490
+ property3({ type: Boolean, converter: stringToBooleanConverter })
469
491
  ], QtiAssessmentItemRef.prototype, "required", 2);
470
492
  __decorateClass([
471
- property2({ type: Boolean, converter: stringToBooleanConverter })
493
+ property3({ type: Boolean, converter: stringToBooleanConverter })
472
494
  ], QtiAssessmentItemRef.prototype, "fixed", 2);
473
495
  __decorateClass([
474
- property2({ type: String })
496
+ property3({ type: String })
475
497
  ], QtiAssessmentItemRef.prototype, "href", 2);
476
498
  __decorateClass([
477
499
  consume({ context: testContext, subscribe: true })
478
500
  ], QtiAssessmentItemRef.prototype, "_testContext", 2);
479
501
  __decorateClass([
480
- property2({ type: Object, attribute: false })
502
+ property3({ type: Object, attribute: false })
481
503
  ], QtiAssessmentItemRef.prototype, "xmlDoc", 2);
482
504
  if (!customElements.get("qti-assessment-item-ref")) {
483
505
  customElements.define("qti-assessment-item-ref", QtiAssessmentItemRef);
@@ -486,7 +508,7 @@ if (!customElements.get("qti-assessment-item-ref")) {
486
508
  // src/lib/qti-test/core/qti-assessment-test/qti-assessment-section.ts
487
509
  import { consume as consume2 } from "@lit/context";
488
510
  import { html as html4, LitElement as LitElement4 } from "lit";
489
- import { property as property3 } from "lit/decorators.js";
511
+ import { property as property4 } from "lit/decorators.js";
490
512
  var stringToBooleanConverter2 = {
491
513
  fromAttribute(value) {
492
514
  return value === "true";
@@ -511,22 +533,22 @@ var QtiAssessmentSection = class extends LitElement4 {
511
533
  }
512
534
  };
513
535
  __decorateClass([
514
- property3({ type: String })
536
+ property4({ type: String })
515
537
  ], QtiAssessmentSection.prototype, "identifier", 2);
516
538
  __decorateClass([
517
- property3({ type: String })
539
+ property4({ type: String })
518
540
  ], QtiAssessmentSection.prototype, "required", 2);
519
541
  __decorateClass([
520
- property3({ type: Boolean, converter: stringToBooleanConverter2 })
542
+ property4({ type: Boolean, converter: stringToBooleanConverter2 })
521
543
  ], QtiAssessmentSection.prototype, "fixed", 2);
522
544
  __decorateClass([
523
- property3({ type: String })
545
+ property4({ type: String })
524
546
  ], QtiAssessmentSection.prototype, "title", 2);
525
547
  __decorateClass([
526
- property3({ type: Boolean, converter: stringToBooleanConverter2 })
548
+ property4({ type: Boolean, converter: stringToBooleanConverter2 })
527
549
  ], QtiAssessmentSection.prototype, "visible", 2);
528
550
  __decorateClass([
529
- property3({ type: Boolean, converter: stringToBooleanConverter2, attribute: "keep-together" })
551
+ property4({ type: Boolean, converter: stringToBooleanConverter2, attribute: "keep-together" })
530
552
  ], QtiAssessmentSection.prototype, "keepTogether", 2);
531
553
  __decorateClass([
532
554
  consume2({ context: testContext, subscribe: true })
@@ -538,7 +560,7 @@ if (!customElements.get("qti-assessment-section")) {
538
560
  // src/lib/qti-test/core/qti-assessment-test/qti-assessment-test.ts
539
561
  import { consume as consume3 } from "@lit/context";
540
562
  import { html as html5, LitElement as LitElement5 } from "lit";
541
- import { customElement as customElement3, property as property4 } from "lit/decorators.js";
563
+ import { customElement as customElement3, property as property5 } from "lit/decorators.js";
542
564
  var QtiAssessmentTest = class extends LitElement5 {
543
565
  async connectedCallback() {
544
566
  super.connectedCallback();
@@ -556,10 +578,10 @@ var QtiAssessmentTest = class extends LitElement5 {
556
578
  }
557
579
  };
558
580
  __decorateClass([
559
- property4({ type: String })
581
+ property5({ type: String })
560
582
  ], QtiAssessmentTest.prototype, "identifier", 2);
561
583
  __decorateClass([
562
- property4({ type: String })
584
+ property5({ type: String })
563
585
  ], QtiAssessmentTest.prototype, "title", 2);
564
586
  __decorateClass([
565
587
  consume3({ context: testContext, subscribe: true })
@@ -570,7 +592,7 @@ QtiAssessmentTest = __decorateClass([
570
592
 
571
593
  // src/lib/qti-test/core/qti-assessment-test/qti-test-part.ts
572
594
  import { html as html6, LitElement as LitElement6 } from "lit";
573
- import { customElement as customElement4, property as property5 } from "lit/decorators.js";
595
+ import { customElement as customElement4, property as property6 } from "lit/decorators.js";
574
596
  var QtiTestPart = class extends LitElement6 {
575
597
  constructor() {
576
598
  super(...arguments);
@@ -595,19 +617,19 @@ var QtiTestPart = class extends LitElement6 {
595
617
  }
596
618
  };
597
619
  __decorateClass([
598
- property5({ type: String })
620
+ property6({ type: String })
599
621
  ], QtiTestPart.prototype, "identifier", 2);
600
622
  __decorateClass([
601
- property5({ type: String })
623
+ property6({ type: String })
602
624
  ], QtiTestPart.prototype, "title", 2);
603
625
  __decorateClass([
604
- property5({ type: String })
626
+ property6({ type: String })
605
627
  ], QtiTestPart.prototype, "class", 2);
606
628
  __decorateClass([
607
- property5({ type: String, attribute: "navigation-mode" })
629
+ property6({ type: String, attribute: "navigation-mode" })
608
630
  ], QtiTestPart.prototype, "NavigationMode", 2);
609
631
  __decorateClass([
610
- property5({ type: String, attribute: "submission-mode" })
632
+ property6({ type: String, attribute: "submission-mode" })
611
633
  ], QtiTestPart.prototype, "submissionMode", 2);
612
634
  QtiTestPart = __decorateClass([
613
635
  customElement4("qti-test-part")
@@ -624,4 +646,4 @@ export {
624
646
  QtiAssessmentTest,
625
647
  QtiTestPart
626
648
  };
627
- //# sourceMappingURL=chunk-4GNVYCBN.js.map
649
+ //# sourceMappingURL=chunk-ZQXZ6PK7.js.map