@citolab/qti-components 8.0.0 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +690 -316
  3. package/dist/base.d.ts +135 -9
  4. package/dist/base.js +1 -1
  5. package/dist/chunk-4DB4SC5K.js +100 -0
  6. package/dist/chunk-4DB4SC5K.js.map +1 -0
  7. package/dist/{chunk-WVVMNF74.js → chunk-7AVWRQIS.js} +188 -160
  8. package/dist/{chunk-WVVMNF74.js.map → chunk-7AVWRQIS.js.map} +1 -1
  9. package/dist/{chunk-MGF5F3S2.js → chunk-BQFWCZFH.js} +2 -2
  10. package/dist/{chunk-5QYII4OZ.js → chunk-CK7AV2UJ.js} +147 -101
  11. package/dist/chunk-CK7AV2UJ.js.map +1 -0
  12. package/dist/chunk-G6GFQDVN.js +7 -0
  13. package/dist/chunk-G6GFQDVN.js.map +1 -0
  14. package/dist/{chunk-LZJHHZQ2.js → chunk-HBSWJC3B.js} +643 -553
  15. package/dist/chunk-HBSWJC3B.js.map +1 -0
  16. package/dist/chunk-HQESINXH.js +834 -0
  17. package/dist/chunk-HQESINXH.js.map +1 -0
  18. package/dist/{chunk-KYEZRYO6.js → chunk-J5SQLKNP.js} +145 -119
  19. package/dist/{chunk-KYEZRYO6.js.map → chunk-J5SQLKNP.js.map} +1 -1
  20. package/dist/{chunk-V5G7X53Y.js → chunk-NJQHUUTN.js} +2 -2
  21. package/dist/{chunk-W4QZPCNC.js → chunk-RSVRS5AK.js} +59 -58
  22. package/dist/chunk-RSVRS5AK.js.map +1 -0
  23. package/dist/{chunk-5SJS36BI.js → chunk-TWPXES3S.js} +642 -673
  24. package/dist/chunk-TWPXES3S.js.map +1 -0
  25. package/dist/{chunk-NA2N2WSG.js → chunk-VAE6HBKR.js} +176 -152
  26. package/dist/{chunk-NA2N2WSG.js.map → chunk-VAE6HBKR.js.map} +1 -1
  27. package/dist/{chunk-MJVPNN7W.js → chunk-ZII6M3SN.js} +2 -2
  28. package/dist/computed-item.types.d-BKZdSLLJ.d.ts +19 -0
  29. package/dist/computed.types.d-DpKIYO6e.d.ts +44 -0
  30. package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
  31. package/dist/corrections.d.ts +415 -1
  32. package/dist/corrections.js +8 -9
  33. package/dist/elements.d.ts +393 -1
  34. package/dist/elements.js +4 -5
  35. package/dist/index.d.ts +27 -9
  36. package/dist/index.js +21 -14
  37. package/dist/interaction.d-CJiMv8H7.d.ts +126 -0
  38. package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
  39. package/dist/interactions.d.ts +281 -1
  40. package/dist/interactions.js +4 -5
  41. package/dist/item.css +588 -214
  42. package/dist/item.d.ts +92 -1
  43. package/dist/item.js +5 -5
  44. package/dist/item.types.d-QU7LljEK.d.ts +82 -0
  45. package/dist/loader.d.ts +22 -1
  46. package/dist/processing.d.ts +730 -1
  47. package/dist/processing.js +2 -2
  48. package/dist/qti-components-jsx.d.ts +854 -844
  49. package/dist/qti-components-jsx.js +1 -0
  50. package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
  51. package/dist/qti-expression.d-BietT_8b.d.ts +31 -0
  52. package/dist/qti-feedback.d-DZbad0RN.d.ts +21 -0
  53. package/dist/qti-rule-base.d-ajOnfGXY.d.ts +16 -0
  54. package/dist/qti-test.d-_YAlhDbt.d.ts +702 -0
  55. package/dist/qti-text-entry-interaction.d-BGdfV9qG.d.ts +1567 -0
  56. package/dist/qti-transform-test.d-BL7GGFJj.d.ts +70 -0
  57. package/dist/qti.context.d-CejJMlfZ.d.ts +50 -0
  58. package/dist/response.d-_8y4kjGP.d.ts +106 -0
  59. package/dist/test.d.ts +32 -1
  60. package/dist/test.js +14 -7
  61. package/dist/transformers.d.ts +18 -1
  62. package/package.json +15 -11
  63. package/dist/chunk-5QYII4OZ.js.map +0 -1
  64. package/dist/chunk-5SJS36BI.js.map +0 -1
  65. package/dist/chunk-64XSIBGO.js +0 -241
  66. package/dist/chunk-64XSIBGO.js.map +0 -1
  67. package/dist/chunk-H3J7LFRO.js +0 -2243
  68. package/dist/chunk-H3J7LFRO.js.map +0 -1
  69. package/dist/chunk-LZJHHZQ2.js.map +0 -1
  70. package/dist/chunk-W4QZPCNC.js.map +0 -1
  71. package/dist/chunk-WCQ26LV7.js +0 -102
  72. package/dist/chunk-WCQ26LV7.js.map +0 -1
  73. package/dist/chunk-X3E5HXG2.js +0 -20
  74. package/dist/chunk-X3E5HXG2.js.map +0 -1
  75. /package/dist/{chunk-MGF5F3S2.js.map → chunk-BQFWCZFH.js.map} +0 -0
  76. /package/dist/{chunk-V5G7X53Y.js.map → chunk-NJQHUUTN.js.map} +0 -0
  77. /package/dist/{chunk-MJVPNN7W.js.map → chunk-ZII6M3SN.js.map} +0 -0
package/dist/item.d.ts CHANGED
@@ -1 +1,92 @@
1
- export * from '@qti-components/item';
1
+ import * as lit from 'lit';
2
+ import { LitElement } from 'lit';
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';
11
+
12
+ /**
13
+ * `<item-container>` is a custom element designed for hosting the qti-assessment-item.
14
+ * The `qti-assessment-item` will be placed inside the shadow DOM of this element.
15
+ * The element loads the item from the provided URL and renders it inside the shadow DOM.
16
+ *
17
+ * ### Styling
18
+ * Add a class to the element for styling.
19
+ *
20
+ * ```html
21
+ * <qti-item>
22
+ * <item-container class="m-4 bg-white" item-url="./path/to/item.xml"></item-container>
23
+ * </qti-item>
24
+ * ```
25
+ */
26
+ declare class ItemContainer extends LitElement {
27
+ #private;
28
+ /** Scoped registry used by the item shadow root. Must be set before connection. */
29
+ customElementRegistry: CustomElementRegistry | null;
30
+ /** URL of the item to load */
31
+ itemURL: string | null;
32
+ /** A parsed HTML document */
33
+ itemDoc: DocumentFragment | null;
34
+ /** The raw XML string */
35
+ itemXML: string | null;
36
+ protected qtiContext: QtiContext;
37
+ protected createRenderRoot(): HTMLElement | DocumentFragment;
38
+ protected handleItemURLChange(): Promise<void>;
39
+ protected handleItemXMLChange(): void;
40
+ connectedCallback(): Promise<void>;
41
+ render(): lit.TemplateResult<1>;
42
+ }
43
+ declare global {
44
+ interface HTMLElementTagNameMap {
45
+ 'item-container': ItemContainer;
46
+ }
47
+ }
48
+
49
+ declare class ItemPrintVariables extends LitElement {
50
+ protected computedContext?: ComputedItemContext;
51
+ static styles: lit.CSSResult;
52
+ render(): lit.TemplateResult<1>;
53
+ }
54
+ declare global {
55
+ interface HTMLElementTagNameMap {
56
+ 'item-print-variables': ItemPrintVariables;
57
+ }
58
+ }
59
+
60
+ /**
61
+ * `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.
62
+ * It can also host some functionalities to interact with the item like scoring, showing feedback, etc.
63
+ * Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.
64
+ * See `<item-container>` for more details.
65
+ *
66
+ * ```html
67
+ * <qti-item>
68
+ * <item-container class="m-4 bg-white" item-url="./path/to/item.xml"></item-container>
69
+ * </qti-item>
70
+ * ```
71
+ */
72
+ declare class QtiItem extends LitElement {
73
+ #private;
74
+ computedContext: ComputedItemContext;
75
+ protected assessmentItem?: QtiAssessmentItem;
76
+ configContext: ConfigContext;
77
+ /**
78
+ * Provided so that descendants (e.g. `<item-container>`) can read the QTI runtime
79
+ * context for standalone item delivery, including the optional shuffle `seed`.
80
+ */
81
+ qtiContext: QtiContext;
82
+ constructor();
83
+ render(): lit.TemplateResult<1>;
84
+ disconnectedCallback(): void;
85
+ }
86
+ declare global {
87
+ interface HTMLElementTagNameMap {
88
+ 'qti-item': QtiItem;
89
+ }
90
+ }
91
+
92
+ export { ItemContainer, ItemPrintVariables, QtiItem };
package/dist/item.js CHANGED
@@ -1,13 +1,13 @@
1
- import "./chunk-MJVPNN7W.js";
1
+ import "./chunk-ZII6M3SN.js";
2
2
  import {
3
3
  ItemContainer,
4
4
  ItemPrintVariables,
5
5
  QtiItem
6
- } from "./chunk-W4QZPCNC.js";
7
- import "./chunk-WCQ26LV7.js";
8
- import "./chunk-64XSIBGO.js";
6
+ } from "./chunk-RSVRS5AK.js";
7
+ import "./chunk-G6GFQDVN.js";
8
+ import "./chunk-4DB4SC5K.js";
9
9
  import "./chunk-IJD53WY6.js";
10
- import "./chunk-H3J7LFRO.js";
10
+ import "./chunk-HQESINXH.js";
11
11
  export {
12
12
  ItemContainer,
13
13
  ItemPrintVariables,
@@ -0,0 +1,82 @@
1
+ interface directedPair {
2
+ destination: string;
3
+ source: string;
4
+ }
5
+ interface ResponseInteraction {
6
+ responseIdentifier: string;
7
+ response: string | string[];
8
+ state?: string | null;
9
+ }
10
+ interface Calculate {
11
+ calculate: () => string | string[];
12
+ }
13
+ type float = number;
14
+ type integer = number;
15
+ type BaseType = 'boolean' | 'directedPair' | 'duration' | 'float' | 'integer' | 'string' | 'identifier' | 'pair' | 'record';
16
+ type Multiple = string | string[][];
17
+ type Ordered = string | string[][];
18
+ type Cardinality = 'multiple' | 'ordered' | 'single' | 'record';
19
+
20
+ type QtiAreaMapping = {
21
+ defaultValue: number;
22
+ lowerBound?: number;
23
+ upperBound?: number;
24
+ areaMapEntries: QtiAreaMapEntry[];
25
+ };
26
+ type QtiAreaMapEntry = {
27
+ shape: areaShape;
28
+ coords: string;
29
+ mappedValue: number;
30
+ defaultValue: number;
31
+ };
32
+ type QtiMapping = {
33
+ defaultValue: number;
34
+ lowerBound?: number;
35
+ upperBound?: number;
36
+ mapEntries: QtiMapEntry[];
37
+ };
38
+ type QtiMapEntry = {
39
+ mapKey: string;
40
+ mappedValue: number;
41
+ caseSensitive: boolean;
42
+ };
43
+ type areaShape = 'default' | 'circle' | 'rect' | 'ellipse' | 'poly';
44
+ interface VariableValue<T> {
45
+ identifier: string;
46
+ value: Readonly<T>;
47
+ defaultValue?: T | null;
48
+ type: 'outcome' | 'response' | 'context' | 'template';
49
+ }
50
+ interface VariableDeclaration<T> extends VariableValue<T> {
51
+ cardinality?: Cardinality;
52
+ baseType?: BaseType;
53
+ }
54
+ interface OutcomeVariable extends VariableDeclaration<string | string[] | null> {
55
+ interpolationTable?: Map<number, number>;
56
+ externalScored?: 'human' | 'externalMachine' | null;
57
+ }
58
+ interface ResponseVariable extends VariableDeclaration<string | string[] | null> {
59
+ candidateResponse?: string | string[] | null;
60
+ mapping?: QtiMapping;
61
+ areaMapping?: QtiAreaMapping;
62
+ correctResponse?: string | string[] | null;
63
+ }
64
+ interface TemplateVariable extends VariableDeclaration<string | string[] | number | boolean | null> {
65
+ type: 'template';
66
+ mathVariable?: boolean;
67
+ paramVariable?: boolean;
68
+ }
69
+
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 +1,22 @@
1
- export * from '@qti-components/loader';
1
+ import { QtiAssessmentItem } from './elements.js';
2
+ import 'lit';
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
+
8
+ type ManifestInfo = {
9
+ testIdentifier: string;
10
+ testHTMLDoc: DocumentFragment;
11
+ testURI: string;
12
+ testURL: string;
13
+ items: {
14
+ identifier: string;
15
+ href: string;
16
+ category: string;
17
+ }[];
18
+ };
19
+ declare const getManifestInfo: (manifestURL: string) => Promise<ManifestInfo>;
20
+ declare const getItemByUri: (itemUri: string) => Promise<QtiAssessmentItem>;
21
+
22
+ export { type ManifestInfo, getItemByUri, getManifestInfo };