@citolab/qti-components 9.2.0 → 9.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +359 -229
  3. package/dist/base.d.ts +10 -10
  4. package/dist/base.js +1 -1
  5. package/dist/{chunk-G5RQ5GKG.js → chunk-3BAQWO5C.js} +2 -2
  6. package/dist/{chunk-ZG7FBQFP.js → chunk-ACRN7YJM.js} +2 -2
  7. package/dist/{chunk-JLZCZVRX.js → chunk-B5XHZI2P.js} +2 -2
  8. package/dist/{chunk-RAJQKCQ3.js → chunk-B74SYQB2.js} +2 -2
  9. package/dist/{chunk-YIYHCHHM.js → chunk-BMXG7D2N.js} +2 -2
  10. package/dist/{chunk-FG5JAWSN.js → chunk-C3JPUV36.js} +2 -2
  11. package/dist/{chunk-7PXUE2GR.js → chunk-GNTO3IFM.js} +976 -296
  12. package/dist/chunk-GNTO3IFM.js.map +1 -0
  13. package/dist/{chunk-ZOQVTG5L.js → chunk-JHPQJDAV.js} +2 -2
  14. package/dist/{chunk-GPGUXZ3X.js → chunk-LKHRHFXO.js} +6 -6
  15. package/dist/{chunk-JGPWBIVD.js → chunk-MSGYZE6L.js} +2 -2
  16. package/dist/{chunk-YVZWNLF4.js → chunk-R7MMMDP7.js} +139 -18
  17. package/dist/chunk-R7MMMDP7.js.map +1 -0
  18. package/dist/{chunk-REKCRWJV.js → chunk-XEWGFAS4.js} +166 -104
  19. package/dist/chunk-XEWGFAS4.js.map +1 -0
  20. package/dist/{computed.types.d-DB5gfOh9.d.ts → computed.types.d-gJrBeUMG.d.ts} +1 -1
  21. package/dist/corrections.d.ts +9 -9
  22. package/dist/corrections.js +7 -7
  23. package/dist/elements.d.ts +46 -6
  24. package/dist/elements.js +5 -3
  25. package/dist/index.d.ts +12 -12
  26. package/dist/index.js +18 -12
  27. package/dist/{interaction.d-DegNJ5ZA.d.ts → interaction.d-g6XG0T0Z.d.ts} +2 -2
  28. package/dist/interactions.d.ts +4 -4
  29. package/dist/interactions.js +3 -3
  30. package/dist/item.d.ts +4 -4
  31. package/dist/item.js +3 -3
  32. package/dist/{item.types.d-BDFrq19E.d.ts → item.types.d-B55QkJ92.d.ts} +10 -0
  33. package/dist/loader.d.ts +2 -2
  34. package/dist/processing.d.ts +3 -3
  35. package/dist/processing.js +3 -3
  36. package/dist/qti-components-jsx.d.ts +628 -268
  37. package/dist/{qti-condition-expression.d-DLboq8bR.d.ts → qti-condition-expression.d-L7yb3Rzy.d.ts} +1 -1
  38. package/dist/{qti-expression.d-BksT9iLB.d.ts → qti-expression.d-CuaLjZ6g.d.ts} +1 -1
  39. package/dist/{qti-feedback.d-D-w6-mJv.d.ts → qti-feedback.d-wMYNVkkj.d.ts} +2 -3
  40. package/dist/{qti-item.d-D_-9_0e6.d.ts → qti-item.d-DgC1AQbY.d.ts} +1 -1
  41. package/dist/{qti-test.d-BfAZE6UF.d.ts → qti-test.d-Cud5Gvy0.d.ts} +278 -38
  42. package/dist/{qti-text-entry-interaction.d-CATtcPyX.d.ts → qti-text-entry-interaction.d-DKvz9ncv.d.ts} +2 -2
  43. package/dist/{session.context.d-Cjs0BkJB.d.ts → session.context.d-D5080LVx.d.ts} +3 -1
  44. package/dist/test.d.ts +58 -11
  45. package/dist/test.js +8 -4
  46. package/package.json +4 -4
  47. package/dist/chunk-7PXUE2GR.js.map +0 -1
  48. package/dist/chunk-REKCRWJV.js.map +0 -1
  49. package/dist/chunk-YVZWNLF4.js.map +0 -1
  50. /package/dist/{chunk-G5RQ5GKG.js.map → chunk-3BAQWO5C.js.map} +0 -0
  51. /package/dist/{chunk-ZG7FBQFP.js.map → chunk-ACRN7YJM.js.map} +0 -0
  52. /package/dist/{chunk-JLZCZVRX.js.map → chunk-B5XHZI2P.js.map} +0 -0
  53. /package/dist/{chunk-RAJQKCQ3.js.map → chunk-B74SYQB2.js.map} +0 -0
  54. /package/dist/{chunk-YIYHCHHM.js.map → chunk-BMXG7D2N.js.map} +0 -0
  55. /package/dist/{chunk-FG5JAWSN.js.map → chunk-C3JPUV36.js.map} +0 -0
  56. /package/dist/{chunk-ZOQVTG5L.js.map → chunk-JHPQJDAV.js.map} +0 -0
  57. /package/dist/{chunk-GPGUXZ3X.js.map → chunk-LKHRHFXO.js.map} +0 -0
  58. /package/dist/{chunk-JGPWBIVD.js.map → chunk-MSGYZE6L.js.map} +0 -0
@@ -11,7 +11,7 @@ import {
11
11
  getCustomOperator,
12
12
  itemContext,
13
13
  itemContextVariables
14
- } from "./chunk-YVZWNLF4.js";
14
+ } from "./chunk-R7MMMDP7.js";
15
15
 
16
16
  // ../qti-elements/dist/components/qti-assessment-item/qti-assessment-item.js
17
17
  import { provide } from "@lit/context";
@@ -30,31 +30,22 @@ var QtiAssessmentItem = class extends LitElement {
30
30
  this.identifier = "";
31
31
  this.adaptive = "false";
32
32
  this.timeDependent = null;
33
- this._handleDisabledChange = (_, disabled) => {
34
- this.interactionElements.forEach((ch) => ch.disabled = disabled);
35
- };
36
- this._handleReadonlyChange = (_, readonly) => this.interactionElements.forEach((ch) => ch.readonly = readonly);
37
33
  this._context = {
38
34
  variables: itemContextVariables
39
35
  };
40
36
  this.#initialContext = { ...this._context, variables: this._context.variables };
41
- this.#feedbackElements = [];
37
+ this.#restoredTemplateValues = /* @__PURE__ */ new Map();
38
+ this.#templatesProcessed = false;
42
39
  this.interactionElements = [];
43
40
  this.#handleRegisterVariable = (e) => {
44
41
  e.stopImmediatePropagation();
45
- this._context = { ...this._context, variables: [...this._context.variables, e.detail.variable] };
42
+ const { variable } = e.detail;
43
+ const restored = variable.type === "template" ? this.#restoredTemplateValues.get(variable.identifier) : void 0;
44
+ const registered = restored !== void 0 ? { ...variable, value: restored } : variable;
45
+ this._context = { ...this._context, variables: [...this._context.variables, registered] };
46
46
  this.#initialContext = this._context;
47
47
  e.stopPropagation();
48
48
  };
49
- this.#handleRegisterFeedback = (e) => {
50
- e.stopImmediatePropagation();
51
- const feedbackElement = e.detail;
52
- this.#feedbackElements.push(feedbackElement);
53
- const numAttempts = Number(this._context.variables.find((v) => v.identifier === "numAttempts")?.value) || 0;
54
- if (numAttempts > 0) {
55
- feedbackElement.checkShowFeedback(feedbackElement.outcomeIdentifier);
56
- }
57
- };
58
49
  this.#handleRegisterInteraction = (e) => {
59
50
  e.stopImmediatePropagation();
60
51
  this.interactionElements.push(e.detail.interactionElement);
@@ -75,7 +66,9 @@ var QtiAssessmentItem = class extends LitElement {
75
66
  this.#handleSetTemplateValue = (e) => {
76
67
  e.stopImmediatePropagation();
77
68
  const { templateIdentifier, value } = e.detail;
78
- this.updateTemplateVariable(templateIdentifier, value ?? void 0);
69
+ if (!this.#restoredTemplateValues.has(templateIdentifier)) {
70
+ this.updateTemplateVariable(templateIdentifier, value ?? void 0);
71
+ }
79
72
  e.stopPropagation();
80
73
  };
81
74
  this.#handleSetCorrectResponse = (e) => {
@@ -97,6 +90,7 @@ var QtiAssessmentItem = class extends LitElement {
97
90
  }
98
91
  };
99
92
  }
93
+ this.validate(false);
100
94
  this.dispatchEvent(new CustomEvent("qti-item-context-updated", {
101
95
  bubbles: true,
102
96
  composed: true,
@@ -114,6 +108,18 @@ var QtiAssessmentItem = class extends LitElement {
114
108
  this.removeAttribute("title");
115
109
  this.setAttribute("data-title", value);
116
110
  }
111
+ willUpdate(changed) {
112
+ super.willUpdate(changed);
113
+ const readonlyChanged = changed.has("readonly") && (this.readonly ?? false) !== (this._context.readonly ?? false);
114
+ const disabledChanged = changed.has("disabled") && (this.disabled ?? false) !== (this._context.disabled ?? false);
115
+ if (readonlyChanged || disabledChanged) {
116
+ this._context = {
117
+ ...this._context,
118
+ ...readonlyChanged ? { readonly: !!this.readonly } : {},
119
+ ...disabledChanged ? { disabled: !!this.disabled } : {}
120
+ };
121
+ }
122
+ }
117
123
  /**
118
124
  * Sets the identifier for the assessment item reference if this item is in a test.
119
125
  *
@@ -125,6 +131,13 @@ var QtiAssessmentItem = class extends LitElement {
125
131
  get assessmentItemRefId() {
126
132
  return this._context.identifier;
127
133
  }
134
+ /**
135
+ * The item's whole context, declarations included, for reading. `variables` is the trimmed view
136
+ * for hosts; the test needs the declarations too, and used to reach for the private field.
137
+ */
138
+ get itemContext() {
139
+ return this._context;
140
+ }
128
141
  get variables() {
129
142
  return this._context.variables.map((v) => ({
130
143
  identifier: v.identifier,
@@ -139,6 +152,10 @@ var QtiAssessmentItem = class extends LitElement {
139
152
  console.warn("variables property should be an array of VariableDeclaration");
140
153
  return;
141
154
  }
155
+ const previous = this._context.variables;
156
+ const restoredTemplates = value.filter((v) => v.value !== null && v.value !== void 0 && (v.type === "template" || previous.some((declared) => declared.identifier === v.identifier && declared.type === "template")));
157
+ restoredTemplates.forEach((v) => this.#restoredTemplateValues.set(v.identifier, v.value));
158
+ const templatesChanged = restoredTemplates.some((v) => JSON.stringify(previous.find((declared) => declared.identifier === v.identifier)?.value) !== JSON.stringify(v.value));
142
159
  this._context = {
143
160
  ...this._context,
144
161
  variables: this._context.variables.map((variable) => {
@@ -154,19 +171,10 @@ var QtiAssessmentItem = class extends LitElement {
154
171
  return variable;
155
172
  })
156
173
  };
157
- this._context.variables.forEach((variable) => {
158
- if (variable.type === "response") {
159
- const interactionElement = this.interactionElements.find((el) => el.responseIdentifier === variable.identifier);
160
- if (interactionElement) {
161
- interactionElement.response = variable.value;
162
- }
163
- }
164
- });
165
- this.variables.forEach((variable) => {
166
- if (variable.type === "outcome") {
167
- this.#feedbackElements.forEach((fe) => fe.checkShowFeedback(variable.identifier));
168
- }
169
- });
174
+ if (this.#templatesProcessed && templatesChanged) {
175
+ this.#runTemplateProcessing();
176
+ }
177
+ void this.updateComplete.then(() => this.#revalidate());
170
178
  }
171
179
  get state() {
172
180
  return this._context.state;
@@ -178,7 +186,13 @@ var QtiAssessmentItem = class extends LitElement {
178
186
  };
179
187
  }
180
188
  #initialContext;
181
- #feedbackElements;
189
+ /**
190
+ * Template values handed in through `variables` — drawn in an earlier visit or session. Template
191
+ * processing keeps them instead of drawing again, so the candidate sees the question they
192
+ * answered, and still runs, so correct responses are derived from them.
193
+ */
194
+ #restoredTemplateValues;
195
+ #templatesProcessed;
182
196
  /** @deprecated use variables property instead */
183
197
  set responses(myResponses) {
184
198
  if (myResponses) {
@@ -201,6 +215,7 @@ var QtiAssessmentItem = class extends LitElement {
201
215
  this.#attachEventListeners();
202
216
  super.connectedCallback();
203
217
  this.updateComplete.then(() => {
218
+ this.validate(false);
204
219
  this.dispatchEvent(new CustomEvent("qti-assessment-item-connected", {
205
220
  bubbles: true,
206
221
  composed: true,
@@ -215,7 +230,6 @@ var QtiAssessmentItem = class extends LitElement {
215
230
  }
216
231
  #attachEventListeners() {
217
232
  this.addEventListener("qti-register-variable", this.#handleRegisterVariable);
218
- this.addEventListener("qti-register-feedback", this.#handleRegisterFeedback);
219
233
  this.addEventListener("qti-register-interaction", this.#handleRegisterInteraction);
220
234
  this.addEventListener("end-attempt", this.#handleEndAttempt);
221
235
  this.addEventListener("qti-set-outcome-value", this.#handleSetOutcomeValue);
@@ -225,7 +239,6 @@ var QtiAssessmentItem = class extends LitElement {
225
239
  }
226
240
  #removeEventListeners() {
227
241
  this.removeEventListener("qti-register-variable", this.#handleRegisterVariable);
228
- this.removeEventListener("qti-register-feedback", this.#handleRegisterFeedback);
229
242
  this.removeEventListener("qti-register-interaction", this.#handleRegisterInteraction);
230
243
  this.removeEventListener("end-attempt", this.#handleEndAttempt);
231
244
  this.removeEventListener("qti-set-outcome-value", this.#handleSetOutcomeValue);
@@ -234,7 +247,6 @@ var QtiAssessmentItem = class extends LitElement {
234
247
  this.removeEventListener("qti-interaction-response", this.#handleUpdateResponseVariable);
235
248
  }
236
249
  #handleRegisterVariable;
237
- #handleRegisterFeedback;
238
250
  #handleRegisterInteraction;
239
251
  #handleEndAttempt;
240
252
  #handleSetOutcomeValue;
@@ -248,10 +260,14 @@ var QtiAssessmentItem = class extends LitElement {
248
260
  await Promise.resolve();
249
261
  }
250
262
  this.#templateProcessing = this.querySelector("qti-template-processing");
251
- if (this.#templateProcessing) {
252
- this.#templateProcessing.process();
253
- this.#initialContext = { ...this._context, variables: this._context.variables };
254
- }
263
+ this.#templatesProcessed = true;
264
+ this.#runTemplateProcessing();
265
+ }
266
+ #runTemplateProcessing() {
267
+ if (!this.#templateProcessing)
268
+ return;
269
+ this.#templateProcessing.process();
270
+ this.#initialContext = { ...this._context, variables: this._context.variables };
255
271
  }
256
272
  processResponse(countNumAttempts = true, reportValidityAfterScoring = true) {
257
273
  this.validate(reportValidityAfterScoring);
@@ -405,7 +421,6 @@ var QtiAssessmentItem = class extends LitElement {
405
421
  };
406
422
  })
407
423
  };
408
- this.#feedbackElements.forEach((fe) => fe.checkShowFeedback(identifier));
409
424
  this.dispatchEvent(new CustomEvent("qti-outcome-changed", {
410
425
  bubbles: true,
411
426
  composed: true,
@@ -418,11 +433,33 @@ var QtiAssessmentItem = class extends LitElement {
418
433
  }
419
434
  validate(reportValidity = true) {
420
435
  const isValid = this.interactionElements.every((interactionElement) => interactionElement.validate());
436
+ this.#publishValidity(isValid);
421
437
  if (reportValidity) {
422
438
  this.reportValidity();
423
439
  }
424
440
  return isValid;
425
441
  }
442
+ /** Puts the verdict in the item context, where the test and anything else can read it. */
443
+ #publishValidity(valid) {
444
+ if (this._context.valid !== valid) {
445
+ this._context = { ...this._context, valid };
446
+ }
447
+ }
448
+ /**
449
+ * Checks again after something the interactions' validity depends on changed without them saying
450
+ * so (an answer handed in through `variables`), and tells the test if the verdict moved.
451
+ */
452
+ #revalidate() {
453
+ const before = this._context.valid;
454
+ this.validate(false);
455
+ if (this._context.valid !== before) {
456
+ this.dispatchEvent(new CustomEvent("qti-item-context-updated", {
457
+ bubbles: true,
458
+ composed: true,
459
+ detail: { itemContext: this._context }
460
+ }));
461
+ }
462
+ }
426
463
  reportValidity() {
427
464
  for (const interactionElement of this.interactionElements) {
428
465
  interactionElement.reportValidity();
@@ -472,21 +509,44 @@ __decorate([
472
509
  __decorate([
473
510
  property({ type: Boolean })
474
511
  ], QtiAssessmentItem.prototype, "disabled", void 0);
475
- __decorate([
476
- watch("disabled", { waitUntilFirstUpdate: true })
477
- ], QtiAssessmentItem.prototype, "_handleDisabledChange", void 0);
478
512
  __decorate([
479
513
  property({ type: Boolean })
480
514
  ], QtiAssessmentItem.prototype, "readonly", void 0);
481
- __decorate([
482
- watch("readonly", { waitUntilFirstUpdate: true })
483
- ], QtiAssessmentItem.prototype, "_handleReadonlyChange", void 0);
484
515
  __decorate([
485
516
  provide({ context: itemContext })
486
517
  ], QtiAssessmentItem.prototype, "_context", void 0);
487
518
 
519
+ // ../qti-elements/dist/components/qti-assessment-stimulus/qti-assessment-stimulus.js
520
+ import { html as html2, LitElement as LitElement2 } from "lit";
521
+
522
+ // ../qti-elements/dist/components/qti-assessment-stimulus/qti-assessment-stimulus.styles.js
523
+ import { css } from "lit";
524
+ var qti_assessment_stimulus_styles_default = css`
525
+ :host {
526
+ display: contents;
527
+ }
528
+
529
+ ::slotted(qti-catalog-info) {
530
+ display: none;
531
+ }
532
+ `;
533
+
534
+ // ../qti-elements/dist/components/qti-assessment-stimulus/qti-assessment-stimulus.js
535
+ var QtiAssessmentStimulus = class extends LitElement2 {
536
+ static {
537
+ this.styles = qti_assessment_stimulus_styles_default;
538
+ }
539
+ connectedCallback() {
540
+ super.connectedCallback();
541
+ this.removeAttribute("title");
542
+ }
543
+ render() {
544
+ return html2`<slot></slot>`;
545
+ }
546
+ };
547
+
488
548
  // ../qti-elements/dist/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.js
489
- import { LitElement as LitElement2 } from "lit";
549
+ import { LitElement as LitElement3 } from "lit";
490
550
  import { property as property2 } from "lit/decorators.js";
491
551
  var __decorate2 = function(decorators, target, key, desc) {
492
552
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -504,7 +564,7 @@ var QtiAssessmentStimulusRefConnectedEvent = class _QtiAssessmentStimulusRefConn
504
564
  this.item = item;
505
565
  }
506
566
  };
507
- var QtiAssessmentStimulusRef = class extends LitElement2 {
567
+ var QtiAssessmentStimulusRef = class extends LitElement3 {
508
568
  constructor() {
509
569
  super(...arguments);
510
570
  this.identifier = "";
@@ -532,10 +592,10 @@ var QtiAssessmentStimulusRef = class extends LitElement2 {
532
592
  */
533
593
  async updateStimulusRef(stimulusRef) {
534
594
  const stimulus = await qtiTransformItem().load(this.href).then((api) => api.htmlDoc());
535
- if (stimulus) {
536
- const elements = stimulus.querySelectorAll("qti-stimulus-body, qti-stylesheet");
595
+ const root = stimulus?.querySelector("qti-assessment-stimulus");
596
+ if (root) {
537
597
  stimulusRef.innerHTML = "";
538
- stimulusRef.append(...elements);
598
+ stimulusRef.append(root);
539
599
  }
540
600
  }
541
601
  };
@@ -547,13 +607,13 @@ __decorate2([
547
607
  ], QtiAssessmentStimulusRef.prototype, "href", void 0);
548
608
 
549
609
  // ../qti-elements/dist/components/qti-companion-materials-info/qti-companion-materials-info.js
550
- import { LitElement as LitElement3 } from "lit";
551
- var QtiCompanionMaterialsInfo = class extends LitElement3 {
610
+ import { LitElement as LitElement4 } from "lit";
611
+ var QtiCompanionMaterialsInfo = class extends LitElement4 {
552
612
  };
553
613
 
554
614
  // ../qti-elements/dist/components/qti-content-body/qti-content-body.js
555
615
  import { consume } from "@lit/context";
556
- import { LitElement as LitElement4, html as html2 } from "lit";
616
+ import { LitElement as LitElement5, html as html3 } from "lit";
557
617
  import { state } from "lit/decorators.js";
558
618
  var __decorate3 = function(decorators, target, key, desc) {
559
619
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -561,9 +621,9 @@ var __decorate3 = function(decorators, target, key, desc) {
561
621
  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;
562
622
  return c > 3 && r && Object.defineProperty(target, key, r), r;
563
623
  };
564
- var QtiContentBody = class extends LitElement4 {
624
+ var QtiContentBody = class extends LitElement5 {
565
625
  render() {
566
- return html2`<slot @slotchange=${this.#expandMathVariables}></slot>`;
626
+ return html3`<slot @slotchange=${this.#expandMathVariables}></slot>`;
567
627
  }
568
628
  connectedCallback() {
569
629
  super.connectedCallback();
@@ -618,7 +678,7 @@ __decorate3([
618
678
  ], QtiContentBody.prototype, "context", void 0);
619
679
 
620
680
  // ../qti-elements/dist/components/qti-context-declaration/qti-context-declaration.js
621
- import { css, LitElement as LitElement5, html as html3 } from "lit";
681
+ import { css as css2, LitElement as LitElement6, html as html4 } from "lit";
622
682
  import { property as property3 } from "lit/decorators.js";
623
683
  var __decorate4 = function(decorators, target, key, desc) {
624
684
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -626,7 +686,7 @@ var __decorate4 = function(decorators, target, key, desc) {
626
686
  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;
627
687
  return c > 3 && r && Object.defineProperty(target, key, r), r;
628
688
  };
629
- var QtiContextDeclaration = class extends LitElement5 {
689
+ var QtiContextDeclaration = class extends LitElement6 {
630
690
  constructor() {
631
691
  super(...arguments);
632
692
  this.identifier = "";
@@ -634,7 +694,7 @@ var QtiContextDeclaration = class extends LitElement5 {
634
694
  }
635
695
  static {
636
696
  this.styles = [
637
- css`
697
+ css2`
638
698
  :host {
639
699
  display: none;
640
700
  }
@@ -642,7 +702,7 @@ var QtiContextDeclaration = class extends LitElement5 {
642
702
  ];
643
703
  }
644
704
  render() {
645
- return html3`<slot></slot>`;
705
+ return html4`<slot></slot>`;
646
706
  }
647
707
  };
648
708
  __decorate4([
@@ -654,7 +714,7 @@ __decorate4([
654
714
 
655
715
  // ../qti-elements/dist/components/qti-custom-operator/qti-custom-operator.js
656
716
  import { consume as consume2 } from "@lit/context";
657
- import { LitElement as LitElement6, html as html4 } from "lit";
717
+ import { LitElement as LitElement7, html as html5 } from "lit";
658
718
  import { state as state2 } from "lit/decorators.js";
659
719
  var __decorate5 = function(decorators, target, key, desc) {
660
720
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -662,11 +722,11 @@ var __decorate5 = function(decorators, target, key, desc) {
662
722
  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;
663
723
  return c > 3 && r && Object.defineProperty(target, key, r), r;
664
724
  };
665
- var QtiCustomOperator = class extends LitElement6 {
725
+ var QtiCustomOperator = class extends LitElement7 {
666
726
  // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
667
727
  #operatorFunction;
668
728
  render() {
669
- return html4`<slot @slotchange=${this.handleSlotChange}></slot>`;
729
+ return html5`<slot @slotchange=${this.handleSlotChange}></slot>`;
670
730
  }
671
731
  handleSlotChange() {
672
732
  const commentNode = Array.from(this.firstElementChild?.childNodes ?? []).find((node) => node.nodeType === Node.COMMENT_NODE);
@@ -735,10 +795,10 @@ __decorate5([
735
795
  ], QtiCustomOperator.prototype, "_context", void 0);
736
796
 
737
797
  // ../qti-elements/dist/components/qti-feedback-block/qti-feedback-block.js
738
- import { css as css2, html as html5 } from "lit";
798
+ import { css as css3, html as html6 } from "lit";
739
799
  var QtiFeedbackBlock = class extends QtiFeedback {
740
800
  static {
741
- this.styles = css2`
801
+ this.styles = css3`
742
802
  :host {
743
803
  display: block;
744
804
  }
@@ -751,7 +811,7 @@ var QtiFeedbackBlock = class extends QtiFeedback {
751
811
  `;
752
812
  }
753
813
  render() {
754
- return html5` <slot part="feedback" class="feedback ${this.showStatus}"></slot> `;
814
+ return html6` <slot part="feedback" class="feedback ${this.showStatus}"></slot> `;
755
815
  }
756
816
  connectedCallback() {
757
817
  super.connectedCallback();
@@ -760,15 +820,15 @@ var QtiFeedbackBlock = class extends QtiFeedback {
760
820
  };
761
821
 
762
822
  // ../qti-elements/dist/components/qti-feedback-inline/qti-feedback-inline.js
763
- import { css as css3, html as html6 } from "lit";
823
+ import { css as css4, html as html7 } from "lit";
764
824
  import { ifDefined } from "lit/directives/if-defined.js";
765
825
  var QtiFeedbackInline = class extends QtiFeedback {
766
826
  constructor() {
767
827
  super(...arguments);
768
- this.render = () => html6` <slot part="feedback" class="${ifDefined(this.showStatus)}"></slot> `;
828
+ this.render = () => html7` <slot part="feedback" class="${ifDefined(this.showStatus)}"></slot> `;
769
829
  }
770
830
  static {
771
- this.styles = css3`
831
+ this.styles = css4`
772
832
  .on {
773
833
  display: inline-block;
774
834
  }
@@ -784,31 +844,31 @@ var QtiFeedbackInline = class extends QtiFeedback {
784
844
  };
785
845
 
786
846
  // ../qti-elements/dist/components/qti-item-body/qti-item-body.js
787
- import { html as html7, LitElement as LitElement7 } from "lit";
847
+ import { html as html8, LitElement as LitElement8 } from "lit";
788
848
 
789
849
  // ../qti-elements/dist/components/qti-item-body/qti-item-body.styles.js
790
- import { css as css4 } from "lit";
791
- var qti_item_body_styles_default = css4`
850
+ import { css as css5 } from "lit";
851
+ var qti_item_body_styles_default = css5`
792
852
  :host {
793
853
  display: block;
794
854
  }
795
855
  `;
796
856
 
797
857
  // ../qti-elements/dist/components/qti-item-body/qti-item-body.js
798
- var QtiItemBody = class extends LitElement7 {
858
+ var QtiItemBody = class extends LitElement8 {
799
859
  static {
800
860
  this.styles = qti_item_body_styles_default;
801
861
  }
802
862
  render() {
803
- return html7`<slot part="qti-rubric-blocks" name="qti-rubric-block"></slot><slot></slot>`;
863
+ return html8`<slot part="qti-rubric-blocks" name="qti-rubric-block"></slot><slot></slot>`;
804
864
  }
805
865
  };
806
866
 
807
867
  // ../qti-elements/dist/components/qti-modal-feedback/qti-modal-feedback.js
808
- import { css as css5, html as html8 } from "lit";
868
+ import { css as css6, html as html9 } from "lit";
809
869
  var QtiModalFeedback = class extends QtiFeedback {
810
870
  static {
811
- this.styles = css5`
871
+ this.styles = css6`
812
872
  .cito-dialog {
813
873
  background: var(--qti-bg);
814
874
  border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);
@@ -849,7 +909,7 @@ var QtiModalFeedback = class extends QtiFeedback {
849
909
  `;
850
910
  }
851
911
  render() {
852
- return html8`
912
+ return html9`
853
913
  <dialog class="cito-dialog" part="feedback" ?open="${this.showStatus === "on"}">
854
914
  <slot></slot>
855
915
  <div style="margin-top: var(--qti-gap); text-align: center;">
@@ -890,7 +950,7 @@ var QtiModalFeedback = class extends QtiFeedback {
890
950
 
891
951
  // ../qti-elements/dist/components/qti-outcome-declaration/qti-outcome-declaration.js
892
952
  import { consume as consume3 } from "@lit/context";
893
- import { css as css6, html as html9 } from "lit";
953
+ import { css as css7, html as html10 } from "lit";
894
954
  import { property as property4, state as state3 } from "lit/decorators.js";
895
955
  var __decorate6 = function(decorators, target, key, desc) {
896
956
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -905,7 +965,7 @@ var QtiOutcomeDeclaration = class extends QtiVariableDeclaration {
905
965
  }
906
966
  static {
907
967
  this.styles = [
908
- css6`
968
+ css7`
909
969
  :host {
910
970
  display: none;
911
971
  }
@@ -914,7 +974,7 @@ var QtiOutcomeDeclaration = class extends QtiVariableDeclaration {
914
974
  }
915
975
  render() {
916
976
  const value = this.itemContext?.variables.find((v) => v.identifier === this.identifier)?.value;
917
- return html9`${JSON.stringify(value, null, 2)}`;
977
+ return html10`${JSON.stringify(value, null, 2)}`;
918
978
  }
919
979
  /**
920
980
  * The entries of a `qti-interpolation-table`, in document order.
@@ -1010,7 +1070,7 @@ __decorate6([
1010
1070
 
1011
1071
  // ../qti-elements/dist/components/qti-response-declaration/qti-response-declaration.js
1012
1072
  import { consume as consume4 } from "@lit/context";
1013
- import { css as css7, html as html10 } from "lit";
1073
+ import { css as css8, html as html11 } from "lit";
1014
1074
  import { property as property5, state as state4 } from "lit/decorators.js";
1015
1075
  var __decorate7 = function(decorators, target, key, desc) {
1016
1076
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -1021,7 +1081,7 @@ var __decorate7 = function(decorators, target, key, desc) {
1021
1081
  var QtiResponseDeclaration = class extends QtiVariableDeclaration {
1022
1082
  static {
1023
1083
  this.styles = [
1024
- css7`
1084
+ css8`
1025
1085
  :host {
1026
1086
  display: none;
1027
1087
  }
@@ -1030,7 +1090,7 @@ var QtiResponseDeclaration = class extends QtiVariableDeclaration {
1030
1090
  }
1031
1091
  render() {
1032
1092
  const value = this.itemContext?.variables.find((v) => v.identifier === this.identifier)?.value;
1033
- return html10`${JSON.stringify(value, null, 2)}`;
1093
+ return html11`${JSON.stringify(value, null, 2)}`;
1034
1094
  }
1035
1095
  connectedCallback() {
1036
1096
  super.connectedCallback();
@@ -1122,7 +1182,7 @@ __decorate7([
1122
1182
  ], QtiResponseDeclaration.prototype, "itemContext", void 0);
1123
1183
 
1124
1184
  // ../qti-elements/dist/components/qti-response-processing/qti-response-processing.js
1125
- import { css as css8, html as html11, LitElement as LitElement8 } from "lit";
1185
+ import { css as css9, html as html12, LitElement as LitElement9 } from "lit";
1126
1186
 
1127
1187
  // ../qti-elements/dist/internal/template-strings.js
1128
1188
  var matchCorrect = `<qti-response-condition>
@@ -1178,10 +1238,10 @@ var responseProcessingTemplates = {
1178
1238
  map_response_point: mapResponsePoint,
1179
1239
  match_correct: matchCorrect
1180
1240
  };
1181
- var QtiResponseProcessing = class extends LitElement8 {
1241
+ var QtiResponseProcessing = class extends LitElement9 {
1182
1242
  static {
1183
1243
  this.styles = [
1184
- css8`
1244
+ css9`
1185
1245
  :host {
1186
1246
  display: none;
1187
1247
  }
@@ -1189,7 +1249,7 @@ var QtiResponseProcessing = class extends LitElement8 {
1189
1249
  ];
1190
1250
  }
1191
1251
  render() {
1192
- return html11`<slot></slot>`;
1252
+ return html12`<slot></slot>`;
1193
1253
  }
1194
1254
  process() {
1195
1255
  const assessmentItem = this.closest("qti-assessment-item");
@@ -1218,7 +1278,7 @@ var QtiResponseProcessing = class extends LitElement8 {
1218
1278
  };
1219
1279
 
1220
1280
  // ../qti-elements/dist/components/qti-rubric-block/qti-rubric-block.js
1221
- import { LitElement as LitElement9, css as css9, html as html12 } from "lit";
1281
+ import { LitElement as LitElement10, css as css10, html as html13 } from "lit";
1222
1282
  import { property as property6 } from "lit/decorators.js";
1223
1283
  var __decorate8 = function(decorators, target, key, desc) {
1224
1284
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -1226,7 +1286,7 @@ var __decorate8 = function(decorators, target, key, desc) {
1226
1286
  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;
1227
1287
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1228
1288
  };
1229
- var QtiRubricBlock = class extends LitElement9 {
1289
+ var QtiRubricBlock = class extends LitElement10 {
1230
1290
  handleclassNamesChange() {
1231
1291
  const classNames = this.classNames.split(" ");
1232
1292
  classNames.forEach((className) => {
@@ -1254,14 +1314,14 @@ var QtiRubricBlock = class extends LitElement9 {
1254
1314
  });
1255
1315
  }
1256
1316
  static {
1257
- this.styles = css9`
1317
+ this.styles = css10`
1258
1318
  :host {
1259
1319
  display: block;
1260
1320
  }
1261
1321
  `;
1262
1322
  }
1263
1323
  render() {
1264
- return html12`<slot></slot>`;
1324
+ return html13`<slot></slot>`;
1265
1325
  }
1266
1326
  };
1267
1327
  __decorate8([
@@ -1281,8 +1341,8 @@ __decorate8([
1281
1341
  ], QtiRubricBlock.prototype, "handleclassNamesChange", null);
1282
1342
 
1283
1343
  // ../qti-elements/dist/components/qti-stylesheet/qti-stylesheet.js
1284
- import { LitElement as LitElement10 } from "lit";
1285
- var QtiStylesheet = class extends LitElement10 {
1344
+ import { LitElement as LitElement11 } from "lit";
1345
+ var QtiStylesheet = class extends LitElement11 {
1286
1346
  #styleElement = null;
1287
1347
  firstUpdated(_changedProperties) {
1288
1348
  super.firstUpdated(_changedProperties);
@@ -1330,10 +1390,10 @@ var QtiStylesheet = class extends LitElement10 {
1330
1390
  };
1331
1391
 
1332
1392
  // ../qti-elements/dist/components/qti-template-constraint/qti-template-constraint.js
1333
- import { LitElement as LitElement11, html as html13 } from "lit";
1334
- var QtiTemplateConstraint = class extends LitElement11 {
1393
+ import { LitElement as LitElement12, html as html14 } from "lit";
1394
+ var QtiTemplateConstraint = class extends LitElement12 {
1335
1395
  render() {
1336
- return html13`<slot></slot>`;
1396
+ return html14`<slot></slot>`;
1337
1397
  }
1338
1398
  /**
1339
1399
  * Evaluates the constraint condition
@@ -1373,7 +1433,7 @@ var QtiTemplateConstraint = class extends LitElement11 {
1373
1433
  };
1374
1434
 
1375
1435
  // ../qti-elements/dist/components/qti-template-declaration/qti-template-declaration.js
1376
- import { css as css10, LitElement as LitElement12, html as html14 } from "lit";
1436
+ import { css as css11, LitElement as LitElement13, html as html15 } from "lit";
1377
1437
  import { property as property7 } from "lit/decorators.js";
1378
1438
  var __decorate9 = function(decorators, target, key, desc) {
1379
1439
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -1381,7 +1441,7 @@ var __decorate9 = function(decorators, target, key, desc) {
1381
1441
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1382
1442
  return c > 3 && r && Object.defineProperty(target, key, r), r;
1383
1443
  };
1384
- var QtiTemplateDeclaration = class extends LitElement12 {
1444
+ var QtiTemplateDeclaration = class extends LitElement13 {
1385
1445
  constructor() {
1386
1446
  super(...arguments);
1387
1447
  this.identifier = "";
@@ -1394,7 +1454,7 @@ var QtiTemplateDeclaration = class extends LitElement12 {
1394
1454
  #defaultValue;
1395
1455
  static {
1396
1456
  this.styles = [
1397
- css10`
1457
+ css11`
1398
1458
  :host {
1399
1459
  display: none;
1400
1460
  }
@@ -1402,7 +1462,7 @@ var QtiTemplateDeclaration = class extends LitElement12 {
1402
1462
  ];
1403
1463
  }
1404
1464
  render() {
1405
- return html14`<slot></slot>`;
1465
+ return html15`<slot></slot>`;
1406
1466
  }
1407
1467
  connectedCallback() {
1408
1468
  super.connectedCallback();
@@ -1494,11 +1554,11 @@ __decorate9([
1494
1554
  ], QtiTemplateDeclaration.prototype, "paramVariable", void 0);
1495
1555
 
1496
1556
  // ../qti-elements/dist/components/qti-template-processing/qti-template-processing.js
1497
- import { css as css11, html as html15, LitElement as LitElement13 } from "lit";
1498
- var QtiTemplateProcessing = class extends LitElement13 {
1557
+ import { css as css12, html as html16, LitElement as LitElement14 } from "lit";
1558
+ var QtiTemplateProcessing = class extends LitElement14 {
1499
1559
  static {
1500
1560
  this.styles = [
1501
- css11`
1561
+ css12`
1502
1562
  :host {
1503
1563
  display: none;
1504
1564
  }
@@ -1508,7 +1568,7 @@ var QtiTemplateProcessing = class extends LitElement13 {
1508
1568
  #maxIterations = 100;
1509
1569
  // Prevent infinite loops in template constraints
1510
1570
  render() {
1511
- return html15`<slot></slot>`;
1571
+ return html16`<slot></slot>`;
1512
1572
  }
1513
1573
  /**
1514
1574
  * Process template rules to set template variable values
@@ -1562,6 +1622,7 @@ var QtiTemplateProcessing = class extends LitElement13 {
1562
1622
  // ../qti-elements/dist/elements.js
1563
1623
  var qtiContentElements = [
1564
1624
  { tag: "qti-assessment-item", ctor: QtiAssessmentItem },
1625
+ { tag: "qti-assessment-stimulus", ctor: QtiAssessmentStimulus },
1565
1626
  { tag: "qti-assessment-stimulus-ref", ctor: QtiAssessmentStimulusRef },
1566
1627
  { tag: "qti-companion-materials-info", ctor: QtiCompanionMaterialsInfo },
1567
1628
  { tag: "qti-content-body", ctor: QtiContentBody },
@@ -1583,6 +1644,7 @@ var qtiContentElements = [
1583
1644
 
1584
1645
  export {
1585
1646
  QtiAssessmentItem,
1647
+ QtiAssessmentStimulus,
1586
1648
  QtiAssessmentStimulusRefConnectedEvent,
1587
1649
  QtiAssessmentStimulusRef,
1588
1650
  QtiCompanionMaterialsInfo,
@@ -1603,4 +1665,4 @@ export {
1603
1665
  QtiTemplateProcessing,
1604
1666
  qtiContentElements
1605
1667
  };
1606
- //# sourceMappingURL=chunk-REKCRWJV.js.map
1668
+ //# sourceMappingURL=chunk-XEWGFAS4.js.map