@citolab/qti-components 10.0.0-next.2 → 10.0.0-next.21
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 +4334 -2688
- package/dist/base.d.ts +39 -13
- package/dist/base.js +14 -1
- package/dist/{chunk-RU6332MD.js → chunk-2A52V5TQ.js} +4 -4
- package/dist/{chunk-2KP5UU5A.js → chunk-55WWIRLN.js} +117 -92
- package/dist/chunk-55WWIRLN.js.map +1 -0
- package/dist/{chunk-MI7774NV.js → chunk-5BP2A7BI.js} +2 -2
- package/dist/{chunk-35WWWFS6.js → chunk-DAESCCLR.js} +2 -2
- package/dist/chunk-DJ7PB252.js +7 -0
- package/dist/chunk-DJ7PB252.js.map +1 -0
- package/dist/{chunk-TDWJ6WZA.js → chunk-GPC53O7P.js} +166 -10
- package/dist/chunk-GPC53O7P.js.map +1 -0
- package/dist/{chunk-6U3YPHXU.js → chunk-H6DO5UHC.js} +277 -154
- package/dist/chunk-H6DO5UHC.js.map +1 -0
- package/dist/chunk-J6VX4N7M.js +197 -0
- package/dist/chunk-J6VX4N7M.js.map +1 -0
- package/dist/{chunk-3ZNECUPV.js → chunk-JIDSFFFD.js} +2 -2
- package/dist/{chunk-FD4AB6TM.js → chunk-KQ2LED4X.js} +2 -2
- package/dist/{chunk-6K3QWJHH.js → chunk-LPYZVKHX.js} +48 -7
- package/dist/chunk-LPYZVKHX.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/{chunk-K3VKQ6QF.js → chunk-TB2OI3ED.js} +677 -1894
- package/dist/chunk-TB2OI3ED.js.map +1 -0
- package/dist/{chunk-GBZNFSFY.js → chunk-TSJGL6FI.js} +2 -2
- package/dist/{chunk-RSMYGGQK.js → chunk-TZCOXFPB.js} +1590 -610
- package/dist/chunk-TZCOXFPB.js.map +1 -0
- package/dist/chunk-UCXLDQYA.js +56 -0
- package/dist/chunk-UCXLDQYA.js.map +1 -0
- package/dist/chunk-WWY2H2YO.js +7 -0
- package/dist/chunk-WWY2H2YO.js.map +1 -0
- package/dist/{chunk-LFVPS7KB.js → chunk-XWRZP2RM.js} +2 -2
- package/dist/{chunk-TLAVOBEM.js → chunk-ZRORBAHB.js} +122 -3
- package/dist/chunk-ZRORBAHB.js.map +1 -0
- package/dist/computed.types.d-6Ht-HNRx.d.ts +80 -0
- package/dist/{config.context.d-BvU9r-Mg.d.ts → config.context.d-Dm11aAuw.d.ts} +21 -3
- package/dist/corrections.d.ts +137 -24
- package/dist/corrections.js +12 -12
- package/dist/corrections.js.map +1 -1
- package/dist/elements.d.ts +66 -73
- package/dist/elements.js +9 -6
- package/dist/index.d.ts +21 -17
- package/dist/index.js +47 -61
- package/dist/interactions.d.ts +98 -19
- package/dist/interactions.js +8 -3
- package/dist/item.css +1948 -1946
- package/dist/item.d.ts +8 -6
- package/dist/item.js +6 -5
- package/dist/item.types.d-Zc6ZQDhu.d.ts +25 -0
- package/dist/loader.d.ts +5 -3
- package/dist/loader.js +3 -2
- package/dist/processing.d.ts +19 -7
- package/dist/processing.js +4 -3
- package/dist/public-events.d-3dGip9pd.d.ts +105 -0
- package/dist/qti-components-jsx.d.ts +1780 -1727
- package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-7Kd4LBxn.d.ts} +1 -1
- package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-iH3w6mqf.d.ts} +2 -1
- package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-CT0W-8Gm.d.ts} +8 -1
- package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-CxP6KtCH.d.ts} +3 -2
- package/dist/{qti-rule-base.d-Bdzg8eGH.d.ts → qti-rule-base.d-CeKP0Ooi.d.ts} +2 -2
- package/dist/qti-test-state-CF9S8X9C.d.ts +68 -0
- package/dist/qti-test-state.d-D8Q89RzZ.d.ts +57 -0
- package/dist/{qti-test.d-DkpBNcsv.d.ts → qti-test.d-DBT-YpRu.d.ts} +124 -485
- package/dist/{qti-text-entry-interaction.d-q8u5BiVK.d.ts → qti-text-entry-interaction.d-m0EFv9no.d.ts} +221 -73
- package/dist/{qti-transform-test.d-BL7GGFJj.d.ts → qti-transform-test.d-Bb9vnLzP.d.ts} +1 -0
- package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-N1Bq7e1f.d.ts} +67 -4
- package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-9gRdGK4T.d.ts} +7 -1
- package/dist/test-plugin-api.d.ts +134 -0
- package/dist/test-plugin-api.js +19 -0
- package/dist/test-plugin-api.js.map +1 -0
- package/dist/test.d.ts +26 -57
- package/dist/test.js +19 -48
- package/dist/transformers.d.ts +1 -1
- package/dist/transformers.js +2 -1
- package/dist/{item.types.d-B55QkJ92.d.ts → variables.d-DWHlTszN.d.ts} +8 -24
- package/package.json +16 -11
- package/dist/chunk-2KP5UU5A.js.map +0 -1
- package/dist/chunk-6K3QWJHH.js.map +0 -1
- package/dist/chunk-6U3YPHXU.js.map +0 -1
- package/dist/chunk-K3VKQ6QF.js.map +0 -1
- package/dist/chunk-RSMYGGQK.js.map +0 -1
- package/dist/chunk-TDWJ6WZA.js.map +0 -1
- package/dist/chunk-TLAVOBEM.js.map +0 -1
- package/dist/chunk-ZP6QQYSU.js +0 -7
- package/dist/chunk-ZP6QQYSU.js.map +0 -1
- package/dist/computed.types.d-gJrBeUMG.d.ts +0 -42
- /package/dist/{chunk-RU6332MD.js.map → chunk-2A52V5TQ.js.map} +0 -0
- /package/dist/{chunk-MI7774NV.js.map → chunk-5BP2A7BI.js.map} +0 -0
- /package/dist/{chunk-35WWWFS6.js.map → chunk-DAESCCLR.js.map} +0 -0
- /package/dist/{chunk-3ZNECUPV.js.map → chunk-JIDSFFFD.js.map} +0 -0
- /package/dist/{chunk-FD4AB6TM.js.map → chunk-KQ2LED4X.js.map} +0 -0
- /package/dist/{chunk-GBZNFSFY.js.map → chunk-TSJGL6FI.js.map} +0 -0
- /package/dist/{chunk-LFVPS7KB.js.map → chunk-XWRZP2RM.js.map} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
import {
|
|
3
|
+
import { I as ItemContext } from './item.types.d-Zc6ZQDhu.js';
|
|
4
4
|
import { a as QtiContextType, Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
|
|
5
|
+
import { V as VariableDeclaration, f as ResponseVariable, B as BaseType } from './variables.d-DWHlTszN.js';
|
|
5
6
|
|
|
6
7
|
interface TestContext {
|
|
7
8
|
items: (ItemContext & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
import { a as Cardinality } from './
|
|
3
|
+
import { a as Cardinality } from './variables.d-DWHlTszN.js';
|
|
4
4
|
|
|
5
5
|
declare abstract class QtiVariableDeclaration extends LitElement {
|
|
6
6
|
render(): lit.TemplateResult<1>;
|
|
@@ -16,6 +16,13 @@ declare abstract class QtiFeedback extends LitElement {
|
|
|
16
16
|
private get _context();
|
|
17
17
|
private _computedContext?;
|
|
18
18
|
checkShowFeedback(outcomeIdentifier: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Called when this feedback is about to show. Return `false` to keep it hidden: the host shows the
|
|
21
|
+
* content itself. The elements dispatch `qc-feedback-show` here.
|
|
22
|
+
*/
|
|
23
|
+
protected feedbackShowing(): boolean;
|
|
24
|
+
/** Called when this feedback is about to hide. Return `false` to keep it showing: the host hides it itself. */
|
|
25
|
+
protected feedbackHiding(): boolean;
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
export { QtiFeedback as Q, QtiVariableDeclaration as a };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
3
|
import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
|
|
4
|
-
import { C as ComputedItemContext, V as View } from './session.context.d-
|
|
5
|
-
import { C as ConfigContext } from './config.context.d-
|
|
4
|
+
import { C as ComputedItemContext, V as View } from './session.context.d-9gRdGK4T.js';
|
|
5
|
+
import { C as ConfigContext } from './config.context.d-Dm11aAuw.js';
|
|
6
|
+
import './public-events.d-3dGip9pd.js';
|
|
6
7
|
import { QtiAssessmentItem } from './elements.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -21,8 +21,8 @@ declare abstract class QtiRuleElement extends LitElement implements QtiRuleBase
|
|
|
21
21
|
* every one of those loops without each of them having to report upwards.
|
|
22
22
|
*
|
|
23
23
|
* `qti-response-processing` catches it at the top of the run. The outcomes set
|
|
24
|
-
* before the exit are kept
|
|
25
|
-
*
|
|
24
|
+
* before the exit are kept: they are already on the run's working copy, which
|
|
25
|
+
* the item applies once the run ends.
|
|
26
26
|
*/
|
|
27
27
|
declare class QtiExitResponseSignal extends Error {
|
|
28
28
|
constructor();
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { C as ComputedContext } from './computed.types.d-6Ht-HNRx.js';
|
|
2
|
+
import { a as QtiTestPluginState$1 } from './qti-test-state.d-D8Q89RzZ.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A plugin's entry in the state, typed through `QtiTestPluginState`, or `undefined` before the
|
|
6
|
+
* plugin has stored anything. Read it from `computedContext`; write it by dispatching
|
|
7
|
+
* `qc-test-update-plugin-state` (`dispatchPublic`).
|
|
8
|
+
*/
|
|
9
|
+
declare const pluginState: <K extends keyof QtiTestPluginState$1 & string>(context: Pick<ComputedContext, "plugins"> | undefined, plugin: K) => QtiTestPluginState$1[K] | undefined;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Everything a host needs to persist to resume a candidate's test session, and nothing else.
|
|
13
|
+
*
|
|
14
|
+
* Read it from `qtiTest.state` or the `qc-test-state-changed` event, store it wherever you like —
|
|
15
|
+
* a database, `localStorage`, `sessionStorage` — and assign it back to `qtiTest.state` to resume.
|
|
16
|
+
*
|
|
17
|
+
* Deliberately not here:
|
|
18
|
+
* - declaration metadata (`baseType`, `cardinality`, `correctResponse`, `mapping`, …): it comes
|
|
19
|
+
* from the item XML on every load, and persisting the answer key with the candidate's data is
|
|
20
|
+
* both bloat and a leak;
|
|
21
|
+
* - `configContext` and `qtiContext`: inputs the host supplies on every load, not session state.
|
|
22
|
+
* The shuffle `seed` in particular must be passed in again, or the restored order changes;
|
|
23
|
+
* - `view`: a role the host decides, not something the candidate produced;
|
|
24
|
+
* - anything computed — scores per section, `done`, `active` — which is rederived from this.
|
|
25
|
+
*/
|
|
26
|
+
interface QtiTestState {
|
|
27
|
+
/** Bumped on any incompatible change to this shape. A state with another version is ignored. */
|
|
28
|
+
version: 1;
|
|
29
|
+
test: {
|
|
30
|
+
items: QtiTestStateItem[];
|
|
31
|
+
/** Test-level outcome values. Only outcomes the test declares are restored. */
|
|
32
|
+
outcomes: QtiTestStateValue[];
|
|
33
|
+
};
|
|
34
|
+
session: QtiTestStateSession;
|
|
35
|
+
}
|
|
36
|
+
interface QtiTestStateItem {
|
|
37
|
+
/** The `qti-assessment-item-ref` identifier. */
|
|
38
|
+
identifier: string;
|
|
39
|
+
variables: (QtiTestStateValue & {
|
|
40
|
+
type?: 'response' | 'outcome' | 'template' | 'context';
|
|
41
|
+
})[];
|
|
42
|
+
/** Opaque per-interaction state keyed by response identifier, e.g. a PCI's `getState()`. */
|
|
43
|
+
state?: Record<string, string | null>;
|
|
44
|
+
}
|
|
45
|
+
interface QtiTestStateValue {
|
|
46
|
+
identifier: string;
|
|
47
|
+
value: string | string[] | null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* What each plugin keeps in the state, by plugin name. Empty here: a plugin adds its own entry by
|
|
51
|
+
* augmenting this interface (`declare module` on the module that declares it, with
|
|
52
|
+
* `interface QtiTestPluginState { bookmarks: string[] }`), and reads it with
|
|
53
|
+
* `pluginState(computedContext, 'bookmarks')`. The test never reads an entry; it
|
|
54
|
+
* stores and restores it, so a value must survive `JSON.stringify`.
|
|
55
|
+
*/
|
|
56
|
+
interface QtiTestPluginState {
|
|
57
|
+
}
|
|
58
|
+
/** Where the candidate is, and what plugins keep. */
|
|
59
|
+
interface QtiTestStateSession {
|
|
60
|
+
/** Plugin entries by plugin name. Entries of plugins that are not loaded are kept as they are. */
|
|
61
|
+
plugins?: Partial<QtiTestPluginState> & Record<string, unknown>;
|
|
62
|
+
navPartId?: string | null;
|
|
63
|
+
navSectionId?: string | null;
|
|
64
|
+
navItemRefId?: string | null;
|
|
65
|
+
}
|
|
66
|
+
declare const QTI_TEST_STATE_VERSION = 1;
|
|
67
|
+
|
|
68
|
+
export { QTI_TEST_STATE_VERSION as Q, type QtiTestPluginState as a, type QtiTestState as b, type QtiTestStateItem as c, type QtiTestStateSession as d, type QtiTestStateValue as e, pluginState as p };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything a host needs to persist to resume a candidate's test session, and nothing else.
|
|
3
|
+
*
|
|
4
|
+
* Read it from `qtiTest.state` or the `qc-test-state-changed` event, store it wherever you like —
|
|
5
|
+
* a database, `localStorage`, `sessionStorage` — and assign it back to `qtiTest.state` to resume.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately not here:
|
|
8
|
+
* - declaration metadata (`baseType`, `cardinality`, `correctResponse`, `mapping`, …): it comes
|
|
9
|
+
* from the item XML on every load, and persisting the answer key with the candidate's data is
|
|
10
|
+
* both bloat and a leak;
|
|
11
|
+
* - `configContext` and `qtiContext`: inputs the host supplies on every load, not session state.
|
|
12
|
+
* The shuffle `seed` in particular must be passed in again, or the restored order changes;
|
|
13
|
+
* - `view`: a role the host decides, not something the candidate produced;
|
|
14
|
+
* - anything computed — scores per section, `done`, `active` — which is rederived from this.
|
|
15
|
+
*/
|
|
16
|
+
interface QtiTestState {
|
|
17
|
+
/** Bumped on any incompatible change to this shape. A state with another version is ignored. */
|
|
18
|
+
version: 1;
|
|
19
|
+
test: {
|
|
20
|
+
items: QtiTestStateItem[];
|
|
21
|
+
/** Test-level outcome values. Only outcomes the test declares are restored. */
|
|
22
|
+
outcomes: QtiTestStateValue[];
|
|
23
|
+
};
|
|
24
|
+
session: QtiTestStateSession;
|
|
25
|
+
}
|
|
26
|
+
interface QtiTestStateItem {
|
|
27
|
+
/** The `qti-assessment-item-ref` identifier. */
|
|
28
|
+
identifier: string;
|
|
29
|
+
variables: (QtiTestStateValue & {
|
|
30
|
+
type?: 'response' | 'outcome' | 'template' | 'context';
|
|
31
|
+
})[];
|
|
32
|
+
/** Opaque per-interaction state keyed by response identifier, e.g. a PCI's `getState()`. */
|
|
33
|
+
state?: Record<string, string | null>;
|
|
34
|
+
}
|
|
35
|
+
interface QtiTestStateValue {
|
|
36
|
+
identifier: string;
|
|
37
|
+
value: string | string[] | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* What each plugin keeps in the state, by plugin name. Empty here: a plugin adds its own entry by
|
|
41
|
+
* augmenting this interface (`declare module` on the module that declares it, with
|
|
42
|
+
* `interface QtiTestPluginState { bookmarks: string[] }`), and reads it with
|
|
43
|
+
* `pluginState(computedContext, 'bookmarks')`. The test never reads an entry; it
|
|
44
|
+
* stores and restores it, so a value must survive `JSON.stringify`.
|
|
45
|
+
*/
|
|
46
|
+
interface QtiTestPluginState {
|
|
47
|
+
}
|
|
48
|
+
/** Where the candidate is, and what plugins keep. */
|
|
49
|
+
interface QtiTestStateSession {
|
|
50
|
+
/** Plugin entries by plugin name. Entries of plugins that are not loaded are kept as they are. */
|
|
51
|
+
plugins?: Partial<QtiTestPluginState> & Record<string, unknown>;
|
|
52
|
+
navPartId?: string | null;
|
|
53
|
+
navSectionId?: string | null;
|
|
54
|
+
navItemRefId?: string | null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type { QtiTestState as Q, QtiTestPluginState as a };
|