@citolab/qti-components 8.0.0 → 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.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +591 -217
- package/dist/base.d.ts +135 -9
- package/dist/{chunk-MJVPNN7W.js → chunk-3AJOQCDU.js} +2 -2
- package/dist/chunk-7HC5SMCU.js +102 -0
- package/dist/chunk-7HC5SMCU.js.map +1 -0
- package/dist/{chunk-MGF5F3S2.js → chunk-CAO4JRLY.js} +2 -2
- package/dist/{chunk-5SJS36BI.js → chunk-F4BNJWYN.js} +1 -1
- package/dist/{chunk-5SJS36BI.js.map → chunk-F4BNJWYN.js.map} +1 -1
- package/dist/{chunk-5QYII4OZ.js → chunk-LVBIQDPM.js} +2 -2
- package/dist/{chunk-W4QZPCNC.js → chunk-QECOPVPO.js} +2 -2
- package/dist/{chunk-LZJHHZQ2.js → chunk-RXGDQDOV.js} +177 -173
- package/dist/chunk-RXGDQDOV.js.map +1 -0
- package/dist/{chunk-KYEZRYO6.js → chunk-XU7HNT4F.js} +4 -4
- package/dist/computed-item.types.d-BKZdSLLJ.d.ts +19 -0
- package/dist/computed.types.d-rKLSPvVG.d.ts +42 -0
- package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
- package/dist/corrections.d.ts +432 -1
- package/dist/corrections.js +5 -5
- package/dist/elements.d.ts +393 -1
- package/dist/index.d.ts +58 -9
- package/dist/index.js +16 -8
- package/dist/interaction.d-D4MstYRz.d.ts +115 -0
- package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
- package/dist/interactions.d.ts +1569 -1
- package/dist/interactions.js +2 -2
- package/dist/item.css +588 -214
- package/dist/item.d.ts +92 -1
- package/dist/item.js +3 -3
- package/dist/item.types.d-QU7LljEK.d.ts +82 -0
- package/dist/loader.d.ts +22 -1
- package/dist/processing.d.ts +730 -1
- package/dist/qti-components-jsx.d.ts +221 -231
- package/dist/qti-components-jsx.js +1 -0
- package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
- package/dist/qti-expression.d-BietT_8b.d.ts +31 -0
- package/dist/qti-feedback.d-DZbad0RN.d.ts +21 -0
- package/dist/qti-rule-base.d-ajOnfGXY.d.ts +16 -0
- package/dist/qti-transform-test.d-BL7GGFJj.d.ts +70 -0
- package/dist/qti.context.d-CejJMlfZ.d.ts +50 -0
- package/dist/response.d-_8y4kjGP.d.ts +106 -0
- package/dist/test.d.ts +699 -1
- package/dist/test.js +11 -3
- package/dist/transformers.d.ts +18 -1
- package/package.json +11 -8
- package/dist/chunk-LZJHHZQ2.js.map +0 -1
- package/dist/chunk-WCQ26LV7.js +0 -102
- package/dist/chunk-WCQ26LV7.js.map +0 -1
- /package/dist/{chunk-MJVPNN7W.js.map → chunk-3AJOQCDU.js.map} +0 -0
- /package/dist/{chunk-MGF5F3S2.js.map → chunk-CAO4JRLY.js.map} +0 -0
- /package/dist/{chunk-5QYII4OZ.js.map → chunk-LVBIQDPM.js.map} +0 -0
- /package/dist/{chunk-W4QZPCNC.js.map → chunk-QECOPVPO.js.map} +0 -0
- /package/dist/{chunk-KYEZRYO6.js.map → chunk-XU7HNT4F.js.map} +0 -0
package/dist/item.d.ts
CHANGED
|
@@ -1 +1,92 @@
|
|
|
1
|
-
|
|
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;
|
|
32
|
+
/** A parsed HTML document */
|
|
33
|
+
itemDoc: DocumentFragment;
|
|
34
|
+
/** The raw XML string */
|
|
35
|
+
itemXML: string;
|
|
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,10 +1,10 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-3AJOQCDU.js";
|
|
2
2
|
import {
|
|
3
3
|
ItemContainer,
|
|
4
4
|
ItemPrintVariables,
|
|
5
5
|
QtiItem
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-QECOPVPO.js";
|
|
7
|
+
import "./chunk-7HC5SMCU.js";
|
|
8
8
|
import "./chunk-64XSIBGO.js";
|
|
9
9
|
import "./chunk-IJD53WY6.js";
|
|
10
10
|
import "./chunk-H3J7LFRO.js";
|
|
@@ -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
|
-
|
|
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 };
|