@citolab/qti-components 10.0.0-next.2 → 10.0.0-next.20
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-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-3ZNECUPV.js → chunk-GJWA6LLT.js} +2 -2
- 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-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-K3VKQ6QF.js → chunk-ORQFZNJW.js} +614 -1847
- package/dist/chunk-ORQFZNJW.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.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-2KP5UU5A.js → chunk-Y6Q3F2S7.js} +117 -92
- package/dist/chunk-Y6Q3F2S7.js.map +1 -0
- 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-sskv-dEN.d.ts} +87 -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-GJWA6LLT.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,7 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
import { C as ConfigContext, V as ValidationDisplayMode } from './config.context.d-
|
|
2
|
+
import { C as ConfigContext, V as ValidationDisplayMode } from './config.context.d-Dm11aAuw.js';
|
|
3
3
|
import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
|
|
4
|
-
import {
|
|
4
|
+
import { f as ResponseVariable, B as BaseType } from './variables.d-DWHlTszN.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* What a choice element should render and behave as. The same element — `qti-simple-choice`,
|
|
@@ -40,6 +40,10 @@ declare const interactionContext: {
|
|
|
40
40
|
__context__: Readonly<InteractionContext>;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
/** Why an interaction is invalid: too few (`min`), too many (`max`), or something else (`other`). */
|
|
44
|
+
type ValidityKind = 'min' | 'max' | 'other';
|
|
45
|
+
/** What asked for the report: the candidate changing the response, or a submit (end attempt, form). */
|
|
46
|
+
type ValidityTrigger = 'change' | 'submit';
|
|
43
47
|
/**
|
|
44
48
|
* Shared QTI interaction base. Formative correction behavior is supplied by the
|
|
45
49
|
* `@qti-components/corrections` package.
|
|
@@ -89,7 +93,27 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
|
|
|
89
93
|
set value(val: string | null);
|
|
90
94
|
abstract get response(): string | string[] | null;
|
|
91
95
|
abstract set response(val: string | string[] | null);
|
|
92
|
-
|
|
96
|
+
/** Why the interaction is invalid right now; `undefined` while it is valid. */
|
|
97
|
+
protected _validityKind?: ValidityKind;
|
|
98
|
+
/** Set once a submit has reported; from then on every change reports in full. */
|
|
99
|
+
protected _validityReported: boolean;
|
|
100
|
+
/** True while this element asks its own internals to report, so its `invalid` is not a submit. */
|
|
101
|
+
protected _reportingNatively: boolean;
|
|
102
|
+
/** Forget that a submit has reported: a reset or a new attempt waits for a submit again. */
|
|
103
|
+
protected resetValidityReport(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Show the validity state, in the configured mode.
|
|
106
|
+
*
|
|
107
|
+
* When it shows depends on what asked: a `change` (the candidate picked or dropped something)
|
|
108
|
+
* reports what they just did wrong, too many, at once; too few is not an error until they say they
|
|
109
|
+
* are done, so a `submit` (the item's end attempt, a form's submit) is what first shows it. After
|
|
110
|
+
* that first submit, changes report in full, so the message clears the moment the minimum is met
|
|
111
|
+
* and comes back if it is lost again. The validity itself is always set: a form with a
|
|
112
|
+
* below-minimum interaction cannot submit either way.
|
|
113
|
+
*/
|
|
114
|
+
reportValidity(options?: {
|
|
115
|
+
trigger?: ValidityTrigger;
|
|
116
|
+
}): boolean;
|
|
93
117
|
protected get validationDisplayMode(): ValidationDisplayMode;
|
|
94
118
|
protected resolveAllowReorder(options?: {
|
|
95
119
|
defaultWhenUnset?: boolean;
|
|
@@ -99,6 +123,7 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
|
|
|
99
123
|
}): boolean;
|
|
100
124
|
protected setInteractionValidity(isValid: boolean, validityMessage?: string, anchor?: HTMLElement | null, options?: {
|
|
101
125
|
suppressInline?: boolean;
|
|
126
|
+
kind?: ValidityKind;
|
|
102
127
|
}): void;
|
|
103
128
|
protected updateInlineValidationMessage(): void;
|
|
104
129
|
protected clearInlineValidationMessage(): void;
|
|
@@ -107,6 +132,12 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
|
|
|
107
132
|
formResetCallback(): void;
|
|
108
133
|
connectedCallback(): void;
|
|
109
134
|
saveResponse(value: string | string[], state?: string | null): void;
|
|
135
|
+
/**
|
|
136
|
+
* `disabled` and `readonly` are states as well as attributes (qti-theme CONTRACT.md §3): a theme
|
|
137
|
+
* reads `:state(disabled)` on the host the way it reads it on a choice. The attribute stays
|
|
138
|
+
* reflected, so `[disabled]` keeps matching.
|
|
139
|
+
*/
|
|
140
|
+
protected update(changed: PropertyValues): void;
|
|
110
141
|
constructor();
|
|
111
142
|
/**
|
|
112
143
|
* Optional lifecycle bridge for interaction subclasses that do not need changed-property data.
|
|
@@ -123,4 +154,36 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
|
|
|
123
154
|
protected firstUpdated(_changedProperties?: PropertyValues): void;
|
|
124
155
|
}
|
|
125
156
|
|
|
126
|
-
|
|
157
|
+
/**
|
|
158
|
+
* The value of a variable with `record` cardinality: its fields by field identifier.
|
|
159
|
+
*
|
|
160
|
+
* Field values are kept the way every other response value is kept, as QTI string literals — a
|
|
161
|
+
* float is `"4.12"`, a point is `"455 250"` — with a list-valued field as an array of them.
|
|
162
|
+
*/
|
|
163
|
+
type RecordValue = Record<string, string | string[] | null>;
|
|
164
|
+
/** A record's field values with the base type each `qti-value` declared for its field. */
|
|
165
|
+
interface RecordFieldValues {
|
|
166
|
+
value: RecordValue;
|
|
167
|
+
baseTypes: Record<string, BaseType>;
|
|
168
|
+
}
|
|
169
|
+
/** Whether a variable value is a record: a plain object, not a list and not NULL. */
|
|
170
|
+
declare const isRecordValue: (value: unknown) => value is RecordValue;
|
|
171
|
+
/**
|
|
172
|
+
* Reads the field values of a record out of `qti-value field-identifier="…" base-type="…"`
|
|
173
|
+
* elements, as found in a `qti-correct-response` or `qti-default-value` of a record declaration.
|
|
174
|
+
*
|
|
175
|
+
* A value without a `field-identifier` is not a record field and is skipped. A field without a
|
|
176
|
+
* `base-type` gets no entry in `baseTypes`, so a reader can tell "declared string" from "unknown".
|
|
177
|
+
*/
|
|
178
|
+
declare const readRecordFieldValues: (valueElements: Iterable<Element>) => RecordFieldValues;
|
|
179
|
+
/**
|
|
180
|
+
* A best guess at a record field's base type, for when the declaration does not say.
|
|
181
|
+
*
|
|
182
|
+
* A record field value carries no type of its own once it is stored, and a record response
|
|
183
|
+
* declaration has no `base-type`, so this is the fallback. A number is a float (or an integer
|
|
184
|
+
* when given as a whole JS number), two numbers separated by whitespace are a point, and
|
|
185
|
+
* anything else is a string.
|
|
186
|
+
*/
|
|
187
|
+
declare const inferRecordFieldBaseType: (value: unknown) => BaseType;
|
|
188
|
+
|
|
189
|
+
export { type ChoiceRole as C, Interaction as I, type RecordFieldValues as R, type ValidityKind as V, type InteractionContext as a, type RecordValue as b, type ValidityTrigger as c, interactionContext as d, isRecordValue as e, inferRecordFieldBaseType as i, readRecordFieldValues as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VariableDeclaration } from './
|
|
1
|
+
import { V as VariableDeclaration } from './variables.d-DWHlTszN.js';
|
|
2
2
|
|
|
3
3
|
type ComputedItemContext = {
|
|
4
4
|
identifier: string;
|
|
@@ -26,6 +26,12 @@ interface SessionContext {
|
|
|
26
26
|
/** @deprecated Never set by the library. Removed in the next major. */
|
|
27
27
|
navTestLoading?: boolean;
|
|
28
28
|
view?: View;
|
|
29
|
+
/**
|
|
30
|
+
* What test plugins keep, by plugin name: JSON the test stores and restores without reading it.
|
|
31
|
+
* Part of the persisted state (`QtiTestState.session.plugins`); written through the
|
|
32
|
+
* `qc-test-update-plugin-state` request.
|
|
33
|
+
*/
|
|
34
|
+
plugins?: Readonly<Record<string, unknown>>;
|
|
29
35
|
}
|
|
30
36
|
declare const INITIAL_SESSION_CONTEXT: Readonly<SessionContext>;
|
|
31
37
|
declare const sessionContext: {
|
|
@@ -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-CF9S8X9C.js';
|
|
5
|
+
import * as lit from 'lit';
|
|
6
|
+
import './variables.d-DWHlTszN.js';
|
|
7
|
+
import './computed.types.d-6Ht-HNRx.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,18 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { b as ItemRefTemplateModel, Q as QtiAssessmentItemRef, c as QtiAssessmentSection, d as QtiAssessmentTest, e as QtiBranchRule, f as QtiItemSessionControl, g as
|
|
1
|
+
import { u as TestSubmit, v as ItemVariableValue, I as ITestNavigationMixin, a as ITestStateMixin } from './qti-test.d-sskv-dEN.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-sskv-dEN.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-CF9S8X9C.js';
|
|
3
4
|
import { LitElement } from 'lit';
|
|
4
|
-
import { b as
|
|
5
|
-
import { S as SessionContext } from './session.context.d-
|
|
6
|
-
import { C as ConfigContext } from './config.context.d-
|
|
7
|
-
import {
|
|
8
|
-
import './qti-
|
|
9
|
-
import './
|
|
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
|
+
import { C as ConfigContext } from './config.context.d-Dm11aAuw.js';
|
|
8
|
+
import { I as ItemContext } from './item.types.d-Zc6ZQDhu.js';
|
|
9
|
+
import { T as TestContext } from './qti-expression.d-iH3w6mqf.js';
|
|
10
|
+
import './qti-transform-test.d-Bb9vnLzP.js';
|
|
11
|
+
import './computed.types.d-6Ht-HNRx.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-
|
|
13
|
-
import './qti-rule-base.d-
|
|
15
|
+
import './qti-feedback.d-CT0W-8Gm.js';
|
|
16
|
+
import './qti-rule-base.d-CeKP0Ooi.js';
|
|
14
17
|
import './qti.context.d-CejJMlfZ.js';
|
|
15
18
|
import '@heximal/templates';
|
|
19
|
+
import './qti-test-state.d-D8Q89RzZ.js';
|
|
20
|
+
|
|
21
|
+
/**
|
|
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`.
|
|
26
|
+
*/
|
|
27
|
+
declare const pluginElements: readonly [{
|
|
28
|
+
readonly tag: "test-submit";
|
|
29
|
+
readonly ctor: typeof TestSubmit;
|
|
30
|
+
}];
|
|
16
31
|
|
|
17
32
|
interface IQtiTest extends LitElement, ITestNavigationMixin, ITestProcessingMixin, ITestStateMixin, IMyQtiTest {
|
|
18
33
|
}
|
|
@@ -30,50 +45,4 @@ interface ITestProcessingMixin {
|
|
|
30
45
|
outcomeProcessing(): boolean;
|
|
31
46
|
}
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
* Everything a host needs to persist to resume a candidate's test session, and nothing else.
|
|
35
|
-
*
|
|
36
|
-
* Read it from `qtiTest.state` or the `qti-state-changed` event, store it wherever you like —
|
|
37
|
-
* a database, `localStorage`, `sessionStorage` — and assign it back to `qtiTest.state` to resume.
|
|
38
|
-
*
|
|
39
|
-
* Deliberately not here:
|
|
40
|
-
* - declaration metadata (`baseType`, `cardinality`, `correctResponse`, `mapping`, …): it comes
|
|
41
|
-
* from the item XML on every load, and persisting the answer key with the candidate's data is
|
|
42
|
-
* both bloat and a leak;
|
|
43
|
-
* - `configContext` and `qtiContext`: inputs the host supplies on every load, not session state.
|
|
44
|
-
* The shuffle `seed` in particular must be passed in again, or the restored order changes;
|
|
45
|
-
* - `view`: a role the host decides, not something the candidate produced;
|
|
46
|
-
* - anything computed — scores per section, `done`, `active` — which is rederived from this.
|
|
47
|
-
*/
|
|
48
|
-
interface QtiTestState {
|
|
49
|
-
/** Bumped on any incompatible change to this shape. A state with another version is ignored. */
|
|
50
|
-
version: 1;
|
|
51
|
-
test: {
|
|
52
|
-
items: QtiTestStateItem[];
|
|
53
|
-
/** Test-level outcome values. Only outcomes the test declares are restored. */
|
|
54
|
-
outcomes: QtiTestStateValue[];
|
|
55
|
-
};
|
|
56
|
-
session: QtiTestStateSession;
|
|
57
|
-
}
|
|
58
|
-
interface QtiTestStateItem {
|
|
59
|
-
/** The `qti-assessment-item-ref` identifier. */
|
|
60
|
-
identifier: string;
|
|
61
|
-
variables: (QtiTestStateValue & {
|
|
62
|
-
type?: 'response' | 'outcome' | 'template' | 'context';
|
|
63
|
-
})[];
|
|
64
|
-
/** Opaque per-interaction state keyed by response identifier, e.g. a PCI's `getState()`. */
|
|
65
|
-
state?: Record<string, string | null>;
|
|
66
|
-
}
|
|
67
|
-
interface QtiTestStateValue {
|
|
68
|
-
identifier: string;
|
|
69
|
-
value: string | string[] | null;
|
|
70
|
-
}
|
|
71
|
-
/** Where the candidate is. */
|
|
72
|
-
interface QtiTestStateSession {
|
|
73
|
-
navPartId?: string | null;
|
|
74
|
-
navSectionId?: string | null;
|
|
75
|
-
navItemRefId?: string | null;
|
|
76
|
-
}
|
|
77
|
-
declare const QTI_TEST_STATE_VERSION = 1;
|
|
78
|
-
|
|
79
|
-
export { type IMyQtiTest, type IQtiTest, ITestNavigationMixin, type ITestProcessingMixin, ITestStateMixin, QTI_TEST_STATE_VERSION, type QtiTestState, type QtiTestStateItem, type QtiTestStateSession, type QtiTestStateValue };
|
|
48
|
+
export { type IMyQtiTest, type IQtiTest, ITestNavigationMixin, type ITestProcessingMixin, ITestStateMixin, TestSubmit, pluginElements };
|
package/dist/test.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-GJWA6LLT.js";
|
|
2
|
+
import {
|
|
3
|
+
pluginState
|
|
4
|
+
} from "./chunk-DJ7PB252.js";
|
|
2
5
|
import {
|
|
3
6
|
QTI_TEST_STATE_VERSION,
|
|
4
7
|
QtiAssessmentItemRef,
|
|
@@ -6,6 +9,7 @@ import {
|
|
|
6
9
|
QtiAssessmentTest,
|
|
7
10
|
QtiBranchRule,
|
|
8
11
|
QtiItemSessionControl,
|
|
12
|
+
QtiNumberPresented,
|
|
9
13
|
QtiNumberSelected,
|
|
10
14
|
QtiOutcomeProcessing,
|
|
11
15
|
QtiOutcomeProcessingProcessor,
|
|
@@ -15,38 +19,22 @@ import {
|
|
|
15
19
|
QtiTestPart,
|
|
16
20
|
QtiTestVariables,
|
|
17
21
|
QtiTestVariablesExpression,
|
|
18
|
-
TestCheckItem,
|
|
19
22
|
TestContainer,
|
|
20
23
|
TestEndAttempt,
|
|
21
|
-
TestItemLink,
|
|
22
|
-
TestItemToSpeech,
|
|
23
24
|
TestNavigation,
|
|
24
25
|
TestNext,
|
|
25
|
-
TestPagingButtonsStamp,
|
|
26
26
|
TestPrev,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
TestTtsNext,
|
|
35
|
-
TestTtsPause,
|
|
36
|
-
TestTtsPick,
|
|
37
|
-
TestTtsPlay,
|
|
38
|
-
TestTtsPrev,
|
|
39
|
-
TestTtsResume,
|
|
40
|
-
TestTtsStop,
|
|
41
|
-
TestView,
|
|
42
|
-
TestViewToggle,
|
|
43
|
-
ttsContext
|
|
44
|
-
} from "./chunk-K3VKQ6QF.js";
|
|
45
|
-
import "./chunk-6U3YPHXU.js";
|
|
46
|
-
import "./chunk-ZP6QQYSU.js";
|
|
27
|
+
TestSubmit,
|
|
28
|
+
pluginElements
|
|
29
|
+
} from "./chunk-ORQFZNJW.js";
|
|
30
|
+
import "./chunk-J6VX4N7M.js";
|
|
31
|
+
import "./chunk-H6DO5UHC.js";
|
|
32
|
+
import "./chunk-UCXLDQYA.js";
|
|
33
|
+
import "./chunk-WWY2H2YO.js";
|
|
47
34
|
import "./chunk-4DB4SC5K.js";
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-ZRORBAHB.js";
|
|
36
|
+
import "./chunk-GPC53O7P.js";
|
|
37
|
+
import "./chunk-PZ5AY32C.js";
|
|
50
38
|
export {
|
|
51
39
|
QTI_TEST_STATE_VERSION,
|
|
52
40
|
QtiAssessmentItemRef,
|
|
@@ -54,6 +42,7 @@ export {
|
|
|
54
42
|
QtiAssessmentTest,
|
|
55
43
|
QtiBranchRule,
|
|
56
44
|
QtiItemSessionControl,
|
|
45
|
+
QtiNumberPresented,
|
|
57
46
|
QtiNumberSelected,
|
|
58
47
|
QtiOutcomeProcessing,
|
|
59
48
|
QtiOutcomeProcessingProcessor,
|
|
@@ -63,31 +52,13 @@ export {
|
|
|
63
52
|
QtiTestPart,
|
|
64
53
|
QtiTestVariables,
|
|
65
54
|
QtiTestVariablesExpression,
|
|
66
|
-
TestCheckItem,
|
|
67
55
|
TestContainer,
|
|
68
56
|
TestEndAttempt,
|
|
69
|
-
TestItemLink,
|
|
70
|
-
TestItemToSpeech,
|
|
71
57
|
TestNavigation,
|
|
72
58
|
TestNext,
|
|
73
|
-
TestPagingButtonsStamp,
|
|
74
59
|
TestPrev,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
TestScoringFeedback,
|
|
79
|
-
TestSectionButtonsStamp,
|
|
80
|
-
TestSectionLink,
|
|
81
|
-
TestStamp,
|
|
82
|
-
TestTtsNext,
|
|
83
|
-
TestTtsPause,
|
|
84
|
-
TestTtsPick,
|
|
85
|
-
TestTtsPlay,
|
|
86
|
-
TestTtsPrev,
|
|
87
|
-
TestTtsResume,
|
|
88
|
-
TestTtsStop,
|
|
89
|
-
TestView,
|
|
90
|
-
TestViewToggle,
|
|
91
|
-
ttsContext
|
|
60
|
+
TestSubmit,
|
|
61
|
+
pluginElements,
|
|
62
|
+
pluginState
|
|
92
63
|
};
|
|
93
64
|
//# sourceMappingURL=test.js.map
|
package/dist/transformers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { M as ModuleResolutionConfig, q as qtiTransformItem, a as qtiTransformTest, t as transformItemApi, b as transformTestApi } from './qti-transform-test.d-
|
|
1
|
+
export { M as ModuleResolutionConfig, q as qtiTransformItem, a as qtiTransformTest, t as transformItemApi, b as transformTestApi } from './qti-transform-test.d-Bb9vnLzP.js';
|
|
2
2
|
|
|
3
3
|
declare const qtiTransformManifest: () => {
|
|
4
4
|
load: (uri: string, signal?: AbortSignal) => Promise<{
|
package/dist/transformers.js
CHANGED
|
@@ -12,7 +12,7 @@ interface Calculate {
|
|
|
12
12
|
}
|
|
13
13
|
type float = number;
|
|
14
14
|
type integer = number;
|
|
15
|
-
type BaseType = 'boolean' | 'directedPair' | 'duration' | 'float' | 'integer' | 'string' | 'identifier' | 'pair' | 'record';
|
|
15
|
+
type BaseType = 'boolean' | 'directedPair' | 'duration' | 'float' | 'integer' | 'string' | 'identifier' | 'pair' | 'point' | 'record';
|
|
16
16
|
type Multiple = string | string[][];
|
|
17
17
|
type Ordered = string | string[][];
|
|
18
18
|
type Cardinality = 'multiple' | 'ordered' | 'single' | 'record';
|
|
@@ -76,6 +76,12 @@ interface ResponseVariable extends VariableDeclaration<string | string[] | null>
|
|
|
76
76
|
mapping?: QtiMapping;
|
|
77
77
|
areaMapping?: QtiAreaMapping;
|
|
78
78
|
correctResponse?: string | string[] | null;
|
|
79
|
+
/**
|
|
80
|
+
* For `record` cardinality: the base type of each field, by field identifier, as declared on the
|
|
81
|
+
* `qti-value` elements of the correct response. A record declaration has no `base-type` of its
|
|
82
|
+
* own, so this is the only place the field types are known once the value is stored.
|
|
83
|
+
*/
|
|
84
|
+
fieldBaseTypes?: Record<string, BaseType>;
|
|
79
85
|
}
|
|
80
86
|
interface TemplateVariable extends VariableDeclaration<string | string[] | number | boolean | null> {
|
|
81
87
|
type: 'template';
|
|
@@ -83,26 +89,4 @@ interface TemplateVariable extends VariableDeclaration<string | string[] | numbe
|
|
|
83
89
|
paramVariable?: boolean;
|
|
84
90
|
}
|
|
85
91
|
|
|
86
|
-
|
|
87
|
-
identifier?: string;
|
|
88
|
-
href?: string;
|
|
89
|
-
variables?: ReadonlyArray<VariableDeclaration<string | string[] | null>>;
|
|
90
|
-
/**
|
|
91
|
-
* Optional per-interaction opaque state, keyed by responseIdentifier.
|
|
92
|
-
* Used for interactions that support state save/restore (e.g. PCI).
|
|
93
|
-
*/
|
|
94
|
-
state?: Record<string, string | null>;
|
|
95
|
-
/** The item is shown for reading only. Interactions follow it; see `qti-assessment-item`'s `readonly`. */
|
|
96
|
-
readonly?: boolean;
|
|
97
|
-
/** The item is locked, for example after it was submitted. Interactions follow it; see `qti-assessment-item`'s `disabled`. */
|
|
98
|
-
disabled?: boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Whether the interactions in the item are valid right now (a required answer is given, a limit is
|
|
101
|
-
* respected). Published by the item whenever it checks, so a reader never has to ask the item.
|
|
102
|
-
* Unset until the item has checked once.
|
|
103
|
-
*/
|
|
104
|
-
valid?: boolean;
|
|
105
|
-
}
|
|
106
|
-
declare const itemContextVariables: VariableDeclaration<string | string[]>[];
|
|
107
|
-
|
|
108
|
-
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.
|
|
4
|
+
"version": "10.0.0-next.20",
|
|
5
5
|
"author": "",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@heximal/templates": "^0.1.5",
|
|
@@ -10,16 +10,17 @@
|
|
|
10
10
|
"lit-html": "^3.3.1"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@qti-components/base": "^
|
|
14
|
-
"@qti-components/corrections": "^0.
|
|
15
|
-
"@qti-components/
|
|
16
|
-
"@qti-components/
|
|
17
|
-
"@qti-components/
|
|
18
|
-
"@qti-components/
|
|
19
|
-
"@qti-components/
|
|
20
|
-
"@qti-components/
|
|
21
|
-
"@qti-components/
|
|
22
|
-
"@qti-components/
|
|
13
|
+
"@qti-components/base": "^3.0.0-next.8",
|
|
14
|
+
"@qti-components/corrections": "^1.0.0-next.11",
|
|
15
|
+
"@qti-components/delivery": "^0.1.0-next.0",
|
|
16
|
+
"@qti-components/elements": "^2.0.0-next.7",
|
|
17
|
+
"@qti-components/interactions": "^1.10.5-next.8",
|
|
18
|
+
"@qti-components/item": "^1.5.1-next.7",
|
|
19
|
+
"@qti-components/loader": "^1.3.4-next.2",
|
|
20
|
+
"@qti-components/processing": "^1.6.1-next.5",
|
|
21
|
+
"@qti-components/test": "^2.0.0-next.16",
|
|
22
|
+
"@qti-components/theme": "^3.0.0-next.6",
|
|
23
|
+
"@qti-components/transformers": "^1.8.0-next.1"
|
|
23
24
|
},
|
|
24
25
|
"exports": {
|
|
25
26
|
".": {
|
|
@@ -50,6 +51,10 @@
|
|
|
50
51
|
"types": "./dist/test.d.ts",
|
|
51
52
|
"import": "./dist/test.js"
|
|
52
53
|
},
|
|
54
|
+
"./qti-test/plugin-api": {
|
|
55
|
+
"types": "./dist/test-plugin-api.d.ts",
|
|
56
|
+
"import": "./dist/test-plugin-api.js"
|
|
57
|
+
},
|
|
53
58
|
"./qti-loader": {
|
|
54
59
|
"types": "./dist/loader.d.ts",
|
|
55
60
|
"import": "./dist/loader.js"
|