@citolab/qti-components 7.28.1 → 8.0.1

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 (88) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +6316 -2710
  3. package/dist/base.d.ts +100 -15
  4. package/dist/base.js +27 -6
  5. package/dist/chunk-3AJOQCDU.js +11 -0
  6. package/dist/chunk-3AJOQCDU.js.map +1 -0
  7. package/dist/chunk-64XSIBGO.js +241 -0
  8. package/dist/chunk-64XSIBGO.js.map +1 -0
  9. package/dist/chunk-7HC5SMCU.js +102 -0
  10. package/dist/chunk-7HC5SMCU.js.map +1 -0
  11. package/dist/{chunk-SP6S2WMG.js → chunk-7V4HJFHW.js} +3 -3
  12. package/dist/{chunk-SP6S2WMG.js.map → chunk-7V4HJFHW.js.map} +1 -1
  13. package/dist/chunk-CAO4JRLY.js +11 -0
  14. package/dist/chunk-CAO4JRLY.js.map +1 -0
  15. package/dist/{chunk-MPC7LIPC.js → chunk-F4BNJWYN.js} +4264 -3647
  16. package/dist/chunk-F4BNJWYN.js.map +1 -0
  17. package/dist/{chunk-3XV26R5M.js → chunk-H3J7LFRO.js} +829 -1005
  18. package/dist/chunk-H3J7LFRO.js.map +1 -0
  19. package/dist/{chunk-3WBG257S.js → chunk-IJD53WY6.js} +96 -74
  20. package/dist/chunk-IJD53WY6.js.map +1 -0
  21. package/dist/chunk-LVBIQDPM.js +1374 -0
  22. package/dist/chunk-LVBIQDPM.js.map +1 -0
  23. package/dist/{chunk-REI3AMCZ.js → chunk-NA2N2WSG.js} +1303 -1193
  24. package/dist/chunk-NA2N2WSG.js.map +1 -0
  25. package/dist/chunk-QECOPVPO.js +294 -0
  26. package/dist/chunk-QECOPVPO.js.map +1 -0
  27. package/dist/{chunk-HFCZFWSH.js → chunk-RXGDQDOV.js} +1993 -1764
  28. package/dist/chunk-RXGDQDOV.js.map +1 -0
  29. package/dist/chunk-V5G7X53Y.js +11 -0
  30. package/dist/chunk-V5G7X53Y.js.map +1 -0
  31. package/dist/{chunk-WDO2TRFM.js → chunk-WVVMNF74.js} +851 -925
  32. package/dist/chunk-WVVMNF74.js.map +1 -0
  33. package/dist/{chunk-FLJAKWXL.js → chunk-X3E5HXG2.js} +2 -2
  34. package/dist/chunk-XU7HNT4F.js +1608 -0
  35. package/dist/chunk-XU7HNT4F.js.map +1 -0
  36. package/dist/{computed-item.context-DfsW_96S.d.ts → computed-item.types.d-BKZdSLLJ.d.ts} +2 -5
  37. package/dist/{computed.context-DHbxad0N.d.ts → computed.types.d-rKLSPvVG.d.ts} +2 -5
  38. package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
  39. package/dist/corrections.d.ts +432 -0
  40. package/dist/corrections.js +84 -0
  41. package/dist/elements.d.ts +8 -14
  42. package/dist/elements.js +6 -5
  43. package/dist/index.d.ts +51 -16
  44. package/dist/index.js +193 -76
  45. package/dist/interaction.d-D4MstYRz.d.ts +115 -0
  46. package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
  47. package/dist/interactions.d.ts +1206 -552
  48. package/dist/interactions.js +19 -15
  49. package/dist/item.css +4228 -1656
  50. package/dist/item.d.ts +13 -55
  51. package/dist/item.js +6 -11
  52. package/dist/{variables-CMYcDbyW.d.ts → item.types.d-QU7LljEK.d.ts} +13 -1
  53. package/dist/loader.d.ts +4 -4
  54. package/dist/loader.js +2 -3
  55. package/dist/processing.d.ts +6 -7
  56. package/dist/processing.js +2 -3
  57. package/dist/qti-components-jsx.d.ts +5348 -2709
  58. package/dist/qti-components-jsx.js +1 -0
  59. package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
  60. package/dist/{qti-condition-expression-Dam-RER6.d.ts → qti-expression.d-BietT_8b.d.ts} +14 -9
  61. package/dist/{qti-feedback-ChmXhZuf.d.ts → qti-feedback.d-DZbad0RN.d.ts} +1 -1
  62. package/dist/{qti-transform-test-DoZaWItm.d.ts → qti-transform-test.d-BL7GGFJj.d.ts} +2 -2
  63. package/dist/response.d-_8y4kjGP.d.ts +106 -0
  64. package/dist/test.d.ts +199 -39
  65. package/dist/test.js +34 -11
  66. package/dist/transformers.d.ts +1 -1
  67. package/dist/transformers.js +1 -2
  68. package/package.json +24 -17
  69. package/custom-elements.json +0 -43251
  70. package/dist/chunk-3WBG257S.js.map +0 -1
  71. package/dist/chunk-3XV26R5M.js.map +0 -1
  72. package/dist/chunk-AQ5RJFM6.js +0 -3673
  73. package/dist/chunk-AQ5RJFM6.js.map +0 -1
  74. package/dist/chunk-HFCZFWSH.js.map +0 -1
  75. package/dist/chunk-MPC7LIPC.js.map +0 -1
  76. package/dist/chunk-QXBXORM3.js +0 -27
  77. package/dist/chunk-REI3AMCZ.js.map +0 -1
  78. package/dist/chunk-RLTYVS2I.js +0 -530
  79. package/dist/chunk-RLTYVS2I.js.map +0 -1
  80. package/dist/chunk-WDO2TRFM.js.map +0 -1
  81. package/dist/config.context-BjZ2bZSY.d.ts +0 -42
  82. package/dist/interaction-Bgzlw7Iu.d.ts +0 -110
  83. package/dist/item.context-CkUeDcaO.d.ts +0 -15
  84. package/dist/test.context-CByZZjkR.d.ts +0 -15
  85. /package/dist/{chunk-FLJAKWXL.js.map → chunk-X3E5HXG2.js.map} +0 -0
  86. /package/dist/{chunk-QXBXORM3.js.map → corrections.js.map} +0 -0
  87. /package/dist/{qti-rule-base-ajOnfGXY.d.ts → qti-rule-base.d-ajOnfGXY.d.ts} +0 -0
  88. /package/dist/{qti.context-CejJMlfZ.d.ts → qti.context.d-CejJMlfZ.d.ts} +0 -0
package/dist/item.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
- import { Q as QtiContext } from './qti.context-CejJMlfZ.js';
4
- import { C as ComputedItemContext } from './computed-item.context-DfsW_96S.js';
5
- import { C as ConfigContext } from './config.context-BjZ2bZSY.js';
6
- import './variables-CMYcDbyW.js';
3
+ import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
4
+ import { C as ComputedItemContext } from './computed-item.types.d-BKZdSLLJ.js';
5
+ import { QtiAssessmentItem } from './elements.js';
6
+ import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
7
+ import './item.types.d-QU7LljEK.js';
8
+ import './interaction.interface.d-CvjHM2bi.js';
9
+ import './qti-feedback.d-DZbad0RN.js';
10
+ import './qti-rule-base.d-ajOnfGXY.js';
7
11
 
8
12
  /**
9
13
  * `<item-container>` is a custom element designed for hosting the qti-assessment-item.
@@ -21,6 +25,8 @@ import './variables-CMYcDbyW.js';
21
25
  */
22
26
  declare class ItemContainer extends LitElement {
23
27
  #private;
28
+ /** Scoped registry used by the item shadow root. Must be set before connection. */
29
+ customElementRegistry: CustomElementRegistry | null;
24
30
  /** URL of the item to load */
25
31
  itemURL: string;
26
32
  /** A parsed HTML document */
@@ -28,6 +34,7 @@ declare class ItemContainer extends LitElement {
28
34
  /** The raw XML string */
29
35
  itemXML: string;
30
36
  protected qtiContext: QtiContext;
37
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
31
38
  protected handleItemURLChange(): Promise<void>;
32
39
  protected handleItemXMLChange(): void;
33
40
  connectedCallback(): Promise<void>;
@@ -39,56 +46,6 @@ declare global {
39
46
  }
40
47
  }
41
48
 
42
- declare class ItemCorrectResponseMode extends LitElement {
43
- #private;
44
- private itemContext;
45
- label: string;
46
- private _options;
47
- render(): lit.TemplateResult<1>;
48
- }
49
- declare global {
50
- interface HTMLElementTagNameMap {
51
- 'item-correct-response-mode': ItemCorrectResponseMode;
52
- }
53
- }
54
-
55
- declare class ItemShowCandidateCorrection extends LitElement {
56
- #private;
57
- computedContext?: ComputedItemContext;
58
- static styles: lit.CSSResult;
59
- shown: boolean;
60
- disabled: boolean;
61
- showCandidateCorrectionText: string;
62
- hideCandidateCorrectionText: string;
63
- noCorrectResponseText: string;
64
- constructor();
65
- updated(): void;
66
- render(): lit.TemplateResult<1>;
67
- }
68
- declare global {
69
- interface HTMLElementTagNameMap {
70
- 'item-show-candidate-correction': ItemShowCandidateCorrection;
71
- }
72
- }
73
-
74
- declare class ItemShowCorrectResponse extends LitElement {
75
- #private;
76
- computedContext?: ComputedItemContext;
77
- static styles: lit.CSSResult;
78
- shown: boolean;
79
- disabled: boolean;
80
- showCorrectText: string;
81
- hideCorrectText: string;
82
- noCorrectResponseText: string;
83
- updated(): void;
84
- render(): lit.TemplateResult<1>;
85
- }
86
- declare global {
87
- interface HTMLElementTagNameMap {
88
- 'item-show-correct-response': ItemShowCorrectResponse;
89
- }
90
- }
91
-
92
49
  declare class ItemPrintVariables extends LitElement {
93
50
  protected computedContext?: ComputedItemContext;
94
51
  static styles: lit.CSSResult;
@@ -115,6 +72,7 @@ declare global {
115
72
  declare class QtiItem extends LitElement {
116
73
  #private;
117
74
  computedContext: ComputedItemContext;
75
+ protected assessmentItem?: QtiAssessmentItem;
118
76
  configContext: ConfigContext;
119
77
  /**
120
78
  * Provided so that descendants (e.g. `<item-container>`) can read the QTI runtime
@@ -131,4 +89,4 @@ declare global {
131
89
  }
132
90
  }
133
91
 
134
- export { ItemContainer, ItemCorrectResponseMode, ItemPrintVariables, ItemShowCandidateCorrection, ItemShowCorrectResponse, QtiItem };
92
+ export { ItemContainer, ItemPrintVariables, QtiItem };
package/dist/item.js CHANGED
@@ -1,21 +1,16 @@
1
+ import "./chunk-3AJOQCDU.js";
1
2
  import {
2
3
  ItemContainer,
3
- ItemCorrectResponseMode,
4
4
  ItemPrintVariables,
5
- ItemShowCandidateCorrection,
6
- ItemShowCorrectResponse,
7
5
  QtiItem
8
- } from "./chunk-RLTYVS2I.js";
9
- import "./chunk-AQ5RJFM6.js";
10
- import "./chunk-3WBG257S.js";
11
- import "./chunk-3XV26R5M.js";
12
- import "./chunk-QXBXORM3.js";
6
+ } from "./chunk-QECOPVPO.js";
7
+ import "./chunk-7HC5SMCU.js";
8
+ import "./chunk-64XSIBGO.js";
9
+ import "./chunk-IJD53WY6.js";
10
+ import "./chunk-H3J7LFRO.js";
13
11
  export {
14
12
  ItemContainer,
15
- ItemCorrectResponseMode,
16
13
  ItemPrintVariables,
17
- ItemShowCandidateCorrection,
18
- ItemShowCorrectResponse,
19
14
  QtiItem
20
15
  };
21
16
  //# sourceMappingURL=item.js.map
@@ -67,4 +67,16 @@ interface TemplateVariable extends VariableDeclaration<string | string[] | numbe
67
67
  paramVariable?: boolean;
68
68
  }
69
69
 
70
- export type { BaseType as B, Calculate as C, Multiple as M, Ordered as O, QtiAreaMapEntry as Q, ResponseInteraction as R, TemplateVariable as T, VariableDeclaration as V, Cardinality as a, OutcomeVariable as b, QtiAreaMapping as c, QtiMapEntry as d, QtiMapping as e, ResponseVariable as f, VariableValue as g, areaShape as h, directedPair as i, float as j, integer as k };
70
+ interface ItemContext {
71
+ identifier?: string;
72
+ href?: string;
73
+ variables?: ReadonlyArray<VariableDeclaration<string | string[] | null>>;
74
+ /**
75
+ * Optional per-interaction opaque state, keyed by responseIdentifier.
76
+ * Used for interactions that support state save/restore (e.g. PCI).
77
+ */
78
+ state?: Record<string, string | null>;
79
+ }
80
+ declare const itemContextVariables: VariableDeclaration<string | string[]>[];
81
+
82
+ export { type BaseType as B, type Calculate as C, type ItemContext as I, type Multiple as M, type Ordered as O, type QtiAreaMapEntry as Q, type ResponseInteraction as R, type TemplateVariable as T, type VariableDeclaration as V, type Cardinality as a, type OutcomeVariable as b, type QtiAreaMapping as c, type QtiMapEntry as d, type QtiMapping as e, type ResponseVariable as f, type VariableValue as g, type areaShape as h, type directedPair as i, type float as j, type integer as k, itemContextVariables as l };
package/dist/loader.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { QtiAssessmentItem } from './elements.js';
2
2
  import 'lit';
3
- import './variables-CMYcDbyW.js';
4
- import './item.context-CkUeDcaO.js';
5
- import './qti-feedback-ChmXhZuf.js';
6
- import './qti-rule-base-ajOnfGXY.js';
3
+ import './item.types.d-QU7LljEK.js';
4
+ import './interaction.interface.d-CvjHM2bi.js';
5
+ import './qti-feedback.d-DZbad0RN.js';
6
+ import './qti-rule-base.d-ajOnfGXY.js';
7
7
 
8
8
  type ManifestInfo = {
9
9
  testIdentifier: string;
package/dist/loader.js CHANGED
@@ -1,9 +1,8 @@
1
1
  import {
2
2
  getItemByUri,
3
3
  getManifestInfo
4
- } from "./chunk-SP6S2WMG.js";
5
- import "./chunk-3WBG257S.js";
6
- import "./chunk-QXBXORM3.js";
4
+ } from "./chunk-7V4HJFHW.js";
5
+ import "./chunk-IJD53WY6.js";
7
6
  export {
8
7
  getItemByUri,
9
8
  getManifestInfo
@@ -1,11 +1,10 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, nothing } from 'lit';
3
- import { Q as QtiRuleBase } from './qti-rule-base-ajOnfGXY.js';
4
- import { I as ItemContext } from './item.context-CkUeDcaO.js';
5
- import { a as QtiExpression, b as QtiExpressionBase, Q as QtiConditionExpression } from './qti-condition-expression-Dam-RER6.js';
6
- import { B as BaseType, f as ResponseVariable, V as VariableDeclaration } from './variables-CMYcDbyW.js';
7
- import { T as TestContext } from './test.context-CByZZjkR.js';
8
- import './qti.context-CejJMlfZ.js';
3
+ import { Q as QtiRuleBase } from './qti-rule-base.d-ajOnfGXY.js';
4
+ import { I as ItemContext, B as BaseType, f as ResponseVariable, V as VariableDeclaration } from './item.types.d-QU7LljEK.js';
5
+ import { Q as QtiExpression, a as QtiExpressionBase, T as TestContext } from './qti-expression.d-BietT_8b.js';
6
+ import { Q as QtiConditionExpression } from './qti-condition-expression.d-aMvBvpc6.js';
7
+ import './qti.context.d-CejJMlfZ.js';
9
8
 
10
9
  declare class QtiRule extends LitElement implements QtiRuleBase {
11
10
  render(): lit.TemplateResult<1>;
@@ -505,7 +504,7 @@ declare class QtiPatternMatch extends QtiExpression<boolean | null> {
505
504
  declare class QtiPrintedVariable extends LitElement {
506
505
  identifier: string;
507
506
  protected context?: ItemContext;
508
- render(): typeof nothing | lit.TemplateResult<1>;
507
+ render(): lit.TemplateResult<1> | typeof nothing;
509
508
  calculate(): VariableDeclaration<string | string[]>;
510
509
  }
511
510
 
@@ -67,9 +67,8 @@ import {
67
67
  QtiVariable,
68
68
  qtiAndMixin,
69
69
  qtiSubtractMixin
70
- } from "./chunk-REI3AMCZ.js";
71
- import "./chunk-3XV26R5M.js";
72
- import "./chunk-QXBXORM3.js";
70
+ } from "./chunk-NA2N2WSG.js";
71
+ import "./chunk-H3J7LFRO.js";
73
72
  export {
74
73
  QtiAnd,
75
74
  QtiAnyN,