@citolab/qti-components 10.0.0-next.16 → 10.0.0-next.18

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 (67) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +233 -459
  3. package/dist/base.d.ts +12 -10
  4. package/dist/base.js +1 -0
  5. package/dist/chunk-DJ7PB252.js +7 -0
  6. package/dist/chunk-DJ7PB252.js.map +1 -0
  7. package/dist/{chunk-7MYZHZWV.js → chunk-DUKQ53E7.js} +46 -3
  8. package/dist/chunk-DUKQ53E7.js.map +1 -0
  9. package/dist/chunk-J6VX4N7M.js +197 -0
  10. package/dist/chunk-J6VX4N7M.js.map +1 -0
  11. package/dist/{chunk-J3F3JSCW.js → chunk-N453PANH.js} +2 -2
  12. package/dist/chunk-PZ5AY32C.js +10 -0
  13. package/dist/chunk-PZ5AY32C.js.map +1 -0
  14. package/dist/{chunk-NWSDBYK7.js → chunk-QLGUI5VG.js} +2 -2
  15. package/dist/{chunk-H3Z3TMFB.js → chunk-SUPLA6QQ.js} +9 -19
  16. package/dist/chunk-SUPLA6QQ.js.map +1 -0
  17. package/dist/chunk-UCXLDQYA.js +56 -0
  18. package/dist/chunk-UCXLDQYA.js.map +1 -0
  19. package/dist/{chunk-LQ65RILE.js → chunk-UURHLJVM.js} +66 -1803
  20. package/dist/chunk-UURHLJVM.js.map +1 -0
  21. package/dist/{chunk-4DC5Z2LQ.js → chunk-V5GL7PTC.js} +2 -2
  22. package/dist/{chunk-M4TZIB3W.js → chunk-WGUQCB2Z.js} +4 -54
  23. package/dist/chunk-WGUQCB2Z.js.map +1 -0
  24. package/dist/{computed.types.d-n3K2VvB0.d.ts → computed.types.d-D4wskgi0.d.ts} +1 -1
  25. package/dist/corrections.d.ts +13 -14
  26. package/dist/corrections.js +7 -7
  27. package/dist/corrections.js.map +1 -1
  28. package/dist/elements.d.ts +5 -105
  29. package/dist/elements.js +7 -4
  30. package/dist/index.d.ts +17 -13
  31. package/dist/index.js +17 -57
  32. package/dist/interactions.d.ts +5 -4
  33. package/dist/interactions.js +3 -2
  34. package/dist/item.d.ts +6 -4
  35. package/dist/item.js +1 -0
  36. package/dist/item.types.d-Zc6ZQDhu.d.ts +25 -0
  37. package/dist/loader.d.ts +4 -2
  38. package/dist/loader.js +1 -0
  39. package/dist/processing.d.ts +4 -3
  40. package/dist/processing.js +1 -0
  41. package/dist/public-events.d-3dGip9pd.d.ts +105 -0
  42. package/dist/qti-components-jsx.d.ts +2686 -4046
  43. package/dist/{qti-condition-expression.d-B-T1NNl0.d.ts → qti-condition-expression.d-7Kd4LBxn.d.ts} +1 -1
  44. package/dist/{qti-expression.d-B-Cfbqlb.d.ts → qti-expression.d-iH3w6mqf.d.ts} +2 -1
  45. package/dist/{qti-feedback.d-1JL_qHjc.d.ts → qti-feedback.d-CT0W-8Gm.d.ts} +1 -1
  46. package/dist/{qti-item.d-DDMDjWIk.d.ts → qti-item.d-CLChmRvB.d.ts} +2 -1
  47. package/dist/qti-test-state-BAf5AmJ2.d.ts +68 -0
  48. package/dist/qti-test-state.d-D8Q89RzZ.d.ts +57 -0
  49. package/dist/{qti-test.d-CDdyCp6e.d.ts → qti-test.d-COzv7YZG.d.ts} +9 -546
  50. package/dist/{qti-text-entry-interaction.d-BTAKmr4b.d.ts → qti-text-entry-interaction.d-DsUyecBC.d.ts} +3 -2
  51. package/dist/{record.d-Bojj6_LW.d.ts → record.d-BfZhFr0L.d.ts} +1 -1
  52. package/dist/{session.context.d-BNxGeyh9.d.ts → session.context.d-9gRdGK4T.d.ts} +1 -1
  53. package/dist/test-plugin-api.d.ts +134 -0
  54. package/dist/test-plugin-api.js +19 -0
  55. package/dist/test-plugin-api.js.map +1 -0
  56. package/dist/test.d.ts +16 -158
  57. package/dist/test.js +11 -50
  58. package/dist/transformers.js +1 -0
  59. package/dist/{item.types.d-DuVR0ZVK.d.ts → variables.d-DWHlTszN.d.ts} +1 -23
  60. package/package.json +7 -3
  61. package/dist/chunk-7MYZHZWV.js.map +0 -1
  62. package/dist/chunk-H3Z3TMFB.js.map +0 -1
  63. package/dist/chunk-LQ65RILE.js.map +0 -1
  64. package/dist/chunk-M4TZIB3W.js.map +0 -1
  65. /package/dist/{chunk-J3F3JSCW.js.map → chunk-N453PANH.js.map} +0 -0
  66. /package/dist/{chunk-NWSDBYK7.js.map → chunk-QLGUI5VG.js.map} +0 -0
  67. /package/dist/{chunk-4DC5Z2LQ.js.map → chunk-V5GL7PTC.js.map} +0 -0
@@ -0,0 +1,134 @@
1
+ import { V as View } from './session.context.d-9gRdGK4T.js';
2
+ import { a as PublicEventDeclaration } from './public-events.d-3dGip9pd.js';
3
+ import { Q as QtiTestState } from './qti-test-state.d-D8Q89RzZ.js';
4
+ export { a as QtiTestPluginState, b as QtiTestState, p as pluginState } from './qti-test-state-BAf5AmJ2.js';
5
+ import * as lit from 'lit';
6
+ import './variables.d-DWHlTszN.js';
7
+ import './computed.types.d-D4wskgi0.js';
8
+
9
+ /**
10
+ * The public events of the test. The name tells you it is public: everything here starts with
11
+ * `qc-`; every other event is internal plumbing and may change in any release.
12
+ *
13
+ * Requests are verbs (a host or plugin dispatches them at the test), notifications are past tense
14
+ * (the test dispatches them). All bubble and are composed.
15
+ *
16
+ * `deprecated` is the `cito-` name this event had in 9.x. One helper (`dispatchPublic`,
17
+ * `listenPublic`) sends or handles both names until the next major, then the field goes. The 7.x
18
+ * names (`qti-request-navigation`, `test-end-attempt`, `on-test-switch-view`, …) are no longer sent
19
+ * or handled.
20
+ */
21
+ interface NavigationTarget {
22
+ type: 'item' | 'section';
23
+ id: string;
24
+ }
25
+ interface NavigationFailure {
26
+ message: string;
27
+ details?: unknown;
28
+ itemId?: string;
29
+ sectionId?: string;
30
+ }
31
+ interface PublicEventMap {
32
+ 'qc-test-navigate': CustomEvent<NavigationTarget>;
33
+ /**
34
+ * Ends an attempt: processes the response of the item-ref `itemId`, or, without it, of the item on
35
+ * screen. `<test-end-attempt>` sends the `itemId` of the item it is stamped into or names.
36
+ */
37
+ 'qc-test-end-attempt': CustomEvent<{
38
+ itemId?: string;
39
+ }>;
40
+ /** Scores the test: resets its outcomes to their defaults, runs outcome processing, then `qc-test-submitted`. */
41
+ 'qc-test-submit': CustomEvent<Record<string, never>>;
42
+ 'qc-test-update-outcome': CustomEvent<{
43
+ assessmentItemRefId: string;
44
+ outcomeVariableId: string;
45
+ value: number | string;
46
+ }>;
47
+ 'qc-test-switch-view': CustomEvent<View>;
48
+ /** `value` is JSON; `null` or `undefined` removes the plugin's entry. */
49
+ 'qc-test-update-plugin-state': CustomEvent<{
50
+ plugin: string;
51
+ value: unknown;
52
+ }>;
53
+ /** Outcome processing ran after a submit: read the test outcomes now. */
54
+ 'qc-test-submitted': CustomEvent<Record<string, never>>;
55
+ 'qc-test-navigated': CustomEvent<NavigationTarget>;
56
+ 'qc-test-navigation-started': CustomEvent<NavigationTarget>;
57
+ 'qc-test-navigation-failed': CustomEvent<NavigationFailure>;
58
+ 'qc-test-rendered': CustomEvent<{
59
+ identifier: string;
60
+ element: Element;
61
+ }[]>;
62
+ 'qc-test-state-changed': CustomEvent<QtiTestState>;
63
+ 'qc-test-items-skipped': CustomEvent<{
64
+ ids: string[];
65
+ }>;
66
+ 'qc-test-end-reached': CustomEvent<Record<string, never>>;
67
+ 'qc-item-ref-connected': CustomEvent<{
68
+ identifier: string;
69
+ href: string;
70
+ category: string;
71
+ }>;
72
+ }
73
+ type PublicEventName = keyof PublicEventMap;
74
+ declare const PUBLIC_EVENTS: Record<PublicEventName, PublicEventDeclaration>;
75
+ declare global {
76
+ interface HTMLElementEventMap extends PublicEventMap {
77
+ }
78
+ }
79
+ /**
80
+ * Dispatch a public event, and its deprecated name with the same `detail` object. The detail is
81
+ * always an object so `listenPublic` can tell the two apart from one dispatch.
82
+ */
83
+ declare function dispatchPublic<K extends PublicEventName>(target: EventTarget, name: K, detail: PublicEventMap[K] extends CustomEvent<infer D> ? D : never): void;
84
+ /**
85
+ * Listen for a public event and its deprecated name; the handler runs once for a sender that
86
+ * dispatched both. See `listenDeclared`.
87
+ */
88
+ declare function listenPublic<K extends PublicEventName>(target: EventTarget, name: K, handler: (e: PublicEventMap[K]) => void): void;
89
+
90
+ declare const hostBox: lit.CSSResult;
91
+ /** The box of the control itself: the inner element. */
92
+ declare const form: lit.CSSResult;
93
+ declare const btn: lit.CSSResult;
94
+ /** The filled look: the neutral colour, its content colour on top. Same box as `btn`, so the two sit level. */
95
+ declare const btnPrimary: lit.CSSResult;
96
+ /** Hover; paint only, so the box never moves. */
97
+ declare const btnInteractive: lit.CSSResult;
98
+ declare const btnPrimaryInteractive: lit.CSSResult;
99
+ /** Pressed: the same mix, twice as far. Paint only, so a click never moves the button. */
100
+ declare const btnActive: lit.CSSResult;
101
+ declare const btnPrimaryActive: lit.CSSResult;
102
+ /** The theme's one focus ring (qti-theme `@mixin foc`), so a page shows one kind of ring. */
103
+ declare const focusRing: lit.CSSResult;
104
+ declare const dis: lit.CSSResult;
105
+ declare const ind: lit.CSSResult;
106
+ /** What a test control renders: the inner element that carries the look (see `hostBox`). */
107
+ declare const control: lit.TemplateResult<1>;
108
+ /**
109
+ * The stylesheet of a neutral test control: the host box, the look on `.control`, and its hover, press,
110
+ * focus and disabled states. A control with its own content (a bookmark's icon) adds to it.
111
+ */
112
+ declare const button: lit.CSSResult;
113
+ /** The filled look of `test-next`: add after `button`, so its rules win at equal specificity. */
114
+ declare const buttonPrimary: lit.CSSResult;
115
+
116
+ declare const styles_btn: typeof btn;
117
+ declare const styles_btnActive: typeof btnActive;
118
+ declare const styles_btnInteractive: typeof btnInteractive;
119
+ declare const styles_btnPrimary: typeof btnPrimary;
120
+ declare const styles_btnPrimaryActive: typeof btnPrimaryActive;
121
+ declare const styles_btnPrimaryInteractive: typeof btnPrimaryInteractive;
122
+ declare const styles_button: typeof button;
123
+ declare const styles_buttonPrimary: typeof buttonPrimary;
124
+ declare const styles_control: typeof control;
125
+ declare const styles_dis: typeof dis;
126
+ declare const styles_focusRing: typeof focusRing;
127
+ declare const styles_form: typeof form;
128
+ declare const styles_hostBox: typeof hostBox;
129
+ declare const styles_ind: typeof ind;
130
+ declare namespace styles {
131
+ export { styles_btn as btn, styles_btnActive as btnActive, styles_btnInteractive as btnInteractive, styles_btnPrimary as btnPrimary, styles_btnPrimaryActive as btnPrimaryActive, styles_btnPrimaryInteractive as btnPrimaryInteractive, styles_button as button, styles_buttonPrimary as buttonPrimary, styles_control as control, styles_dis as dis, styles_focusRing as focusRing, styles_form as form, styles_hostBox as hostBox, styles_ind as ind };
132
+ }
133
+
134
+ export { type NavigationFailure, type NavigationTarget, PUBLIC_EVENTS, type PublicEventMap, type PublicEventName, styles as controlStyles, dispatchPublic, listenPublic };
@@ -0,0 +1,19 @@
1
+ import {
2
+ pluginState
3
+ } from "./chunk-DJ7PB252.js";
4
+ import {
5
+ PUBLIC_EVENTS,
6
+ dispatchPublic,
7
+ listenPublic,
8
+ styles_exports
9
+ } from "./chunk-J6VX4N7M.js";
10
+ import "./chunk-UCXLDQYA.js";
11
+ import "./chunk-PZ5AY32C.js";
12
+ export {
13
+ PUBLIC_EVENTS,
14
+ styles_exports as controlStyles,
15
+ dispatchPublic,
16
+ listenPublic,
17
+ pluginState
18
+ };
19
+ //# sourceMappingURL=test-plugin-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/test.d.ts CHANGED
@@ -1,119 +1,34 @@
1
- import { u as TestItemToSpeech, G as TestTtsNext, H as TestTtsPause, J as TestTtsPick, K as TestTtsPlay, L as TestTtsPrev, M as TestTtsResume, N as TestTtsStop, q as TestCheckItem, T as TestBookmark, y as TestPrintContext, A as TestPrintVariables, z as TestPrintState, B as TestScoringButtons, C as TestScoringFeedback, E as TestStamp, F as TestSubmit, O as TestView, P as TestViewToggle, S as QtiTestPluginState$1, U as ItemVariableValue, I as ITestNavigationMixin, a as ITestStateMixin } from './qti-test.d-CDdyCp6e.js';
2
- export { b as ItemRefTemplateModel, Q as QtiAssessmentItemRef, c as QtiAssessmentSection, d as QtiAssessmentTest, e as QtiBranchRule, f as QtiItemSessionControl, g as QtiNumberPresented, h as QtiNumberSelected, i as QtiOutcomeProcessing, j as QtiOutcomeProcessingProcessor, k as QtiPreCondition, l as QtiTest, m as QtiTestFeedback, n as QtiTestPart, o as QtiTestVariables, p as QtiTestVariablesExpression, r as TestContainer, s as TestEndAttempt, t as TestItemLink, v as TestNavigation, w as TestNext, x as TestPrev, D as TestSectionLink, R as bookmarkedItems } from './qti-test.d-CDdyCp6e.js';
3
- import { C as ComputedContext } from './computed.types.d-n3K2VvB0.js';
1
+ import { u as TestSubmit, v as ItemVariableValue, I as ITestNavigationMixin, a as ITestStateMixin } from './qti-test.d-COzv7YZG.js';
2
+ export { b as ItemRefTemplateModel, Q as QtiAssessmentItemRef, c as QtiAssessmentSection, d as QtiAssessmentTest, e as QtiBranchRule, f as QtiItemSessionControl, g as QtiNumberPresented, h as QtiNumberSelected, i as QtiOutcomeProcessing, j as QtiOutcomeProcessingProcessor, k as QtiPreCondition, l as QtiTest, m as QtiTestFeedback, n as QtiTestPart, o as QtiTestVariables, p as QtiTestVariablesExpression, T as TestContainer, q as TestEndAttempt, r as TestNavigation, s as TestNext, t as TestPrev } from './qti-test.d-COzv7YZG.js';
3
+ export { Q as QTI_TEST_STATE_VERSION, a as QtiTestPluginState, b as QtiTestState, c as QtiTestStateItem, d as QtiTestStateSession, e as QtiTestStateValue, p as pluginState } from './qti-test-state-BAf5AmJ2.js';
4
4
  import { LitElement } from 'lit';
5
- import { b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
6
- import { S as SessionContext } from './session.context.d-BNxGeyh9.js';
5
+ import { b as OutcomeVariable, V as VariableDeclaration } from './variables.d-DWHlTszN.js';
6
+ import { S as SessionContext } from './session.context.d-9gRdGK4T.js';
7
7
  import { C as ConfigContext } from './config.context.d-CCqlJXpE.js';
8
- import { T as TestContext } from './qti-expression.d-B-Cfbqlb.js';
8
+ import { I as ItemContext } from './item.types.d-Zc6ZQDhu.js';
9
+ import { T as TestContext } from './qti-expression.d-iH3w6mqf.js';
9
10
  import './qti-transform-test.d-Bb9vnLzP.js';
11
+ import './computed.types.d-D4wskgi0.js';
12
+ import './public-events.d-3dGip9pd.js';
10
13
  import './elements.js';
11
14
  import './interaction.interface.d-CvjHM2bi.js';
12
- import './qti-feedback.d-1JL_qHjc.js';
15
+ import './qti-feedback.d-CT0W-8Gm.js';
13
16
  import './qti-rule-base.d-CeKP0Ooi.js';
14
17
  import './qti.context.d-CejJMlfZ.js';
15
18
  import '@heximal/templates';
16
-
17
- /** The text-to-speech elements, for registering them yourself (e.g. in a scoped registry). Defines nothing. */
18
- declare const ttsElements: readonly [{
19
- readonly tag: "test-item-to-speech";
20
- readonly ctor: typeof TestItemToSpeech;
21
- }, {
22
- readonly tag: "test-tts-next";
23
- readonly ctor: typeof TestTtsNext;
24
- }, {
25
- readonly tag: "test-tts-pause";
26
- readonly ctor: typeof TestTtsPause;
27
- }, {
28
- readonly tag: "test-tts-pick";
29
- readonly ctor: typeof TestTtsPick;
30
- }, {
31
- readonly tag: "test-tts-play";
32
- readonly ctor: typeof TestTtsPlay;
33
- }, {
34
- readonly tag: "test-tts-prev";
35
- readonly ctor: typeof TestTtsPrev;
36
- }, {
37
- readonly tag: "test-tts-resume";
38
- readonly ctor: typeof TestTtsResume;
39
- }, {
40
- readonly tag: "test-tts-stop";
41
- readonly ctor: typeof TestTtsStop;
42
- }];
19
+ import './qti-test-state.d-D8Q89RzZ.js';
43
20
 
44
21
  /**
45
- * Every test plugin's elements in one list. `qti-test` registers them with the rest of its
46
- * elements, and a scoped registry can use the list directly. Defines nothing.
47
- *
48
- * A plugin is the set of files listed for it in `plugin-boundary.spec.ts` (`PLUGINS`); this file is
49
- * the one place that names them all.
22
+ * The plugins' `{ tag, ctor }` pairs, so a scoped registry (an item-ref template is stamped into
23
+ * `test-container`'s shadow root) can define them with the rest. `elements.ts` spreads these into
24
+ * `qtiTestElements`; this is the one place that composes the plugins. The other plugins are in
25
+ * `@qti-components/extended`.
50
26
  */
51
27
  declare const pluginElements: readonly [{
52
- readonly tag: "test-check-item";
53
- readonly ctor: typeof TestCheckItem;
54
- }, {
55
- readonly tag: "test-bookmark";
56
- readonly ctor: typeof TestBookmark;
57
- }, {
58
- readonly tag: "test-print-context";
59
- readonly ctor: typeof TestPrintContext;
60
- }, {
61
- readonly tag: "test-print-item-variables";
62
- readonly ctor: typeof TestPrintVariables;
63
- }, {
64
- readonly tag: "test-print-state";
65
- readonly ctor: typeof TestPrintState;
66
- }, {
67
- readonly tag: "test-scoring-buttons";
68
- readonly ctor: typeof TestScoringButtons;
69
- }, {
70
- readonly tag: "test-scoring-feedback";
71
- readonly ctor: typeof TestScoringFeedback;
72
- }, {
73
- readonly tag: "test-stamp";
74
- readonly ctor: typeof TestStamp;
75
- }, {
76
28
  readonly tag: "test-submit";
77
29
  readonly ctor: typeof TestSubmit;
78
- }, {
79
- readonly tag: "test-view";
80
- readonly ctor: typeof TestView;
81
- }, {
82
- readonly tag: "test-view-toggle";
83
- readonly ctor: typeof TestViewToggle;
84
- }, {
85
- readonly tag: "test-item-to-speech";
86
- readonly ctor: typeof TestItemToSpeech;
87
- }, {
88
- readonly tag: "test-tts-next";
89
- readonly ctor: typeof TestTtsNext;
90
- }, {
91
- readonly tag: "test-tts-pause";
92
- readonly ctor: typeof TestTtsPause;
93
- }, {
94
- readonly tag: "test-tts-pick";
95
- readonly ctor: typeof TestTtsPick;
96
- }, {
97
- readonly tag: "test-tts-play";
98
- readonly ctor: typeof TestTtsPlay;
99
- }, {
100
- readonly tag: "test-tts-prev";
101
- readonly ctor: typeof TestTtsPrev;
102
- }, {
103
- readonly tag: "test-tts-resume";
104
- readonly ctor: typeof TestTtsResume;
105
- }, {
106
- readonly tag: "test-tts-stop";
107
- readonly ctor: typeof TestTtsStop;
108
30
  }];
109
31
 
110
- /**
111
- * A plugin's entry in the state, typed through `QtiTestPluginState`, or `undefined` before the
112
- * plugin has stored anything. Read it from `computedContext`; write it by dispatching
113
- * `qc-test-update-plugin-state` (`dispatchPublic`).
114
- */
115
- declare const pluginState: <K extends keyof QtiTestPluginState$1 & string>(context: Pick<ComputedContext, "plugins"> | undefined, plugin: K) => QtiTestPluginState$1[K] | undefined;
116
-
117
32
  interface IQtiTest extends LitElement, ITestNavigationMixin, ITestProcessingMixin, ITestStateMixin, IMyQtiTest {
118
33
  }
119
34
  interface IMyQtiTest {
@@ -130,61 +45,4 @@ interface ITestProcessingMixin {
130
45
  outcomeProcessing(): boolean;
131
46
  }
132
47
 
133
- /**
134
- * Everything a host needs to persist to resume a candidate's test session, and nothing else.
135
- *
136
- * Read it from `qtiTest.state` or the `qc-test-state-changed` event, store it wherever you like —
137
- * a database, `localStorage`, `sessionStorage` — and assign it back to `qtiTest.state` to resume.
138
- *
139
- * Deliberately not here:
140
- * - declaration metadata (`baseType`, `cardinality`, `correctResponse`, `mapping`, …): it comes
141
- * from the item XML on every load, and persisting the answer key with the candidate's data is
142
- * both bloat and a leak;
143
- * - `configContext` and `qtiContext`: inputs the host supplies on every load, not session state.
144
- * The shuffle `seed` in particular must be passed in again, or the restored order changes;
145
- * - `view`: a role the host decides, not something the candidate produced;
146
- * - anything computed — scores per section, `done`, `active` — which is rederived from this.
147
- */
148
- interface QtiTestState {
149
- /** Bumped on any incompatible change to this shape. A state with another version is ignored. */
150
- version: 1;
151
- test: {
152
- items: QtiTestStateItem[];
153
- /** Test-level outcome values. Only outcomes the test declares are restored. */
154
- outcomes: QtiTestStateValue[];
155
- };
156
- session: QtiTestStateSession;
157
- }
158
- interface QtiTestStateItem {
159
- /** The `qti-assessment-item-ref` identifier. */
160
- identifier: string;
161
- variables: (QtiTestStateValue & {
162
- type?: 'response' | 'outcome' | 'template' | 'context';
163
- })[];
164
- /** Opaque per-interaction state keyed by response identifier, e.g. a PCI's `getState()`. */
165
- state?: Record<string, string | null>;
166
- }
167
- interface QtiTestStateValue {
168
- identifier: string;
169
- value: string | string[] | null;
170
- }
171
- /**
172
- * What each plugin keeps in the state, by plugin name. Empty here: a plugin adds its own entry by
173
- * augmenting this interface (`declare module` on the module that declares it, with
174
- * `interface QtiTestPluginState { bookmarks: string[] }`), and reads it with
175
- * `pluginState(computedContext, 'bookmarks')`. The test never reads an entry; it
176
- * stores and restores it, so a value must survive `JSON.stringify`.
177
- */
178
- interface QtiTestPluginState {
179
- }
180
- /** Where the candidate is, and what plugins keep. */
181
- interface QtiTestStateSession {
182
- /** Plugin entries by plugin name. Entries of plugins that are not loaded are kept as they are. */
183
- plugins?: Partial<QtiTestPluginState> & Record<string, unknown>;
184
- navPartId?: string | null;
185
- navSectionId?: string | null;
186
- navItemRefId?: string | null;
187
- }
188
- declare const QTI_TEST_STATE_VERSION = 1;
189
-
190
- export { type IMyQtiTest, type IQtiTest, ITestNavigationMixin, type ITestProcessingMixin, ITestStateMixin, QTI_TEST_STATE_VERSION, type QtiTestPluginState, type QtiTestState, type QtiTestStateItem, type QtiTestStateSession, type QtiTestStateValue, TestBookmark, TestCheckItem, TestItemToSpeech, TestPrintContext, TestPrintState, TestPrintVariables, TestScoringButtons, TestScoringFeedback, TestStamp, TestSubmit, TestTtsNext, TestTtsPause, TestTtsPick, TestTtsPlay, TestTtsPrev, TestTtsResume, TestTtsStop, TestView, TestViewToggle, pluginElements, pluginState, ttsElements };
48
+ export { type IMyQtiTest, type IQtiTest, ITestNavigationMixin, type ITestProcessingMixin, ITestStateMixin, TestSubmit, pluginElements };
package/dist/test.js CHANGED
@@ -1,4 +1,7 @@
1
- import "./chunk-NWSDBYK7.js";
1
+ import "./chunk-QLGUI5VG.js";
2
+ import {
3
+ pluginState
4
+ } from "./chunk-DJ7PB252.js";
2
5
  import {
3
6
  QTI_TEST_STATE_VERSION,
4
7
  QtiAssessmentItemRef,
@@ -16,42 +19,22 @@ import {
16
19
  QtiTestPart,
17
20
  QtiTestVariables,
18
21
  QtiTestVariablesExpression,
19
- TestBookmark,
20
- TestCheckItem,
21
22
  TestContainer,
22
23
  TestEndAttempt,
23
- TestItemLink,
24
- TestItemToSpeech,
25
24
  TestNavigation,
26
25
  TestNext,
27
26
  TestPrev,
28
- TestPrintContext,
29
- TestPrintState,
30
- TestPrintVariables,
31
- TestScoringButtons,
32
- TestScoringFeedback,
33
- TestSectionLink,
34
- TestStamp,
35
27
  TestSubmit,
36
- TestTtsNext,
37
- TestTtsPause,
38
- TestTtsPick,
39
- TestTtsPlay,
40
- TestTtsPrev,
41
- TestTtsResume,
42
- TestTtsStop,
43
- TestView,
44
- TestViewToggle,
45
- bookmarkedItems,
46
- pluginElements,
47
- pluginState,
48
- ttsElements
49
- } from "./chunk-LQ65RILE.js";
50
- import "./chunk-M4TZIB3W.js";
28
+ pluginElements
29
+ } from "./chunk-UURHLJVM.js";
30
+ import "./chunk-J6VX4N7M.js";
31
+ import "./chunk-WGUQCB2Z.js";
32
+ import "./chunk-UCXLDQYA.js";
51
33
  import "./chunk-WWY2H2YO.js";
52
34
  import "./chunk-4DB4SC5K.js";
53
35
  import "./chunk-LORYM4U2.js";
54
36
  import "./chunk-NZ7ZC4SP.js";
37
+ import "./chunk-PZ5AY32C.js";
55
38
  export {
56
39
  QTI_TEST_STATE_VERSION,
57
40
  QtiAssessmentItemRef,
@@ -69,35 +52,13 @@ export {
69
52
  QtiTestPart,
70
53
  QtiTestVariables,
71
54
  QtiTestVariablesExpression,
72
- TestBookmark,
73
- TestCheckItem,
74
55
  TestContainer,
75
56
  TestEndAttempt,
76
- TestItemLink,
77
- TestItemToSpeech,
78
57
  TestNavigation,
79
58
  TestNext,
80
59
  TestPrev,
81
- TestPrintContext,
82
- TestPrintState,
83
- TestPrintVariables,
84
- TestScoringButtons,
85
- TestScoringFeedback,
86
- TestSectionLink,
87
- TestStamp,
88
60
  TestSubmit,
89
- TestTtsNext,
90
- TestTtsPause,
91
- TestTtsPick,
92
- TestTtsPlay,
93
- TestTtsPrev,
94
- TestTtsResume,
95
- TestTtsStop,
96
- TestView,
97
- TestViewToggle,
98
- bookmarkedItems,
99
61
  pluginElements,
100
- pluginState,
101
- ttsElements
62
+ pluginState
102
63
  };
103
64
  //# sourceMappingURL=test.js.map
@@ -3,6 +3,7 @@ import {
3
3
  qtiTransformManifest,
4
4
  qtiTransformTest
5
5
  } from "./chunk-LORYM4U2.js";
6
+ import "./chunk-PZ5AY32C.js";
6
7
  export {
7
8
  qtiTransformItem,
8
9
  qtiTransformManifest,
@@ -89,26 +89,4 @@ interface TemplateVariable extends VariableDeclaration<string | string[] | numbe
89
89
  paramVariable?: boolean;
90
90
  }
91
91
 
92
- interface ItemContext {
93
- identifier?: string;
94
- href?: string;
95
- variables?: ReadonlyArray<VariableDeclaration<string | string[] | null>>;
96
- /**
97
- * Optional per-interaction opaque state, keyed by responseIdentifier.
98
- * Used for interactions that support state save/restore (e.g. PCI).
99
- */
100
- state?: Record<string, string | null>;
101
- /** The item is shown for reading only. Interactions follow it; see `qti-assessment-item`'s `readonly`. */
102
- readonly?: boolean;
103
- /** The item is locked, for example after it was submitted. Interactions follow it; see `qti-assessment-item`'s `disabled`. */
104
- disabled?: boolean;
105
- /**
106
- * Whether the interactions in the item are valid right now (a required answer is given, a limit is
107
- * respected). Published by the item whenever it checks, so a reader never has to ask the item.
108
- * Unset until the item has checked once.
109
- */
110
- valid?: boolean;
111
- }
112
- declare const itemContextVariables: VariableDeclaration<string | string[]>[];
113
-
114
- export { type BaseType as B, type Calculate as C, type InterpolationTableEntry 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 ItemContext as b, type OutcomeVariable as c, type QtiAreaMapping as d, type QtiMapEntry as e, type QtiMapping as f, type ResponseVariable as g, type VariableValue as h, type areaShape as i, type directedPair as j, type float as k, type integer as l, itemContextVariables as m };
92
+ export type { BaseType as B, Calculate as C, InterpolationTableEntry as I, 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 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@citolab/qti-components",
3
3
  "description": "QTI component utilities",
4
- "version": "10.0.0-next.16",
4
+ "version": "10.0.0-next.18",
5
5
  "author": "",
6
6
  "dependencies": {
7
7
  "@heximal/templates": "^0.1.5",
@@ -11,13 +11,13 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@qti-components/base": "^3.0.0-next.6",
14
- "@qti-components/corrections": "^1.0.0-next.9",
14
+ "@qti-components/corrections": "^1.0.0-next.10",
15
15
  "@qti-components/elements": "^2.0.0-next.7",
16
16
  "@qti-components/interactions": "^1.10.5-next.8",
17
17
  "@qti-components/item": "^1.5.1-next.7",
18
18
  "@qti-components/loader": "^1.3.4-next.2",
19
19
  "@qti-components/processing": "^1.6.1-next.5",
20
- "@qti-components/test": "^2.0.0-next.14",
20
+ "@qti-components/test": "^2.0.0-next.15",
21
21
  "@qti-components/theme": "^3.0.0-next.6",
22
22
  "@qti-components/transformers": "^1.8.0-next.0"
23
23
  },
@@ -50,6 +50,10 @@
50
50
  "types": "./dist/test.d.ts",
51
51
  "import": "./dist/test.js"
52
52
  },
53
+ "./qti-test/plugin-api": {
54
+ "types": "./dist/test-plugin-api.d.ts",
55
+ "import": "./dist/test-plugin-api.js"
56
+ },
53
57
  "./qti-loader": {
54
58
  "types": "./dist/loader.d.ts",
55
59
  "import": "./dist/loader.js"