@citolab/qti-components 7.27.3 → 7.27.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +164 -160
  3. package/custom-elements.json +4214 -1176
  4. package/dist/base.d.ts +3 -2
  5. package/dist/base.js +1 -1
  6. package/dist/{chunk-D6EHVZG2.js → chunk-3HJE3KRM.js} +6 -8
  7. package/dist/chunk-3HJE3KRM.js.map +1 -0
  8. package/dist/{chunk-WMPG7ULB.js → chunk-424AWLRU.js} +4 -4
  9. package/dist/{chunk-3XXXAWMZ.js → chunk-FFESMKSD.js} +263 -7
  10. package/dist/chunk-FFESMKSD.js.map +1 -0
  11. package/dist/{chunk-CVB5ISWF.js → chunk-LQZCSHN5.js} +2 -2
  12. package/dist/{chunk-DGIXWHK3.js → chunk-N7S3GNUP.js} +2 -2
  13. package/dist/{chunk-RXRKP6P7.js → chunk-SX63OCDZ.js} +2 -2
  14. package/dist/{chunk-K7HR6ZAY.js → chunk-UKPCQKPF.js} +2 -2
  15. package/dist/chunk-UKPCQKPF.js.map +1 -0
  16. package/dist/{chunk-CSYOTHK2.js → chunk-XYTJOQRZ.js} +23 -16
  17. package/dist/chunk-XYTJOQRZ.js.map +1 -0
  18. package/dist/{chunk-PHCCFYNE.js → chunk-YLIYPNMK.js} +994 -2
  19. package/dist/chunk-YLIYPNMK.js.map +1 -0
  20. package/dist/{chunk-A7HX4462.js → chunk-Z2SUBRH5.js} +14 -2
  21. package/dist/{chunk-A7HX4462.js.map → chunk-Z2SUBRH5.js.map} +1 -1
  22. package/dist/elements.d.ts +67 -2
  23. package/dist/elements.js +10 -6
  24. package/dist/index.d.ts +5 -4
  25. package/dist/index.js +55 -11
  26. package/dist/interactions.js +3 -3
  27. package/dist/item.js +4 -4
  28. package/dist/loader.d.ts +2 -1
  29. package/dist/loader.js +2 -2
  30. package/dist/processing.d.ts +374 -17
  31. package/dist/processing.js +42 -2
  32. package/dist/qti-components-jsx.d.ts +1446 -389
  33. package/dist/{qti-rule-base-DGhWN-as.d.ts → qti-condition-expression-B1BYmCcq.d.ts} +1 -14
  34. package/dist/{qti-feedback-BZjWNyxP.d.ts → qti-feedback-ChmXhZuf.d.ts} +1 -1
  35. package/dist/qti-rule-base-ajOnfGXY.d.ts +16 -0
  36. package/dist/test.d.ts +2 -1
  37. package/dist/test.js +6 -6
  38. package/dist/transformers.js +1 -1
  39. package/package.json +10 -10
  40. package/dist/chunk-3XXXAWMZ.js.map +0 -1
  41. package/dist/chunk-CSYOTHK2.js.map +0 -1
  42. package/dist/chunk-D6EHVZG2.js.map +0 -1
  43. package/dist/chunk-K7HR6ZAY.js.map +0 -1
  44. package/dist/chunk-PHCCFYNE.js.map +0 -1
  45. /package/dist/{chunk-WMPG7ULB.js.map → chunk-424AWLRU.js.map} +0 -0
  46. /package/dist/{chunk-CVB5ISWF.js.map → chunk-LQZCSHN5.js.map} +0 -0
  47. /package/dist/{chunk-DGIXWHK3.js.map → chunk-N7S3GNUP.js.map} +0 -0
  48. /package/dist/{chunk-RXRKP6P7.js.map → chunk-SX63OCDZ.js.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  item_default,
3
3
  m
4
- } from "./chunk-CVB5ISWF.js";
4
+ } from "./chunk-LQZCSHN5.js";
5
5
  import {
6
6
  qtiTransformItem
7
- } from "./chunk-K7HR6ZAY.js";
7
+ } from "./chunk-UKPCQKPF.js";
8
8
  import {
9
9
  T,
10
10
  c,
@@ -17,7 +17,7 @@ import {
17
17
  r,
18
18
  t,
19
19
  watch
20
- } from "./chunk-A7HX4462.js";
20
+ } from "./chunk-Z2SUBRH5.js";
21
21
  import {
22
22
  __decorateClass,
23
23
  __privateAdd,
@@ -507,4 +507,4 @@ export {
507
507
  ItemPrintVariables,
508
508
  QtiItem
509
509
  };
510
- //# sourceMappingURL=chunk-WMPG7ULB.js.map
510
+ //# sourceMappingURL=chunk-424AWLRU.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  o
3
- } from "./chunk-DGIXWHK3.js";
3
+ } from "./chunk-N7S3GNUP.js";
4
4
  import {
5
5
  qtiTransformItem
6
- } from "./chunk-K7HR6ZAY.js";
6
+ } from "./chunk-UKPCQKPF.js";
7
7
  import {
8
8
  QtiFeedback,
9
9
  QtiVariableDeclaration,
@@ -18,7 +18,7 @@ import {
18
18
  r,
19
19
  t,
20
20
  watch
21
- } from "./chunk-A7HX4462.js";
21
+ } from "./chunk-Z2SUBRH5.js";
22
22
  import {
23
23
  __decorateClass,
24
24
  __privateAdd,
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-QXBXORM3.js";
29
29
 
30
30
  // ../qti-elements/src/components/qti-assessment-item/qti-assessment-item.ts
31
- var _itemTitle, _templateProcessing, _initialContext, _feedbackElements, _interactionElements, _QtiAssessmentItem_instances, attachEventListeners_fn, removeEventListeners_fn, _handleRegisterVariable, _handleRegisterFeedback, _handleRegisterInteraction, _handleEndAttempt, _handleSetOutcomeValue, _handleUpdateResponseVariable, processTemplates_fn, getCompletionStatus_fn, resetOutcomeVariablesBeforeResponseProcessing_fn;
31
+ var _itemTitle, _templateProcessing, _initialContext, _feedbackElements, _interactionElements, _QtiAssessmentItem_instances, attachEventListeners_fn, removeEventListeners_fn, _handleRegisterVariable, _handleRegisterFeedback, _handleRegisterInteraction, _handleEndAttempt, _handleSetOutcomeValue, _handleSetTemplateValue, _handleSetCorrectResponse, _handleUpdateResponseVariable, processTemplates_fn, getCompletionStatus_fn, resetOutcomeVariablesBeforeResponseProcessing_fn;
32
32
  var QtiAssessmentItem = class extends i2 {
33
33
  constructor() {
34
34
  super(...arguments);
@@ -80,6 +80,18 @@ var QtiAssessmentItem = class extends i2 {
80
80
  this.updateOutcomeVariable(outcomeIdentifier, value);
81
81
  e2.stopPropagation();
82
82
  });
83
+ __privateAdd(this, _handleSetTemplateValue, (e2) => {
84
+ e2.stopImmediatePropagation();
85
+ const { templateIdentifier, value } = e2.detail;
86
+ this.updateTemplateVariable(templateIdentifier, value ?? void 0);
87
+ e2.stopPropagation();
88
+ });
89
+ __privateAdd(this, _handleSetCorrectResponse, (e2) => {
90
+ e2.stopImmediatePropagation();
91
+ const { responseIdentifier, value } = e2.detail;
92
+ this.updateCorrectResponse(responseIdentifier, value ?? void 0);
93
+ e2.stopPropagation();
94
+ });
83
95
  __privateAdd(this, _handleUpdateResponseVariable, (e2) => {
84
96
  e2.stopImmediatePropagation();
85
97
  const { responseIdentifier, response, state } = e2.detail;
@@ -309,6 +321,60 @@ var QtiAssessmentItem = class extends i2 {
309
321
  this.updateOutcomeVariable("completionStatus", __privateMethod(this, _QtiAssessmentItem_instances, getCompletionStatus_fn).call(this));
310
322
  }
311
323
  }
324
+ /**
325
+ * Updates the template variable with the specified identifier to the given value.
326
+ */
327
+ updateTemplateVariable(identifier, value) {
328
+ const templateVariable = this._context.variables.find((v) => v.identifier === identifier && v.type === "template");
329
+ if (!templateVariable) {
330
+ console.warn(`Can not set qti-template-identifier: ${identifier}, it is not available`);
331
+ return;
332
+ }
333
+ const normalizedValue = templateVariable.cardinality === "single" ? Array.isArray(value) ? value[0] : value ?? null : value === void 0 || value === null ? null : Array.isArray(value) ? value : [value];
334
+ this._context = {
335
+ ...this._context,
336
+ variables: this._context.variables.map(
337
+ (v) => v.identifier !== identifier ? v : {
338
+ ...v,
339
+ value: normalizedValue
340
+ }
341
+ )
342
+ };
343
+ this.dispatchEvent(
344
+ new CustomEvent("qti-item-context-updated", {
345
+ bubbles: true,
346
+ composed: true,
347
+ detail: { itemContext: this._context }
348
+ })
349
+ );
350
+ }
351
+ /**
352
+ * Updates the correct response for the specified response variable.
353
+ */
354
+ updateCorrectResponse(identifier, value) {
355
+ const responseVariable = this.getResponse(identifier);
356
+ if (!responseVariable) {
357
+ console.warn(`Can not set correct response for identifier: ${identifier}, it is not available`);
358
+ return;
359
+ }
360
+ const normalizedValue = responseVariable.cardinality === "single" ? Array.isArray(value) ? value[0] : value ?? null : value === void 0 || value === null ? null : Array.isArray(value) ? value : [value];
361
+ this._context = {
362
+ ...this._context,
363
+ variables: this._context.variables.map(
364
+ (v) => v.identifier !== identifier ? v : {
365
+ ...v,
366
+ correctResponse: normalizedValue
367
+ }
368
+ )
369
+ };
370
+ this.dispatchEvent(
371
+ new CustomEvent("qti-item-context-updated", {
372
+ bubbles: true,
373
+ composed: true,
374
+ detail: { itemContext: this._context }
375
+ })
376
+ );
377
+ }
312
378
  setOutcomeVariable(identifier, value) {
313
379
  this.updateOutcomeVariable(identifier, value);
314
380
  this.dispatchEvent(
@@ -386,6 +452,8 @@ attachEventListeners_fn = function() {
386
452
  this.addEventListener("qti-register-interaction", __privateGet(this, _handleRegisterInteraction));
387
453
  this.addEventListener("end-attempt", __privateGet(this, _handleEndAttempt));
388
454
  this.addEventListener("qti-set-outcome-value", __privateGet(this, _handleSetOutcomeValue));
455
+ this.addEventListener("qti-set-template-value", __privateGet(this, _handleSetTemplateValue));
456
+ this.addEventListener("qti-set-correct-response", __privateGet(this, _handleSetCorrectResponse));
389
457
  this.addEventListener("qti-interaction-response", __privateGet(this, _handleUpdateResponseVariable));
390
458
  };
391
459
  removeEventListeners_fn = function() {
@@ -394,6 +462,8 @@ removeEventListeners_fn = function() {
394
462
  this.removeEventListener("qti-register-interaction", __privateGet(this, _handleRegisterInteraction));
395
463
  this.removeEventListener("end-attempt", __privateGet(this, _handleEndAttempt));
396
464
  this.removeEventListener("qti-set-outcome-value", __privateGet(this, _handleSetOutcomeValue));
465
+ this.removeEventListener("qti-set-template-value", __privateGet(this, _handleSetTemplateValue));
466
+ this.removeEventListener("qti-set-correct-response", __privateGet(this, _handleSetCorrectResponse));
397
467
  this.removeEventListener("qti-interaction-response", __privateGet(this, _handleUpdateResponseVariable));
398
468
  };
399
469
  _handleRegisterVariable = new WeakMap();
@@ -401,11 +471,19 @@ _handleRegisterFeedback = new WeakMap();
401
471
  _handleRegisterInteraction = new WeakMap();
402
472
  _handleEndAttempt = new WeakMap();
403
473
  _handleSetOutcomeValue = new WeakMap();
474
+ _handleSetTemplateValue = new WeakMap();
475
+ _handleSetCorrectResponse = new WeakMap();
404
476
  _handleUpdateResponseVariable = new WeakMap();
405
- processTemplates_fn = function() {
477
+ processTemplates_fn = async function() {
478
+ const templateDeclarations = Array.from(this.querySelectorAll("qti-template-declaration"));
479
+ if (templateDeclarations.length > 0) {
480
+ await Promise.all(templateDeclarations.map((declaration) => declaration.updateComplete));
481
+ await Promise.resolve();
482
+ }
406
483
  __privateSet(this, _templateProcessing, this.querySelector("qti-template-processing"));
407
484
  if (__privateGet(this, _templateProcessing)) {
408
485
  __privateGet(this, _templateProcessing).process();
486
+ __privateSet(this, _initialContext, { ...this._context, variables: this._context.variables });
409
487
  }
410
488
  };
411
489
  getCompletionStatus_fn = function() {
@@ -753,11 +831,69 @@ QtiItemBody = __decorateClass([
753
831
  ], QtiItemBody);
754
832
 
755
833
  // ../qti-elements/src/components/qti-content-body/qti-content-body.ts
834
+ var _QtiContentBody_instances, expandMathVariables_fn, stringifyValue_fn;
756
835
  var QtiContentBody = class extends i2 {
836
+ constructor() {
837
+ super(...arguments);
838
+ __privateAdd(this, _QtiContentBody_instances);
839
+ }
757
840
  render() {
758
- return T`<slot></slot>`;
841
+ return T`<slot @slotchange=${__privateMethod(this, _QtiContentBody_instances, expandMathVariables_fn)}></slot>`;
842
+ }
843
+ connectedCallback() {
844
+ super.connectedCallback();
845
+ this.updateComplete.then(() => __privateMethod(this, _QtiContentBody_instances, expandMathVariables_fn).call(this));
846
+ }
847
+ updated(changedProperties) {
848
+ if (changedProperties.has("context")) {
849
+ __privateMethod(this, _QtiContentBody_instances, expandMathVariables_fn).call(this);
850
+ }
851
+ }
852
+ };
853
+ _QtiContentBody_instances = new WeakSet();
854
+ expandMathVariables_fn = function() {
855
+ const mathVariables = /* @__PURE__ */ new Map();
856
+ const templateVariables = (this.context?.variables ?? []).filter((variable) => variable.type === "template");
857
+ for (const variable of templateVariables) {
858
+ const templateVariable = variable;
859
+ if (templateVariable.mathVariable !== true || templateVariable.value === null || templateVariable.value === void 0) {
860
+ continue;
861
+ }
862
+ mathVariables.set(templateVariable.identifier, __privateMethod(this, _QtiContentBody_instances, stringifyValue_fn).call(this, templateVariable.value));
863
+ }
864
+ if (mathVariables.size === 0) {
865
+ return;
866
+ }
867
+ const mathIdentifiers = Array.from(this.querySelectorAll("*")).filter(
868
+ (element) => element.localName.toLowerCase() === "mi" || element.localName.toLowerCase() === "mn"
869
+ );
870
+ for (const element of mathIdentifiers) {
871
+ const identifier = element.getAttribute("data-qti-math-variable-source") ?? element.textContent?.trim() ?? "";
872
+ const value = mathVariables.get(identifier);
873
+ if (!value) {
874
+ continue;
875
+ }
876
+ if (element.localName.toLowerCase() === "mn") {
877
+ element.textContent = value;
878
+ element.setAttribute("data-qti-math-variable-source", identifier);
879
+ continue;
880
+ }
881
+ const replacement = document.createElement("mn");
882
+ replacement.textContent = value;
883
+ replacement.setAttribute("data-qti-math-variable-source", identifier);
884
+ element.replaceWith(replacement);
885
+ }
886
+ };
887
+ stringifyValue_fn = function(value) {
888
+ if (Array.isArray(value)) {
889
+ return value.join(" ");
759
890
  }
891
+ return value?.toString() ?? "";
760
892
  };
893
+ __decorateClass([
894
+ c({ context: itemContext, subscribe: true }),
895
+ r()
896
+ ], QtiContentBody.prototype, "context", 2);
761
897
  QtiContentBody = __decorateClass([
762
898
  t("qti-content-body")
763
899
  ], QtiContentBody);
@@ -1298,6 +1434,124 @@ QtiTemplateDeclaration = __decorateClass([
1298
1434
  t("qti-template-declaration")
1299
1435
  ], QtiTemplateDeclaration);
1300
1436
 
1437
+ // ../qti-elements/src/components/qti-template-processing/qti-template-processing.ts
1438
+ var _maxIterations;
1439
+ var QtiTemplateProcessing = class extends i2 {
1440
+ constructor() {
1441
+ super(...arguments);
1442
+ __privateAdd(this, _maxIterations, 100);
1443
+ }
1444
+ // Prevent infinite loops in template constraints
1445
+ render() {
1446
+ return T`<slot></slot>`;
1447
+ }
1448
+ /**
1449
+ * Process template rules to set template variable values
1450
+ */
1451
+ process() {
1452
+ const assessmentItem = this.closest("qti-assessment-item");
1453
+ if (!assessmentItem) {
1454
+ console.warn("qti-template-processing must be inside qti-assessment-item");
1455
+ return;
1456
+ }
1457
+ let iterations = 0;
1458
+ let shouldReprocess = false;
1459
+ do {
1460
+ shouldReprocess = false;
1461
+ iterations++;
1462
+ if (iterations > __privateGet(this, _maxIterations)) {
1463
+ console.error("Template processing exceeded maximum iterations. Possible infinite loop.");
1464
+ break;
1465
+ }
1466
+ try {
1467
+ const rules = [...this.children];
1468
+ for (const rule of rules) {
1469
+ if (rule.tagName.toLowerCase() === "qti-template-constraint") {
1470
+ const constraintResult = rule.calculate();
1471
+ if (constraintResult === false) {
1472
+ shouldReprocess = true;
1473
+ break;
1474
+ }
1475
+ } else {
1476
+ rule.process();
1477
+ }
1478
+ }
1479
+ } catch (error) {
1480
+ console.error("Error during template processing:", error);
1481
+ break;
1482
+ }
1483
+ } while (shouldReprocess);
1484
+ this.dispatchEvent(
1485
+ new CustomEvent("qti-template-processing-complete", {
1486
+ bubbles: true,
1487
+ composed: true,
1488
+ detail: { iterations }
1489
+ })
1490
+ );
1491
+ }
1492
+ firstUpdated(_changedProperties) {
1493
+ if (this.getAttribute("template")) {
1494
+ console.info("Template processing with external template not yet implemented");
1495
+ }
1496
+ }
1497
+ };
1498
+ _maxIterations = new WeakMap();
1499
+ QtiTemplateProcessing.styles = [
1500
+ i`
1501
+ :host {
1502
+ display: none;
1503
+ }
1504
+ `
1505
+ ];
1506
+ QtiTemplateProcessing = __decorateClass([
1507
+ t("qti-template-processing")
1508
+ ], QtiTemplateProcessing);
1509
+
1510
+ // ../qti-elements/src/components/qti-template-constraint/qti-template-constraint.ts
1511
+ var QtiTemplateConstraint = class extends i2 {
1512
+ render() {
1513
+ return T`<slot></slot>`;
1514
+ }
1515
+ /**
1516
+ * Evaluates the constraint condition
1517
+ * @returns true if constraint is satisfied, false if template processing should restart
1518
+ */
1519
+ calculate() {
1520
+ const expressions = [...this.children];
1521
+ if (expressions.length !== 1) {
1522
+ console.error("qti-template-constraint must have exactly one child expression");
1523
+ return true;
1524
+ }
1525
+ try {
1526
+ const result = expressions[0].calculate();
1527
+ return Boolean(result);
1528
+ } catch (error) {
1529
+ console.error("Error evaluating template constraint:", error);
1530
+ return true;
1531
+ }
1532
+ }
1533
+ /**
1534
+ * Template constraints don't have sub-rules like conditions
1535
+ */
1536
+ getSubRules() {
1537
+ return [];
1538
+ }
1539
+ /**
1540
+ * Process the template constraint
1541
+ * @returns true if constraint is satisfied, false if template processing should restart
1542
+ */
1543
+ process() {
1544
+ const constraintSatisfied = this.calculate();
1545
+ if (!constraintSatisfied) {
1546
+ console.debug("Template constraint not satisfied, restarting template processing");
1547
+ }
1548
+ return constraintSatisfied;
1549
+ }
1550
+ };
1551
+ QtiTemplateConstraint = __decorateClass([
1552
+ t("qti-template-constraint")
1553
+ ], QtiTemplateConstraint);
1554
+
1301
1555
  // ../qti-elements/src/components/qti-context-declaration/qti-context-declaration.ts
1302
1556
  var QtiContextDeclaration = class extends i2 {
1303
1557
  constructor() {
@@ -1343,6 +1597,8 @@ export {
1343
1597
  QtiOutcomeDeclaration,
1344
1598
  QtiResponseProcessing,
1345
1599
  QtiTemplateDeclaration,
1600
+ QtiTemplateProcessing,
1601
+ QtiTemplateConstraint,
1346
1602
  QtiContextDeclaration
1347
1603
  };
1348
- //# sourceMappingURL=chunk-3XXXAWMZ.js.map
1604
+ //# sourceMappingURL=chunk-FFESMKSD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../qti-elements/src/components/qti-assessment-item/qti-assessment-item.ts","../../qti-elements/src/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts","../../qti-elements/src/components/qti-companion-materials-info/qti-companion-materials-info.ts","../../qti-elements/src/components/qti-custom-operator/qti-custom-operator.ts","../../qti-elements/src/components/qti-feedback-block/qti-feedback-block.ts","../../qti-elements/src/components/qti-feedback-inline/qti-feedback-inline.ts","../../qti-elements/src/components/qti-modal-feedback/qti-modal-feedback.ts","../../qti-elements/src/components/qti-item-body/qti-item-body.styles.ts","../../qti-elements/src/components/qti-item-body/qti-item-body.ts","../../qti-elements/src/components/qti-content-body/qti-content-body.ts","../../qti-elements/src/components/qti-rubric-block/qti-rubric-block.ts","../../qti-elements/src/components/qti-stylesheet/qti-stylesheet.ts","../../qti-elements/src/components/qti-response-declaration/qti-response-declaration.ts","../../qti-elements/src/components/qti-outcome-declaration/qti-outcome-declaration.ts","../../qti-elements/src/internal/template-strings.ts","../../qti-elements/src/components/qti-response-processing/qti-response-processing.ts","../../qti-elements/src/components/qti-template-declaration/qti-template-declaration.ts","../../qti-elements/src/components/qti-template-processing/qti-template-processing.ts","../../qti-elements/src/components/qti-template-constraint/qti-template-constraint.ts","../../qti-elements/src/components/qti-context-declaration/qti-context-declaration.ts"],"sourcesContent":["import { provide } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { itemContext, itemContextVariables } from '@qti-components/base';\nimport { watch } from '@qti-components/utilities';\n\nimport type { QtiTemplateProcessing } from '../qti-template-processing/qti-template-processing.js';\nimport type { InteractionChangedDetails, OutcomeChangedDetails } from '../../internal/event-types.ts';\nimport type { QtiFeedback, ResponseInteraction } from '@qti-components/base';\nimport type { VariableDeclaration, VariableValue } from '@qti-components/base';\nimport type { OutcomeVariable, ResponseVariable, TemplateVariable } from '@qti-components/base';\nimport type { QtiResponseProcessing } from '../qti-response-processing/qti-response-processing.ts';\nimport type QtiRegisterVariable from '../../internal/events/qti-register-variable.ts';\nimport type { ItemContext } from '@qti-components/base';\nimport type { Interaction } from '@qti-components/base';\n// import type { ItemShowCandidateCorrection } from '../../qti-item/components/item-show-candidate-correction.ts';\n// import type { ItemShowCorrectResponse } from '../../qti-item/components/item-show-correct-response.ts';\n\n/**\n * @summary The qti-assessment-item element contains all the other QTI 3 item structures.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj\n *\n * @dependency qti-feedback\n * @dependency qti-responseprocessing\n *\n * @event qti-item-context-updated - Emitted when through a user action the itemContext is updated,\n * typically on interaction with the interactions, or calling response processing.\n */\n@customElement('qti-assessment-item')\nexport class QtiAssessmentItem extends LitElement {\n #itemTitle: string | undefined;\n #templateProcessing: QtiTemplateProcessing | null = null;\n\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) adaptive: 'true' | 'false' = 'false';\n @property({ type: String }) timeDependent: 'true' | 'false' | null = null;\n\n @property({ type: String })\n override get title(): string {\n return this.#itemTitle;\n }\n override set title(value: string) {\n this.#itemTitle = value;\n this.removeAttribute('title');\n this.setAttribute('data-title', value);\n }\n\n @property({ type: Boolean }) disabled: boolean;\n @watch('disabled', { waitUntilFirstUpdate: true })\n protected _handleDisabledChange = (_: boolean, disabled: boolean) => {\n this.#interactionElements.forEach(ch => (ch.disabled = disabled));\n };\n\n @property({ type: Boolean }) readonly: boolean;\n @watch('readonly', { waitUntilFirstUpdate: true })\n protected _handleReadonlyChange = (_: boolean, readonly: boolean) =>\n this.#interactionElements.forEach(ch => (ch.readonly = readonly));\n\n @provide({ context: itemContext })\n private _context: ItemContext = {\n variables: itemContextVariables\n };\n\n /**\n * Sets the identifier for the assessment item reference if this item is in a test.\n *\n * @param identifier - The identifier for the assessment item reference.\n */\n public set assessmentItemRefId(identifier: string) {\n this._context = { ...this._context, identifier };\n }\n\n public get assessmentItemRefId(): string {\n return this._context.identifier;\n }\n\n public get variables(): VariableValue<string | string[] | null>[] {\n return this._context.variables.map(v => ({\n identifier: v.identifier,\n value: v.value,\n type: v.type,\n // add externalscored, a fixed prop to the test, so the testcontext can read and decide how to score this item\n ...(v.type === 'outcome' && v.identifier === 'SCORE'\n ? { externalScored: (v as OutcomeVariable).externalScored }\n : {})\n }));\n }\n\n public set variables(value: VariableValue<string | string[] | null>[]) {\n if (!Array.isArray(value) || value.some(v => !('identifier' in v))) {\n console.warn('variables property should be an array of VariableDeclaration');\n return;\n }\n this._context = {\n ...this._context,\n variables: this._context.variables.map(variable => {\n const matchingValue = value.find(v => v.identifier === variable.identifier);\n if (matchingValue) {\n return {\n ...variable,\n ...matchingValue,\n interpolationTable: (variable as OutcomeVariable).interpolationTable\n };\n }\n return variable;\n })\n };\n\n this._context.variables.forEach(variable => {\n if (variable.type === 'response') {\n const interactionElement = this.#interactionElements.find(\n (el: Interaction) => el.responseIdentifier === variable.identifier\n );\n if (interactionElement) {\n interactionElement.response = variable.value as string | string[];\n }\n }\n });\n\n this.variables.forEach(variable => {\n if (variable.type === 'outcome') {\n this.#feedbackElements.forEach(fe => fe.checkShowFeedback(variable.identifier));\n }\n });\n }\n\n public get state(): ItemContext['state'] {\n return this._context.state;\n }\n\n public set state(value: ItemContext['state']) {\n this._context = {\n ...this._context,\n state: value ? { ...value } : undefined\n };\n }\n\n #initialContext: Readonly<ItemContext> = { ...this._context, variables: this._context.variables };\n #feedbackElements: QtiFeedback[] = [];\n #interactionElements: Interaction[] = [];\n\n /** @deprecated use variables property instead */\n set responses(myResponses: ResponseInteraction[]) {\n if (myResponses) {\n for (const response of myResponses) {\n const responseVariable = this.getResponse(response.responseIdentifier);\n if (responseVariable) {\n this.updateResponseVariable(response.responseIdentifier, response.response);\n }\n\n const interaction: Interaction | undefined = this.#interactionElements.find(\n i => i.getAttribute('response-identifier') === response.responseIdentifier\n );\n if (interaction) {\n interaction.response = response.response;\n }\n }\n }\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n this.#attachEventListeners();\n super.connectedCallback();\n this.updateComplete.then(() => {\n this.dispatchEvent(\n new CustomEvent<QtiAssessmentItem>('qti-assessment-item-connected', {\n bubbles: true,\n composed: true,\n detail: this\n })\n );\n this.#processTemplates();\n });\n }\n\n override disconnectedCallback(): void {\n this.#removeEventListeners();\n super.disconnectedCallback();\n }\n\n #attachEventListeners() {\n this.addEventListener('qti-register-variable', this.#handleRegisterVariable);\n this.addEventListener('qti-register-feedback', this.#handleRegisterFeedback);\n this.addEventListener('qti-register-interaction', this.#handleRegisterInteraction);\n this.addEventListener('end-attempt', this.#handleEndAttempt);\n this.addEventListener('qti-set-outcome-value', this.#handleSetOutcomeValue);\n this.addEventListener('qti-set-template-value', this.#handleSetTemplateValue);\n this.addEventListener('qti-set-correct-response', this.#handleSetCorrectResponse);\n this.addEventListener('qti-interaction-response', this.#handleUpdateResponseVariable);\n }\n\n #removeEventListeners() {\n this.removeEventListener('qti-register-variable', this.#handleRegisterVariable);\n this.removeEventListener('qti-register-feedback', this.#handleRegisterFeedback);\n this.removeEventListener('qti-register-interaction', this.#handleRegisterInteraction);\n this.removeEventListener('end-attempt', this.#handleEndAttempt);\n this.removeEventListener('qti-set-outcome-value', this.#handleSetOutcomeValue);\n this.removeEventListener('qti-set-template-value', this.#handleSetTemplateValue);\n this.removeEventListener('qti-set-correct-response', this.#handleSetCorrectResponse);\n this.removeEventListener('qti-interaction-response', this.#handleUpdateResponseVariable);\n }\n\n #handleRegisterVariable = (e: QtiRegisterVariable) => {\n e.stopImmediatePropagation();\n this._context = { ...this._context, variables: [...this._context.variables, e.detail.variable] };\n this.#initialContext = this._context;\n e.stopPropagation();\n };\n\n #handleRegisterFeedback = (e: CustomEvent<QtiFeedback>) => {\n e.stopImmediatePropagation();\n const feedbackElement = e.detail;\n this.#feedbackElements.push(feedbackElement);\n const numAttempts = Number(this._context.variables.find(v => v.identifier === 'numAttempts')?.value) || 0;\n if (numAttempts > 0) {\n feedbackElement.checkShowFeedback(feedbackElement.outcomeIdentifier);\n }\n };\n\n #handleRegisterInteraction = (e: CustomEvent<{ interaction: string; interactionElement: Interaction }>) => {\n e.stopImmediatePropagation();\n this.#interactionElements.push(e.detail.interactionElement);\n };\n\n #handleEndAttempt = (e: CustomEvent<{ responseIdentifier: string; countAttempt: boolean }>) => {\n e.stopImmediatePropagation();\n const { responseIdentifier, countAttempt } = e.detail;\n this.validate();\n this.updateResponseVariable(responseIdentifier, 'true');\n this.processResponse(countAttempt);\n };\n\n #handleSetOutcomeValue = (e: CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>) => {\n e.stopImmediatePropagation();\n const { outcomeIdentifier, value } = e.detail;\n this.updateOutcomeVariable(outcomeIdentifier, value);\n e.stopPropagation();\n };\n\n #handleSetTemplateValue = (e: CustomEvent<{ templateIdentifier: string; value: string | string[] | null }>) => {\n e.stopImmediatePropagation();\n const { templateIdentifier, value } = e.detail;\n this.updateTemplateVariable(templateIdentifier, value ?? undefined);\n e.stopPropagation();\n };\n\n #handleSetCorrectResponse = (e: CustomEvent<{ responseIdentifier: string; value: string | string[] | null }>) => {\n e.stopImmediatePropagation();\n const { responseIdentifier, value } = e.detail;\n this.updateCorrectResponse(responseIdentifier, value ?? undefined);\n e.stopPropagation();\n };\n\n #handleUpdateResponseVariable = (e: CustomEvent<ResponseInteraction>) => {\n e.stopImmediatePropagation();\n\n const { responseIdentifier, response, state } = e.detail;\n this.updateResponseVariable(responseIdentifier, response);\n if (state !== undefined) {\n this._context = {\n ...this._context,\n state: {\n ...(this._context.state || {}),\n [responseIdentifier]: state\n }\n };\n }\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n };\n\n /**\n * Toggles the display of correct responses for all interactions.\n * @param show - A boolean indicating whether to show or hide correct responses.\n */\n public showCorrectResponse(show: boolean): void {\n // Iterate through all interaction elements\n for (const interaction of this.#interactionElements) {\n interaction.toggleCorrectResponse(show);\n }\n\n // Update one or more toggle component states // ItemShowCorrectResponse\n document.querySelectorAll('item-show-correct-response').forEach((el: HTMLElement & { shown: boolean }) => {\n el.shown = show;\n });\n }\n\n /**\n * Toggles the display of the candidate correction for all interactions.\n * @param show - A boolean indicating whether to show or hide candidate correction.\n */\n public showCandidateCorrection(show: boolean): void {\n // Iterate through all interaction elements\n for (const interaction of this.#interactionElements) {\n interaction.toggleCandidateCorrection(show);\n }\n\n // Update one or more toggle component states // ItemShowCandidateCorrection\n document.querySelectorAll('item-show-candidate-correction').forEach((el: HTMLElement & { shown: boolean }) => {\n el.shown = show;\n });\n }\n\n async #processTemplates(): Promise<void> {\n const templateDeclarations = Array.from(this.querySelectorAll<LitElement>('qti-template-declaration'));\n if (templateDeclarations.length > 0) {\n await Promise.all(templateDeclarations.map(declaration => declaration.updateComplete));\n await Promise.resolve();\n }\n\n this.#templateProcessing = this.querySelector<QtiTemplateProcessing>('qti-template-processing');\n if (this.#templateProcessing) {\n // Run template processing before first presentation\n this.#templateProcessing.process();\n this.#initialContext = { ...this._context, variables: this._context.variables };\n }\n }\n\n public processResponse(countNumAttempts = true, reportValidityAfterScoring = true): boolean {\n this.validate(reportValidityAfterScoring);\n\n if (countNumAttempts) {\n this.updateOutcomeVariable(\n 'numAttempts',\n (+this._context.variables.find(v => v.identifier === 'numAttempts')?.value + 1).toString()\n );\n }\n\n if (this.adaptive === 'false') {\n this.#resetOutcomeVariablesBeforeResponseProcessing();\n }\n\n const responseProcessor = this.querySelector<QtiResponseProcessing>('qti-response-processing');\n const canProcess = !!(responseProcessor && typeof responseProcessor.process === 'function');\n if (canProcess) {\n responseProcessor.process();\n }\n if (this.adaptive === 'false') {\n // if adaptive, completionStatus is set by the processing template\n this.updateOutcomeVariable('completionStatus', this.#getCompletionStatus());\n }\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n\n return canProcess;\n }\n\n public resetResponses() {\n this._context = this.#initialContext;\n }\n\n protected getResponse(identifier: string): Readonly<ResponseVariable> {\n return this.getVariable(identifier) as ResponseVariable;\n }\n\n public getOutcome(identifier: string): Readonly<OutcomeVariable> {\n return this.getVariable(identifier) as OutcomeVariable;\n }\n\n protected getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>> {\n return this._context.variables.find(v => v.identifier === identifier) || null;\n }\n\n // saving privates here: ------------------------------------------------------------------------------\n\n /**\n * Updates the response variable with the specified identifier to the given value.\n *\n * @protected\n *\n * This method is intended for internal use within the class and subclasses.\n * It should not be called externally by third parties.\n *\n * @param identifier - The identifier of the response variable to update.\n * @param value - The new value for the response variable.\n */\n public updateResponseVariable(identifier: string, value: string | string[] | undefined) {\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v => (v.identifier !== identifier ? v : { ...v, value: value }))\n };\n\n // Turn off candidate correction after change of response variable\n this.showCandidateCorrection(false);\n\n this.dispatchEvent(\n new CustomEvent<InteractionChangedDetails>('qti-interaction-changed', {\n bubbles: true,\n composed: true,\n detail: {\n item: this.identifier,\n responseIdentifier: identifier,\n response: Array.isArray(value) ? [...value] : value\n }\n })\n );\n\n if (this.adaptive === 'false') {\n // if adaptive, completionStatus is set by the processing template\n this.updateOutcomeVariable('completionStatus', this.#getCompletionStatus());\n }\n }\n\n /**\n * Updates the template variable with the specified identifier to the given value.\n */\n public updateTemplateVariable(identifier: string, value: string | string[] | undefined) {\n const templateVariable = this._context.variables.find(v => v.identifier === identifier && v.type === 'template') as\n | TemplateVariable\n | undefined;\n\n if (!templateVariable) {\n console.warn(`Can not set qti-template-identifier: ${identifier}, it is not available`);\n return;\n }\n\n const normalizedValue =\n templateVariable.cardinality === 'single'\n ? Array.isArray(value)\n ? value[0]\n : (value ?? null)\n : value === undefined || value === null\n ? null\n : Array.isArray(value)\n ? value\n : [value];\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v =>\n v.identifier !== identifier\n ? v\n : {\n ...v,\n value: normalizedValue\n }\n )\n };\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n /**\n * Updates the correct response for the specified response variable.\n */\n public updateCorrectResponse(identifier: string, value: string | string[] | undefined) {\n const responseVariable = this.getResponse(identifier);\n\n if (!responseVariable) {\n console.warn(`Can not set correct response for identifier: ${identifier}, it is not available`);\n return;\n }\n\n const normalizedValue =\n responseVariable.cardinality === 'single'\n ? Array.isArray(value)\n ? value[0]\n : (value ?? null)\n : value === undefined || value === null\n ? null\n : Array.isArray(value)\n ? value\n : [value];\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v =>\n v.identifier !== identifier\n ? v\n : {\n ...v,\n correctResponse: normalizedValue\n }\n )\n };\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n public setOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n this.updateOutcomeVariable(identifier, value);\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n /**\n * Updates the outcome variable with the specified identifier to the given value.\n *\n * @protected\n *\n * This method is intended for internal use within the class and subclasses.\n * It should not be called externally by third parties.\n *\n * @param identifier - The identifier of the response variable to update.\n * @param value - The new value for the response variable.\n */\n public updateOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n const outcomeVariable = this.getOutcome(identifier);\n\n if (!outcomeVariable) {\n console.warn(`Can not set qti-outcome-identifier: ${identifier}, it is not available`);\n return;\n }\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v => {\n if (v.identifier !== identifier) {\n return v;\n }\n return {\n ...v,\n value: outcomeVariable.cardinality === 'single' ? value : Array.isArray(value) ? value : [value]\n };\n })\n };\n this.#feedbackElements.forEach(fe => fe.checkShowFeedback(identifier));\n\n this.dispatchEvent(\n new CustomEvent<OutcomeChangedDetails>('qti-outcome-changed', {\n bubbles: true,\n composed: true,\n detail: {\n item: this.identifier,\n outcomeIdentifier: identifier,\n value: this._context.variables.find(v => v.identifier === identifier)?.value\n }\n })\n );\n }\n\n public validate(reportValidity = true): boolean {\n const isValid = this.#interactionElements.every(interactionElement => interactionElement.validate());\n\n if (reportValidity) {\n this.reportValidity();\n }\n\n return isValid;\n }\n\n public reportValidity() {\n for (const interactionElement of this.#interactionElements) {\n interactionElement.reportValidity();\n }\n }\n\n #getCompletionStatus(): 'completed' | 'incomplete' | 'not_attempted' | 'unknown' {\n const valid = this.validate(false);\n if (valid === true) return 'completed';\n if (valid === false) return 'incomplete';\n return 'not_attempted';\n }\n\n #resetOutcomeVariablesBeforeResponseProcessing(): void {\n this._context = {\n ...this._context,\n variables: this._context.variables.map(variable => {\n if (variable.type !== 'outcome') {\n return variable;\n }\n\n const hasDefaultValue = 'defaultValue' in variable;\n const declaredDefault = hasDefaultValue ? variable.defaultValue : null;\n\n let value = declaredDefault ?? null;\n if (\n (value === null || value === undefined) &&\n (variable.baseType === 'integer' || variable.baseType === 'float')\n ) {\n value = '0';\n }\n\n return {\n ...variable,\n value\n };\n })\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-item': QtiAssessmentItem;\n }\n}\n","import { LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { qtiTransformItem } from '@qti-components/transformers';\n\nimport type { QtiAssessmentItem } from '../qti-assessment-item/qti-assessment-item';\n\nexport class QtiAssessmentStimulusRefConnectedEvent extends Event {\n public static eventName = 'qti-assessment-stimulus-ref-connected';\n constructor(\n public element: QtiAssessmentStimulusRef,\n public item: QtiAssessmentItem\n ) {\n super(QtiAssessmentStimulusRefConnectedEvent.eventName, { bubbles: true, composed: true, cancelable: true });\n }\n}\n\n/**\n * Represents a custom element for referencing an assessment stimulus.\n */\n@customElement('qti-assessment-stimulus-ref')\nexport class QtiAssessmentStimulusRef extends LitElement {\n @property({ type: String }) identifier = '';\n @property({ type: String }) href = '';\n\n /**\n * Lifecycle method called when the element is connected to the DOM.\n * First checks if there's a data-stimulus-idref element. If found, loads the stimulus directly.\n * If not found, delegates to the delivery platform via an event.\n */\n public override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n // VERY important to wait for updateComplete to ensure that the stimulusRef is connected after item\n // for the test-navigation to correctly process everything in order\n await this.updateComplete;\n\n const item = this.closest<QtiAssessmentItem>('qti-assessment-item');\n\n const event = new QtiAssessmentStimulusRefConnectedEvent(this, item);\n this.dispatchEvent(event);\n\n const stimulusRef = item?.querySelector(`[data-stimulus-idref=\"${this.identifier}\"]`);\n if (!event.defaultPrevented && stimulusRef) {\n await this.updateStimulusRef(stimulusRef);\n }\n }\n\n /**\n * Loads and appends the stimulus to the specified element.\n * @param stimulusRef - The element to which the stimulus will be appended.\n */\n public async updateStimulusRef(stimulusRef: Element) {\n const stimulus = await qtiTransformItem()\n .load(this.href)\n .then(api => api.htmlDoc());\n if (stimulus) {\n const elements = stimulus.querySelectorAll('qti-stimulus-body, qti-stylesheet');\n stimulusRef.innerHTML = '';\n stimulusRef.append(...elements);\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-stimulus-ref': QtiAssessmentStimulusRef;\n }\n}\n","import { LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n@customElement('qti-companion-materials-info')\nexport class QtiCompanionMaterialsInfo extends LitElement {\n // static override styles = css`\n // slot {\n // display: hidden;\n // }\n // `;\n // override render() {\n // return html` <slot></slot> `;\n // }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-companion-materials-info': QtiCompanionMaterialsInfo;\n }\n}\n","import { consume } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\n\nimport { itemContext } from '@qti-components/base';\n\nimport type { ResponseVariable } from '@qti-components/base';\nimport type { Calculate } from '@qti-components/base';\nimport type { ItemContext } from '@qti-components/base';\n\n/**\n * https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw\n * <qti-custom-operator class=\"js.org\">\n <qti-base-value base-type=\"string\"><![CDATA[\n console.log(context.variables);\n return 'B'\n document.querySelector('qti-end-attempt-interaction').disabled = true;\n ]]></qti-base-value>\n </qti-custom-operator>\n </qti-set-outcome-value>\n */\n@customElement('qti-custom-operator')\nexport class QtiCustomOperator extends LitElement implements Calculate {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n #operatorFunction: Function;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n private _context?: ItemContext;\n\n override render() {\n return html`<slot @slotchange=${this.handleSlotChange}></slot>`;\n }\n\n handleSlotChange() {\n // expecting <[!CDATA[ ... ]]> is converted into <!-- ... --> with qti-transform: cDataToComment\n const commentNode = Array.from(this.firstElementChild?.childNodes ?? []).find(\n node => node.nodeType === Node.COMMENT_NODE\n );\n try {\n this.#operatorFunction = new Function('context', 'fn', 'item', commentNode?.textContent ?? '');\n } catch (e) {\n console.error('custom-operator contains invalid javascript code', e);\n }\n }\n\n public calculate() {\n const fn = {\n variable: (responseIdentifier: string) =>\n this._context?.variables.find(v => v.identifier === responseIdentifier)?.value ?? '',\n correct: (responseIdentifier: string) =>\n (this._context?.variables.find(v => v.identifier === responseIdentifier) as ResponseVariable)\n ?.correctResponse ?? ''\n };\n const item = {\n getVariable: (variableIdentifier: string) =>\n this._context?.variables.find(v => v.identifier === variableIdentifier),\n updateOutcomeVariable: (outcomeIdentifier: string, value: string | string[]) => {\n this.dispatchEvent(\n new CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>('qti-set-outcome-value', {\n bubbles: true,\n composed: true,\n detail: {\n outcomeIdentifier,\n value\n }\n })\n );\n },\n updateResponseVariable: (responseIdentifier: string, response: string | string[]) => {\n this.dispatchEvent(\n new CustomEvent<{ responseIdentifier: string; response: string | string[] }>('qti-interaction-response', {\n bubbles: true,\n composed: true,\n detail: {\n responseIdentifier,\n response\n }\n })\n );\n }\n };\n\n return this.#operatorFunction(this._context, fn, item);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-custom-operator': QtiCustomOperator;\n }\n}\n","import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { QtiFeedback } from '@qti-components/base';\n\n@customElement('qti-feedback-block')\nexport class QtiFeedbackBlock extends QtiFeedback {\n static override styles = css`\n :host {\n display: block;\n }\n .on {\n display: block;\n }\n .off {\n display: none;\n }\n `;\n\n override render() {\n return html` <slot part=\"feedback\" class=\"feedback ${this.showStatus}\"></slot> `;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.checkShowFeedback(this.outcomeIdentifier);\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-feedback-block': QtiFeedbackBlock;\n }\n}\n","import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\n\nimport { QtiFeedback } from '@qti-components/base';\n\n@customElement('qti-feedback-inline')\nexport class QtiFeedbackInline extends QtiFeedback {\n static override styles = css`\n .on {\n display: inline-block;\n }\n .off {\n display: none;\n }\n `;\n\n override render = () => html` <slot part=\"feedback\" class=\"${ifDefined(this.showStatus)}\"></slot> `;\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.checkShowFeedback(this.outcomeIdentifier);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-feedback-inline': QtiFeedbackInline;\n }\n}\n","import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { QtiFeedback } from '@qti-components/base';\n\n@customElement('qti-modal-feedback')\nexport class QtiModalFeedback extends QtiFeedback {\n static override styles = css`\n .qti-dialog {\n background: var(--qti-bg);\n border: var(--qti-border-thickness) var(--qti-border-style) var(--qti-border-color);\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1000;\n width: auto;\n max-width: 90%;\n }\n\n .button {\n border-radius: var(--qti-border-radius);\n padding: var(--qti-padding-vertical) var(--qti-padding-horizontal);\n background-color: var(--qti-bg-active);\n border: var(--qti-border-active);\n cursor: pointer;\n position: relative;\n display: inline-block;\n }\n\n .button:hover {\n background-color: var(--qti-hover-bg);\n }\n\n .button:disabled {\n background-color: var(--qti-disabled-bg);\n color: var(--qti-disabled-color);\n cursor: not-allowed;\n }\n\n .button:focus {\n outline: var(--qti-focus-border-width) solid var(--qti-focus-color);\n }\n `;\n\n override render() {\n return html`\n <dialog class=\"qti-dialog\" part=\"feedback\" ?open=\"${this.showStatus === 'on'}\">\n <slot></slot>\n <div style=\"margin-top: var(--qti-gap-size); text-align: center;\">\n <button class=\"button close-button\" @click=\"${this.closeFeedback}\">Close</button>\n </div>\n </dialog>\n `;\n }\n\n openFeedback() {\n const dialog = this.shadowRoot?.querySelector('dialog') as HTMLDialogElement | null;\n if (dialog && !dialog.open) {\n dialog.showModal();\n }\n }\n\n closeFeedback() {\n const dialog = this.shadowRoot?.querySelector('dialog') as HTMLDialogElement | null;\n if (dialog && dialog.open) {\n dialog.close();\n this.showStatus = 'off';\n }\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (this.showStatus === 'on') {\n this.openFeedback();\n }\n }\n\n protected override updated(changedProperties: Map<string | number | symbol, unknown>): void {\n if (changedProperties.has('showStatus')) {\n if (this.showStatus === 'on') {\n this.openFeedback();\n } else {\n this.closeFeedback();\n }\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-modal-feedback': QtiModalFeedback;\n }\n}\n","import { css } from 'lit';\n\nexport default css`\n :host {\n display: block;\n }\n`;\n","import { customElement } from 'lit/decorators.js';\nimport { html, LitElement } from 'lit';\n\nimport styles from './qti-item-body.styles';\n\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary The qti-item-body node contains the text, graphics, media objects and interactions that describe the item's content and information about how it is structured.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi\n * @status stable\n * @since 4.0\n *\n * @slot - item body content.\n * @slot qti-rubric-block - the qti rubric block is placed above the item\n * @part qti-rubric-block - the qti rubric block part\n */\n@customElement('qti-item-body')\nexport class QtiItemBody extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n override render() {\n return html`<slot part=\"qti-rubric-blocks\" name=\"qti-rubric-block\"></slot><slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item-body': QtiItemBody;\n }\n}\n","import { consume } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\n\nimport { itemContext } from '@qti-components/base';\n\nimport type { ItemContext, TemplateVariable } from '@qti-components/base';\n\n@customElement('qti-content-body')\nexport class QtiContentBody extends LitElement {\n @consume({ context: itemContext, subscribe: true })\n @state()\n protected context?: ItemContext;\n\n override render() {\n return html`<slot @slotchange=${this.#expandMathVariables}></slot>`;\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.updateComplete.then(() => this.#expandMathVariables());\n }\n\n protected override updated(changedProperties: Map<string | number | symbol, unknown>): void {\n if (changedProperties.has('context')) {\n this.#expandMathVariables();\n }\n }\n\n #expandMathVariables(): void {\n const mathVariables = new Map<string, string>();\n const templateVariables = (this.context?.variables ?? []).filter(variable => variable.type === 'template');\n\n for (const variable of templateVariables) {\n const templateVariable = variable as TemplateVariable;\n if (templateVariable.mathVariable !== true || templateVariable.value === null || templateVariable.value === undefined) {\n continue;\n }\n\n mathVariables.set(templateVariable.identifier, this.#stringifyValue(templateVariable.value));\n }\n\n if (mathVariables.size === 0) {\n return;\n }\n\n const mathIdentifiers = Array.from(this.querySelectorAll('*')).filter(\n element => element.localName.toLowerCase() === 'mi' || element.localName.toLowerCase() === 'mn'\n );\n\n for (const element of mathIdentifiers) {\n const identifier = element.getAttribute('data-qti-math-variable-source') ?? element.textContent?.trim() ?? '';\n const value = mathVariables.get(identifier);\n\n if (!value) {\n continue;\n }\n\n if (element.localName.toLowerCase() === 'mn') {\n element.textContent = value;\n element.setAttribute('data-qti-math-variable-source', identifier);\n continue;\n }\n\n const replacement = document.createElement('mn');\n replacement.textContent = value;\n replacement.setAttribute('data-qti-math-variable-source', identifier);\n element.replaceWith(replacement);\n }\n }\n\n #stringifyValue(value: string | readonly string[] | number | boolean | null): string {\n if (Array.isArray(value)) {\n return value.join(' ');\n }\n\n return value?.toString() ?? '';\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-content-body': QtiContentBody;\n }\n}\n","import { LitElement, css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { watch } from '@qti-components/utilities';\n\n@customElement('qti-rubric-block')\nexport class QtiRubricBlock extends LitElement {\n @property({ type: String }) override id: string; // =\"qtiAspectInhoudRubricBlock\"\n\n @property({ type: String }) use: 'instructions' | 'scoring' | 'navigation'; // = \"scoring\"\n\n @property({ type: String }) view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';\n\n @property({ type: String, attribute: 'class' }) classNames: string;\n @watch('classNames', { waitUntilFirstUpdate: true })\n handleclassNamesChange() {\n const classNames = this.classNames.split(' ');\n classNames.forEach((className: string) => {\n switch (className) {\n case 'qti-rubric-discretionary-placement':\n {\n const event = new CustomEvent('qti-rubric:discretionary-placement', {\n detail: { className, element: this },\n bubbles: true,\n composed: true,\n cancelable: true\n });\n const notCancelled = this.dispatchEvent(event);\n if (!notCancelled) return;\n this.setAttribute('slot', 'qti-rubric-block');\n }\n break;\n case 'qti-rubric-inline':\n this.setAttribute('slot', '');\n break;\n default:\n break;\n }\n });\n }\n\n static override styles = css`\n :host {\n display: block;\n }\n `;\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-rubric-block': QtiRubricBlock;\n }\n}\n","import { LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport type { PropertyValueMap } from 'lit';\n\n@customElement('qti-stylesheet')\nexport class QtiStylesheet extends LitElement {\n #styleElement: HTMLStyleElement | null = null;\n\n protected override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n super.firstUpdated(_changedProperties);\n\n const link = this.getAttribute('href');\n\n if (link !== null) {\n // Fetch the stylesheet content\n fetch(link)\n .then(response => response.text())\n .then(cssContent => {\n // Minify the CSS content by removing whitespace and comments\n const minifiedCss = this.#minifyCss(cssContent);\n\n // Create a <style> element with @scope surrounding the minified CSS\n this.#styleElement = document.createElement('style');\n this.#styleElement.media = 'screen';\n this.#styleElement.textContent = `@scope {${minifiedCss}}`;\n\n // Append the style element to the parent element of this component\n if (this.parentElement) {\n this.parentElement.appendChild(this.#styleElement);\n } else {\n console.warn('No parent element to append the scoped stylesheet to.');\n }\n })\n .catch(error => {\n console.error('Failed to load stylesheet:', error);\n });\n }\n\n if (this.textContent !== null && this.textContent.trim() !== '') {\n // Minify the inline CSS content\n const minifiedCss = this.#minifyCss(this.textContent);\n\n // Directly create a <style> element with the @scope surrounding the minified inline styles\n this.#styleElement = document.createElement('style');\n this.#styleElement.media = 'screen';\n this.#styleElement.textContent = `@scope {${minifiedCss}}`;\n\n // Append the style element to the parent element of this component\n if (this.parentElement) {\n this.parentElement.appendChild(this.#styleElement);\n } else {\n console.warn('No parent element to append the scoped stylesheet to.');\n }\n }\n }\n\n #minifyCss(cssContent: string): string {\n // Remove comments, whitespace, and newline characters\n return cssContent\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '') // Remove comments\n .replace(/\\s+/g, ' ') // Collapse whitespace\n .replace(/\\s*([{}:;])\\s*/g, '$1') // Remove spaces around {}, :, ;\n .trim(); // Trim leading/trailing whitespace\n }\n\n override disconnectedCallback() {\n if (this.#styleElement) {\n try {\n this.#styleElement.remove();\n } catch (error) {\n console.error('Could not remove stylesheet:', error);\n }\n }\n super.disconnectedCallback();\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-stylesheet': QtiStylesheet;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { itemContext } from '@qti-components/base';\nimport { QtiVariableDeclaration } from '@qti-components/base';\n\nimport type { QtiAreaMapping } from '@qti-components/base';\nimport type { BaseType, Cardinality } from '@qti-components/base';\nimport type { ResponseVariable } from '@qti-components/base';\nimport type { QtiMapping } from '@qti-components/base';\nimport type { ItemContext } from '@qti-components/base';\n\n@customElement('qti-response-declaration')\nexport class QtiResponseDeclaration extends QtiVariableDeclaration {\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType;\n\n @property({ type: String }) identifier: string;\n\n @property({ type: String }) cardinality: Cardinality;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n public itemContext?: ItemContext;\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n const value = this.itemContext?.variables.find(v => v.identifier === this.identifier)?.value;\n return html`${JSON.stringify(value, null, 2)}`;\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n const defaultValue = this.defaultValues(this.cardinality);\n\n const responseVariable: ResponseVariable = {\n baseType: this.baseType,\n identifier: this.identifier,\n correctResponse: this.#correctResponse,\n cardinality: this.cardinality || 'single',\n mapping: this.#mapping,\n defaultValue,\n areaMapping: this.#areaMapping,\n value: null,\n type: 'response',\n candidateResponse: null\n };\n responseVariable.value = defaultValue;\n\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable: responseVariable }\n })\n );\n }\n\n get #correctResponse(): string | string[] {\n let result: string | string[];\n const correctResponse = this.querySelector('qti-correct-response');\n if (correctResponse) {\n const values = correctResponse.querySelectorAll('qti-value');\n if (this.cardinality === 'single' && values.length > 0) {\n result = values[0].textContent.trim();\n values[0].remove();\n } else if (this.cardinality !== 'single') {\n result = [];\n for (let i = 0; i < values.length; i++) {\n result.push(values[i].textContent.trim());\n values[i].remove();\n }\n }\n }\n return result;\n }\n\n get #mapping(): QtiMapping {\n const mappingElement = this.querySelector('qti-mapping');\n const lowerBound = parseFloat(mappingElement?.getAttribute('lower-bound'));\n const uppperBound = parseFloat(mappingElement?.getAttribute('upper-bound'));\n const mappingValue = {\n defaultValue: Number(mappingElement?.getAttribute('default-value')) || 0,\n lowerBound: isNaN(lowerBound) ? null : lowerBound,\n upperBound: isNaN(uppperBound) ? null : uppperBound,\n mapEntries: Array.from(mappingElement?.querySelectorAll('qti-map-entry') || []).map(el => ({\n mapKey: el.getAttribute('map-key') || '',\n mappedValue: Number(el.getAttribute('mapped-value')) || 0,\n caseSensitive: el.hasAttribute('case-sensitive') ? el.getAttribute('case-sensitive') !== 'false' : false\n }))\n };\n return mappingValue;\n }\n\n get #areaMapping(): QtiAreaMapping {\n const areaMappingElement = this.querySelector('qti-area-mapping') as HTMLElement;\n\n const defaultValue = Number(areaMappingElement?.getAttribute('default-value')) || 0;\n const lowerBound = parseFloat(areaMappingElement?.getAttribute('lower-bound'));\n const uppperBound = parseFloat(areaMappingElement?.getAttribute('upper-bound'));\n\n const areaMapEntries = Array.from(areaMappingElement?.querySelectorAll('qti-area-map-entry') || []).map(\n (el: HTMLElement) => ({\n shape: (el.getAttribute('shape') as 'default' | 'circle' | 'rect' | 'ellipse' | 'poly') || 'default',\n coords: el.getAttribute('coords') || '',\n mappedValue: Number(el.getAttribute('mapped-value')) || 0,\n defaultValue: Number(el.getAttribute('default-value')) || 0\n })\n );\n\n return {\n defaultValue,\n lowerBound: isNaN(lowerBound) ? null : lowerBound,\n upperBound: isNaN(uppperBound) ? null : uppperBound,\n areaMapEntries\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-response-declaration': QtiResponseDeclaration;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\n\nimport { itemContext } from '@qti-components/base';\nimport { QtiVariableDeclaration } from '@qti-components/base';\n\nimport type { BaseType, Cardinality } from '@qti-components/base';\nimport type { OutcomeVariable } from '@qti-components/base';\nimport type { ItemContext } from '@qti-components/base';\n\n@customElement('qti-outcome-declaration')\nexport class QtiOutcomeDeclaration extends QtiVariableDeclaration {\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType;\n @property({ type: String, attribute: 'external-scored' }) externalScored: 'human' | 'externalMachine' | null = null;\n @property({ type: String }) identifier: string;\n @property({ type: String }) cardinality: Cardinality;\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n public itemContext?: ItemContext;\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n const value = this.itemContext?.variables.find(v => v.identifier === this.identifier)?.value;\n return html`${JSON.stringify(value, null, 2)}`;\n }\n\n get interpolationTable(): Map<number, number> | null {\n const table = this.querySelector('qti-interpolation-table');\n if (table) {\n const entries = new Map<number, number>();\n for (const entry of table.querySelectorAll('qti-interpolation-table-entry')) {\n if (!entry.getAttribute('source-value') && entry.getAttribute('target-value')) {\n console.error('source-value or target-value is missing in qti-interpolation-table-entry');\n }\n const sourceValue = parseFloat(entry.getAttribute('source-value'));\n const targetValue = parseFloat(entry.getAttribute('target-value'));\n if (isNaN(sourceValue) || isNaN(targetValue)) {\n console.error('source-value or target-value is not a number in qti-interpolation-table-entry');\n }\n entries.set(sourceValue, targetValue);\n }\n return entries;\n }\n return null;\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n\n const defaultValue = this.defaultValues(this.cardinality);\n\n const outcomeVariable: OutcomeVariable = {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n defaultValue: defaultValue,\n type: 'outcome',\n value: null,\n interpolationTable: this.interpolationTable,\n externalScored: this.externalScored\n };\n // At runtime, outcome variables are instantiated as part of an item session.\n // Their values may be initialized with a default value and/or set during response processing.\n // If no default value is given in the declaration then the outcome variable is initialized to NULL unless the outcome is of a numeric type (integer or float) in which case it is initialized to 0.\n outcomeVariable.value = defaultValue;\n if (\n (outcomeVariable.value === null || outcomeVariable.value == undefined) &&\n (outcomeVariable.baseType === 'integer' || outcomeVariable.baseType === 'float')\n ) {\n outcomeVariable.value = '0';\n }\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable: outcomeVariable }\n })\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-outcome-declaration': QtiOutcomeDeclaration;\n }\n}\n","export const matchCorrect = `<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-match>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n <qti-correct identifier=\"RESPONSE\"></qti-correct>\n </qti-match>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">1</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>`;\n\nexport const mapResponse = `<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0.0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-map-response identifier=\"RESPONSE\"> </qti-map-response>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>`;\n\nexport const mapResponsePoint = `<qti-response-processing>\n <qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-map-response-point identifier=\"RESPONSE\"></qti-map-response-point>\n </qti-set-outcome-value>\n </qti-response-else>\n </qti-response-condition>\n</qti-response-processing>`;\n","import { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { type QtiRuleBase } from '@qti-components/base';\n\nimport { mapResponse, mapResponsePoint, matchCorrect } from '../../internal/template-strings';\n\nimport type { PropertyValueMap } from 'lit';\n\n@customElement('qti-response-processing')\nexport class QtiResponseProcessing extends LitElement {\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n\n public process() {\n const assessmentItem = this.closest('qti-assessment-item');\n if (!assessmentItem) return;\n const rules = [...this.children] as unknown as QtiRuleBase[];\n for (const rule of rules) {\n rule.process();\n }\n }\n\n public override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n if (this.getAttribute('template')) {\n const splittedTemplateName = this.getAttribute('template')!.split('/');\n const templateName = splittedTemplateName[splittedTemplateName.length - 1].replace('.xml', '');\n this.innerHTML = '';\n switch (templateName) {\n case 'map_response': {\n this.appendChild(this.#fragmentFromString(mapResponse).firstElementChild.firstElementChild);\n break;\n }\n case 'map_response_point': {\n this.appendChild(this.#fragmentFromString(mapResponsePoint).firstElementChild.firstElementChild);\n break;\n }\n case 'match_correct':\n this.appendChild(this.#fragmentFromString(matchCorrect).firstElementChild.firstElementChild);\n break;\n }\n }\n }\n\n #fragmentFromString(strHTML: string) {\n return document.createRange().createContextualFragment(strHTML);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-response-processing': QtiResponseProcessing;\n }\n}\n","import { css, LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport type { TemplateVariable } from '@qti-components/base';\nimport type { BaseType } from '@qti-components/base';\n\n/**\n * @summary The qti-template-declaration element declares template variables for item cloning.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-declaration\n */\n@customElement('qti-template-declaration')\nexport class QtiTemplateDeclaration extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) cardinality: 'single' | 'multiple' | 'ordered' | 'record' = 'single';\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType = 'string';\n @property({ type: Boolean, attribute: 'math-variable' }) mathVariable: boolean = false;\n @property({ type: Boolean, attribute: 'param-variable' }) paramVariable: boolean = false;\n\n #defaultValue: any = null;\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.updateComplete.then(() => {\n this.#processDefaultValue();\n this.#registerTemplateVariable();\n });\n }\n\n /**\n * Process qti-default-value to extract the default value\n */\n #processDefaultValue(): void {\n const defaultValueElement = this.querySelector('qti-default-value');\n if (!defaultValueElement) {\n return;\n }\n\n // For now, just get the text content - this could be enhanced to handle expressions\n const textContent = defaultValueElement.textContent?.trim() || '';\n this.#defaultValue = this.#convertValue(textContent);\n }\n\n /**\n * Convert string value based on base-type\n */\n #convertValue(value: string): any {\n if (!value) return null;\n\n switch (this.baseType) {\n case 'integer':\n return parseInt(value, 10);\n case 'float':\n case 'duration':\n return parseFloat(value);\n case 'boolean':\n return value.toLowerCase() === 'true';\n case 'string':\n default:\n return value;\n }\n }\n\n /**\n * Register this template variable with the assessment item\n */\n #registerTemplateVariable(): void {\n const templateVariable: TemplateVariable = {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n defaultValue: this.#defaultValue,\n value: this.#defaultValue,\n type: 'template',\n mathVariable: this.mathVariable,\n paramVariable: this.paramVariable\n };\n\n // Dispatch event to register the variable\n\n // value must string or string[]\n const variable = { ...templateVariable, value: this.#defaultValue?.toString() || '' };\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable }\n })\n );\n }\n\n /**\n * Get the template variable definition\n */\n public getTemplateVariable(): TemplateVariable {\n return {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n value: this.#defaultValue,\n type: 'template',\n mathVariable: this.mathVariable,\n paramVariable: this.paramVariable\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-declaration': QtiTemplateDeclaration;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport type { QtiRuleBase } from '@qti-components/base';\nimport type { QtiTemplateConstraint } from '../qti-template-constraint/qti-template-constraint';\nimport type { PropertyValueMap } from 'lit';\n\n/**\n * @summary The qti-template-processing element contains template processing rules.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing\n */\n@customElement('qti-template-processing')\nexport class QtiTemplateProcessing extends LitElement {\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n #maxIterations = 100; // Prevent infinite loops in template constraints\n\n override render() {\n return html`<slot></slot>`;\n }\n\n /**\n * Process template rules to set template variable values\n */\n public process(): void {\n const assessmentItem = this.closest('qti-assessment-item');\n if (!assessmentItem) {\n console.warn('qti-template-processing must be inside qti-assessment-item');\n return;\n }\n\n let iterations = 0;\n let shouldReprocess = false;\n\n do {\n shouldReprocess = false;\n iterations++;\n\n if (iterations > this.#maxIterations) {\n console.error('Template processing exceeded maximum iterations. Possible infinite loop.');\n break;\n }\n\n try {\n const rules = [...this.children] as unknown as (Element & QtiRuleBase)[];\n for (const rule of rules) {\n // Check if this is a template constraint that failed\n if (rule.tagName.toLowerCase() === 'qti-template-constraint') {\n const constraintResult = (rule as QtiTemplateConstraint).calculate();\n if (constraintResult === false) {\n // Template constraint failed, restart processing\n shouldReprocess = true;\n break;\n }\n } else {\n rule.process();\n }\n }\n } catch (error) {\n console.error('Error during template processing:', error);\n break;\n }\n } while (shouldReprocess);\n\n // Dispatch event that template processing is complete\n this.dispatchEvent(\n new CustomEvent('qti-template-processing-complete', {\n bubbles: true,\n composed: true,\n detail: { iterations }\n })\n );\n }\n\n public override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n // Template processing doesn't typically use external templates like response processing\n // But we could add support for common template processing patterns here if needed\n if (this.getAttribute('template')) {\n console.info('Template processing with external template not yet implemented');\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-processing': QtiTemplateProcessing;\n }\n}\n","import { LitElement, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport type { QtiExpression } from '@qti-components/base';\nimport type { QtiRuleBase } from '@qti-components/base';\n\n/**\n * @summary The qti-template-constraint element is a processing rule available only in Template Processing.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-constraint\n *\n * It terminates Template Processing and re-runs it from the beginning if the condition\n * specified in the template constraint is not satisfied. This can be used to iterate\n * the Template Processing with different randomly-generated values until a predetermined\n * condition is satisfied.\n */\n@customElement('qti-template-constraint')\nexport class QtiTemplateConstraint extends LitElement implements QtiRuleBase {\n override render() {\n return html`<slot></slot>`;\n }\n\n /**\n * Evaluates the constraint condition\n * @returns true if constraint is satisfied, false if template processing should restart\n */\n public calculate(): boolean {\n const expressions = [...this.children] as QtiExpression<boolean>[];\n\n if (expressions.length !== 1) {\n console.error('qti-template-constraint must have exactly one child expression');\n return true; // Don't restart on error\n }\n\n try {\n const result = expressions[0].calculate();\n return Boolean(result);\n } catch (error) {\n console.error('Error evaluating template constraint:', error);\n return true; // Don't restart on error\n }\n }\n\n /**\n * Template constraints don't have sub-rules like conditions\n */\n public getSubRules(): QtiRuleBase[] {\n return [];\n }\n\n /**\n * Process the template constraint\n * @returns true if constraint is satisfied, false if template processing should restart\n */\n public process(): boolean {\n const constraintSatisfied = this.calculate();\n\n if (!constraintSatisfied) {\n console.debug('Template constraint not satisfied, restarting template processing');\n }\n\n return constraintSatisfied;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-constraint': QtiTemplateConstraint;\n }\n}\n","import { css, LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\n/**\n * @summary The qti-context-declaration element declares context variables for an item.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.qti-context-declaration\n */\n@customElement('qti-context-declaration')\nexport class QtiContextDeclaration extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) cardinality: 'single' | 'multiple' | 'ordered' | 'record' = 'record';\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-context-declaration': QtiContextDeclaration;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AA8BO,IAAM,oBAAN,cAAgCA,GAAW;AAAA,EAA3C;AAAA;AAAA;AACL;AACA,4CAAoD;AAExB,sBAAqB;AACrB,oBAA6B;AAC7B,yBAAyC;AAcrE,SAAU,wBAAwB,CAAC,GAAY,aAAsB;AACnE,yBAAK,sBAAqB,QAAQ,QAAO,GAAG,WAAW,QAAS;AAAA,IAClE;AAIA,SAAU,wBAAwB,CAAC,GAAY,aAC7C,mBAAK,sBAAqB,QAAQ,QAAO,GAAG,WAAW,QAAS;AAGlE,SAAQ,WAAwB;AAAA,MAC9B,WAAW;AAAA,IACb;AA4EA,wCAAyC,EAAE,GAAG,KAAK,UAAU,WAAW,KAAK,SAAS,UAAU;AAChG,0CAAmC,CAAC;AACpC,6CAAsC,CAAC;AAmEvC,gDAA0B,CAACC,OAA2B;AACpD,MAAAA,GAAE,yBAAyB;AAC3B,WAAK,WAAW,EAAE,GAAG,KAAK,UAAU,WAAW,CAAC,GAAG,KAAK,SAAS,WAAWA,GAAE,OAAO,QAAQ,EAAE;AAC/F,yBAAK,iBAAkB,KAAK;AAC5B,MAAAA,GAAE,gBAAgB;AAAA,IACpB;AAEA,gDAA0B,CAACA,OAAgC;AACzD,MAAAA,GAAE,yBAAyB;AAC3B,YAAM,kBAAkBA,GAAE;AAC1B,yBAAK,mBAAkB,KAAK,eAAe;AAC3C,YAAM,cAAc,OAAO,KAAK,SAAS,UAAU,KAAK,OAAK,EAAE,eAAe,aAAa,GAAG,KAAK,KAAK;AACxG,UAAI,cAAc,GAAG;AACnB,wBAAgB,kBAAkB,gBAAgB,iBAAiB;AAAA,MACrE;AAAA,IACF;AAE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EAAc,yBAAyB;AAAA,GAC3B;","names":["i","e","i","i","i","e","i","i","i","i","i","i","i","i","i","i"]}
@@ -3,7 +3,7 @@ import {
3
3
  e3 as e,
4
4
  f,
5
5
  n2 as n
6
- } from "./chunk-A7HX4462.js";
6
+ } from "./chunk-Z2SUBRH5.js";
7
7
 
8
8
  // ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/private-async-helpers.js
9
9
  var s = class {
@@ -3670,4 +3670,4 @@ lit-html/node/directives/until.js:
3670
3670
  * SPDX-License-Identifier: BSD-3-Clause
3671
3671
  *)
3672
3672
  */
3673
- //# sourceMappingURL=chunk-CVB5ISWF.js.map
3673
+ //# sourceMappingURL=chunk-LQZCSHN5.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  A
3
- } from "./chunk-A7HX4462.js";
3
+ } from "./chunk-Z2SUBRH5.js";
4
4
 
5
5
  // ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/node/directives/if-defined.js
6
6
  var o = (o2) => o2 ?? A;
@@ -17,4 +17,4 @@ lit-html/node/directives/if-defined.js:
17
17
  * SPDX-License-Identifier: BSD-3-Clause
18
18
  *)
19
19
  */
20
- //# sourceMappingURL=chunk-DGIXWHK3.js.map
20
+ //# sourceMappingURL=chunk-N7S3GNUP.js.map