@citolab/qti-components 8.0.0 → 8.0.2

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 (77) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +690 -316
  3. package/dist/base.d.ts +135 -9
  4. package/dist/base.js +1 -1
  5. package/dist/chunk-4DB4SC5K.js +100 -0
  6. package/dist/chunk-4DB4SC5K.js.map +1 -0
  7. package/dist/{chunk-WVVMNF74.js → chunk-7AVWRQIS.js} +188 -160
  8. package/dist/{chunk-WVVMNF74.js.map → chunk-7AVWRQIS.js.map} +1 -1
  9. package/dist/{chunk-MGF5F3S2.js → chunk-BQFWCZFH.js} +2 -2
  10. package/dist/{chunk-5QYII4OZ.js → chunk-CK7AV2UJ.js} +147 -101
  11. package/dist/chunk-CK7AV2UJ.js.map +1 -0
  12. package/dist/chunk-G6GFQDVN.js +7 -0
  13. package/dist/chunk-G6GFQDVN.js.map +1 -0
  14. package/dist/{chunk-LZJHHZQ2.js → chunk-HBSWJC3B.js} +643 -553
  15. package/dist/chunk-HBSWJC3B.js.map +1 -0
  16. package/dist/chunk-HQESINXH.js +834 -0
  17. package/dist/chunk-HQESINXH.js.map +1 -0
  18. package/dist/{chunk-KYEZRYO6.js → chunk-J5SQLKNP.js} +145 -119
  19. package/dist/{chunk-KYEZRYO6.js.map → chunk-J5SQLKNP.js.map} +1 -1
  20. package/dist/{chunk-V5G7X53Y.js → chunk-NJQHUUTN.js} +2 -2
  21. package/dist/{chunk-W4QZPCNC.js → chunk-RSVRS5AK.js} +59 -58
  22. package/dist/chunk-RSVRS5AK.js.map +1 -0
  23. package/dist/{chunk-5SJS36BI.js → chunk-TWPXES3S.js} +642 -673
  24. package/dist/chunk-TWPXES3S.js.map +1 -0
  25. package/dist/{chunk-NA2N2WSG.js → chunk-VAE6HBKR.js} +176 -152
  26. package/dist/{chunk-NA2N2WSG.js.map → chunk-VAE6HBKR.js.map} +1 -1
  27. package/dist/{chunk-MJVPNN7W.js → chunk-ZII6M3SN.js} +2 -2
  28. package/dist/computed-item.types.d-BKZdSLLJ.d.ts +19 -0
  29. package/dist/computed.types.d-DpKIYO6e.d.ts +44 -0
  30. package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
  31. package/dist/corrections.d.ts +415 -1
  32. package/dist/corrections.js +8 -9
  33. package/dist/elements.d.ts +393 -1
  34. package/dist/elements.js +4 -5
  35. package/dist/index.d.ts +27 -9
  36. package/dist/index.js +21 -14
  37. package/dist/interaction.d-CJiMv8H7.d.ts +126 -0
  38. package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
  39. package/dist/interactions.d.ts +281 -1
  40. package/dist/interactions.js +4 -5
  41. package/dist/item.css +588 -214
  42. package/dist/item.d.ts +92 -1
  43. package/dist/item.js +5 -5
  44. package/dist/item.types.d-QU7LljEK.d.ts +82 -0
  45. package/dist/loader.d.ts +22 -1
  46. package/dist/processing.d.ts +730 -1
  47. package/dist/processing.js +2 -2
  48. package/dist/qti-components-jsx.d.ts +854 -844
  49. package/dist/qti-components-jsx.js +1 -0
  50. package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
  51. package/dist/qti-expression.d-BietT_8b.d.ts +31 -0
  52. package/dist/qti-feedback.d-DZbad0RN.d.ts +21 -0
  53. package/dist/qti-rule-base.d-ajOnfGXY.d.ts +16 -0
  54. package/dist/qti-test.d-_YAlhDbt.d.ts +702 -0
  55. package/dist/qti-text-entry-interaction.d-BGdfV9qG.d.ts +1567 -0
  56. package/dist/qti-transform-test.d-BL7GGFJj.d.ts +70 -0
  57. package/dist/qti.context.d-CejJMlfZ.d.ts +50 -0
  58. package/dist/response.d-_8y4kjGP.d.ts +106 -0
  59. package/dist/test.d.ts +32 -1
  60. package/dist/test.js +14 -7
  61. package/dist/transformers.d.ts +18 -1
  62. package/package.json +15 -11
  63. package/dist/chunk-5QYII4OZ.js.map +0 -1
  64. package/dist/chunk-5SJS36BI.js.map +0 -1
  65. package/dist/chunk-64XSIBGO.js +0 -241
  66. package/dist/chunk-64XSIBGO.js.map +0 -1
  67. package/dist/chunk-H3J7LFRO.js +0 -2243
  68. package/dist/chunk-H3J7LFRO.js.map +0 -1
  69. package/dist/chunk-LZJHHZQ2.js.map +0 -1
  70. package/dist/chunk-W4QZPCNC.js.map +0 -1
  71. package/dist/chunk-WCQ26LV7.js +0 -102
  72. package/dist/chunk-WCQ26LV7.js.map +0 -1
  73. package/dist/chunk-X3E5HXG2.js +0 -20
  74. package/dist/chunk-X3E5HXG2.js.map +0 -1
  75. /package/dist/{chunk-MGF5F3S2.js.map → chunk-BQFWCZFH.js.map} +0 -0
  76. /package/dist/{chunk-V5G7X53Y.js.map → chunk-NJQHUUTN.js.map} +0 -0
  77. /package/dist/{chunk-MJVPNN7W.js.map → chunk-ZII6M3SN.js.map} +0 -0
@@ -1,45 +1,35 @@
1
1
  import {
2
2
  QtiModalFeedback
3
- } from "./chunk-WVVMNF74.js";
3
+ } from "./chunk-7AVWRQIS.js";
4
4
  import {
5
- item_default,
6
- m
7
- } from "./chunk-WCQ26LV7.js";
5
+ item_default
6
+ } from "./chunk-G6GFQDVN.js";
8
7
  import {
9
8
  watch
10
- } from "./chunk-64XSIBGO.js";
9
+ } from "./chunk-4DB4SC5K.js";
11
10
  import {
12
11
  qtiTransformItem,
13
12
  qtiTransformTest
14
13
  } from "./chunk-IJD53WY6.js";
15
14
  import {
16
- A,
17
- E,
18
15
  INITIAL_SESSION_CONTEXT,
19
16
  INITIAL_TEST_CONTEXT,
20
17
  QtiExpression,
21
- T,
22
- Z,
23
- c,
24
18
  computedContext,
25
19
  configContext,
26
- e,
27
- i,
28
- i2,
29
- n,
30
- n2,
31
20
  qtiContext,
32
- r,
33
21
  sessionContext,
34
22
  testContext
35
- } from "./chunk-H3J7LFRO.js";
23
+ } from "./chunk-HQESINXH.js";
36
24
 
37
25
  // ../qti-test/dist/components/qti-assessment-item-ref/qti-assessment-item-ref.js
26
+ import { LitElement } from "lit";
27
+ import { property } from "lit/decorators.js";
38
28
  var __decorate = function(decorators, target, key, desc) {
39
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
40
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
41
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
42
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
29
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
30
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
31
+ 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;
32
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
43
33
  };
44
34
  var stringToBooleanConverter = {
45
35
  fromAttribute(value) {
@@ -49,7 +39,7 @@ var stringToBooleanConverter = {
49
39
  return value ? "true" : "false";
50
40
  }
51
41
  };
52
- var QtiAssessmentItemRef = class extends i2 {
42
+ var QtiAssessmentItemRef = class extends LitElement {
53
43
  constructor() {
54
44
  super(...arguments);
55
45
  this.weigths = /* @__PURE__ */ new Map();
@@ -74,30 +64,33 @@ var QtiAssessmentItemRef = class extends i2 {
74
64
  }
75
65
  };
76
66
  __decorate([
77
- n2({ type: String })
67
+ property({ type: String })
78
68
  ], QtiAssessmentItemRef.prototype, "category", void 0);
79
69
  __decorate([
80
- n2({ type: String })
70
+ property({ type: String })
81
71
  ], QtiAssessmentItemRef.prototype, "identifier", void 0);
82
72
  __decorate([
83
- n2({ type: Boolean, converter: stringToBooleanConverter })
73
+ property({ type: Boolean, converter: stringToBooleanConverter })
84
74
  ], QtiAssessmentItemRef.prototype, "required", void 0);
85
75
  __decorate([
86
- n2({ type: Boolean, converter: stringToBooleanConverter })
76
+ property({ type: Boolean, converter: stringToBooleanConverter })
87
77
  ], QtiAssessmentItemRef.prototype, "fixed", void 0);
88
78
  __decorate([
89
- n2({ type: String })
79
+ property({ type: String })
90
80
  ], QtiAssessmentItemRef.prototype, "href", void 0);
91
81
  __decorate([
92
- n2({ type: Object, attribute: false })
82
+ property({ type: Object, attribute: false })
93
83
  ], QtiAssessmentItemRef.prototype, "xmlDoc", void 0);
94
84
 
95
85
  // ../qti-test/dist/components/qti-assessment-section/qti-assessment-section.js
86
+ import { consume } from "@lit/context";
87
+ import { html, LitElement as LitElement2 } from "lit";
88
+ import { property as property2 } from "lit/decorators.js";
96
89
  var __decorate2 = function(decorators, target, key, desc) {
97
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
98
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
99
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
100
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
90
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
91
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
92
+ 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;
93
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
101
94
  };
102
95
  var stringToBooleanConverter2 = {
103
96
  fromAttribute(value) {
@@ -107,7 +100,7 @@ var stringToBooleanConverter2 = {
107
100
  return value ? "true" : "false";
108
101
  }
109
102
  };
110
- var QtiAssessmentSection = class extends i2 {
103
+ var QtiAssessmentSection = class extends LitElement2 {
111
104
  get title() {
112
105
  return this.#title;
113
106
  }
@@ -127,36 +120,45 @@ var QtiAssessmentSection = class extends i2 {
127
120
  }));
128
121
  }
129
122
  render() {
130
- return T`<slot name="qti-rubric-block"></slot><slot></slot>`;
123
+ return html`<slot name="qti-rubric-block"></slot><slot></slot>`;
131
124
  }
132
125
  };
133
126
  __decorate2([
134
- n2({ type: String })
127
+ property2({ type: String })
135
128
  ], QtiAssessmentSection.prototype, "identifier", void 0);
136
129
  __decorate2([
137
- n2({ type: String })
130
+ property2({ type: String })
138
131
  ], QtiAssessmentSection.prototype, "required", void 0);
139
132
  __decorate2([
140
- n2({ type: Boolean, converter: stringToBooleanConverter2 })
133
+ property2({ type: Boolean, converter: stringToBooleanConverter2 })
141
134
  ], QtiAssessmentSection.prototype, "fixed", void 0);
142
135
  __decorate2([
143
- n2({ type: Boolean, converter: stringToBooleanConverter2 })
136
+ property2({ type: Boolean, converter: stringToBooleanConverter2 })
144
137
  ], QtiAssessmentSection.prototype, "visible", void 0);
145
138
  __decorate2([
146
- n2({ type: Boolean, converter: stringToBooleanConverter2, attribute: "keep-together" })
139
+ property2({ type: Boolean, converter: stringToBooleanConverter2, attribute: "keep-together" })
147
140
  ], QtiAssessmentSection.prototype, "keepTogether", void 0);
148
141
  __decorate2([
149
- c({ context: testContext, subscribe: true })
142
+ property2({ type: String, attribute: "navigation-mode" })
143
+ ], QtiAssessmentSection.prototype, "navigationMode", void 0);
144
+ __decorate2([
145
+ property2({ type: String, attribute: "submission-mode" })
146
+ ], QtiAssessmentSection.prototype, "submissionMode", void 0);
147
+ __decorate2([
148
+ consume({ context: testContext, subscribe: true })
150
149
  ], QtiAssessmentSection.prototype, "_testContext", void 0);
151
150
 
152
151
  // ../qti-test/dist/components/qti-assessment-test/qti-assessment-test.js
152
+ import { consume as consume2 } from "@lit/context";
153
+ import { html as html2, LitElement as LitElement3 } from "lit";
154
+ import { property as property3 } from "lit/decorators.js";
153
155
  var __decorate3 = function(decorators, target, key, desc) {
154
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
155
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
156
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
157
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
156
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
157
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
158
+ 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;
159
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
158
160
  };
159
- var QtiAssessmentTest = class extends i2 {
161
+ var QtiAssessmentTest = class extends LitElement3 {
160
162
  get title() {
161
163
  return this.#title;
162
164
  }
@@ -176,41 +178,73 @@ var QtiAssessmentTest = class extends i2 {
176
178
  }));
177
179
  }
178
180
  render() {
179
- return T` <slot></slot>`;
181
+ return html2` <slot></slot>`;
180
182
  }
181
183
  };
182
184
  __decorate3([
183
- n2({ type: String })
185
+ property3({ type: String })
184
186
  ], QtiAssessmentTest.prototype, "identifier", void 0);
185
187
  __decorate3([
186
- n2({ type: String })
188
+ property3({ type: String })
187
189
  ], QtiAssessmentTest.prototype, "title", null);
188
190
  __decorate3([
189
- c({ context: testContext, subscribe: true })
191
+ consume2({ context: testContext, subscribe: true })
190
192
  ], QtiAssessmentTest.prototype, "_testContext", void 0);
191
193
 
194
+ // ../qti-test/dist/components/qti-outcome-processing/qti-outcome-processing.js
195
+ import { css, html as html3, LitElement as LitElement4 } from "lit";
196
+ var QtiOutcomeProcessing = class extends LitElement4 {
197
+ static {
198
+ this.styles = [
199
+ css`
200
+ :host {
201
+ display: none;
202
+ }
203
+ `
204
+ ];
205
+ }
206
+ render() {
207
+ return html3`<slot></slot>`;
208
+ }
209
+ process() {
210
+ const logic = new QtiOutcomeProcessingProcessor();
211
+ const rules = [...this.children];
212
+ logic.process(rules);
213
+ }
214
+ };
215
+ var QtiOutcomeProcessingProcessor = class {
216
+ process(rules) {
217
+ for (const rule of rules) {
218
+ rule.process();
219
+ }
220
+ }
221
+ };
222
+
192
223
  // ../qti-test/dist/components/qti-test-feedback/qti-test-feedback.js
224
+ import { css as css2, html as html4 } from "lit";
193
225
  var QtiTestFeedback = class extends QtiModalFeedback {
194
226
  static {
195
- this.styles = i`
227
+ this.styles = css2`
196
228
  :host {
197
229
  color: gray;
198
230
  }
199
231
  `;
200
232
  }
201
233
  render() {
202
- return T``;
234
+ return html4``;
203
235
  }
204
236
  };
205
237
 
206
238
  // ../qti-test/dist/components/qti-test-part/qti-test-part.js
239
+ import { html as html5, LitElement as LitElement5 } from "lit";
240
+ import { property as property4 } from "lit/decorators.js";
207
241
  var __decorate4 = function(decorators, target, key, desc) {
208
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
209
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
210
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
211
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
242
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
243
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
244
+ 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;
245
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
212
246
  };
213
- var QtiTestPart = class extends i2 {
247
+ var QtiTestPart = class extends LitElement5 {
214
248
  constructor() {
215
249
  super(...arguments);
216
250
  this.identifier = "";
@@ -237,28 +271,107 @@ var QtiTestPart = class extends i2 {
237
271
  }));
238
272
  }
239
273
  render() {
240
- return T` <slot></slot>`;
274
+ return html5` <slot></slot>`;
241
275
  }
242
276
  };
243
277
  __decorate4([
244
- n2({ type: String })
278
+ property4({ type: String })
245
279
  ], QtiTestPart.prototype, "identifier", void 0);
246
280
  __decorate4([
247
- n2({ type: String })
281
+ property4({ type: String })
248
282
  ], QtiTestPart.prototype, "class", void 0);
249
283
  __decorate4([
250
- n2({ type: String, attribute: "navigation-mode" })
284
+ property4({ type: String, attribute: "navigation-mode" })
251
285
  ], QtiTestPart.prototype, "navigationMode", void 0);
252
286
  __decorate4([
253
- n2({ type: String, attribute: "submission-mode" })
287
+ property4({ type: String, attribute: "submission-mode" })
254
288
  ], QtiTestPart.prototype, "submissionMode", void 0);
255
289
 
256
- // ../qti-test/dist/mixins/test-navigation.mixin.js
290
+ // ../qti-test/dist/components/qti-test-variables/qti-test-variables.js
291
+ import { consume as consume3 } from "@lit/context";
257
292
  var __decorate5 = function(decorators, target, key, desc) {
258
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
259
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
260
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
261
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
293
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
294
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
295
+ 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;
296
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
297
+ };
298
+ var QtiTestVariables = class extends QtiExpression {
299
+ #testElement;
300
+ constructor() {
301
+ super();
302
+ this.addEventListener("qti-assessment-test-connected", (e) => this.#testElement = e.detail);
303
+ }
304
+ getResult() {
305
+ const includedCategories = this.getAttribute("include-category")?.split(" ") ?? [];
306
+ const excludedCategories = this.getAttribute("exclude-category")?.split(" ") ?? [];
307
+ const weightIdentifier = this.getAttribute("weight-identifier") ?? "";
308
+ const itemVariable = this.getAttribute("variable-identifier");
309
+ const itemRefEls = Array.from(this.#testElement.querySelectorAll(`qti-asssessment-test qti-assessment-item-ref`));
310
+ const includedItems = itemRefEls.filter((itemRef) => {
311
+ let include = true;
312
+ if (includedCategories.length > 0) {
313
+ include = includedCategories.includes(itemRef.category);
314
+ }
315
+ if (excludedCategories.length > 0) {
316
+ include = !excludedCategories.includes(itemRef.category);
317
+ }
318
+ return include;
319
+ }).map((itemRef) => {
320
+ let weight = 1;
321
+ if (weightIdentifier) {
322
+ const weightVariable = itemRef.weigths.get(weightIdentifier);
323
+ if (weightVariable !== null && weightVariable !== void 0) {
324
+ weight = weightVariable;
325
+ }
326
+ }
327
+ return { item: itemRef.identifier, weight };
328
+ });
329
+ const logic = new QtiTestVariablesExpression(this._testContext, itemVariable, includedItems);
330
+ const value = logic.calculate();
331
+ return value;
332
+ }
333
+ calculate() {
334
+ return this.getResult();
335
+ }
336
+ };
337
+ __decorate5([
338
+ consume3({ context: testContext, subscribe: true })
339
+ ], QtiTestVariables.prototype, "_testContext", void 0);
340
+ var QtiTestVariablesExpression = class {
341
+ constructor(testContext2, itemVariable, includedItems) {
342
+ this.testContext = testContext2;
343
+ this.itemVariable = itemVariable;
344
+ this.includedItems = includedItems;
345
+ }
346
+ calculate() {
347
+ const { items } = this.testContext;
348
+ let total = 0;
349
+ const uniqueItems = [...new Set(this.includedItems.map((item) => item.item))];
350
+ items.forEach((item) => {
351
+ if (uniqueItems.includes(item.identifier)) {
352
+ const variable = item.variables.find((vr) => vr.identifier === this.itemVariable);
353
+ const weight = this.includedItems.find((i) => i.item === item.identifier)?.weight ?? 1;
354
+ if (variable) {
355
+ total += Number(variable.value) * weight;
356
+ }
357
+ }
358
+ });
359
+ return total;
360
+ }
361
+ };
362
+
363
+ // ../qti-test/dist/components/qti-test/qti-test.js
364
+ import { provide as provide2 } from "@lit/context";
365
+ import { html as html6, LitElement as LitElement7 } from "lit";
366
+ import { state } from "lit/decorators.js";
367
+
368
+ // ../qti-test/dist/mixins/test-navigation.mixin.js
369
+ import { property as property5 } from "lit/decorators.js";
370
+ var __decorate6 = function(decorators, target, key, desc) {
371
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
372
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
373
+ 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;
374
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
262
375
  };
263
376
  var TestNavigationMixin = (superClass) => {
264
377
  class TestNavigationClass extends superClass {
@@ -309,15 +422,15 @@ var TestNavigationMixin = (superClass) => {
309
422
  this.addEventListener("qti-assessment-item-connected", this._handleItemConnected.bind(this));
310
423
  this.addEventListener("qti-assessment-stimulus-ref-connected", this._handleStimulusRefConnected.bind(this));
311
424
  }
312
- _handleTestConnected(e2) {
313
- this._testElement = e2.detail;
425
+ _handleTestConnected(e) {
426
+ this._testElement = e.detail;
314
427
  this._initializeNavigation();
315
428
  }
316
429
  /**
317
430
  * Handle item connection events - track connected items and discover stimulus references
318
431
  */
319
- _handleItemConnected(e2) {
320
- const itemRef = e2.detail;
432
+ _handleItemConnected(e) {
433
+ const itemRef = e.detail;
321
434
  this._loadingState.connectedItems++;
322
435
  const stimulusRefs = itemRef.querySelectorAll("qti-assessment-stimulus-ref");
323
436
  this._loadingState.expectedStimulus += stimulusRefs.length;
@@ -326,9 +439,9 @@ var TestNavigationMixin = (superClass) => {
326
439
  /**
327
440
  * Handle stimulus reference connection events with duplicate prevention
328
441
  */
329
- async _handleStimulusRefConnected(e2) {
330
- e2.preventDefault();
331
- const { element, item } = e2;
442
+ async _handleStimulusRefConnected(e) {
443
+ e.preventDefault();
444
+ const { element, item } = e;
332
445
  console.info("Stimulus ref connected:", {
333
446
  identifier: element.identifier,
334
447
  href: element.href,
@@ -381,12 +494,40 @@ var TestNavigationMixin = (superClass) => {
381
494
  this.navigateTo(this.navigate, id);
382
495
  }
383
496
  }
497
+ _isLinearNavigationRestricted(type, targetId) {
498
+ const currentItemId = this.sessionContext?.navItemRefId;
499
+ if (!currentItemId)
500
+ return false;
501
+ if (type === "item" && targetId === currentItemId)
502
+ return false;
503
+ const currentItemRef = this._testElement?.querySelector(`qti-assessment-item-ref[identifier="${currentItemId}"]`);
504
+ if (!currentItemRef)
505
+ return false;
506
+ const section = currentItemRef.closest("qti-assessment-section");
507
+ const testPart = currentItemRef.closest("qti-test-part");
508
+ const navigationMode = section?.navigationMode || section?.getAttribute("navigation-mode") || testPart?.navigationMode || testPart?.getAttribute("navigation-mode") || "nonlinear";
509
+ if (navigationMode !== "linear")
510
+ return false;
511
+ const allItemRefs = Array.from(this._testElement?.querySelectorAll("qti-assessment-item-ref") || []);
512
+ const currentIndex = allItemRefs.findIndex((ref) => ref.identifier === currentItemId);
513
+ if (type === "item") {
514
+ const targetIndex = allItemRefs.findIndex((ref) => ref.identifier === targetId);
515
+ if (targetIndex === -1 || currentIndex === -1)
516
+ return false;
517
+ return targetIndex !== currentIndex + 1;
518
+ }
519
+ return true;
520
+ }
384
521
  /**
385
522
  * Main navigation request handler with proper lifecycle management
386
523
  */
387
524
  async _handleNavigationRequest({ detail }) {
388
525
  if (!detail?.id)
389
526
  return;
527
+ if (this._isLinearNavigationRestricted(detail.type, detail.id)) {
528
+ this._handleNavigationError(new Error("Navigation restricted in linear mode"), detail.type, detail.id);
529
+ return;
530
+ }
390
531
  this._cancelPreviousNavigation();
391
532
  const navigationId = ++this._navigationId;
392
533
  const controller = new AbortController();
@@ -579,7 +720,7 @@ var TestNavigationMixin = (superClass) => {
579
720
  const itemId = itemRef?.identifier;
580
721
  if (!itemRef || !itemId)
581
722
  return;
582
- const savedState = this.testContext.items.find((i4) => i4.identifier === itemId)?.state;
723
+ const savedState = this.testContext.items.find((i) => i.identifier === itemId)?.state;
583
724
  if (savedState === void 0)
584
725
  return;
585
726
  itemRef.updateComplete.then(() => {
@@ -704,17 +845,17 @@ var TestNavigationMixin = (superClass) => {
704
845
  });
705
846
  }
706
847
  }
707
- __decorate5([
708
- n2({ type: String })
848
+ __decorate6([
849
+ property5({ type: String })
709
850
  ], TestNavigationClass.prototype, "navigate", void 0);
710
- __decorate5([
711
- n2({ type: Number })
851
+ __decorate6([
852
+ property5({ type: Number })
712
853
  ], TestNavigationClass.prototype, "requestTimeout", void 0);
713
- __decorate5([
714
- n2({ attribute: false })
854
+ __decorate6([
855
+ property5({ attribute: false })
715
856
  ], TestNavigationClass.prototype, "postLoadTransformCallback", void 0);
716
- __decorate5([
717
- n2({ attribute: false })
857
+ __decorate6([
858
+ property5({ attribute: false })
718
859
  ], TestNavigationClass.prototype, "postLoadTestTransformCallback", void 0);
719
860
  return TestNavigationClass;
720
861
  };
@@ -725,16 +866,16 @@ var TestViewMixin = (superClass) => {
725
866
  constructor(...args) {
726
867
  super(...args);
727
868
  this.sessionContext = { ...this.sessionContext, view: "candidate" };
728
- this.addEventListener("on-test-switch-view", (e2) => {
729
- this.sessionContext = { ...this.sessionContext, view: e2.detail };
869
+ this.addEventListener("on-test-switch-view", (e) => {
870
+ this.sessionContext = { ...this.sessionContext, view: e.detail };
730
871
  this._updateElementView();
731
872
  });
732
873
  this.addEventListener("qti-assessment-test-connected", () => {
733
874
  this._updateElementView();
734
875
  });
735
- this.addEventListener("qti-assessment-item-connected", (e2) => {
876
+ this.addEventListener("qti-assessment-item-connected", (e) => {
736
877
  this._updateElementView();
737
- this._setCorrectResponseVisibility(e2.detail);
878
+ this._setCorrectResponseVisibility(e.detail);
738
879
  });
739
880
  }
740
881
  willUpdate(changedProperties) {
@@ -768,11 +909,14 @@ var TestViewMixin = (superClass) => {
768
909
  };
769
910
 
770
911
  // ../qti-test/dist/mixins/test-base.js
771
- var __decorate6 = function(decorators, target, key, desc) {
772
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
773
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
774
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
775
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
912
+ import { provide } from "@lit/context";
913
+ import { LitElement as LitElement6 } from "lit";
914
+ import { property as property6 } from "lit/decorators.js";
915
+ var __decorate7 = function(decorators, target, key, desc) {
916
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
917
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
918
+ 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;
919
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
776
920
  };
777
921
  var TestBaseMixin = (superClass) => {
778
922
  class TestBaseClass extends superClass {
@@ -784,7 +928,7 @@ var TestBaseMixin = (superClass) => {
784
928
  const context = assessmentItem._context;
785
929
  const identifier = context.identifier;
786
930
  const fullVariables = context.variables;
787
- const itemContext = this.testContext.items.find((i4) => i4?.identifier === identifier);
931
+ const itemContext = this.testContext.items.find((i) => i?.identifier === identifier);
788
932
  if (!itemContext) {
789
933
  console.warn(`Item IDs between assessment.xml and item.xml should match: ${identifier} is not found!`);
790
934
  return;
@@ -820,12 +964,12 @@ var TestBaseMixin = (superClass) => {
820
964
  }
821
965
  }
822
966
  _initializeEventListeners() {
823
- this.addEventListener("qti-assessment-test-connected", (e2) => {
967
+ this.addEventListener("qti-assessment-test-connected", (e) => {
824
968
  this.testContext = INITIAL_TEST_CONTEXT;
825
969
  this.sessionContext = INITIAL_SESSION_CONTEXT;
826
970
  if (this.testContext && this.testContext.items.length > 0)
827
971
  return;
828
- this._testElement = e2.detail;
972
+ this._testElement = e.detail;
829
973
  const items = Array.from(this._testElement.querySelectorAll("qti-assessment-item-ref")).map((itemRef) => {
830
974
  return {
831
975
  href: itemRef.href,
@@ -842,19 +986,19 @@ var TestBaseMixin = (superClass) => {
842
986
  });
843
987
  this.testContext = { ...this.testContext, items };
844
988
  });
845
- this.addEventListener("qti-assessment-item-connected", (e2) => {
846
- const assessmentItem = e2.detail;
989
+ this.addEventListener("qti-assessment-item-connected", (e) => {
990
+ const assessmentItem = e.detail;
847
991
  const assessmentRefId = assessmentItem.closest("qti-assessment-item-ref")?.identifier;
848
992
  if (assessmentRefId) {
849
993
  assessmentItem.assessmentItemRefId = assessmentRefId;
850
994
  }
851
- this._updateItemInTestContext(e2.detail);
995
+ this._updateItemInTestContext(e.detail);
852
996
  });
853
- this.addEventListener("qti-item-context-updated", (e2) => {
854
- this._updateItemVariablesInTestContext(e2.detail.itemContext.identifier, e2.detail.itemContext.variables, e2.detail.itemContext.state);
997
+ this.addEventListener("qti-item-context-updated", (e) => {
998
+ this._updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail.itemContext.variables, e.detail.itemContext.state);
855
999
  });
856
1000
  }
857
- _updateItemVariablesInTestContext(identifier, variables, state) {
1001
+ _updateItemVariablesInTestContext(identifier, variables, state8) {
858
1002
  this.testContext = {
859
1003
  ...this.testContext,
860
1004
  // Spread existing test context properties
@@ -869,24 +1013,24 @@ var TestBaseMixin = (superClass) => {
869
1013
  const matchingVariable = itemContext.variables.find((v) => v.identifier === variable.identifier);
870
1014
  return matchingVariable ? { ...matchingVariable, ...variable } : variable;
871
1015
  }),
872
- ...state !== void 0 ? { state: state ? { ...state } : void 0 } : {}
1016
+ ...state8 !== void 0 ? { state: state8 ? { ...state8 } : void 0 } : {}
873
1017
  };
874
1018
  })
875
1019
  };
876
1020
  this.dispatchEvent(new CustomEvent("qti-test-context-updated", { detail: this.testContext, bubbles: false, composed: false }));
877
1021
  }
878
1022
  }
879
- __decorate6([
880
- n2({ attribute: false, type: Object }),
881
- e({ context: testContext })
1023
+ __decorate7([
1024
+ property6({ attribute: false, type: Object }),
1025
+ provide({ context: testContext })
882
1026
  ], TestBaseClass.prototype, "testContext", void 0);
883
- __decorate6([
884
- n2({ attribute: false, type: Object }),
885
- e({ context: sessionContext })
1027
+ __decorate7([
1028
+ property6({ attribute: false, type: Object }),
1029
+ provide({ context: sessionContext })
886
1030
  ], TestBaseClass.prototype, "sessionContext", void 0);
887
1031
  return TestBaseClass;
888
1032
  };
889
- var TestBase = class extends TestBaseMixin(i2) {
1033
+ var TestBase = class extends TestBaseMixin(LitElement6) {
890
1034
  };
891
1035
 
892
1036
  // ../qti-test/dist/mixins/test-processing.mixin.js
@@ -894,17 +1038,17 @@ var TestProcessingMixin = (superClass) => {
894
1038
  class TestProcessingElement extends superClass {
895
1039
  constructor(...args) {
896
1040
  super(...args);
897
- this.addEventListener("qti-register-variable", (e2) => {
1041
+ this.addEventListener("qti-register-variable", (e) => {
898
1042
  this.testContext = {
899
1043
  ...this.testContext,
900
- testOutcomeVariables: [...this.testContext.testOutcomeVariables || [], e2.detail.variable]
1044
+ testOutcomeVariables: [...this.testContext.testOutcomeVariables || [], e.detail.variable]
901
1045
  };
902
- e2.stopPropagation();
1046
+ e.stopPropagation();
903
1047
  });
904
- this.addEventListener("qti-set-outcome-value", (e2) => {
905
- const { outcomeIdentifier, value } = e2.detail;
1048
+ this.addEventListener("qti-set-outcome-value", (e) => {
1049
+ const { outcomeIdentifier, value } = e.detail;
906
1050
  this.updateOutcomeVariable(outcomeIdentifier, value);
907
- e2.stopPropagation();
1051
+ e.stopPropagation();
908
1052
  });
909
1053
  }
910
1054
  outcomeProcessing() {
@@ -945,13 +1089,13 @@ var TestProcessingMixin = (superClass) => {
945
1089
  };
946
1090
 
947
1091
  // ../qti-test/dist/components/qti-test/qti-test.js
948
- var __decorate7 = function(decorators, target, key, desc) {
949
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
950
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
951
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
952
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
1092
+ var __decorate8 = function(decorators, target, key, desc) {
1093
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1094
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1095
+ 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;
1096
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
953
1097
  };
954
- var QtiTest = class extends TestNavigationMixin(TestViewMixin(TestProcessingMixin(TestBaseMixin(i2)))) {
1098
+ var QtiTest = class extends TestNavigationMixin(TestViewMixin(TestProcessingMixin(TestBaseMixin(LitElement7)))) {
955
1099
  constructor() {
956
1100
  super(...arguments);
957
1101
  this.configContext = {};
@@ -966,16 +1110,20 @@ var QtiTest = class extends TestNavigationMixin(TestViewMixin(TestProcessingMixi
966
1110
  this.dispatchEvent(new CustomEvent("qti-test-connected", { detail: this }));
967
1111
  }
968
1112
  render() {
969
- return T`<slot></slot>`;
1113
+ return html6`<slot></slot>`;
970
1114
  }
971
1115
  };
972
- __decorate7([
973
- r(),
974
- e({ context: configContext })
1116
+ __decorate8([
1117
+ state(),
1118
+ provide2({ context: configContext })
975
1119
  ], QtiTest.prototype, "configContext", void 0);
976
1120
 
1121
+ // ../qti-test/dist/components/test-check-item/test-check-item.js
1122
+ import { css as css4, html as html7, LitElement as LitElement8 } from "lit";
1123
+
977
1124
  // ../qti-test/dist/components/styles.js
978
- var form = i`
1125
+ import { css as css3 } from "lit";
1126
+ var form = css3`
979
1127
  display: inline-flex;
980
1128
  align-items: center;
981
1129
  cursor: pointer;
@@ -983,23 +1131,23 @@ var form = i`
983
1131
  border-radius: 0.25rem;
984
1132
  user-select: none;
985
1133
  `;
986
- var btn = i`
1134
+ var btn = css3`
987
1135
  background-color: lightgray;
988
1136
  ${form};
989
1137
  `;
990
- var dis = i`
1138
+ var dis = css3`
991
1139
  cursor: not-allowed;
992
1140
  opacity: 0.8;
993
1141
  `;
994
- var ind = i`
1142
+ var ind = css3`
995
1143
  ${form};
996
1144
  border: 1px solid gray;
997
1145
  `;
998
1146
 
999
1147
  // ../qti-test/dist/components/test-check-item/test-check-item.js
1000
- var TestCheckItem = class extends i2 {
1148
+ var TestCheckItem = class extends LitElement8 {
1001
1149
  static {
1002
- this.styles = i`
1150
+ this.styles = css4`
1003
1151
  :host {
1004
1152
  ${btn};
1005
1153
  }
@@ -1021,18 +1169,22 @@ var TestCheckItem = class extends i2 {
1021
1169
  });
1022
1170
  }
1023
1171
  render() {
1024
- return T` <slot></slot> `;
1172
+ return html7` <slot></slot> `;
1025
1173
  }
1026
1174
  };
1027
1175
 
1028
1176
  // ../qti-test/dist/components/test-container/test-container.js
1029
- var __decorate8 = function(decorators, target, key, desc) {
1030
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1031
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
1032
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
1033
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
1177
+ import { consume as consume4 } from "@lit/context";
1178
+ import { LitElement as LitElement9, html as html8 } from "lit";
1179
+ import { property as property7, state as state2 } from "lit/decorators.js";
1180
+ import { until } from "lit/directives/until.js";
1181
+ var __decorate9 = function(decorators, target, key, desc) {
1182
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1183
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1184
+ 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;
1185
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1034
1186
  };
1035
- var TestContainer = class extends i2 {
1187
+ var TestContainer = class extends LitElement9 {
1036
1188
  constructor() {
1037
1189
  super(...arguments);
1038
1190
  this.customElementRegistry = null;
@@ -1100,7 +1252,7 @@ var TestContainer = class extends i2 {
1100
1252
  }
1101
1253
  #initializeTemplateContent() {
1102
1254
  const template = this.querySelector("template");
1103
- this.#templateContent = template ? template.content : T``;
1255
+ this.#templateContent = template ? template.content : html8``;
1104
1256
  }
1105
1257
  #applyStyles() {
1106
1258
  const sheet = new CSSStyleSheet();
@@ -1108,40 +1260,41 @@ var TestContainer = class extends i2 {
1108
1260
  this.shadowRoot.adoptedStyleSheets = [sheet];
1109
1261
  }
1110
1262
  render() {
1111
- return T`
1263
+ return html8`
1112
1264
  ${this.#templateContent}
1113
1265
  <slot></slot>
1114
- ${m(this.testDoc, T`<span>Loading...</span>`)}
1266
+ ${until(this.testDoc, html8`<span>Loading...</span>`)}
1115
1267
  `;
1116
1268
  }
1117
1269
  };
1118
- __decorate8([
1119
- n2({ attribute: false })
1270
+ __decorate9([
1271
+ property7({ attribute: false })
1120
1272
  ], TestContainer.prototype, "customElementRegistry", void 0);
1121
- __decorate8([
1122
- n2({ type: String, attribute: "test-url" })
1273
+ __decorate9([
1274
+ property7({ type: String, attribute: "test-url" })
1123
1275
  ], TestContainer.prototype, "testURL", void 0);
1124
- __decorate8([
1125
- r()
1276
+ __decorate9([
1277
+ state2()
1126
1278
  ], TestContainer.prototype, "testDoc", void 0);
1127
- __decorate8([
1128
- r()
1279
+ __decorate9([
1280
+ state2()
1129
1281
  ], TestContainer.prototype, "testXML", void 0);
1130
- __decorate8([
1131
- r(),
1132
- c({ context: qtiContext, subscribe: true })
1282
+ __decorate9([
1283
+ state2(),
1284
+ consume4({ context: qtiContext, subscribe: true })
1133
1285
  ], TestContainer.prototype, "qtiContext", void 0);
1134
- __decorate8([
1286
+ __decorate9([
1135
1287
  watch("testURL", { waitUntilFirstUpdate: true })
1136
1288
  ], TestContainer.prototype, "handleTestURLChange", null);
1137
- __decorate8([
1289
+ __decorate9([
1138
1290
  watch("testXML", { waitUntilFirstUpdate: true })
1139
1291
  ], TestContainer.prototype, "handleTestXMLChange", null);
1140
1292
 
1141
1293
  // ../qti-test/dist/components/test-end-attempt/test-end-attempt.js
1142
- var TestEndAttempt = class extends i2 {
1294
+ import { css as css5, html as html9, LitElement as LitElement10 } from "lit";
1295
+ var TestEndAttempt = class extends LitElement10 {
1143
1296
  static {
1144
- this.styles = i`
1297
+ this.styles = css5`
1145
1298
  :host {
1146
1299
  ${btn};
1147
1300
  }
@@ -1155,20 +1308,22 @@ var TestEndAttempt = class extends i2 {
1155
1308
  this.addEventListener("click", () => this.dispatchEvent(new CustomEvent("test-end-attempt", { bubbles: true })));
1156
1309
  }
1157
1310
  render() {
1158
- return T` <slot></slot> `;
1311
+ return html9` <slot></slot> `;
1159
1312
  }
1160
1313
  };
1161
1314
 
1162
1315
  // ../qti-test/dist/components/test-item-link/test-item-link.js
1163
- var __decorate9 = function(decorators, target, key, desc) {
1164
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1165
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
1166
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
1167
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
1316
+ import { css as css6, html as html10, LitElement as LitElement11 } from "lit";
1317
+ import { property as property8 } from "lit/decorators.js";
1318
+ var __decorate10 = function(decorators, target, key, desc) {
1319
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1320
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1321
+ 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;
1322
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1168
1323
  };
1169
- var TestItemLink = class extends i2 {
1324
+ var TestItemLink = class extends LitElement11 {
1170
1325
  static {
1171
- this.styles = i`
1326
+ this.styles = css6`
1172
1327
  :host {
1173
1328
  ${btn};
1174
1329
  }
@@ -1193,19 +1348,22 @@ var TestItemLink = class extends i2 {
1193
1348
  }));
1194
1349
  }
1195
1350
  render() {
1196
- return T` <slot></slot> `;
1351
+ return html10` <slot></slot> `;
1197
1352
  }
1198
1353
  };
1199
- __decorate9([
1200
- n2({ type: String, attribute: "item-id" })
1354
+ __decorate10([
1355
+ property8({ type: String, attribute: "item-id" })
1201
1356
  ], TestItemLink.prototype, "itemId", void 0);
1202
1357
 
1203
1358
  // ../qti-test/dist/components/test-item-to-speech/test-item-to-speech.js
1204
- var __decorate10 = function(decorators, target, key, desc) {
1205
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1206
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
1207
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
1208
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
1359
+ import { html as html11, LitElement as LitElement12, css as css7 } from "lit";
1360
+ import { consume as consume5, provide as provide3, createContext } from "@lit/context";
1361
+ import { property as property9, state as state3 } from "lit/decorators.js";
1362
+ var __decorate11 = function(decorators, target, key, desc) {
1363
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1364
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1365
+ 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;
1366
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1209
1367
  };
1210
1368
  var HIGHLIGHT_ELEMENT = "tts-element";
1211
1369
  var HIGHLIGHT_WORD = "tts-word";
@@ -1220,10 +1378,10 @@ function getHighlightSheet() {
1220
1378
  }
1221
1379
  return highlightSheet;
1222
1380
  }
1223
- var ttsContext = n(/* @__PURE__ */ Symbol("tts-context"));
1224
- var TtsButtonBase = class extends i2 {
1381
+ var ttsContext = createContext(/* @__PURE__ */ Symbol("tts-context"));
1382
+ var TtsButtonBase = class extends LitElement12 {
1225
1383
  static {
1226
- this.styles = i`
1384
+ this.styles = css7`
1227
1385
  :host {
1228
1386
  display: inline-block;
1229
1387
  }
@@ -1245,10 +1403,10 @@ var TtsButtonBase = class extends i2 {
1245
1403
  }
1246
1404
  }
1247
1405
  };
1248
- __decorate10([
1249
- c({ context: ttsContext, subscribe: true })
1406
+ __decorate11([
1407
+ consume5({ context: ttsContext, subscribe: true })
1250
1408
  ], TtsButtonBase.prototype, "_tts", void 0);
1251
- var TestItemToSpeech = class extends i2 {
1409
+ var TestItemToSpeech = class extends LitElement12 {
1252
1410
  #internals;
1253
1411
  #itemElements;
1254
1412
  #boundHandleItemConnected;
@@ -1322,7 +1480,7 @@ var TestItemToSpeech = class extends i2 {
1322
1480
  this.#itemElements.clear();
1323
1481
  }
1324
1482
  render() {
1325
- return T`<slot></slot>`;
1483
+ return html11`<slot></slot>`;
1326
1484
  }
1327
1485
  #handleItemConnected(event) {
1328
1486
  const item = event.detail;
@@ -1331,12 +1489,12 @@ var TestItemToSpeech = class extends i2 {
1331
1489
  }
1332
1490
  }
1333
1491
  /** Update speech state on both the context (notifies children) and the host's CSS custom states. */
1334
- #setSpeechState(state) {
1335
- this._ttsContext = { ...this._ttsContext, state };
1492
+ #setSpeechState(state8) {
1493
+ this._ttsContext = { ...this._ttsContext, state: state8 };
1336
1494
  this.#internals.states.delete("idle");
1337
1495
  this.#internals.states.delete("playing");
1338
1496
  this.#internals.states.delete("paused");
1339
- this.#internals.states.add(state);
1497
+ this.#internals.states.add(state8);
1340
1498
  }
1341
1499
  /** Push currentElementIndex and elementCount into context so children can react. */
1342
1500
  #updateContext() {
@@ -1389,7 +1547,7 @@ var TestItemToSpeech = class extends i2 {
1389
1547
  element.scrollIntoView({ behavior: "smooth", block: "nearest" });
1390
1548
  this.#highlightElement(element);
1391
1549
  this.#textNodes = this.#collectTextNodes(element);
1392
- const text = this.#textNodes.map((n3) => n3.textContent ?? "").join("");
1550
+ const text = this.#textNodes.map((n) => n.textContent ?? "").join("");
1393
1551
  if (!text.trim()) {
1394
1552
  this.#speakElement(index + 1);
1395
1553
  return;
@@ -1477,7 +1635,7 @@ var TestItemToSpeech = class extends i2 {
1477
1635
  return;
1478
1636
  this.#ensureHighlightStyles();
1479
1637
  this.#wordHighlight.clear();
1480
- const text = this.#textNodes.map((n3) => n3.textContent ?? "").join("");
1638
+ const text = this.#textNodes.map((n) => n.textContent ?? "").join("");
1481
1639
  const endIndex = charIndex + (charLength > 0 ? charLength : this.#wordLengthAt(charIndex, text));
1482
1640
  let offset = 0;
1483
1641
  let startNode = null;
@@ -1544,15 +1702,15 @@ var TestItemToSpeech = class extends i2 {
1544
1702
  }
1545
1703
  }
1546
1704
  };
1547
- __decorate10([
1548
- n2({ type: String })
1705
+ __decorate11([
1706
+ property9({ type: String })
1549
1707
  ], TestItemToSpeech.prototype, "language", void 0);
1550
- __decorate10([
1551
- c({ context: sessionContext, subscribe: true })
1708
+ __decorate11([
1709
+ consume5({ context: sessionContext, subscribe: true })
1552
1710
  ], TestItemToSpeech.prototype, "_sessionContext", void 0);
1553
- __decorate10([
1554
- r(),
1555
- e({ context: ttsContext })
1711
+ __decorate11([
1712
+ state3(),
1713
+ provide3({ context: ttsContext })
1556
1714
  ], TestItemToSpeech.prototype, "_ttsContext", void 0);
1557
1715
  var TestTtsPlay = class extends TtsButtonBase {
1558
1716
  #toggle() {
@@ -1567,16 +1725,16 @@ var TestTtsPlay = class extends TtsButtonBase {
1567
1725
  }
1568
1726
  render() {
1569
1727
  const playing = this._tts?.state === "playing";
1570
- return T`
1728
+ return html11`
1571
1729
  <button part="button" @click=${this.#toggle}>
1572
- ${playing ? T`<slot name="pause">⏸</slot>` : T`<slot name="play">▶</slot>`}
1730
+ ${playing ? html11`<slot name="pause">⏸</slot>` : html11`<slot name="play">▶</slot>`}
1573
1731
  </button>
1574
1732
  `;
1575
1733
  }
1576
1734
  };
1577
1735
  var TestTtsPause = class extends TtsButtonBase {
1578
1736
  render() {
1579
- return T`
1737
+ return html11`
1580
1738
  <button part="button" ?disabled=${this._tts?.state !== "playing"} @click=${() => this._tts?.pause()}>
1581
1739
  <slot>⏸</slot>
1582
1740
  </button>
@@ -1585,7 +1743,7 @@ var TestTtsPause = class extends TtsButtonBase {
1585
1743
  };
1586
1744
  var TestTtsResume = class extends TtsButtonBase {
1587
1745
  render() {
1588
- return T`
1746
+ return html11`
1589
1747
  <button part="button" ?disabled=${this._tts?.state !== "paused"} @click=${() => this._tts?.resume()}>
1590
1748
  <slot>▶</slot>
1591
1749
  </button>
@@ -1594,7 +1752,7 @@ var TestTtsResume = class extends TtsButtonBase {
1594
1752
  };
1595
1753
  var TestTtsStop = class extends TtsButtonBase {
1596
1754
  render() {
1597
- return T`
1755
+ return html11`
1598
1756
  <button part="button" ?disabled=${this._tts?.state === "idle"} @click=${() => this._tts?.stop()}>
1599
1757
  <slot>■</slot>
1600
1758
  </button>
@@ -1605,7 +1763,7 @@ var TestTtsPrev = class extends TtsButtonBase {
1605
1763
  render() {
1606
1764
  const atStart = (this._tts?.currentElementIndex ?? 0) === 0;
1607
1765
  const noElements = (this._tts?.elementCount ?? 0) === 0;
1608
- return T`
1766
+ return html11`
1609
1767
  <button part="button" ?disabled=${noElements || atStart} @click=${() => this._tts?.prevElement()}>
1610
1768
  <slot>◀◀</slot>
1611
1769
  </button>
@@ -1616,7 +1774,7 @@ var TestTtsNext = class extends TtsButtonBase {
1616
1774
  render() {
1617
1775
  const atEnd = (this._tts?.elementCount ?? 0) > 0 && (this._tts?.currentElementIndex ?? 0) >= (this._tts?.elementCount ?? 0) - 1;
1618
1776
  const noElements = (this._tts?.elementCount ?? 0) === 0;
1619
- return T`
1777
+ return html11`
1620
1778
  <button part="button" ?disabled=${noElements || atEnd} @click=${() => this._tts?.nextElement()}>
1621
1779
  <slot>▶▶</slot>
1622
1780
  </button>
@@ -1625,13 +1783,16 @@ var TestTtsNext = class extends TtsButtonBase {
1625
1783
  };
1626
1784
 
1627
1785
  // ../qti-test/dist/components/test-navigation/test-navigation.js
1628
- var __decorate11 = function(decorators, target, key, desc) {
1629
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1630
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
1631
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
1632
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
1786
+ import { consume as consume6, provide as provide4 } from "@lit/context";
1787
+ import { html as html12, LitElement as LitElement13 } from "lit";
1788
+ import { property as property10, state as state4 } from "lit/decorators.js";
1789
+ var __decorate12 = function(decorators, target, key, desc) {
1790
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1791
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1792
+ 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;
1793
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1633
1794
  };
1634
- var TestNavigation = class extends i2 {
1795
+ var TestNavigation = class extends LitElement13 {
1635
1796
  #testElement;
1636
1797
  constructor() {
1637
1798
  super();
@@ -1686,7 +1847,7 @@ var TestNavigation = class extends i2 {
1686
1847
  }
1687
1848
  }
1688
1849
  render() {
1689
- return T`<slot></slot>`;
1850
+ return html12`<slot></slot>`;
1690
1851
  }
1691
1852
  /* PK: on test connected we can build the computed context */
1692
1853
  #handleTestConnected(event) {
@@ -1737,8 +1898,10 @@ var TestNavigation = class extends i2 {
1737
1898
  active: false,
1738
1899
  identifier: section.identifier,
1739
1900
  title: section.title,
1901
+ navigationMode: section.navigationMode,
1902
+ submissionMode: section.submissionMode,
1740
1903
  items: itemElements.map((item) => ({
1741
- ...this.initContext?.find((i4) => i4.identifier === item.identifier),
1904
+ ...this.initContext?.find((i) => i.identifier === item.identifier),
1742
1905
  active: false,
1743
1906
  identifier: item.identifier,
1744
1907
  categories: item.category ? item.category?.split(" ") : [],
@@ -1806,10 +1969,10 @@ var TestNavigation = class extends i2 {
1806
1969
  const scoreOutcome = itemElement.querySelector("qti-outcome-declaration[identifier='SCORE']");
1807
1970
  const externalScored = scoreOutcome?.getAttribute("externalScored");
1808
1971
  const responseDeclarations = itemElement.querySelectorAll("qti-response-declaration");
1809
- const containsCorrectResponse = Array.from(responseDeclarations).some((r3) => r3.querySelector("qti-correct-response"));
1810
- const containsMapping = Array.from(responseDeclarations).some((r3) => {
1811
- const mapping = r3.querySelector("qti-mapping");
1812
- const areaMapping = r3.querySelector("qti-area-mapping");
1972
+ const containsCorrectResponse = Array.from(responseDeclarations).some((r) => r.querySelector("qti-correct-response"));
1973
+ const containsMapping = Array.from(responseDeclarations).some((r) => {
1974
+ const mapping = r.querySelector("qti-mapping");
1975
+ const areaMapping = r.querySelector("qti-area-mapping");
1813
1976
  return mapping?.querySelector("qti-map-entry") || areaMapping?.querySelector("qti-area-map-entry");
1814
1977
  });
1815
1978
  const hasCorrectResponse = containsCorrectResponse || containsMapping;
@@ -1849,13 +2012,13 @@ var TestNavigation = class extends i2 {
1849
2012
  return {
1850
2013
  ...section,
1851
2014
  active: this._sessionContext?.navSectionId === section.identifier || false,
1852
- completed: section.items.every((item) => this._testContext.items.find((i4) => i4.identifier === item.identifier)?.variables.find((v) => v.identifier === "completionStatus").value === "completed"),
2015
+ completed: section.items.every((item) => this._testContext.items.find((i) => i.identifier === item.identifier)?.variables.find((v) => v.identifier === "completionStatus").value === "completed"),
1853
2016
  items: section.items.map((item) => {
1854
- const itemContext = this._testContext?.items.find((i4) => i4.identifier === item.identifier);
2017
+ const itemContext = this._testContext?.items.find((i) => i.identifier === item.identifier);
1855
2018
  const computedItem = {
1856
2019
  ...item,
1857
2020
  ...itemContext,
1858
- ...this.initContext?.find((i4) => i4.identifier === item.identifier)
2021
+ ...this.initContext?.find((i) => i.identifier === item.identifier)
1859
2022
  };
1860
2023
  const rawscore = computedItem.variables?.find((vr) => vr.identifier == "SCORE")?.value;
1861
2024
  const score = rawscore === void 0 || rawscore === null ? null : parseFloat(rawscore?.toString());
@@ -1892,51 +2055,54 @@ var TestNavigation = class extends i2 {
1892
2055
  }));
1893
2056
  }
1894
2057
  };
1895
- __decorate11([
1896
- n2({ type: String })
2058
+ __decorate12([
2059
+ property10({ type: String })
1897
2060
  ], TestNavigation.prototype, "identifier", void 0);
1898
- __decorate11([
1899
- r()
2061
+ __decorate12([
2062
+ state4()
1900
2063
  ], TestNavigation.prototype, "initContext", void 0);
1901
- __decorate11([
1902
- r(),
1903
- e({ context: qtiContext })
2064
+ __decorate12([
2065
+ state4(),
2066
+ provide4({ context: qtiContext })
1904
2067
  ], TestNavigation.prototype, "qtiContext", void 0);
1905
- __decorate11([
1906
- r(),
1907
- c({ context: configContext, subscribe: true })
2068
+ __decorate12([
2069
+ state4(),
2070
+ consume6({ context: configContext, subscribe: true })
1908
2071
  ], TestNavigation.prototype, "configContext", void 0);
1909
- __decorate11([
1910
- r(),
1911
- c({ context: testContext, subscribe: true })
2072
+ __decorate12([
2073
+ state4(),
2074
+ consume6({ context: testContext, subscribe: true })
1912
2075
  ], TestNavigation.prototype, "_testContext", void 0);
1913
- __decorate11([
1914
- r(),
1915
- c({ context: sessionContext, subscribe: true })
2076
+ __decorate12([
2077
+ state4(),
2078
+ consume6({ context: sessionContext, subscribe: true })
1916
2079
  ], TestNavigation.prototype, "_sessionContext", void 0);
1917
- __decorate11([
1918
- r(),
1919
- e({ context: computedContext })
2080
+ __decorate12([
2081
+ state4(),
2082
+ provide4({ context: computedContext })
1920
2083
  ], TestNavigation.prototype, "computedContext", void 0);
1921
- __decorate11([
1922
- n2({ type: Boolean, attribute: "auto-score-items" })
2084
+ __decorate12([
2085
+ property10({ type: Boolean, attribute: "auto-score-items" })
1923
2086
  ], TestNavigation.prototype, "autoScoreItems", void 0);
1924
2087
 
1925
2088
  // ../qti-test/dist/components/test-next/test-next.js
1926
- var __decorate12 = function(decorators, target, key, desc) {
1927
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1928
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
1929
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
1930
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
2089
+ import { css as css8, html as html13, LitElement as LitElement14 } from "lit";
2090
+ import { property as property11 } from "lit/decorators.js";
2091
+ import { consume as consume7 } from "@lit/context";
2092
+ var __decorate13 = function(decorators, target, key, desc) {
2093
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2094
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2095
+ 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;
2096
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1931
2097
  };
1932
- var TestNext = class extends i2 {
2098
+ var TestNext = class extends LitElement14 {
1933
2099
  _handleTestElementChange(_oldValue, newValue) {
1934
2100
  if (newValue) {
1935
- this._internalDisabled = false;
2101
+ this.requestUpdate();
1936
2102
  }
1937
2103
  }
1938
2104
  static {
1939
- this.styles = i`
2105
+ this.styles = css8`
1940
2106
  :host {
1941
2107
  ${btn};
1942
2108
  }
@@ -1952,8 +2118,8 @@ var TestNext = class extends i2 {
1952
2118
  this.#internals = this.attachInternals();
1953
2119
  this.#internals.role = "button";
1954
2120
  this.#internals.ariaLabel = "Next item";
1955
- this.addEventListener("click", (e2) => {
1956
- e2.preventDefault();
2121
+ this.addEventListener("click", (e) => {
2122
+ e.preventDefault();
1957
2123
  if (!this._internalDisabled)
1958
2124
  this._requestItem(this.sectionItems[this.itemIndex + 1].identifier);
1959
2125
  });
@@ -1973,7 +2139,16 @@ var TestNext = class extends i2 {
1973
2139
  this.checkDisabled();
1974
2140
  }
1975
2141
  checkDisabled() {
1976
- this._internalDisabled = !this.computedContext || this.itemIndex < 0 || this.itemIndex >= this.sectionItems?.length - 1;
2142
+ const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
2143
+ if (!testPart)
2144
+ return;
2145
+ const activeSection = testPart.sections.find((s) => s.active);
2146
+ const navigationMode = activeSection?.navigationMode || testPart.navigationMode;
2147
+ const submissionMode = activeSection?.submissionMode || testPart.submissionMode;
2148
+ const activeItem = this.sectionItems[this.itemIndex];
2149
+ const isLinearIndividual = navigationMode === "linear" && submissionMode === "individual";
2150
+ const numAttempts = Number(activeItem?.variables.find((v) => v.identifier === "numAttempts")?.value) || 0;
2151
+ this._internalDisabled = !this.computedContext || this.itemIndex < 0 || this.itemIndex >= (this.sectionItems?.length ?? 0) - 1 || isLinearIndividual && numAttempts === 0;
1977
2152
  }
1978
2153
  _requestItem(identifier) {
1979
2154
  this.dispatchEvent(new CustomEvent("qti-request-navigation", {
@@ -1986,19 +2161,25 @@ var TestNext = class extends i2 {
1986
2161
  }));
1987
2162
  }
1988
2163
  render() {
1989
- return T`<slot></slot>`;
2164
+ return html13`<slot></slot>`;
1990
2165
  }
1991
2166
  };
1992
- __decorate12([
1993
- n2({ type: Boolean, reflect: true, attribute: "disabled" })
2167
+ __decorate13([
2168
+ property11({ type: Boolean, reflect: true, attribute: "disabled" })
1994
2169
  ], TestNext.prototype, "_internalDisabled", void 0);
1995
- __decorate12([
1996
- c({ context: computedContext, subscribe: true })
2170
+ __decorate13([
2171
+ consume7({ context: computedContext, subscribe: true })
1997
2172
  ], TestNext.prototype, "computedContext", void 0);
1998
- __decorate12([
2173
+ __decorate13([
1999
2174
  watch("computedContext")
2000
2175
  ], TestNext.prototype, "_handleTestElementChange", null);
2001
2176
 
2177
+ // ../qti-test/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js
2178
+ import { html as html14, LitElement as LitElement15 } from "lit";
2179
+
2180
+ // ../../node_modules/.pnpm/@heximal+templates@0.1.5/node_modules/@heximal/templates/index.js
2181
+ import { render as renderLit, nothing } from "lit-html";
2182
+
2002
2183
  // ../../node_modules/.pnpm/@heximal+expressions@0.1.5/node_modules/@heximal/expressions/lib/constants.js
2003
2184
  var KEYWORDS = ["this"];
2004
2185
  var UNARY_OPERATORS = ["+", "-", "!"];
@@ -2483,7 +2664,7 @@ var Parser = class {
2483
2664
  if (this._matches(Kind.ARROW)) {
2484
2665
  this.#advance();
2485
2666
  const body = this.#parseExpression();
2486
- const params = expressions?.map((e2) => e2.value) ?? [];
2667
+ const params = expressions?.map((e) => e.value) ?? [];
2487
2668
  return this.#ast.arrowFunction(params, body);
2488
2669
  } else {
2489
2670
  return this.#ast.paren(expressions[0]);
@@ -2587,13 +2768,13 @@ var EvalAstFactory = class {
2587
2768
  }
2588
2769
  };
2589
2770
  }
2590
- binary(l, op, r3) {
2771
+ binary(l, op, r) {
2591
2772
  const f = _BINARY_OPERATORS[op];
2592
2773
  return {
2593
2774
  type: "Binary",
2594
2775
  operator: op,
2595
2776
  left: l,
2596
- right: r3,
2777
+ right: r,
2597
2778
  evaluate(scope) {
2598
2779
  if (this.operator === "=") {
2599
2780
  if (this.left.type !== "ID" && this.left.type !== "Getter" && this.left.type !== "Index") {
@@ -2601,18 +2782,18 @@ var EvalAstFactory = class {
2601
2782
  }
2602
2783
  const value = this.right.evaluate(scope);
2603
2784
  let receiver = void 0;
2604
- let property;
2785
+ let property18;
2605
2786
  if (this.left.type === "Getter") {
2606
2787
  receiver = this.left.receiver.evaluate(scope);
2607
- property = this.left.name;
2788
+ property18 = this.left.name;
2608
2789
  } else if (this.left.type === "Index") {
2609
2790
  receiver = this.left.receiver.evaluate(scope);
2610
- property = this.left.argument.evaluate(scope);
2791
+ property18 = this.left.argument.evaluate(scope);
2611
2792
  } else if (this.left.type === "ID") {
2612
2793
  receiver = scope;
2613
- property = this.left.value;
2794
+ property18 = this.left.value;
2614
2795
  }
2615
- return receiver === void 0 ? void 0 : receiver[property] = value;
2796
+ return receiver === void 0 ? void 0 : receiver[property18] = value;
2616
2797
  }
2617
2798
  return f(this.left.evaluate(scope), this.right.evaluate(scope));
2618
2799
  },
@@ -2623,11 +2804,11 @@ var EvalAstFactory = class {
2623
2804
  }
2624
2805
  };
2625
2806
  }
2626
- getter(g, n3) {
2807
+ getter(g, n) {
2627
2808
  return {
2628
2809
  type: "Getter",
2629
2810
  receiver: g,
2630
- name: n3,
2811
+ name: n,
2631
2812
  evaluate(scope) {
2632
2813
  return this.receiver.evaluate(scope)?.[this.name];
2633
2814
  },
@@ -2661,13 +2842,13 @@ var EvalAstFactory = class {
2661
2842
  }
2662
2843
  };
2663
2844
  }
2664
- paren(e2) {
2665
- return e2;
2845
+ paren(e) {
2846
+ return e;
2666
2847
  }
2667
- index(e2, a) {
2848
+ index(e, a) {
2668
2849
  return {
2669
2850
  type: "Index",
2670
- receiver: e2,
2851
+ receiver: e,
2671
2852
  argument: a,
2672
2853
  evaluate(scope) {
2673
2854
  return this.receiver.evaluate(scope)?.[this.argument.evaluate(scope)];
@@ -2678,15 +2859,15 @@ var EvalAstFactory = class {
2678
2859
  }
2679
2860
  };
2680
2861
  }
2681
- ternary(c2, t, f) {
2862
+ ternary(c, t, f) {
2682
2863
  return {
2683
2864
  type: "Ternary",
2684
- condition: c2,
2865
+ condition: c,
2685
2866
  trueExpr: t,
2686
2867
  falseExpr: f,
2687
2868
  evaluate(scope) {
2688
- const c3 = this.condition.evaluate(scope);
2689
- if (c3) {
2869
+ const c2 = this.condition.evaluate(scope);
2870
+ if (c2) {
2690
2871
  return this.trueExpr.evaluate(scope);
2691
2872
  } else {
2692
2873
  return this.falseExpr.evaluate(scope);
@@ -2738,7 +2919,7 @@ var EvalAstFactory = class {
2738
2919
  return this.items?.map((a) => a?.evaluate(scope));
2739
2920
  },
2740
2921
  getIds(idents) {
2741
- this.items?.forEach((i4) => i4?.getIds(idents));
2922
+ this.items?.forEach((i) => i?.getIds(idents));
2742
2923
  return idents;
2743
2924
  }
2744
2925
  };
@@ -2752,7 +2933,7 @@ var EvalAstFactory = class {
2752
2933
  const params2 = this.params;
2753
2934
  const body2 = this.body;
2754
2935
  return function(...args) {
2755
- const paramsObj = fromEntries(params2.map((p, i4) => [p, args[i4]]));
2936
+ const paramsObj = fromEntries(params2.map((p, i) => [p, args[i]]));
2756
2937
  const newScope = new Proxy(scope ?? {}, {
2757
2938
  set(target, prop, value) {
2758
2939
  if (hasOwn(paramsObj, prop)) {
@@ -2777,27 +2958,9 @@ var EvalAstFactory = class {
2777
2958
  }
2778
2959
  };
2779
2960
 
2780
- // ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/private-ssr-support.js
2781
- var r2 = null;
2782
- var i3 = { boundAttributeSuffix: Z.M, marker: Z.P, markerMatch: Z.A, HTML_RESULT: Z.C, getTemplateHtml: Z.L, overrideDirectiveResolve: (e2, t) => class extends e2 {
2783
- _$AS(e3, r3) {
2784
- return t(this, r3);
2785
- }
2786
- }, patchDirectiveResolve: (e2, t) => {
2787
- if (e2.prototype._$AS.name !== t.name) {
2788
- r2 ??= e2.prototype._$AS.name;
2789
- for (let i4 = e2.prototype; i4 !== Object.prototype; i4 = Object.getPrototypeOf(i4)) if (i4.hasOwnProperty(r2)) return void (i4[r2] = t);
2790
- throw Error("Internal error: It is possible that both dev mode and production mode Lit was mixed together during SSR. Please comment on the issue: https://github.com/lit/lit/issues/4527");
2791
- }
2792
- }, setDirectiveClass(e2, t) {
2793
- e2._$litDirective$ = t;
2794
- }, getAttributePartCommittedValue: (e2, r3, i4) => {
2795
- let o = E;
2796
- return e2.j = (e3) => o = e3, e2._$AI(r3, e2, i4), o;
2797
- }, connectedDisconnectable: (e2) => ({ ...e2, _$AU: true }), resolveDirective: Z.V, AttributePart: Z.H, PropertyPart: Z.B, BooleanAttributePart: Z.N, EventPart: Z.U, ElementPart: Z.F, TemplateInstance: Z.R, isIterable: Z.D, ChildPart: Z.I };
2798
-
2799
2961
  // ../../node_modules/.pnpm/@heximal+templates@0.1.5/node_modules/@heximal/templates/index.js
2800
- var { AttributePart, PropertyPart, BooleanAttributePart, EventPart } = i3;
2962
+ import { _$LH } from "lit-html/private-ssr-support.js";
2963
+ var { AttributePart, PropertyPart, BooleanAttributePart, EventPart } = _$LH;
2801
2964
  var astFactory = new EvalAstFactory();
2802
2965
  var expressionCache = /* @__PURE__ */ new Map();
2803
2966
  var toCamelCase = (s) => s.replace(/-(-|\w)/g, (_, p1) => p1.toUpperCase());
@@ -2831,7 +2994,7 @@ var repeatHandler = (template, model, handlers, renderers) => {
2831
2994
  if (repeatAttribute !== null) {
2832
2995
  const items = getSingleValue(repeatAttribute, model);
2833
2996
  if (!items[Symbol.iterator]) {
2834
- return A;
2997
+ return nothing;
2835
2998
  }
2836
2999
  const litTemplate = getLitTemplate(template);
2837
3000
  let index = -1;
@@ -3034,10 +3197,10 @@ var makeLitTemplate = (template) => {
3034
3197
  }
3035
3198
  const strings = [unescapeBindingMarkers(splitValue[0])];
3036
3199
  const exprs = [];
3037
- for (let i4 = 1; i4 < splitValue.length; i4 += 2) {
3038
- const exprText = splitValue[i4];
3200
+ for (let i = 1; i < splitValue.length; i += 2) {
3201
+ const exprText = splitValue[i];
3039
3202
  exprs.push(parse(exprText, astFactory));
3040
- strings.push(unescapeBindingMarkers(splitValue[i4 + 1]));
3203
+ strings.push(unescapeBindingMarkers(splitValue[i + 1]));
3041
3204
  }
3042
3205
  litTemplate.parts.push({
3043
3206
  type: 1,
@@ -3060,15 +3223,15 @@ var makeLitTemplate = (template) => {
3060
3223
  } else if (hasEscapedBindingMarkers(text)) {
3061
3224
  textNode.textContent = unescapeBindingMarkers(text);
3062
3225
  }
3063
- for (let i4 = 1; i4 < strings.length; i4 += 2) {
3064
- const exprText = strings[i4];
3226
+ for (let i = 1; i < strings.length; i += 2) {
3227
+ const exprText = strings[i];
3065
3228
  const expr = parse(exprText, astFactory);
3066
3229
  litTemplate.parts.push({
3067
3230
  type: 2,
3068
3231
  index: ++nodeIndex,
3069
3232
  update: (model, _handlers) => expr.evaluate(model)
3070
3233
  });
3071
- const newTextNode = new Text(strings[i4 + 1].replace("\\{{", "{{"));
3234
+ const newTextNode = new Text(strings[i + 1].replace("\\{{", "{{"));
3072
3235
  textNode.parentNode.insertBefore(newTextNode, textNode.nextSibling);
3073
3236
  textNode.parentNode.insertBefore(document.createComment(""), textNode.nextSibling);
3074
3237
  textNode = newTextNode;
@@ -3076,20 +3239,21 @@ var makeLitTemplate = (template) => {
3076
3239
  }
3077
3240
  }
3078
3241
  }
3079
- for (const e2 of elementsToRemove) {
3080
- e2.remove();
3242
+ for (const e of elementsToRemove) {
3243
+ e.remove();
3081
3244
  }
3082
3245
  return litTemplate;
3083
3246
  };
3084
3247
 
3085
3248
  // ../qti-test/dist/components/test-paging-buttons-stamp/test-paging-buttons-stamp.js
3086
- var __decorate13 = function(decorators, target, key, desc) {
3087
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3088
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3089
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3090
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3249
+ import { consume as consume8 } from "@lit/context";
3250
+ var __decorate14 = function(decorators, target, key, desc) {
3251
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3252
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3253
+ 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;
3254
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3091
3255
  };
3092
- var TestPagingButtonsStamp = class extends i2 {
3256
+ var TestPagingButtonsStamp = class extends LitElement15 {
3093
3257
  #internals;
3094
3258
  createRenderRoot() {
3095
3259
  return this;
@@ -3106,30 +3270,33 @@ var TestPagingButtonsStamp = class extends i2 {
3106
3270
  }
3107
3271
  render() {
3108
3272
  if (!this.computedContext)
3109
- return T``;
3273
+ return html14``;
3110
3274
  const items = this.computedContext.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items));
3111
- return T` ${items.map((item) => this.myTemplate({ item, view: this.computedContext.view }))} `;
3275
+ return html14` ${items.map((item) => this.myTemplate({ item, view: this.computedContext.view }))} `;
3112
3276
  }
3113
3277
  };
3114
- __decorate13([
3115
- c({ context: computedContext, subscribe: true })
3278
+ __decorate14([
3279
+ consume8({ context: computedContext, subscribe: true })
3116
3280
  ], TestPagingButtonsStamp.prototype, "computedContext", void 0);
3117
3281
 
3118
3282
  // ../qti-test/dist/components/test-prev/test-prev.js
3119
- var __decorate14 = function(decorators, target, key, desc) {
3120
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3121
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3122
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3123
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3283
+ import { css as css9, html as html15, LitElement as LitElement16 } from "lit";
3284
+ import { property as property12 } from "lit/decorators.js";
3285
+ import { consume as consume9 } from "@lit/context";
3286
+ var __decorate15 = function(decorators, target, key, desc) {
3287
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3288
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3289
+ 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;
3290
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3124
3291
  };
3125
- var TestPrev = class extends i2 {
3292
+ var TestPrev = class extends LitElement16 {
3126
3293
  _handleTestElementChange(_oldValue, newValue) {
3127
3294
  if (newValue) {
3128
- this._internalDisabled = false;
3295
+ this.requestUpdate();
3129
3296
  }
3130
3297
  }
3131
3298
  static {
3132
- this.styles = i`
3299
+ this.styles = css9`
3133
3300
  :host {
3134
3301
  ${btn};
3135
3302
  }
@@ -3141,8 +3308,8 @@ var TestPrev = class extends i2 {
3141
3308
  constructor() {
3142
3309
  super();
3143
3310
  this._internalDisabled = true;
3144
- this.addEventListener("click", (e2) => {
3145
- e2.preventDefault();
3311
+ this.addEventListener("click", (e) => {
3312
+ e.preventDefault();
3146
3313
  if (!this._internalDisabled)
3147
3314
  this._requestItem(this.sectionItems[this.itemIndex - 1].identifier);
3148
3315
  });
@@ -3158,7 +3325,10 @@ var TestPrev = class extends i2 {
3158
3325
  this.checkDisabled();
3159
3326
  }
3160
3327
  checkDisabled() {
3161
- this._internalDisabled = !this.computedContext || this.itemIndex === 0 || this.itemIndex === -1;
3328
+ const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
3329
+ const activeSection = testPart?.sections.find((s) => s.active);
3330
+ const navigationMode = activeSection?.navigationMode || testPart?.navigationMode || "nonlinear";
3331
+ this._internalDisabled = navigationMode === "linear" || !this.computedContext || this.itemIndex === 0 || this.itemIndex === -1;
3162
3332
  }
3163
3333
  _requestItem(identifier) {
3164
3334
  this.dispatchEvent(new CustomEvent("qti-request-navigation", {
@@ -3171,46 +3341,51 @@ var TestPrev = class extends i2 {
3171
3341
  }));
3172
3342
  }
3173
3343
  render() {
3174
- return T`<slot></slot>`;
3344
+ return html15`<slot></slot>`;
3175
3345
  }
3176
3346
  };
3177
- __decorate14([
3178
- n2({ type: Boolean, reflect: true, attribute: "disabled" })
3347
+ __decorate15([
3348
+ property12({ type: Boolean, reflect: true, attribute: "disabled" })
3179
3349
  ], TestPrev.prototype, "_internalDisabled", void 0);
3180
- __decorate14([
3181
- c({ context: computedContext, subscribe: true })
3350
+ __decorate15([
3351
+ consume9({ context: computedContext, subscribe: true })
3182
3352
  ], TestPrev.prototype, "computedContext", void 0);
3183
- __decorate14([
3353
+ __decorate15([
3184
3354
  watch("computedContext")
3185
3355
  ], TestPrev.prototype, "_handleTestElementChange", null);
3186
3356
 
3187
3357
  // ../qti-test/dist/components/test-print-context/test-print-context.js
3188
- var __decorate15 = function(decorators, target, key, desc) {
3189
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3190
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3191
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3192
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3358
+ import { html as html16, LitElement as LitElement17 } from "lit";
3359
+ import { consume as consume10 } from "@lit/context";
3360
+ import { state as state5 } from "lit/decorators.js";
3361
+ var __decorate16 = function(decorators, target, key, desc) {
3362
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3363
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3364
+ 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;
3365
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3193
3366
  };
3194
- var TestPrintContext = class extends i2 {
3367
+ var TestPrintContext = class extends LitElement17 {
3195
3368
  render() {
3196
- return T` <small><pre>${JSON.stringify(this.computedContext, null, 2)}</pre></small> `;
3369
+ return html16` <small><pre>${JSON.stringify(this.computedContext, null, 2)}</pre></small> `;
3197
3370
  }
3198
3371
  };
3199
- __decorate15([
3200
- r(),
3201
- c({ context: computedContext, subscribe: true })
3372
+ __decorate16([
3373
+ state5(),
3374
+ consume10({ context: computedContext, subscribe: true })
3202
3375
  ], TestPrintContext.prototype, "computedContext", void 0);
3203
3376
 
3204
3377
  // ../qti-test/dist/components/test-print-item-variables/test-print-item-variables.js
3205
- var __decorate16 = function(decorators, target, key, desc) {
3206
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3207
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3208
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3209
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3378
+ import { html as html17, css as css10, LitElement as LitElement18 } from "lit";
3379
+ import { consume as consume11 } from "@lit/context";
3380
+ var __decorate17 = function(decorators, target, key, desc) {
3381
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3382
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3383
+ 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;
3384
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3210
3385
  };
3211
- var TestPrintVariables = class extends i2 {
3386
+ var TestPrintVariables = class extends LitElement18 {
3212
3387
  static {
3213
- this.styles = i`
3388
+ this.styles = css10`
3214
3389
  table {
3215
3390
  width: 100%;
3216
3391
  border-collapse: collapse;
@@ -3236,10 +3411,10 @@ var TestPrintVariables = class extends i2 {
3236
3411
  render() {
3237
3412
  const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
3238
3413
  if (!activeItem || !activeItem.variables)
3239
- return T``;
3414
+ return html17``;
3240
3415
  const responseVariables = activeItem.variables.filter((v) => v.type === "response");
3241
3416
  const outcomeVariables = activeItem.variables.filter((v) => v.type === "outcome");
3242
- const renderTable = (variables, title) => T`
3417
+ const renderTable = (variables, title) => html17`
3243
3418
  <h3>${title}</h3>
3244
3419
  <table>
3245
3420
  <thead>
@@ -3254,9 +3429,9 @@ var TestPrintVariables = class extends i2 {
3254
3429
  <tbody>
3255
3430
  ${variables.map((v) => {
3256
3431
  const correctResponse = v.correctResponse ? Array.isArray(v.correctResponse) ? v.correctResponse.join(", ") : v.correctResponse : "";
3257
- const mapEntries = v.mapping?.mapEntries?.map((m2) => `${m2.mapKey}=${m2.mappedValue}pt`).join(", ") || "";
3258
- const areaMapEntries = v.areaMapping?.areaMapEntries?.map((m2) => `${m2.shape}(${m2.coords})=${m2.mappedValue}pt`).join(", ") || "";
3259
- return T`
3432
+ const mapEntries = v.mapping?.mapEntries?.map((m) => `${m.mapKey}=${m.mappedValue}pt`).join(", ") || "";
3433
+ const areaMapEntries = v.areaMapping?.areaMapEntries?.map((m) => `${m.shape}(${m.coords})=${m.mappedValue}pt`).join(", ") || "";
3434
+ return html17`
3260
3435
  <tr>
3261
3436
  <td>${v.identifier}</td>
3262
3437
  <td>${Array.isArray(v.value) ? v.value.join(", ") : v.value}</td>
@@ -3269,23 +3444,26 @@ var TestPrintVariables = class extends i2 {
3269
3444
  </tbody>
3270
3445
  </table>
3271
3446
  `;
3272
- return T`
3447
+ return html17`
3273
3448
  ${renderTable(responseVariables, "Response Variables")} ${renderTable(outcomeVariables, "Outcome Variables")}
3274
3449
  `;
3275
3450
  }
3276
3451
  };
3277
- __decorate16([
3278
- c({ context: computedContext, subscribe: true })
3452
+ __decorate17([
3453
+ consume11({ context: computedContext, subscribe: true })
3279
3454
  ], TestPrintVariables.prototype, "computedContext", void 0);
3280
3455
 
3281
3456
  // ../qti-test/dist/components/test-scoring-buttons/test-scoring-buttons.js
3282
- var __decorate17 = function(decorators, target, key, desc) {
3283
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3284
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3285
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3286
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3457
+ import { html as html18, LitElement as LitElement19, nothing as nothing2 } from "lit";
3458
+ import { consume as consume12 } from "@lit/context";
3459
+ import { property as property13 } from "lit/decorators.js";
3460
+ var __decorate18 = function(decorators, target, key, desc) {
3461
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3462
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3463
+ 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;
3464
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3287
3465
  };
3288
- var TestScoringButtons = class extends i2 {
3466
+ var TestScoringButtons = class extends LitElement19 {
3289
3467
  createRenderRoot() {
3290
3468
  return this;
3291
3469
  }
@@ -3314,23 +3492,23 @@ var TestScoringButtons = class extends i2 {
3314
3492
  render() {
3315
3493
  const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
3316
3494
  if (!activeItem || !activeItem.variables)
3317
- return T``;
3495
+ return html18``;
3318
3496
  const maxScore = activeItem.variables.find((vr) => vr.identifier == "MAXSCORE")?.value;
3319
3497
  const scoreOutcome = activeItem.variables.find((vr) => vr.identifier == "SCORE");
3320
3498
  const score = scoreOutcome?.value;
3321
3499
  const disabled = !(scoreOutcome?.externalScored === "human");
3322
3500
  if (!maxScore || !scoreOutcome)
3323
- return A;
3501
+ return nothing2;
3324
3502
  const scores = [...Array(Number(maxScore) + 1).keys()];
3325
- return T`${this.myTemplate ? this.myTemplate({ scores, score, disabled }) : A}`;
3503
+ return html18`${this.myTemplate ? this.myTemplate({ scores, score, disabled }) : nothing2}`;
3326
3504
  }
3327
3505
  constructor() {
3328
3506
  super();
3329
3507
  this.view = "";
3330
3508
  this.disabled = false;
3331
3509
  this.myTemplate = null;
3332
- this.addEventListener("click", (e2) => {
3333
- const target = e2.target;
3510
+ this.addEventListener("click", (e) => {
3511
+ const target = e.target;
3334
3512
  const value = parseFloat(target.value);
3335
3513
  if (target.tagName === "INPUT") {
3336
3514
  this.#changeOutcomeScore(value);
@@ -3338,24 +3516,27 @@ var TestScoringButtons = class extends i2 {
3338
3516
  });
3339
3517
  }
3340
3518
  };
3341
- __decorate17([
3342
- n2({ type: String, attribute: "view" })
3519
+ __decorate18([
3520
+ property13({ type: String, attribute: "view" })
3343
3521
  ], TestScoringButtons.prototype, "view", void 0);
3344
- __decorate17([
3345
- n2({ type: Boolean })
3522
+ __decorate18([
3523
+ property13({ type: Boolean })
3346
3524
  ], TestScoringButtons.prototype, "disabled", void 0);
3347
- __decorate17([
3348
- c({ context: computedContext, subscribe: true })
3525
+ __decorate18([
3526
+ consume12({ context: computedContext, subscribe: true })
3349
3527
  ], TestScoringButtons.prototype, "computedContext", void 0);
3350
3528
 
3351
3529
  // ../qti-test/dist/components/test-scoring-feedback/test-scoring-feedback.js
3352
- var __decorate18 = function(decorators, target, key, desc) {
3353
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3354
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3355
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3356
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3530
+ import { consume as consume13 } from "@lit/context";
3531
+ import { html as html19, LitElement as LitElement20 } from "lit";
3532
+ import { property as property14 } from "lit/decorators.js";
3533
+ var __decorate19 = function(decorators, target, key, desc) {
3534
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3535
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3536
+ 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;
3537
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3357
3538
  };
3358
- var TestScoringFeedback = class extends i2 {
3539
+ var TestScoringFeedback = class extends LitElement20 {
3359
3540
  constructor() {
3360
3541
  super(...arguments);
3361
3542
  this.view = null;
@@ -3363,9 +3544,9 @@ var TestScoringFeedback = class extends i2 {
3363
3544
  render() {
3364
3545
  const activeItem = this.computedContext?.testParts.flatMap((testPart) => testPart.sections.flatMap((section) => section.items)).find((item) => item.active);
3365
3546
  if (!activeItem || !activeItem.variables)
3366
- return T``;
3547
+ return html19``;
3367
3548
  if (activeItem["category"] === "dep-informational")
3368
- return T`<div>${this.dataset.informational}</div>`;
3549
+ return html19`<div>${this.dataset.informational}</div>`;
3369
3550
  const completionStatus = activeItem?.variables.find((v) => v.identifier === "completionStatus")?.value;
3370
3551
  const scoreOutcome = activeItem?.variables.find((vr) => vr.identifier == "SCORE");
3371
3552
  const score = parseFloat(scoreOutcome?.value);
@@ -3385,24 +3566,26 @@ var TestScoringFeedback = class extends i2 {
3385
3566
  }
3386
3567
  return this.dataset.inProgress;
3387
3568
  };
3388
- return T`<div>${feedbackText()}</div>`;
3569
+ return html19`<div>${feedbackText()}</div>`;
3389
3570
  }
3390
3571
  };
3391
- __decorate18([
3392
- c({ context: computedContext, subscribe: true })
3572
+ __decorate19([
3573
+ consume13({ context: computedContext, subscribe: true })
3393
3574
  ], TestScoringFeedback.prototype, "computedContext", void 0);
3394
- __decorate18([
3395
- n2({ type: String, attribute: "view" })
3575
+ __decorate19([
3576
+ property14({ type: String, attribute: "view" })
3396
3577
  ], TestScoringFeedback.prototype, "view", void 0);
3397
3578
 
3398
3579
  // ../qti-test/dist/components/test-section-buttons-stamp/test-section-buttons-stamp.js
3399
- var __decorate19 = function(decorators, target, key, desc) {
3400
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3401
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3402
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3403
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3580
+ import { html as html20, LitElement as LitElement21 } from "lit";
3581
+ import { consume as consume14 } from "@lit/context";
3582
+ var __decorate20 = function(decorators, target, key, desc) {
3583
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3584
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3585
+ 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;
3586
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3404
3587
  };
3405
- var TestSectionButtonsStamp = class extends i2 {
3588
+ var TestSectionButtonsStamp = class extends LitElement21 {
3406
3589
  #internals;
3407
3590
  createRenderRoot() {
3408
3591
  return this;
@@ -3419,25 +3602,27 @@ var TestSectionButtonsStamp = class extends i2 {
3419
3602
  }
3420
3603
  render() {
3421
3604
  if (!this.computedContext)
3422
- return T``;
3605
+ return html20``;
3423
3606
  const sections = this.computedContext.testParts.flatMap((testPart) => testPart.sections);
3424
- return T` ${sections.map((item) => this.myTemplate({ item }))} `;
3607
+ return html20` ${sections.map((item) => this.myTemplate({ item }))} `;
3425
3608
  }
3426
3609
  };
3427
- __decorate19([
3428
- c({ context: computedContext, subscribe: true })
3610
+ __decorate20([
3611
+ consume14({ context: computedContext, subscribe: true })
3429
3612
  ], TestSectionButtonsStamp.prototype, "computedContext", void 0);
3430
3613
 
3431
3614
  // ../qti-test/dist/components/test-section-link/test-section-link.js
3432
- var __decorate20 = function(decorators, target, key, desc) {
3433
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3434
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3435
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3436
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3615
+ import { css as css11, html as html21, LitElement as LitElement22 } from "lit";
3616
+ import { property as property15 } from "lit/decorators.js";
3617
+ var __decorate21 = function(decorators, target, key, desc) {
3618
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3619
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3620
+ 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;
3621
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3437
3622
  };
3438
- var TestSectionLink = class extends i2 {
3623
+ var TestSectionLink = class extends LitElement22 {
3439
3624
  static {
3440
- this.styles = i`
3625
+ this.styles = css11`
3441
3626
  :host {
3442
3627
  ${btn};
3443
3628
  }
@@ -3462,21 +3647,24 @@ var TestSectionLink = class extends i2 {
3462
3647
  this.addEventListener("click", () => this.#requestItem(this.sectionId));
3463
3648
  }
3464
3649
  render() {
3465
- return T` <slot></slot> `;
3650
+ return html21` <slot></slot> `;
3466
3651
  }
3467
3652
  };
3468
- __decorate20([
3469
- n2({ type: String, attribute: "section-id" })
3653
+ __decorate21([
3654
+ property15({ type: String, attribute: "section-id" })
3470
3655
  ], TestSectionLink.prototype, "sectionId", void 0);
3471
3656
 
3472
3657
  // ../qti-test/dist/components/test-stamp/test-stamp.js
3473
- var __decorate21 = function(decorators, target, key, desc) {
3474
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3475
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3476
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3477
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3658
+ import { html as html22, LitElement as LitElement23, nothing as nothing3 } from "lit";
3659
+ import { property as property16, state as state6 } from "lit/decorators.js";
3660
+ import { consume as consume15 } from "@lit/context";
3661
+ var __decorate22 = function(decorators, target, key, desc) {
3662
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3663
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3664
+ 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;
3665
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3478
3666
  };
3479
- var TestStamp = class extends i2 {
3667
+ var TestStamp = class extends LitElement23 {
3480
3668
  constructor() {
3481
3669
  super(...arguments);
3482
3670
  this.debug = false;
@@ -3539,30 +3727,33 @@ var TestStamp = class extends i2 {
3539
3727
  }));
3540
3728
  }
3541
3729
  render() {
3542
- return T` ${this.debug ? T`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : A}
3543
- ${this.myTemplate ? this.myTemplate(this.stampContext) : A}`;
3730
+ return html22` ${this.debug ? html22`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing3}
3731
+ ${this.myTemplate ? this.myTemplate(this.stampContext) : nothing3}`;
3544
3732
  }
3545
3733
  };
3546
- __decorate21([
3547
- n2({ type: Boolean, reflect: true })
3734
+ __decorate22([
3735
+ property16({ type: Boolean, reflect: true })
3548
3736
  ], TestStamp.prototype, "debug", void 0);
3549
- __decorate21([
3550
- r(),
3551
- c({ context: computedContext, subscribe: true })
3737
+ __decorate22([
3738
+ state6(),
3739
+ consume15({ context: computedContext, subscribe: true })
3552
3740
  ], TestStamp.prototype, "computedContext", void 0);
3553
- __decorate21([
3554
- r()
3741
+ __decorate22([
3742
+ state6()
3555
3743
  ], TestStamp.prototype, "stampContext", void 0);
3556
3744
 
3557
3745
  // ../qti-test/dist/components/test-view-toggle/test-view.js
3558
- var __decorate22 = function(decorators, target, key, desc) {
3559
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3560
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3561
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3562
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3746
+ import { html as html23, LitElement as LitElement24 } from "lit";
3747
+ import { property as property17, state as state7 } from "lit/decorators.js";
3748
+ import { consume as consume16 } from "@lit/context";
3749
+ var __decorate23 = function(decorators, target, key, desc) {
3750
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3751
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3752
+ 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;
3753
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3563
3754
  };
3564
3755
  var _a;
3565
- var TestView = class extends i2 {
3756
+ var TestView = class extends LitElement24 {
3566
3757
  constructor() {
3567
3758
  super(...arguments);
3568
3759
  this.label = "view";
@@ -3594,46 +3785,48 @@ var TestView = class extends i2 {
3594
3785
  }));
3595
3786
  }
3596
3787
  render() {
3597
- return T`
3788
+ return html23`
3598
3789
  <label part="label" for="viewSelect">${this.label}</label>
3599
3790
  <select
3600
3791
  part="select"
3601
3792
  id="viewSelect"
3602
- @change=${(e2) => {
3603
- const el = e2.target;
3793
+ @change=${(e) => {
3794
+ const el = e.target;
3604
3795
  this._switchView(el.value);
3605
3796
  }}
3606
3797
  >
3607
- ${this._viewOptions.map((v) => T`<option value="${v}" ?selected=${v === this.sessionContext.view}>${v}</option>`)}
3798
+ ${this._viewOptions.map((v) => html23`<option value="${v}" ?selected=${v === this.sessionContext.view}>${v}</option>`)}
3608
3799
  </select>
3609
3800
  `;
3610
3801
  }
3611
3802
  };
3612
3803
  _a = TestView;
3613
- __decorate22([
3614
- c({ context: sessionContext, subscribe: true })
3804
+ __decorate23([
3805
+ consume16({ context: sessionContext, subscribe: true })
3615
3806
  ], TestView.prototype, "sessionContext", void 0);
3616
- __decorate22([
3617
- n2({ type: String })
3807
+ __decorate23([
3808
+ property17({ type: String })
3618
3809
  ], TestView.prototype, "label", void 0);
3619
- __decorate22([
3620
- n2({ type: String, attribute: "view-options" })
3810
+ __decorate23([
3811
+ property17({ type: String, attribute: "view-options" })
3621
3812
  ], TestView.prototype, "viewOptions", void 0);
3622
- __decorate22([
3813
+ __decorate23([
3623
3814
  watch("viewOptions", { waitUntilFirstUpdate: true })
3624
3815
  ], TestView.prototype, "_handleViewOptionsChange", void 0);
3625
- __decorate22([
3626
- r()
3816
+ __decorate23([
3817
+ state7()
3627
3818
  ], TestView.prototype, "_viewOptions", void 0);
3628
3819
 
3629
3820
  // ../qti-test/dist/components/test-view-toggle/test-view-toggle.js
3630
- var __decorate23 = function(decorators, target, key, desc) {
3631
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3632
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3633
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3634
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3821
+ import { consume as consume17 } from "@lit/context";
3822
+ import { html as html24, LitElement as LitElement25, nothing as nothing4 } from "lit";
3823
+ var __decorate24 = function(decorators, target, key, desc) {
3824
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3825
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3826
+ 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;
3827
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3635
3828
  };
3636
- var TestViewToggle = class extends i2 {
3829
+ var TestViewToggle = class extends LitElement25 {
3637
3830
  createRenderRoot() {
3638
3831
  return this;
3639
3832
  }
@@ -3663,114 +3856,14 @@ var TestViewToggle = class extends i2 {
3663
3856
  });
3664
3857
  }
3665
3858
  render() {
3666
- return T`${this.myTemplate ? this.myTemplate({
3859
+ return html24`${this.myTemplate ? this.myTemplate({
3667
3860
  view: this.sessionContext?.view
3668
- }) : A}`;
3669
- }
3670
- };
3671
- __decorate23([
3672
- c({ context: sessionContext, subscribe: true })
3673
- ], TestViewToggle.prototype, "sessionContext", void 0);
3674
-
3675
- // ../qti-test/dist/components/qti-outcome-processing/qti-outcome-processing.js
3676
- var QtiOutcomeProcessing = class extends i2 {
3677
- static {
3678
- this.styles = [
3679
- i`
3680
- :host {
3681
- display: none;
3682
- }
3683
- `
3684
- ];
3685
- }
3686
- render() {
3687
- return T`<slot></slot>`;
3688
- }
3689
- process() {
3690
- const logic = new QtiOutcomeProcessingProcessor();
3691
- const rules = [...this.children];
3692
- logic.process(rules);
3693
- }
3694
- };
3695
- var QtiOutcomeProcessingProcessor = class {
3696
- process(rules) {
3697
- for (const rule of rules) {
3698
- rule.process();
3699
- }
3700
- }
3701
- };
3702
-
3703
- // ../qti-test/dist/components/qti-test-variables/qti-test-variables.js
3704
- var __decorate24 = function(decorators, target, key, desc) {
3705
- var c2 = arguments.length, r3 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3706
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc);
3707
- else for (var i4 = decorators.length - 1; i4 >= 0; i4--) if (d = decorators[i4]) r3 = (c2 < 3 ? d(r3) : c2 > 3 ? d(target, key, r3) : d(target, key)) || r3;
3708
- return c2 > 3 && r3 && Object.defineProperty(target, key, r3), r3;
3709
- };
3710
- var QtiTestVariables = class extends QtiExpression {
3711
- #testElement;
3712
- constructor() {
3713
- super();
3714
- this.addEventListener("qti-assessment-test-connected", (e2) => this.#testElement = e2.detail);
3715
- }
3716
- getResult() {
3717
- const includedCategories = this.getAttribute("include-category")?.split(" ") ?? [];
3718
- const excludedCategories = this.getAttribute("exclude-category")?.split(" ") ?? [];
3719
- const weightIdentifier = this.getAttribute("weight-identifier") ?? "";
3720
- const itemVariable = this.getAttribute("variable-identifier");
3721
- const itemRefEls = Array.from(this.#testElement.querySelectorAll(`qti-asssessment-test qti-assessment-item-ref`));
3722
- const includedItems = itemRefEls.filter((itemRef) => {
3723
- let include = true;
3724
- if (includedCategories.length > 0) {
3725
- include = includedCategories.includes(itemRef.category);
3726
- }
3727
- if (excludedCategories.length > 0) {
3728
- include = !excludedCategories.includes(itemRef.category);
3729
- }
3730
- return include;
3731
- }).map((itemRef) => {
3732
- let weight = 1;
3733
- if (weightIdentifier) {
3734
- const weightVariable = itemRef.weigths.get(weightIdentifier);
3735
- if (weightVariable !== null && weightVariable !== void 0) {
3736
- weight = weightVariable;
3737
- }
3738
- }
3739
- return { item: itemRef.identifier, weight };
3740
- });
3741
- const logic = new QtiTestVariablesExpression(this._testContext, itemVariable, includedItems);
3742
- const value = logic.calculate();
3743
- return value;
3744
- }
3745
- calculate() {
3746
- return this.getResult();
3861
+ }) : nothing4}`;
3747
3862
  }
3748
3863
  };
3749
3864
  __decorate24([
3750
- c({ context: testContext, subscribe: true })
3751
- ], QtiTestVariables.prototype, "_testContext", void 0);
3752
- var QtiTestVariablesExpression = class {
3753
- constructor(testContext2, itemVariable, includedItems) {
3754
- this.testContext = testContext2;
3755
- this.itemVariable = itemVariable;
3756
- this.includedItems = includedItems;
3757
- }
3758
- calculate() {
3759
- const { items } = this.testContext;
3760
- let total = 0;
3761
- const uniqueItems = [...new Set(this.includedItems.map((item) => item.item))];
3762
- items.forEach((item) => {
3763
- if (uniqueItems.includes(item.identifier)) {
3764
- const variable = item.variables.find((vr) => vr.identifier === this.itemVariable);
3765
- const weight = this.includedItems.find((i4) => i4.item === item.identifier)?.weight ?? 1;
3766
- if (variable) {
3767
- total += Number(variable.value) * weight;
3768
- }
3769
- }
3770
- });
3771
- return total;
3772
- }
3773
- };
3865
+ consume17({ context: sessionContext, subscribe: true })
3866
+ ], TestViewToggle.prototype, "sessionContext", void 0);
3774
3867
 
3775
3868
  // ../qti-test/dist/elements.js
3776
3869
  var qtiTestElements = [
@@ -3812,8 +3905,12 @@ export {
3812
3905
  QtiAssessmentItemRef,
3813
3906
  QtiAssessmentSection,
3814
3907
  QtiAssessmentTest,
3908
+ QtiOutcomeProcessing,
3909
+ QtiOutcomeProcessingProcessor,
3815
3910
  QtiTestFeedback,
3816
3911
  QtiTestPart,
3912
+ QtiTestVariables,
3913
+ QtiTestVariablesExpression,
3817
3914
  QtiTest,
3818
3915
  TestCheckItem,
3819
3916
  TestContainer,
@@ -3853,12 +3950,5 @@ export {
3853
3950
  * @license
3854
3951
  * Portions Copyright (c) 2013, the Dart project authors.
3855
3952
  *)
3856
-
3857
- lit-html/node/private-ssr-support.js:
3858
- (**
3859
- * @license
3860
- * Copyright 2019 Google LLC
3861
- * SPDX-License-Identifier: BSD-3-Clause
3862
- *)
3863
3953
  */
3864
- //# sourceMappingURL=chunk-LZJHHZQ2.js.map
3954
+ //# sourceMappingURL=chunk-HBSWJC3B.js.map