@citolab/qti-components 8.0.2 → 8.2.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 (64) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +751 -813
  3. package/dist/base.d.ts +63 -6
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-CK7AV2UJ.js → chunk-43XBJ47H.js} +3 -3
  6. package/dist/{chunk-7V4HJFHW.js → chunk-6ITD55QE.js} +2 -2
  7. package/dist/{chunk-HQESINXH.js → chunk-7D3NKAGZ.js} +137 -3
  8. package/dist/chunk-7D3NKAGZ.js.map +1 -0
  9. package/dist/{chunk-HBSWJC3B.js → chunk-CRLXQZFA.js} +595 -260
  10. package/dist/chunk-CRLXQZFA.js.map +1 -0
  11. package/dist/{chunk-IJD53WY6.js → chunk-HDEG6BAZ.js} +15 -15
  12. package/dist/{chunk-IJD53WY6.js.map → chunk-HDEG6BAZ.js.map} +1 -1
  13. package/dist/{chunk-RSVRS5AK.js → chunk-LMGJOBJA.js} +4 -4
  14. package/dist/{chunk-ZII6M3SN.js → chunk-M7K5C522.js} +2 -2
  15. package/dist/{chunk-J5SQLKNP.js → chunk-OIUK5BFU.js} +22 -6
  16. package/dist/{chunk-J5SQLKNP.js.map → chunk-OIUK5BFU.js.map} +1 -1
  17. package/dist/{chunk-VAE6HBKR.js → chunk-OVBG223G.js} +88 -62
  18. package/dist/chunk-OVBG223G.js.map +1 -0
  19. package/dist/{chunk-TWPXES3S.js → chunk-Q6ZK4LRH.js} +30 -6
  20. package/dist/chunk-Q6ZK4LRH.js.map +1 -0
  21. package/dist/chunk-TLTYXWW7.js +7 -0
  22. package/dist/chunk-TLTYXWW7.js.map +1 -0
  23. package/dist/{chunk-NJQHUUTN.js → chunk-U7YCXDYC.js} +2 -2
  24. package/dist/{chunk-BQFWCZFH.js → chunk-UC3T3NI3.js} +2 -2
  25. package/dist/{chunk-7AVWRQIS.js → chunk-YLRMOX6C.js} +63 -77
  26. package/dist/chunk-YLRMOX6C.js.map +1 -0
  27. package/dist/{computed.types.d-DpKIYO6e.d.ts → computed.types.d-CJarqC6s.d.ts} +12 -0
  28. package/dist/corrections.d.ts +14 -4
  29. package/dist/corrections.js +8 -8
  30. package/dist/elements.d.ts +1 -2
  31. package/dist/elements.js +4 -4
  32. package/dist/index.d.ts +7 -7
  33. package/dist/index.js +30 -14
  34. package/dist/interactions.js +3 -3
  35. package/dist/item.css +451 -532
  36. package/dist/item.d.ts +1 -1
  37. package/dist/item.js +5 -5
  38. package/dist/loader.d.ts +1 -1
  39. package/dist/loader.js +2 -2
  40. package/dist/processing.d.ts +64 -14
  41. package/dist/processing.js +10 -2
  42. package/dist/qti-components-jsx.d.ts +8139 -7358
  43. package/dist/{qti-condition-expression.d-aMvBvpc6.d.ts → qti-condition-expression.d-CYwXOUb1.d.ts} +1 -1
  44. package/dist/{qti-expression.d-BietT_8b.d.ts → qti-expression.d-B_-m9emA.d.ts} +11 -1
  45. package/dist/{qti-feedback.d-DZbad0RN.d.ts → qti-feedback.d-B1EIF-fU.d.ts} +1 -0
  46. package/dist/{qti-test.d-_YAlhDbt.d.ts → qti-test.d-C6lCEMRB.d.ts} +38 -3
  47. package/dist/test.d.ts +5 -5
  48. package/dist/test.js +8 -6
  49. package/dist/transformers.d.ts +1 -1
  50. package/dist/transformers.js +1 -1
  51. package/package.json +9 -9
  52. package/dist/chunk-7AVWRQIS.js.map +0 -1
  53. package/dist/chunk-G6GFQDVN.js +0 -7
  54. package/dist/chunk-G6GFQDVN.js.map +0 -1
  55. package/dist/chunk-HBSWJC3B.js.map +0 -1
  56. package/dist/chunk-HQESINXH.js.map +0 -1
  57. package/dist/chunk-TWPXES3S.js.map +0 -1
  58. package/dist/chunk-VAE6HBKR.js.map +0 -1
  59. /package/dist/{chunk-CK7AV2UJ.js.map → chunk-43XBJ47H.js.map} +0 -0
  60. /package/dist/{chunk-7V4HJFHW.js.map → chunk-6ITD55QE.js.map} +0 -0
  61. /package/dist/{chunk-RSVRS5AK.js.map → chunk-LMGJOBJA.js.map} +0 -0
  62. /package/dist/{chunk-ZII6M3SN.js.map → chunk-M7K5C522.js.map} +0 -0
  63. /package/dist/{chunk-NJQHUUTN.js.map → chunk-U7YCXDYC.js.map} +0 -0
  64. /package/dist/{chunk-BQFWCZFH.js.map → chunk-UC3T3NI3.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { Q as QtiExpression } from './qti-expression.d-BietT_8b.js';
1
+ import { Q as QtiExpression } from './qti-expression.d-B_-m9emA.js';
2
2
 
3
3
  declare abstract class QtiConditionExpression extends QtiExpression<boolean> {
4
4
  calculate(): Readonly<boolean>;
@@ -1,6 +1,6 @@
1
- import { I as ItemContext, V as VariableDeclaration, f as ResponseVariable } from './item.types.d-QU7LljEK.js';
2
1
  import * as lit from 'lit';
3
2
  import { LitElement } from 'lit';
3
+ import { I as ItemContext, V as VariableDeclaration, f as ResponseVariable } from './item.types.d-QU7LljEK.js';
4
4
  import { Q as QtiContext, a as QtiContextType } from './qti.context.d-CejJMlfZ.js';
5
5
 
6
6
  interface TestContext {
@@ -25,6 +25,16 @@ declare abstract class QtiExpression<T> extends LitElement implements QtiExpress
25
25
  protected getResult(): Readonly<T>;
26
26
  protected context?: ItemContext;
27
27
  protected qtiContext?: QtiContext;
28
+ protected _testContext?: TestContext;
29
+ /**
30
+ * Resolve a declared variable from the closest available scope: item-level
31
+ * first, then the test-level outcome variables. So an expression used in an
32
+ * assessmentTest's outcome processing can reference a test-level outcome
33
+ * (e.g. a total set earlier in the same run) — which the QTI variable
34
+ * expression is specified to do. Returns null when unresolved rather than
35
+ * throwing, so callers degrade gracefully.
36
+ */
37
+ protected resolveVariable(identifier: string): VariableDeclaration<string | string[] | null> | null;
28
38
  getVariables: () => (ResponseVariable | VariableDeclaration<QtiContextType>)[];
29
39
  }
30
40
 
@@ -14,6 +14,7 @@ declare abstract class QtiFeedback extends LitElement {
14
14
  protected identifier: string;
15
15
  showStatus: string;
16
16
  private _context?;
17
+ private _computedContext?;
17
18
  connectedCallback(): void;
18
19
  checkShowFeedback(outcomeIdentifier: string): void;
19
20
  }
@@ -3,9 +3,9 @@ import { LitElement, PropertyValues, nothing } from 'lit';
3
3
  import { t as transformItemApi, b as transformTestApi } from './qti-transform-test.d-BL7GGFJj.js';
4
4
  import { QtiAssessmentItem, QtiModalFeedback } from './elements.js';
5
5
  import { TemplateFunction } from '@heximal/templates';
6
- import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-BietT_8b.js';
6
+ import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-B_-m9emA.js';
7
7
  import { g as VariableValue, b as OutcomeVariable, V as VariableDeclaration } from './item.types.d-QU7LljEK.js';
8
- import { S as SessionContext, C as ComputedContext, a as ComputedItem, V as View } from './computed.types.d-DpKIYO6e.js';
8
+ import { S as SessionContext, C as ComputedContext, a as ComputedItem, V as View } from './computed.types.d-CJarqC6s.js';
9
9
  import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
10
10
  import { Q as QtiRuleBase } from './qti-rule-base.d-ajOnfGXY.js';
11
11
  import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
@@ -66,6 +66,27 @@ declare global {
66
66
  }
67
67
  }
68
68
 
69
+ /**
70
+ * @summary The qti-item-session-control element contains configurations relating to flow of test sessions.
71
+ * @documentation https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/imsqti_asi_v3p0p1_infomodel_v1p0.html#Derived_ItemSessionControl
72
+ */
73
+ declare class QtiItemSessionControl extends LitElement {
74
+ maxAttempts: number;
75
+ showFeedback: boolean;
76
+ allowReview: boolean;
77
+ showSolution: boolean;
78
+ allowComment: boolean;
79
+ allowSkipping: boolean;
80
+ validateResponses: boolean;
81
+ connectedCallback(): Promise<void>;
82
+ render(): lit.TemplateResult<1>;
83
+ }
84
+ declare global {
85
+ interface HTMLElementTagNameMap {
86
+ 'qti-item-session-control': QtiItemSessionControl;
87
+ }
88
+ }
89
+
69
90
  declare class QtiOutcomeProcessing extends LitElement {
70
91
  static styles: lit.CSSResult[];
71
92
  render(): lit.TemplateResult<1>;
@@ -191,6 +212,15 @@ declare class TestNavigation extends LitElement {
191
212
  protected computedContext: ComputedContext;
192
213
  autoScoreItems: boolean;
193
214
  constructor();
215
+ /**
216
+ * Extension point for presentation packages reacting to an ended attempt.
217
+ * `done` is settled here — from the freshly latched optimality and the
218
+ * session-control cascade — because the computed context only catches up on
219
+ * the next update, after this event has finished bubbling.
220
+ */
221
+ protected afterAttemptEnded(_assessmentItem: QtiAssessmentItem | undefined, _computedItem: ComputedItem | undefined, _done: boolean): void;
222
+ /** The computed-context entry for an item, from the session-control cascade. */
223
+ protected computedItemFor(identifier: string): ComputedItem | undefined;
194
224
  /** The currently active assessment item, exposed for optional presentation extensions. */
195
225
  protected get activeAssessmentItem(): QtiAssessmentItem | undefined;
196
226
  render(): lit.TemplateResult<1>;
@@ -298,8 +328,13 @@ declare global {
298
328
  }
299
329
 
300
330
  declare class TestEndAttempt extends LitElement {
331
+ protected computedContext: ComputedContext;
332
+ _internalDisabled: boolean;
333
+ _handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext): void;
301
334
  static styles: lit.CSSResult;
302
335
  constructor();
336
+ willUpdate(_changedProperties: Map<string | number | symbol, unknown>): void;
337
+ checkDisabled(): void;
303
338
  render(): lit.TemplateResult<1>;
304
339
  }
305
340
  declare global {
@@ -699,4 +734,4 @@ declare global {
699
734
  }
700
735
  }
701
736
 
702
- export { TestTtsPlay as A, TestTtsPrev as B, TestTtsResume as C, TestTtsStop as D, TestView as E, TestViewToggle as F, type TtsContext as G, ttsContext as H, type ITestNavigationMixin as I, QtiAssessmentItemRef as Q, type SpeechState as S, TestCheckItem as T, QtiAssessmentSection as a, QtiAssessmentTest as b, QtiOutcomeProcessing as c, QtiOutcomeProcessingProcessor as d, QtiTest as e, QtiTestFeedback as f, QtiTestPart as g, QtiTestVariables as h, QtiTestVariablesExpression as i, TestContainer as j, TestEndAttempt as k, TestItemLink as l, TestItemToSpeech as m, TestNavigation as n, TestNext as o, TestPagingButtonsStamp as p, TestPrev as q, TestPrintContext as r, TestPrintVariables as s, TestScoringButtons as t, TestScoringFeedback as u, TestSectionButtonsStamp as v, TestSectionLink as w, TestStamp as x, TestTtsNext as y, TestTtsPause as z };
737
+ export { TestTtsPause as A, TestTtsPlay as B, TestTtsPrev as C, TestTtsResume as D, TestTtsStop as E, TestView as F, TestViewToggle as G, type TtsContext as H, type ITestNavigationMixin as I, ttsContext as J, QtiAssessmentItemRef as Q, type SpeechState as S, TestCheckItem as T, QtiAssessmentSection as a, QtiAssessmentTest as b, QtiItemSessionControl as c, QtiOutcomeProcessing as d, QtiOutcomeProcessingProcessor as e, QtiTest as f, QtiTestFeedback as g, QtiTestPart as h, QtiTestVariables as i, QtiTestVariablesExpression as j, TestContainer as k, TestEndAttempt as l, TestItemLink as m, TestItemToSpeech as n, TestNavigation as o, TestNext as p, TestPagingButtonsStamp as q, TestPrev as r, TestPrintContext as s, TestPrintVariables as t, TestScoringButtons as u, TestScoringFeedback as v, TestSectionButtonsStamp as w, TestSectionLink as x, TestStamp as y, TestTtsNext as z };
package/dist/test.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { I as ITestNavigationMixin } from './qti-test.d-_YAlhDbt.js';
2
- export { Q as QtiAssessmentItemRef, a as QtiAssessmentSection, b as QtiAssessmentTest, c as QtiOutcomeProcessing, d as QtiOutcomeProcessingProcessor, e as QtiTest, f as QtiTestFeedback, g as QtiTestPart, h as QtiTestVariables, i as QtiTestVariablesExpression, S as SpeechState, T as TestCheckItem, j as TestContainer, k as TestEndAttempt, l as TestItemLink, m as TestItemToSpeech, n as TestNavigation, o as TestNext, p as TestPagingButtonsStamp, q as TestPrev, r as TestPrintContext, s as TestPrintVariables, t as TestScoringButtons, u as TestScoringFeedback, v as TestSectionButtonsStamp, w as TestSectionLink, x as TestStamp, y as TestTtsNext, z as TestTtsPause, A as TestTtsPlay, B as TestTtsPrev, C as TestTtsResume, D as TestTtsStop, E as TestView, F as TestViewToggle, G as TtsContext, H as ttsContext } from './qti-test.d-_YAlhDbt.js';
1
+ import { I as ITestNavigationMixin } from './qti-test.d-C6lCEMRB.js';
2
+ export { Q as QtiAssessmentItemRef, a as QtiAssessmentSection, b as QtiAssessmentTest, c as QtiItemSessionControl, d as QtiOutcomeProcessing, e as QtiOutcomeProcessingProcessor, f as QtiTest, g as QtiTestFeedback, h as QtiTestPart, i as QtiTestVariables, j as QtiTestVariablesExpression, S as SpeechState, T as TestCheckItem, k as TestContainer, l as TestEndAttempt, m as TestItemLink, n as TestItemToSpeech, o as TestNavigation, p as TestNext, q as TestPagingButtonsStamp, r as TestPrev, s as TestPrintContext, t as TestPrintVariables, u as TestScoringButtons, v as TestScoringFeedback, w as TestSectionButtonsStamp, x as TestSectionLink, y as TestStamp, z as TestTtsNext, A as TestTtsPause, B as TestTtsPlay, C as TestTtsPrev, D as TestTtsResume, E as TestTtsStop, F as TestView, G as TestViewToggle, H as TtsContext, J as ttsContext } from './qti-test.d-C6lCEMRB.js';
3
3
  import { LitElement } from 'lit';
4
4
  import { g as VariableValue, b as OutcomeVariable, V as VariableDeclaration } from './item.types.d-QU7LljEK.js';
5
- import { S as SessionContext } from './computed.types.d-DpKIYO6e.js';
5
+ import { S as SessionContext } from './computed.types.d-CJarqC6s.js';
6
6
  import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
7
- import { T as TestContext } from './qti-expression.d-BietT_8b.js';
7
+ import { T as TestContext } from './qti-expression.d-B_-m9emA.js';
8
8
  import './qti-transform-test.d-BL7GGFJj.js';
9
9
  import './elements.js';
10
10
  import './interaction.interface.d-CvjHM2bi.js';
11
- import './qti-feedback.d-DZbad0RN.js';
11
+ import './qti-feedback.d-B1EIF-fU.js';
12
12
  import './qti-rule-base.d-ajOnfGXY.js';
13
13
  import '@heximal/templates';
14
14
  import './qti.context.d-CejJMlfZ.js';
package/dist/test.js CHANGED
@@ -1,8 +1,9 @@
1
- import "./chunk-BQFWCZFH.js";
1
+ import "./chunk-UC3T3NI3.js";
2
2
  import {
3
3
  QtiAssessmentItemRef,
4
4
  QtiAssessmentSection,
5
5
  QtiAssessmentTest,
6
+ QtiItemSessionControl,
6
7
  QtiOutcomeProcessing,
7
8
  QtiOutcomeProcessingProcessor,
8
9
  QtiTest,
@@ -35,16 +36,17 @@ import {
35
36
  TestView,
36
37
  TestViewToggle,
37
38
  ttsContext
38
- } from "./chunk-HBSWJC3B.js";
39
- import "./chunk-7AVWRQIS.js";
40
- import "./chunk-G6GFQDVN.js";
39
+ } from "./chunk-CRLXQZFA.js";
40
+ import "./chunk-YLRMOX6C.js";
41
+ import "./chunk-TLTYXWW7.js";
41
42
  import "./chunk-4DB4SC5K.js";
42
- import "./chunk-IJD53WY6.js";
43
- import "./chunk-HQESINXH.js";
43
+ import "./chunk-HDEG6BAZ.js";
44
+ import "./chunk-7D3NKAGZ.js";
44
45
  export {
45
46
  QtiAssessmentItemRef,
46
47
  QtiAssessmentSection,
47
48
  QtiAssessmentTest,
49
+ QtiItemSessionControl,
48
50
  QtiOutcomeProcessing,
49
51
  QtiOutcomeProcessingProcessor,
50
52
  QtiTest,
@@ -2,7 +2,7 @@ export { M as ModuleResolutionConfig, q as qtiTransformItem, a as qtiTransformTe
2
2
 
3
3
  declare const qtiTransformManifest: () => {
4
4
  load: (uri: string, signal?: AbortSignal) => Promise<{
5
- load(uri: string, signal: AbortSignal): Promise</*elided*/ any>;
5
+ load(uri: string, signal?: AbortSignal): Promise</*elided*/ any>;
6
6
  parse(xmlString: string): void;
7
7
  assessmentTest(): {
8
8
  href: string;
@@ -2,7 +2,7 @@ import {
2
2
  qtiTransformItem,
3
3
  qtiTransformManifest,
4
4
  qtiTransformTest
5
- } from "./chunk-IJD53WY6.js";
5
+ } from "./chunk-HDEG6BAZ.js";
6
6
  export {
7
7
  qtiTransformItem,
8
8
  qtiTransformManifest,
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@citolab/qti-components",
3
3
  "description": "QTI component utilities",
4
- "version": "8.0.2",
4
+ "version": "8.2.0",
5
5
  "author": "",
6
6
  "dependencies": {
7
7
  "@heximal/templates": "^0.1.5",
8
8
  "@lit/context": "^1.1.6",
9
- "lit": "^3.3.2"
9
+ "lit": "^3.3.3"
10
10
  },
11
11
  "devDependencies": {
12
- "@qti-components/base": "^2.0.1",
12
+ "@qti-components/base": "^2.2.0",
13
+ "@qti-components/corrections": "^0.3.0",
14
+ "@qti-components/elements": "^1.7.0",
13
15
  "@qti-components/interactions": "^1.10.4",
14
16
  "@qti-components/item": "^1.4.3",
15
- "@qti-components/elements": "^1.6.4",
16
- "@qti-components/corrections": "^0.2.0",
17
17
  "@qti-components/loader": "^1.3.3",
18
- "@qti-components/processing": "^1.3.4",
19
- "@qti-components/test": "^1.5.4",
20
- "@qti-components/theme": "^2.0.1",
21
- "@qti-components/transformers": "^1.7.1"
18
+ "@qti-components/processing": "^1.4.1",
19
+ "@qti-components/test": "^1.6.0",
20
+ "@qti-components/theme": "^2.1.0",
21
+ "@qti-components/transformers": "^1.7.2"
22
22
  },
23
23
  "exports": {
24
24
  ".": {
@@ -1 +0,0 @@
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-content-body/qti-content-body.ts","../../qti-elements/src/components/qti-context-declaration/qti-context-declaration.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-item-body/qti-item-body.ts","../../qti-elements/src/components/qti-item-body/qti-item-body.styles.ts","../../qti-elements/src/components/qti-modal-feedback/qti-modal-feedback.ts","../../qti-elements/src/components/qti-outcome-declaration/qti-outcome-declaration.ts","../../qti-elements/src/components/qti-response-declaration/qti-response-declaration.ts","../../qti-elements/src/components/qti-response-processing/qti-response-processing.ts","../../qti-elements/src/internal/template-strings.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-template-constraint/qti-template-constraint.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/elements.ts"],"sourcesContent":["import { provide } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { 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 { RegisteredInteraction } 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';\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\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: RegisteredInteraction) => 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 /** Registered candidate-input interactions. Correction packages may extend their presentation behavior. */\n protected interactionElements: RegisteredInteraction[] = [];\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: RegisteredInteraction | 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: RegisteredInteraction }>) => {\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 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 /** Extension point for presentation packages reacting to a candidate response change. */\n protected afterResponseVariableUpdated(): void {}\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 this.afterResponseVariableUpdated();\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 { 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\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';\n\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 { state } from 'lit/decorators.js';\n\nimport { itemContext } from '@qti-components/base';\n\nimport type { ItemContext, TemplateVariable } from '@qti-components/base';\n\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 (\n templateVariable.mathVariable !== true ||\n templateVariable.value === null ||\n templateVariable.value === undefined\n ) {\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 { css, LitElement, html } from 'lit';\nimport { 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\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","import { consume } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { 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\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';\n\nimport { QtiFeedback } from '@qti-components/base';\n\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 { ifDefined } from 'lit/directives/if-defined.js';\n\nimport { QtiFeedback } from '@qti-components/base';\n\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 { 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\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 { css } from 'lit';\n\nexport default css`\n :host {\n display: block;\n }\n`;\n","import { css, html } from 'lit';\n\nimport { QtiFeedback } from '@qti-components/base';\n\nexport class QtiModalFeedback extends QtiFeedback {\n static override styles = css`\n .cito-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-box);\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-box);\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 /* Inlined from --qti-disabled-bg / --qti-disabled-color, which this button was the only reader\n of anywhere in the repo. They were named as a global disabled vocabulary but no interaction\n ever used them: the theme's disabled treatment is cursor only (see the note in qti-mixins.css). */\n .button:disabled {\n background-color: transparent;\n color: var(--qti-fg);\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=\"cito-dialog\" part=\"feedback\" ?open=\"${this.showStatus === 'on'}\">\n <slot></slot>\n <div style=\"margin-top: var(--qti-gap); 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 { consume } from '@lit/context';\nimport { css, html } from 'lit';\nimport { 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\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","import { consume } from '@lit/context';\nimport { css, html } from 'lit';\nimport { 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\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 { css, html, LitElement } from 'lit';\n\nimport { type QtiRuleBase } from '@qti-components/base';\n\nimport { mapResponse, mapResponsePoint, matchCorrect } from '../../internal/template-strings';\n\nimport type { PropertyValueMap } from 'lit';\n\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","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 { LitElement, css, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { watch } from '@qti-components/utilities';\n\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';\n\nimport type { PropertyValueMap } from 'lit';\n\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 { LitElement, html } from 'lit';\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\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 { 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\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';\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\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 { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';\nimport { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nimport { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';\nimport { QtiContentBody } from './components/qti-content-body/qti-content-body';\nimport { QtiContextDeclaration } from './components/qti-context-declaration/qti-context-declaration';\nimport { QtiCustomOperator } from './components/qti-custom-operator/qti-custom-operator';\nimport { QtiFeedbackBlock } from './components/qti-feedback-block/qti-feedback-block';\nimport { QtiFeedbackInline } from './components/qti-feedback-inline/qti-feedback-inline';\nimport { QtiItemBody } from './components/qti-item-body/qti-item-body';\nimport { QtiModalFeedback } from './components/qti-modal-feedback/qti-modal-feedback';\nimport { QtiOutcomeDeclaration } from './components/qti-outcome-declaration/qti-outcome-declaration';\nimport { QtiResponseDeclaration } from './components/qti-response-declaration/qti-response-declaration';\nimport { QtiResponseProcessing } from './components/qti-response-processing/qti-response-processing';\nimport { QtiRubricBlock } from './components/qti-rubric-block/qti-rubric-block';\nimport { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';\nimport { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';\nimport { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';\nimport { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';\n\nexport {\n QtiAssessmentItem,\n QtiAssessmentStimulusRef,\n QtiCompanionMaterialsInfo,\n QtiContentBody,\n QtiContextDeclaration,\n QtiCustomOperator,\n QtiFeedbackBlock,\n QtiFeedbackInline,\n QtiItemBody,\n QtiModalFeedback,\n QtiOutcomeDeclaration,\n QtiResponseDeclaration,\n QtiResponseProcessing,\n QtiRubricBlock,\n QtiStylesheet,\n QtiTemplateConstraint,\n QtiTemplateDeclaration,\n QtiTemplateProcessing\n};\n\nexport const qtiContentElements = [\n { tag: 'qti-assessment-item', ctor: QtiAssessmentItem },\n { tag: 'qti-assessment-stimulus-ref', ctor: QtiAssessmentStimulusRef },\n { tag: 'qti-companion-materials-info', ctor: QtiCompanionMaterialsInfo },\n { tag: 'qti-content-body', ctor: QtiContentBody },\n { tag: 'qti-context-declaration', ctor: QtiContextDeclaration },\n { tag: 'qti-custom-operator', ctor: QtiCustomOperator },\n { tag: 'qti-feedback-block', ctor: QtiFeedbackBlock },\n { tag: 'qti-feedback-inline', ctor: QtiFeedbackInline },\n { tag: 'qti-item-body', ctor: QtiItemBody },\n { tag: 'qti-modal-feedback', ctor: QtiModalFeedback },\n { tag: 'qti-outcome-declaration', ctor: QtiOutcomeDeclaration },\n { tag: 'qti-response-declaration', ctor: QtiResponseDeclaration },\n { tag: 'qti-response-processing', ctor: QtiResponseProcessing },\n { tag: 'qti-rubric-block', ctor: QtiRubricBlock },\n { tag: 'qti-stylesheet', ctor: QtiStylesheet },\n { tag: 'qti-template-constraint', ctor: QtiTemplateConstraint },\n { tag: 'qti-template-declaration', ctor: QtiTemplateDeclaration },\n { tag: 'qti-template-processing', ctor: QtiTemplateProcessing }\n] as const;\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,YAAY,YAAY;AACjC,SAAS,gBAAgB;;;;;;;AA0BnB,IAAO,oBAAP,cAAiC,WAAU;EAAjD,cAAA;;AAEE,SAAA,sBAAoD;AAExB,SAAA,aAAqB;AACrB,SAAA,WAA6B;AAC7B,SAAA,gBAAyC;AAc3D,SAAA,wBAAwB,CAAC,GAAY,aAAqB;AAClE,WAAK,oBAAoB,QAAQ,QAAO,GAAG,WAAW,QAAS;IACjE;AAIU,SAAA,wBAAwB,CAAC,GAAY,aAC7C,KAAK,oBAAoB,QAAQ,QAAO,GAAG,WAAW,QAAS;AAGzD,SAAA,WAAwB;MAC9B,WAAW;;AA6Eb,SAAA,kBAAy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,YAAY,oCAAoC;MAClD,SAAS;MACT,UAAU;MACV,QAAQ,EAAE,WAAU;KACrB,CAAC;EAEN;EAEgB,aAAa,oBAAqE;AAGhG,QAAI,KAAK,aAAa,UAAU,GAAG;AACjC,cAAQ,KAAK,gEAAgE;IAC/E;EACF;;;;AC7CK,IAAM,qBAAqB;EAChC,EAAE,KAAK,uBAAuB,MAAM,kBAAiB;EACrD,EAAE,KAAK,+BAA+B,MAAM,yBAAwB;EACpE,EAAE,KAAK,gCAAgC,MAAM,0BAAyB;EACtE,EAAE,KAAK,oBAAoB,MAAM,eAAc;EAC/C,EAAE,KAAK,2BAA2B,MAAM,sBAAqB;EAC7D,EAAE,KAAK,uBAAuB,MAAM,kBAAiB;EACrD,EAAE,KAAK,sBAAsB,MAAM,iBAAgB;EACnD,EAAE,KAAK,uBAAuB,MAAM,kBAAiB;EACrD,EAAE,KAAK,iBAAiB,MAAM,YAAW;EACzC,EAAE,KAAK,sBAAsB,MAAM,iBAAgB;EACnD,EAAE,KAAK,2BAA2B,MAAM,sBAAqB;EAC7D,EAAE,KAAK,4BAA4B,MAAM,uBAAsB;EAC/D,EAAE,KAAK,2BAA2B,MAAM,sBAAqB;EAC7D,EAAE,KAAK,oBAAoB,MAAM,eAAc;EAC/C,EAAE,KAAK,kBAAkB,MAAM,cAAa;EAC5C,EAAE,KAAK,2BAA2B,MAAM,sBAAqB;EAC7D,EAAE,KAAK,4BAA4B,MAAM,uBAAsB;EAC/D,EAAE,KAAK,2BAA2B,MAAM,sBAAqB;;","names":["state","LitElement","property","LitElement","__decorate","property","LitElement","LitElement","html","LitElement","html","__decorate","LitElement","html","property","__decorate","consume","LitElement","html","state","LitElement","html","__decorate","consume","state","css","html","css","html","css","html","html","css","html","LitElement","css","LitElement","html","css","html","css","html","consume","css","html","property","state","css","html","__decorate","property","consume","state","consume","css","html","property","state","css","html","__decorate","property","consume","state","css","html","LitElement","LitElement","css","html","LitElement","css","html","property","LitElement","css","html","__decorate","property","LitElement","LitElement","html","css","LitElement","html","property","__decorate","css","html","LitElement"]}