@citolab/qti-components 9.4.0 → 9.6.0
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 +1876 -272
- package/dist/base.d.ts +10 -10
- package/dist/base.js +7 -1
- package/dist/{chunk-GNTO3IFM.js → chunk-EAQOUBXA.js} +717 -417
- package/dist/chunk-EAQOUBXA.js.map +1 -0
- package/dist/{chunk-B5XHZI2P.js → chunk-H72OXVRF.js} +2 -2
- package/dist/{chunk-B74SYQB2.js → chunk-I7ACMH74.js} +3 -3
- package/dist/{chunk-MSGYZE6L.js → chunk-LOKULHVY.js} +504 -283
- package/dist/chunk-LOKULHVY.js.map +1 -0
- package/dist/{chunk-ACRN7YJM.js → chunk-QOFGUIYE.js} +2 -2
- package/dist/{chunk-R7MMMDP7.js → chunk-QUTM5TT6.js} +56 -2
- package/dist/chunk-QUTM5TT6.js.map +1 -0
- package/dist/chunk-QVZLJY75.js +7 -0
- package/dist/chunk-QVZLJY75.js.map +1 -0
- package/dist/{chunk-BMXG7D2N.js → chunk-RV7ADJ33.js} +2 -2
- package/dist/{chunk-JHPQJDAV.js → chunk-TBJT7AGB.js} +2 -2
- package/dist/{chunk-LKHRHFXO.js → chunk-TC4257SG.js} +6 -6
- package/dist/{chunk-XEWGFAS4.js → chunk-TFQAUWCM.js} +105 -30
- package/dist/chunk-TFQAUWCM.js.map +1 -0
- package/dist/{chunk-3BAQWO5C.js → chunk-V3NKEAQY.js} +40 -4
- package/dist/chunk-V3NKEAQY.js.map +1 -0
- package/dist/{chunk-C3JPUV36.js → chunk-YS6CBO45.js} +2 -2
- package/dist/{computed.types.d-gJrBeUMG.d.ts → computed.types.d-SsTm3ieP.d.ts} +1 -1
- package/dist/corrections.d.ts +9 -9
- package/dist/corrections.js +8 -8
- package/dist/elements.d.ts +65 -3
- package/dist/elements.js +15 -5
- package/dist/index.d.ts +11 -11
- package/dist/index.js +40 -14
- package/dist/interactions.d.ts +4 -4
- package/dist/interactions.js +7 -3
- package/dist/item.css +12 -0
- package/dist/item.d.ts +4 -4
- package/dist/item.js +4 -4
- package/dist/{item.types.d-B55QkJ92.d.ts → item.types.d-DuVR0ZVK.d.ts} +7 -1
- package/dist/loader.d.ts +2 -2
- package/dist/processing.d.ts +10 -3
- package/dist/processing.js +3 -3
- package/dist/qti-components-jsx.d.ts +273 -213
- package/dist/{qti-condition-expression.d-L7yb3Rzy.d.ts → qti-condition-expression.d-B-T1NNl0.d.ts} +1 -1
- package/dist/{qti-expression.d-CuaLjZ6g.d.ts → qti-expression.d-B-Cfbqlb.d.ts} +8 -1
- package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-DbzPSJuK.d.ts} +1 -1
- package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-DjWvKbfL.d.ts} +1 -1
- package/dist/{qti-test.d-Cud5Gvy0.d.ts → qti-test.d-DOWT6YNa.d.ts} +109 -12
- package/dist/{qti-text-entry-interaction.d-DKvz9ncv.d.ts → qti-text-entry-interaction.d-h5UZ8Qvp.d.ts} +34 -19
- package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-wB9uYs-j.d.ts} +34 -2
- package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-Cw8GcziG.d.ts} +1 -1
- package/dist/test.d.ts +7 -7
- package/dist/test.js +11 -5
- package/package.json +6 -6
- package/dist/chunk-3BAQWO5C.js.map +0 -1
- package/dist/chunk-A32YH4H5.js +0 -7
- package/dist/chunk-A32YH4H5.js.map +0 -1
- package/dist/chunk-GNTO3IFM.js.map +0 -1
- package/dist/chunk-MSGYZE6L.js.map +0 -1
- package/dist/chunk-R7MMMDP7.js.map +0 -1
- package/dist/chunk-XEWGFAS4.js.map +0 -1
- /package/dist/{chunk-B5XHZI2P.js.map → chunk-H72OXVRF.js.map} +0 -0
- /package/dist/{chunk-B74SYQB2.js.map → chunk-I7ACMH74.js.map} +0 -0
- /package/dist/{chunk-ACRN7YJM.js.map → chunk-QOFGUIYE.js.map} +0 -0
- /package/dist/{chunk-BMXG7D2N.js.map → chunk-RV7ADJ33.js.map} +0 -0
- /package/dist/{chunk-JHPQJDAV.js.map → chunk-TBJT7AGB.js.map} +0 -0
- /package/dist/{chunk-LKHRHFXO.js.map → chunk-TC4257SG.js.map} +0 -0
- /package/dist/{chunk-C3JPUV36.js.map → chunk-YS6CBO45.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
import { b as ItemContext, V as VariableDeclaration, g as ResponseVariable, B as BaseType } from './item.types.d-
|
|
3
|
+
import { b as ItemContext, V as VariableDeclaration, g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js';
|
|
4
4
|
import { a as QtiContextType, Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
|
|
5
5
|
|
|
6
6
|
interface TestContext {
|
|
@@ -58,6 +58,13 @@ declare abstract class QtiExpression<T> extends LitElement implements QtiExpress
|
|
|
58
58
|
* throwing, so callers degrade gracefully.
|
|
59
59
|
*/
|
|
60
60
|
protected resolveVariable(identifier: string): VariableDeclaration<string | string[] | null> | null;
|
|
61
|
+
/**
|
|
62
|
+
* `ITEMREF.VAR`: a variable of an individual item session, looked up by prefixing the variable
|
|
63
|
+
* with the identifier the item ref gave the item (QTI 3 `qti-variable`), e.g. `Q01.SCORE`. An
|
|
64
|
+
* item that was never presented has no variables, which resolves to NULL. Instances of a cloned
|
|
65
|
+
* item (`Q01.2.SCORE`) are not supported: the item itself is used.
|
|
66
|
+
*/
|
|
67
|
+
private resolveItemVariable;
|
|
61
68
|
getVariables: () => ExpressionVariable[];
|
|
62
69
|
}
|
|
63
70
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
import { a as Cardinality } from './item.types.d-
|
|
3
|
+
import { a as Cardinality } from './item.types.d-DuVR0ZVK.js';
|
|
4
4
|
|
|
5
5
|
declare abstract class QtiVariableDeclaration extends LitElement {
|
|
6
6
|
render(): lit.TemplateResult<1>;
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
4
|
+
import { C as ComputedItemContext, V as View } from './session.context.d-Cw8GcziG.js';
|
|
5
5
|
import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
|
|
6
6
|
import { QtiAssessmentItem } from './elements.js';
|
|
7
7
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement, PropertyValues, nothing } from 'lit';
|
|
3
3
|
import { b as transformTestApi, t as transformItemApi } from './qti-transform-test.d-BL7GGFJj.js';
|
|
4
|
-
import { C as ComputedContext, a as ComputedItem } from './computed.types.d-
|
|
4
|
+
import { C as ComputedContext, a as ComputedItem } from './computed.types.d-SsTm3ieP.js';
|
|
5
5
|
import { QtiAssessmentItem, QtiModalFeedback } from './elements.js';
|
|
6
6
|
import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
|
|
7
|
-
import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-
|
|
7
|
+
import { T as TestContext, Q as QtiExpression, a as QtiExpressionBase } from './qti-expression.d-B-Cfbqlb.js';
|
|
8
8
|
import { TemplateFunction } from '@heximal/templates';
|
|
9
|
-
import { h as VariableValue, b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-
|
|
10
|
-
import { S as SessionContext, V as View } from './session.context.d-
|
|
9
|
+
import { h as VariableValue, b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
|
|
10
|
+
import { S as SessionContext, V as View } from './session.context.d-Cw8GcziG.js';
|
|
11
11
|
import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
|
|
12
12
|
import { b as QtiRuleBase } from './qti-rule-base.d-Bdzg8eGH.js';
|
|
13
13
|
|
|
@@ -25,6 +25,11 @@ declare global {
|
|
|
25
25
|
'qti-assessment-test': QtiAssessmentTest;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
declare module '../../public-events' {
|
|
29
|
+
interface PublicEventMap {
|
|
30
|
+
'cito-test-loaded': CustomEvent<QtiAssessmentTest>;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
28
33
|
|
|
29
34
|
/**
|
|
30
35
|
* Defined here, and re-exported by the navigation mixin under the same name, so this file imports
|
|
@@ -123,6 +128,41 @@ declare global {
|
|
|
123
128
|
}
|
|
124
129
|
}
|
|
125
130
|
|
|
131
|
+
/** An element that evaluates to a boolean: a `qti-pre-condition` or `qti-branch-rule`. */
|
|
132
|
+
interface Condition extends Element {
|
|
133
|
+
evaluate(): boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @summary The qti-branch-rule element jumps the test forward to `target` when its expression is true.
|
|
138
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.branch-rule
|
|
139
|
+
*
|
|
140
|
+
* A child of `qti-test-part`, `qti-assessment-section` or `qti-assessment-item-ref`. It is
|
|
141
|
+
* evaluated after the parent has been presented; the first rule whose expression is true wins.
|
|
142
|
+
* Branch rules only apply in linear navigation mode. An expression that cannot be evaluated does
|
|
143
|
+
* not branch.
|
|
144
|
+
*
|
|
145
|
+
* @attr {string} target - Required. The identifier of an item ref, section or test part ahead of
|
|
146
|
+
* the parent, or one of the reserved targets `EXIT_SECTION`, `EXIT_TESTPART`, `EXIT_TEST`.
|
|
147
|
+
*
|
|
148
|
+
* @slot - The boolean expression.
|
|
149
|
+
*/
|
|
150
|
+
declare class QtiBranchRule extends LitElement implements Condition {
|
|
151
|
+
static readonly EXIT_SECTION = "EXIT_SECTION";
|
|
152
|
+
static readonly EXIT_TESTPART = "EXIT_TESTPART";
|
|
153
|
+
static readonly EXIT_TEST = "EXIT_TEST";
|
|
154
|
+
static styles: lit.CSSResult;
|
|
155
|
+
target: string;
|
|
156
|
+
/** `true` when the test should jump to `target`. */
|
|
157
|
+
evaluate(): boolean;
|
|
158
|
+
render(): lit.TemplateResult<1>;
|
|
159
|
+
}
|
|
160
|
+
declare global {
|
|
161
|
+
interface HTMLElementTagNameMap {
|
|
162
|
+
'qti-branch-rule': QtiBranchRule;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
126
166
|
/**
|
|
127
167
|
* @summary The qti-item-session-control element contains configurations relating to flow of test sessions.
|
|
128
168
|
* @documentation https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/imsqti_asi_v3p0p1_infomodel_v1p0.html#Derived_ItemSessionControl
|
|
@@ -144,6 +184,33 @@ declare global {
|
|
|
144
184
|
}
|
|
145
185
|
}
|
|
146
186
|
|
|
187
|
+
/**
|
|
188
|
+
* @summary The qti-number-presented expression counts the selected items that have been presented to the candidate.
|
|
189
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.number-presented
|
|
190
|
+
*
|
|
191
|
+
* Outcome processing only. `section-identifier`, `include-category` and
|
|
192
|
+
* `exclude-category` narrow which item references are counted, the same way as
|
|
193
|
+
* for `qti-number-selected` and `qti-test-variables`.
|
|
194
|
+
*
|
|
195
|
+
* An item is presented once its `completionStatus` has left `not_attempted`:
|
|
196
|
+
* presenting an item starts its first attempt. An item a linear test part
|
|
197
|
+
* passed over (pre-condition, branch rule) or one the candidate has not reached
|
|
198
|
+
* keeps `not_attempted`. That makes this the count to use for a total over the
|
|
199
|
+
* candidate's own route, such as a maximum score of one point per presented item.
|
|
200
|
+
*/
|
|
201
|
+
declare class QtiNumberPresented extends QtiExpression<number> {
|
|
202
|
+
#private;
|
|
203
|
+
_testContext?: TestContext;
|
|
204
|
+
constructor();
|
|
205
|
+
getResult(): number;
|
|
206
|
+
calculate(): number;
|
|
207
|
+
}
|
|
208
|
+
declare global {
|
|
209
|
+
interface HTMLElementTagNameMap {
|
|
210
|
+
'qti-number-presented': QtiNumberPresented;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
147
214
|
/**
|
|
148
215
|
* @summary The qti-number-selected expression counts the item refs selected for the test.
|
|
149
216
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.number-selected
|
|
@@ -168,6 +235,31 @@ declare global {
|
|
|
168
235
|
}
|
|
169
236
|
}
|
|
170
237
|
|
|
238
|
+
/**
|
|
239
|
+
* @summary The qti-pre-condition element holds one boolean expression that decides whether its parent is presented.
|
|
240
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.pre-condition
|
|
241
|
+
*
|
|
242
|
+
* A child of `qti-test-part`, `qti-assessment-section` or `qti-assessment-item-ref`. When the test
|
|
243
|
+
* is about to present the parent and the expression is false (or NULL), the parent is skipped.
|
|
244
|
+
* Pre-conditions only apply in linear navigation mode; in nonlinear mode they are ignored.
|
|
245
|
+
*
|
|
246
|
+
* Evaluation is pull-based, like every expression: the test calls `evaluate()` when it needs the
|
|
247
|
+
* answer. An expression that cannot be evaluated fails open, so the parent is shown.
|
|
248
|
+
*
|
|
249
|
+
* @slot - The boolean expression.
|
|
250
|
+
*/
|
|
251
|
+
declare class QtiPreCondition extends LitElement implements Condition {
|
|
252
|
+
static styles: lit.CSSResult;
|
|
253
|
+
/** `true` when the parent may be presented. */
|
|
254
|
+
evaluate(): boolean;
|
|
255
|
+
render(): lit.TemplateResult<1>;
|
|
256
|
+
}
|
|
257
|
+
declare global {
|
|
258
|
+
interface HTMLElementTagNameMap {
|
|
259
|
+
'qti-pre-condition': QtiPreCondition;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
171
263
|
declare class QtiOutcomeProcessing extends LitElement {
|
|
172
264
|
static styles: lit.CSSResult[];
|
|
173
265
|
render(): lit.TemplateResult<1>;
|
|
@@ -182,8 +274,19 @@ declare class QtiOutcomeProcessingProcessor {
|
|
|
182
274
|
process(rules: QtiRuleBase[]): void;
|
|
183
275
|
}
|
|
184
276
|
|
|
277
|
+
/**
|
|
278
|
+
* Test-level feedback. It renders nothing where it is declared: where and when it appears is up to
|
|
279
|
+
* the host. After outcome processing, `qtiTest.getTestFeedback(access)` returns the ones that apply.
|
|
280
|
+
*/
|
|
185
281
|
declare class QtiTestFeedback extends QtiModalFeedback {
|
|
186
282
|
static styles: lit.CSSResult;
|
|
283
|
+
/** When the feedback may be shown: at the end of the test (`atEnd`), or while it runs (`during`). */
|
|
284
|
+
access: 'atEnd' | 'during';
|
|
285
|
+
/**
|
|
286
|
+
* Whether this feedback applies for a value of its `outcome-identifier`: with `show-hide="show"`
|
|
287
|
+
* when the value is (or, for a container, holds) its `identifier`; with `hide` when it is not.
|
|
288
|
+
*/
|
|
289
|
+
matches(value: string | readonly string[] | null | undefined): boolean;
|
|
187
290
|
render(): lit.TemplateResult<1>;
|
|
188
291
|
}
|
|
189
292
|
declare global {
|
|
@@ -342,13 +445,6 @@ interface ITestStateMixin {
|
|
|
342
445
|
state: QtiTestState;
|
|
343
446
|
}
|
|
344
447
|
|
|
345
|
-
type CustomEventMap = {
|
|
346
|
-
'test-end-attempt': CustomEvent;
|
|
347
|
-
};
|
|
348
|
-
declare global {
|
|
349
|
-
interface GlobalEventHandlersEventMap extends CustomEventMap {
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
448
|
declare class TestNavigation extends LitElement {
|
|
353
449
|
#private;
|
|
354
450
|
identifier: string | undefined;
|
|
@@ -948,6 +1044,7 @@ declare const QtiTest_base: (abstract new (...args: any[]) => ITestNavigationMix
|
|
|
948
1044
|
getOutcome(identifier: string): Readonly<OutcomeVariable>;
|
|
949
1045
|
getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;
|
|
950
1046
|
outcomeProcessing(): boolean;
|
|
1047
|
+
getTestFeedback(access?: "atEnd" | "during"): QtiTestFeedback[];
|
|
951
1048
|
}) & (abstract new (...args: any[]) => ITestStateMixin) & (abstract new (...args: any[]) => TestBaseInterface) & typeof LitElement;
|
|
952
1049
|
/**
|
|
953
1050
|
* `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
|
|
@@ -1026,4 +1123,4 @@ declare global {
|
|
|
1026
1123
|
}
|
|
1027
1124
|
}
|
|
1028
1125
|
|
|
1029
|
-
export {
|
|
1126
|
+
export { TestScoringButtons as A, TestScoringFeedback as B, TestSectionButtonsStamp as C, TestSectionLink as D, TestStamp as E, TestTtsNext as F, TestTtsPause as G, TestTtsPick as H, type ITestNavigationMixin as I, TestTtsPlay as J, TestTtsPrev as K, TestTtsResume as L, TestTtsStop as M, TestView as N, TestViewToggle as O, type TtsContext as P, QtiAssessmentItemRef as Q, ttsContext as R, type SpeechState as S, TestCheckItem as T, type ItemVariableValue as U, type ITestStateMixin as a, type ItemRefTemplateModel as b, QtiAssessmentSection as c, QtiAssessmentTest as d, QtiBranchRule as e, QtiItemSessionControl as f, QtiNumberPresented as g, QtiNumberSelected as h, QtiOutcomeProcessing as i, QtiOutcomeProcessingProcessor as j, QtiPreCondition as k, QtiTest as l, QtiTestFeedback as m, QtiTestPart as n, QtiTestVariables as o, QtiTestVariablesExpression as p, TestContainer as q, TestEndAttempt as r, TestItemLink as s, TestItemToSpeech as t, TestNavigation as u, TestNext as v, TestPagingButtonsStamp as w, TestPrev as x, TestPrintContext as y, TestPrintVariables as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
|
|
3
|
-
import { I as Interaction } from './
|
|
3
|
+
import { I as Interaction, b as RecordValue } from './record.d-wB9uYs-j.js';
|
|
4
4
|
import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
|
|
5
5
|
import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
|
|
6
|
-
import { B as BaseType, a as Cardinality, b as ItemContext, Q as QtiAreaMapEntry } from './item.types.d-
|
|
6
|
+
import { B as BaseType, a as Cardinality, b as ItemContext, Q as QtiAreaMapEntry } from './item.types.d-DuVR0ZVK.js';
|
|
7
7
|
import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
|
|
8
8
|
import * as lit_directives_ref_js from 'lit/directives/ref.js';
|
|
9
9
|
|
|
@@ -750,6 +750,20 @@ declare const QtiGraphicGapMatchInteraction_base: (abstract new (...args: any[])
|
|
|
750
750
|
declare class QtiGraphicGapMatchInteraction extends QtiGraphicGapMatchInteraction_base {
|
|
751
751
|
#private;
|
|
752
752
|
static styles: CSSResultGroup;
|
|
753
|
+
/**
|
|
754
|
+
* A hotspot's box is its authored `coords`, always (CONFIGURABILITY.md §4). The measured
|
|
755
|
+
* `--qti-dropzone-min-*` reservation is a floor on the hotspot's `min-width`/`min-height`, and it
|
|
756
|
+
* beat the percentage box from `positionShapes` as soon as the graphic rendered narrower than its
|
|
757
|
+
* declared width: a 275px chip kept a 17% hotspot at 275px over a 482px map. Chips are sized to
|
|
758
|
+
* their hotspots through `--qti-graphic-scale` instead.
|
|
759
|
+
*/
|
|
760
|
+
autoSizeDropzones: boolean;
|
|
761
|
+
/**
|
|
762
|
+
* Rendered width of the graphic over its declared width: the factor the drop areas are scaled by.
|
|
763
|
+
* Published as `--qti-graphic-scale` on both slots, so it reaches a chip in the bank and one placed
|
|
764
|
+
* in a hotspot (qti-gap-img.styles.ts), without writing to the light-DOM host.
|
|
765
|
+
*/
|
|
766
|
+
private _graphicScale;
|
|
753
767
|
render(): lit.TemplateResult<1>;
|
|
754
768
|
shouldReturnToInventoryOnInventoryDrop(): boolean;
|
|
755
769
|
connectedCallback(): void;
|
|
@@ -1107,10 +1121,11 @@ type PciInteractionStatus = 'interacting' | 'suspended' | 'closed' | 'solution'
|
|
|
1107
1121
|
* Correct response of a response declaration, mirroring `qti-correct-response`.
|
|
1108
1122
|
*
|
|
1109
1123
|
* `value` holds the authored `qti-value` content: a single value for `single`
|
|
1110
|
-
* cardinality,
|
|
1124
|
+
* cardinality, a field map (`{ time: '4.0', point: '460 245' }`) for `record`
|
|
1125
|
+
* cardinality, and an array of values for every other cardinality.
|
|
1111
1126
|
*/
|
|
1112
1127
|
interface PciCorrectResponse {
|
|
1113
|
-
value: string | string[]
|
|
1128
|
+
value: string | string[] | Record<string, string | string[] | null>;
|
|
1114
1129
|
}
|
|
1115
1130
|
/**
|
|
1116
1131
|
* Response declaration passed into the `getInstance` configuration so a PCI can
|
|
@@ -1203,6 +1218,12 @@ declare type QtiVariableJSON = {
|
|
|
1203
1218
|
record?: QtiRecordItem[] | null;
|
|
1204
1219
|
};
|
|
1205
1220
|
|
|
1221
|
+
/** Text for an inline `<script>`: a `</script` inside it would end the element early. */
|
|
1222
|
+
declare const inlineScriptText: (text: string) => string;
|
|
1223
|
+
/** Text for an inline `<style>`: a `</style` inside it would end the element early. */
|
|
1224
|
+
declare const inlineStyleText: (text: string) => string;
|
|
1225
|
+
/** A response value as this interaction holds it: a record response is its field map. */
|
|
1226
|
+
type PciResponseValue = string | string[] | RecordValue;
|
|
1206
1227
|
declare class QtiPortableCustomInteraction extends Interaction {
|
|
1207
1228
|
#private;
|
|
1208
1229
|
protected _iframeLoaded: boolean;
|
|
@@ -1218,6 +1239,7 @@ declare class QtiPortableCustomInteraction extends Interaction {
|
|
|
1218
1239
|
customInteractionTypeIdentifier: string;
|
|
1219
1240
|
requirePathsJson: string;
|
|
1220
1241
|
requireShimJson: string;
|
|
1242
|
+
/** A RequireJS to load in the iframe instead of the inlined copy (src/vendor/require-js.ts). */
|
|
1221
1243
|
requireJsUrl: string;
|
|
1222
1244
|
baseUrl: string;
|
|
1223
1245
|
useDefaultPaths: boolean;
|
|
@@ -1245,10 +1267,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
|
|
|
1245
1267
|
* Get direct child elements by tag name
|
|
1246
1268
|
*/
|
|
1247
1269
|
private getDirectChildrenByTag;
|
|
1248
|
-
/**
|
|
1249
|
-
* Coerce a scalar value to the expected base-type when possible
|
|
1250
|
-
*/
|
|
1251
|
-
private coerceBaseValue;
|
|
1252
1270
|
/**
|
|
1253
1271
|
* Normalize an input into a list form
|
|
1254
1272
|
*/
|
|
@@ -1257,14 +1275,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
|
|
|
1257
1275
|
* Convert a variable value to QtiVariableJSON
|
|
1258
1276
|
*/
|
|
1259
1277
|
private variableToQtiVariableJSON;
|
|
1260
|
-
/**
|
|
1261
|
-
* Convert a record object into QtiVariableJSON
|
|
1262
|
-
*/
|
|
1263
|
-
private recordToQtiVariableJSON;
|
|
1264
|
-
/**
|
|
1265
|
-
* Build a record entry from an arbitrary value
|
|
1266
|
-
*/
|
|
1267
|
-
private recordEntryFromValue;
|
|
1268
1278
|
/**
|
|
1269
1279
|
* Extract default QTI_CONTEXT values from qti-context-declaration elements
|
|
1270
1280
|
*/
|
|
@@ -1284,7 +1294,7 @@ declare class QtiPortableCustomInteraction extends Interaction {
|
|
|
1284
1294
|
/**
|
|
1285
1295
|
* Converts response variables to QtiVariableJSON
|
|
1286
1296
|
*/
|
|
1287
|
-
protected responseVariablesToQtiVariableJSON(input:
|
|
1297
|
+
protected responseVariablesToQtiVariableJSON(input: PciResponseValue, cardinality: Cardinality, baseType: BaseType, fieldBaseTypes?: Record<string, BaseType>): QtiVariableJSON;
|
|
1288
1298
|
validate(): boolean;
|
|
1289
1299
|
set value(v: string | null);
|
|
1290
1300
|
get value(): string | null;
|
|
@@ -1498,7 +1508,12 @@ declare class QtiSliderInteraction extends Interaction {
|
|
|
1498
1508
|
step: number;
|
|
1499
1509
|
validate(): boolean;
|
|
1500
1510
|
connectedCallback(): void;
|
|
1501
|
-
|
|
1511
|
+
willUpdate(changed: PropertyValues): void;
|
|
1512
|
+
/**
|
|
1513
|
+
* Shows the value without publishing it: it came from the item (a default or a restored answer) or
|
|
1514
|
+
* from the host, which hold it already. Only the candidate's input is published.
|
|
1515
|
+
*/
|
|
1516
|
+
get response(): string | null;
|
|
1502
1517
|
set response(val: string | null);
|
|
1503
1518
|
/** Extension hook for optional content rendered on the slider rail. */
|
|
1504
1519
|
protected renderRailSupplement(): unknown;
|
|
@@ -1565,4 +1580,4 @@ declare global {
|
|
|
1565
1580
|
}
|
|
1566
1581
|
}
|
|
1567
1582
|
|
|
1568
|
-
export { type Choice as C, type Orientation as O, QtiAssociableHotspot as Q, QtiAssociateInteraction as a, QtiChoiceInteraction as b, QtiExtendedTextInteraction as c, QtiGap as d, QtiGapImg as e, QtiGapMatchInteraction as f, QtiGapText as g, QtiGraphicAssociateInteraction as h, QtiGraphicGapMatchInteraction as i, QtiGraphicOrderInteraction as j, QtiHotspotChoice as k, QtiHotspotInteraction as l, QtiHottext as m, QtiHottextInteraction as n, QtiInlineChoice as o, QtiInlineChoiceInteraction as p, QtiMatchInteraction as q, QtiOrderInteraction as r, QtiPortableCustomInteraction as s, QtiPrompt as t, QtiSelectPointInteraction as u, QtiSimpleAssociableChoice as v, QtiSimpleChoice as w, QtiSliderInteraction as x, QtiTextEntryInteraction as y,
|
|
1583
|
+
export { inlineStyleText as A, QtiPortableCustomInteractionTest as B, type Choice as C, type Orientation as O, QtiAssociableHotspot as Q, QtiAssociateInteraction as a, QtiChoiceInteraction as b, QtiExtendedTextInteraction as c, QtiGap as d, QtiGapImg as e, QtiGapMatchInteraction as f, QtiGapText as g, QtiGraphicAssociateInteraction as h, QtiGraphicGapMatchInteraction as i, QtiGraphicOrderInteraction as j, QtiHotspotChoice as k, QtiHotspotInteraction as l, QtiHottext as m, QtiHottextInteraction as n, QtiInlineChoice as o, QtiInlineChoiceInteraction as p, QtiMatchInteraction as q, QtiOrderInteraction as r, QtiPortableCustomInteraction as s, QtiPrompt as t, QtiSelectPointInteraction as u, QtiSimpleAssociableChoice as v, QtiSimpleChoice as w, QtiSliderInteraction as x, QtiTextEntryInteraction as y, inlineScriptText as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import { C as ConfigContext, V as ValidationDisplayMode } from './config.context.d-BvU9r-Mg.js';
|
|
3
3
|
import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
|
|
4
|
-
import { g as ResponseVariable } from './item.types.d-
|
|
4
|
+
import { g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* What a choice element should render and behave as. The same element — `qti-simple-choice`,
|
|
@@ -123,4 +123,36 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
|
|
|
123
123
|
protected firstUpdated(_changedProperties?: PropertyValues): void;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
/**
|
|
127
|
+
* The value of a variable with `record` cardinality: its fields by field identifier.
|
|
128
|
+
*
|
|
129
|
+
* Field values are kept the way every other response value is kept, as QTI string literals — a
|
|
130
|
+
* float is `"4.12"`, a point is `"455 250"` — with a list-valued field as an array of them.
|
|
131
|
+
*/
|
|
132
|
+
type RecordValue = Record<string, string | string[] | null>;
|
|
133
|
+
/** A record's field values with the base type each `qti-value` declared for its field. */
|
|
134
|
+
interface RecordFieldValues {
|
|
135
|
+
value: RecordValue;
|
|
136
|
+
baseTypes: Record<string, BaseType>;
|
|
137
|
+
}
|
|
138
|
+
/** Whether a variable value is a record: a plain object, not a list and not NULL. */
|
|
139
|
+
declare const isRecordValue: (value: unknown) => value is RecordValue;
|
|
140
|
+
/**
|
|
141
|
+
* Reads the field values of a record out of `qti-value field-identifier="…" base-type="…"`
|
|
142
|
+
* elements, as found in a `qti-correct-response` or `qti-default-value` of a record declaration.
|
|
143
|
+
*
|
|
144
|
+
* A value without a `field-identifier` is not a record field and is skipped. A field without a
|
|
145
|
+
* `base-type` gets no entry in `baseTypes`, so a reader can tell "declared string" from "unknown".
|
|
146
|
+
*/
|
|
147
|
+
declare const readRecordFieldValues: (valueElements: Iterable<Element>) => RecordFieldValues;
|
|
148
|
+
/**
|
|
149
|
+
* A best guess at a record field's base type, for when the declaration does not say.
|
|
150
|
+
*
|
|
151
|
+
* A record field value carries no type of its own once it is stored, and a record response
|
|
152
|
+
* declaration has no `base-type`, so this is the fallback. A number is a float (or an integer
|
|
153
|
+
* when given as a whole JS number), two numbers separated by whitespace are a point, and
|
|
154
|
+
* anything else is a string.
|
|
155
|
+
*/
|
|
156
|
+
declare const inferRecordFieldBaseType: (value: unknown) => BaseType;
|
|
157
|
+
|
|
158
|
+
export { type ChoiceRole as C, Interaction as I, type RecordFieldValues as R, type InteractionContext as a, type RecordValue as b, interactionContext as c, isRecordValue as d, inferRecordFieldBaseType as i, readRecordFieldValues as r };
|
package/dist/test.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { b as ItemRefTemplateModel, Q as QtiAssessmentItemRef, c as QtiAssessmentSection, d as QtiAssessmentTest, e as
|
|
1
|
+
import { U as ItemVariableValue, I as ITestNavigationMixin, a as ITestStateMixin } from './qti-test.d-DOWT6YNa.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, S as SpeechState, T as TestCheckItem, q as TestContainer, r as TestEndAttempt, s as TestItemLink, t as TestItemToSpeech, u as TestNavigation, v as TestNext, w as TestPagingButtonsStamp, x as TestPrev, y as TestPrintContext, z as TestPrintVariables, A as TestScoringButtons, B as TestScoringFeedback, C as TestSectionButtonsStamp, D as TestSectionLink, E as TestStamp, F as TestTtsNext, G as TestTtsPause, H as TestTtsPick, J as TestTtsPlay, K as TestTtsPrev, L as TestTtsResume, M as TestTtsStop, N as TestView, O as TestViewToggle, P as TtsContext, R as ttsContext } from './qti-test.d-DOWT6YNa.js';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
-
import { b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-
|
|
5
|
-
import { S as SessionContext } from './session.context.d-
|
|
4
|
+
import { b as ItemContext, c as OutcomeVariable, V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
|
|
5
|
+
import { S as SessionContext } from './session.context.d-Cw8GcziG.js';
|
|
6
6
|
import { C as ConfigContext } from './config.context.d-BvU9r-Mg.js';
|
|
7
|
-
import { T as TestContext } from './qti-expression.d-
|
|
7
|
+
import { T as TestContext } from './qti-expression.d-B-Cfbqlb.js';
|
|
8
8
|
import './qti-transform-test.d-BL7GGFJj.js';
|
|
9
|
-
import './computed.types.d-
|
|
9
|
+
import './computed.types.d-SsTm3ieP.js';
|
|
10
10
|
import './elements.js';
|
|
11
11
|
import './interaction.interface.d-CvjHM2bi.js';
|
|
12
|
-
import './qti-feedback.d-
|
|
12
|
+
import './qti-feedback.d-DbzPSJuK.js';
|
|
13
13
|
import './qti-rule-base.d-Bdzg8eGH.js';
|
|
14
14
|
import './qti.context.d-CejJMlfZ.js';
|
|
15
15
|
import '@heximal/templates';
|
package/dist/test.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-TBJT7AGB.js";
|
|
2
2
|
import {
|
|
3
3
|
QTI_TEST_STATE_VERSION,
|
|
4
4
|
QtiAssessmentItemRef,
|
|
5
5
|
QtiAssessmentSection,
|
|
6
6
|
QtiAssessmentTest,
|
|
7
|
+
QtiBranchRule,
|
|
7
8
|
QtiItemSessionControl,
|
|
9
|
+
QtiNumberPresented,
|
|
8
10
|
QtiNumberSelected,
|
|
9
11
|
QtiOutcomeProcessing,
|
|
10
12
|
QtiOutcomeProcessingProcessor,
|
|
13
|
+
QtiPreCondition,
|
|
11
14
|
QtiTest,
|
|
12
15
|
QtiTestFeedback,
|
|
13
16
|
QtiTestPart,
|
|
@@ -39,21 +42,24 @@ import {
|
|
|
39
42
|
TestView,
|
|
40
43
|
TestViewToggle,
|
|
41
44
|
ttsContext
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
+
} from "./chunk-EAQOUBXA.js";
|
|
46
|
+
import "./chunk-TFQAUWCM.js";
|
|
47
|
+
import "./chunk-QVZLJY75.js";
|
|
45
48
|
import "./chunk-4DB4SC5K.js";
|
|
46
49
|
import "./chunk-TLAVOBEM.js";
|
|
47
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-QUTM5TT6.js";
|
|
48
51
|
export {
|
|
49
52
|
QTI_TEST_STATE_VERSION,
|
|
50
53
|
QtiAssessmentItemRef,
|
|
51
54
|
QtiAssessmentSection,
|
|
52
55
|
QtiAssessmentTest,
|
|
56
|
+
QtiBranchRule,
|
|
53
57
|
QtiItemSessionControl,
|
|
58
|
+
QtiNumberPresented,
|
|
54
59
|
QtiNumberSelected,
|
|
55
60
|
QtiOutcomeProcessing,
|
|
56
61
|
QtiOutcomeProcessingProcessor,
|
|
62
|
+
QtiPreCondition,
|
|
57
63
|
QtiTest,
|
|
58
64
|
QtiTestFeedback,
|
|
59
65
|
QtiTestPart,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citolab/qti-components",
|
|
3
3
|
"description": "QTI component utilities",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.6.0",
|
|
5
5
|
"author": "",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@heximal/templates": "^0.1.5",
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"lit-html": "^3.3.1"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@qti-components/base": "^2.
|
|
13
|
+
"@qti-components/base": "^2.5.0",
|
|
14
14
|
"@qti-components/corrections": "^0.4.0",
|
|
15
|
-
"@qti-components/elements": "^1.
|
|
15
|
+
"@qti-components/elements": "^1.10.1",
|
|
16
16
|
"@qti-components/interactions": "^1.10.4",
|
|
17
17
|
"@qti-components/item": "^1.5.0",
|
|
18
18
|
"@qti-components/loader": "^1.3.3",
|
|
19
|
-
"@qti-components/processing": "^1.6.
|
|
20
|
-
"@qti-components/test": "^1.
|
|
21
|
-
"@qti-components/theme": "^2.
|
|
19
|
+
"@qti-components/processing": "^1.6.1",
|
|
20
|
+
"@qti-components/test": "^1.10.0",
|
|
21
|
+
"@qti-components/theme": "^2.3.0",
|
|
22
22
|
"@qti-components/transformers": "^1.7.3"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|