@citolab/qti-components 8.0.0 → 8.0.2
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 +690 -316
- package/dist/base.d.ts +135 -9
- package/dist/base.js +1 -1
- package/dist/chunk-4DB4SC5K.js +100 -0
- package/dist/chunk-4DB4SC5K.js.map +1 -0
- package/dist/{chunk-WVVMNF74.js → chunk-7AVWRQIS.js} +188 -160
- package/dist/{chunk-WVVMNF74.js.map → chunk-7AVWRQIS.js.map} +1 -1
- package/dist/{chunk-MGF5F3S2.js → chunk-BQFWCZFH.js} +2 -2
- package/dist/{chunk-5QYII4OZ.js → chunk-CK7AV2UJ.js} +147 -101
- package/dist/chunk-CK7AV2UJ.js.map +1 -0
- package/dist/chunk-G6GFQDVN.js +7 -0
- package/dist/chunk-G6GFQDVN.js.map +1 -0
- package/dist/{chunk-LZJHHZQ2.js → chunk-HBSWJC3B.js} +643 -553
- package/dist/chunk-HBSWJC3B.js.map +1 -0
- package/dist/chunk-HQESINXH.js +834 -0
- package/dist/chunk-HQESINXH.js.map +1 -0
- package/dist/{chunk-KYEZRYO6.js → chunk-J5SQLKNP.js} +145 -119
- package/dist/{chunk-KYEZRYO6.js.map → chunk-J5SQLKNP.js.map} +1 -1
- package/dist/{chunk-V5G7X53Y.js → chunk-NJQHUUTN.js} +2 -2
- package/dist/{chunk-W4QZPCNC.js → chunk-RSVRS5AK.js} +59 -58
- package/dist/chunk-RSVRS5AK.js.map +1 -0
- package/dist/{chunk-5SJS36BI.js → chunk-TWPXES3S.js} +642 -673
- package/dist/chunk-TWPXES3S.js.map +1 -0
- package/dist/{chunk-NA2N2WSG.js → chunk-VAE6HBKR.js} +176 -152
- package/dist/{chunk-NA2N2WSG.js.map → chunk-VAE6HBKR.js.map} +1 -1
- package/dist/{chunk-MJVPNN7W.js → chunk-ZII6M3SN.js} +2 -2
- package/dist/computed-item.types.d-BKZdSLLJ.d.ts +19 -0
- package/dist/computed.types.d-DpKIYO6e.d.ts +44 -0
- package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
- package/dist/corrections.d.ts +415 -1
- package/dist/corrections.js +8 -9
- package/dist/elements.d.ts +393 -1
- package/dist/elements.js +4 -5
- package/dist/index.d.ts +27 -9
- package/dist/index.js +21 -14
- package/dist/interaction.d-CJiMv8H7.d.ts +126 -0
- package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
- package/dist/interactions.d.ts +281 -1
- package/dist/interactions.js +4 -5
- package/dist/item.css +588 -214
- package/dist/item.d.ts +92 -1
- package/dist/item.js +5 -5
- package/dist/item.types.d-QU7LljEK.d.ts +82 -0
- package/dist/loader.d.ts +22 -1
- package/dist/processing.d.ts +730 -1
- package/dist/processing.js +2 -2
- package/dist/qti-components-jsx.d.ts +854 -844
- package/dist/qti-components-jsx.js +1 -0
- package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
- package/dist/qti-expression.d-BietT_8b.d.ts +31 -0
- package/dist/qti-feedback.d-DZbad0RN.d.ts +21 -0
- package/dist/qti-rule-base.d-ajOnfGXY.d.ts +16 -0
- package/dist/qti-test.d-_YAlhDbt.d.ts +702 -0
- package/dist/qti-text-entry-interaction.d-BGdfV9qG.d.ts +1567 -0
- package/dist/qti-transform-test.d-BL7GGFJj.d.ts +70 -0
- package/dist/qti.context.d-CejJMlfZ.d.ts +50 -0
- package/dist/response.d-_8y4kjGP.d.ts +106 -0
- package/dist/test.d.ts +32 -1
- package/dist/test.js +14 -7
- package/dist/transformers.d.ts +18 -1
- package/package.json +15 -11
- package/dist/chunk-5QYII4OZ.js.map +0 -1
- package/dist/chunk-5SJS36BI.js.map +0 -1
- package/dist/chunk-64XSIBGO.js +0 -241
- package/dist/chunk-64XSIBGO.js.map +0 -1
- package/dist/chunk-H3J7LFRO.js +0 -2243
- package/dist/chunk-H3J7LFRO.js.map +0 -1
- package/dist/chunk-LZJHHZQ2.js.map +0 -1
- package/dist/chunk-W4QZPCNC.js.map +0 -1
- package/dist/chunk-WCQ26LV7.js +0 -102
- package/dist/chunk-WCQ26LV7.js.map +0 -1
- package/dist/chunk-X3E5HXG2.js +0 -20
- package/dist/chunk-X3E5HXG2.js.map +0 -1
- /package/dist/{chunk-MGF5F3S2.js.map → chunk-BQFWCZFH.js.map} +0 -0
- /package/dist/{chunk-V5G7X53Y.js.map → chunk-NJQHUUTN.js.map} +0 -0
- /package/dist/{chunk-MJVPNN7W.js.map → chunk-ZII6M3SN.js.map} +0 -0
package/dist/processing.d.ts
CHANGED
|
@@ -1 +1,730 @@
|
|
|
1
|
-
|
|
1
|
+
import * as lit from 'lit';
|
|
2
|
+
import { LitElement, nothing } from 'lit';
|
|
3
|
+
import { Q as QtiRuleBase } from './qti-rule-base.d-ajOnfGXY.js';
|
|
4
|
+
import { I as ItemContext, B as BaseType, f as ResponseVariable, V as VariableDeclaration } from './item.types.d-QU7LljEK.js';
|
|
5
|
+
import { Q as QtiExpression, a as QtiExpressionBase, T as TestContext } from './qti-expression.d-BietT_8b.js';
|
|
6
|
+
import { Q as QtiConditionExpression } from './qti-condition-expression.d-aMvBvpc6.js';
|
|
7
|
+
import './qti.context.d-CejJMlfZ.js';
|
|
8
|
+
|
|
9
|
+
declare class QtiRule extends LitElement implements QtiRuleBase {
|
|
10
|
+
render(): lit.TemplateResult<1>;
|
|
11
|
+
process(): void;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
'qti-rule': QtiRule;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The lookupOutcomeValue rule sets the value of an outcome variable to the value obtained
|
|
21
|
+
* by looking up the value of the associated expression in the lookupTable associated
|
|
22
|
+
* with the outcome's declaration.
|
|
23
|
+
*/
|
|
24
|
+
declare class QtiLookupOutcomeValue extends QtiRule {
|
|
25
|
+
identifier: string;
|
|
26
|
+
protected context?: ItemContext;
|
|
27
|
+
get childExpression(): QtiExpression<string>;
|
|
28
|
+
process(): number;
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface HTMLElementTagNameMap {
|
|
32
|
+
'qti-lookup-outcome-value': QtiLookupOutcomeValue;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare class QtiResponseCondition extends QtiRule {
|
|
37
|
+
render(): lit.TemplateResult<1>;
|
|
38
|
+
process(): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Web component that processes `setOutcomeValue` in QTI.
|
|
43
|
+
*/
|
|
44
|
+
declare class QtiSetOutcomeValue extends QtiRule {
|
|
45
|
+
#private;
|
|
46
|
+
/**
|
|
47
|
+
* Processes the QTI rule and dispatches a custom event with the computed outcome value.
|
|
48
|
+
*/
|
|
49
|
+
process(): void;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Encapsulates the logic for processing QTI setOutcomeValue expressions.
|
|
53
|
+
*/
|
|
54
|
+
declare class QtiSetOutcomeValueRule<T> implements QtiRuleBase {
|
|
55
|
+
private expression;
|
|
56
|
+
constructor(expression: QtiExpressionBase<T>);
|
|
57
|
+
/**
|
|
58
|
+
* Evaluates the expression and returns its value.
|
|
59
|
+
*/
|
|
60
|
+
process(): string | string[] | null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare class QtiResponseElse extends LitElement {
|
|
64
|
+
render(): lit.TemplateResult<1>;
|
|
65
|
+
calculate(): boolean;
|
|
66
|
+
getSubRules(): QtiRule[];
|
|
67
|
+
process(): void;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare class QtiResponseIf extends QtiResponseElse {
|
|
71
|
+
calculate(): boolean;
|
|
72
|
+
getSubRules(): QtiRule[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare class QtiResponseElseIf extends QtiResponseIf {
|
|
76
|
+
render(): lit.TemplateResult<1>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type Constructor$1<T> = new (...args: any[]) => T;
|
|
80
|
+
declare const QtiAnd_base: {
|
|
81
|
+
new (...args: any[]): {
|
|
82
|
+
calculateChildren(children: Array<MockQtiExpression$1<any>>): boolean;
|
|
83
|
+
};
|
|
84
|
+
} & Constructor$1<QtiConditionExpression>;
|
|
85
|
+
/**
|
|
86
|
+
* @summary The qti-and operator evaluates multiple boolean expressions.
|
|
87
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#and
|
|
88
|
+
*
|
|
89
|
+
* Takes 1 or more sub-expressions with base-type boolean and single cardinality.
|
|
90
|
+
* Returns true if all sub-expressions are true, false if any are false.
|
|
91
|
+
* Special cases: Returns NULL if any sub-expression is NULL and all others are true.
|
|
92
|
+
*/
|
|
93
|
+
declare class QtiAnd extends QtiAnd_base {
|
|
94
|
+
calculate(): boolean;
|
|
95
|
+
}
|
|
96
|
+
type MockQtiExpression$1<T> = {
|
|
97
|
+
calculate: () => T;
|
|
98
|
+
};
|
|
99
|
+
type MockConstructor$1 = new (...args: any[]) => {};
|
|
100
|
+
declare function qtiAndMixin<TBase extends MockConstructor$1>(Base: TBase): {
|
|
101
|
+
new (...args: any[]): {
|
|
102
|
+
calculateChildren(children: Array<MockQtiExpression$1<any>>): boolean;
|
|
103
|
+
};
|
|
104
|
+
} & TBase;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @summary The qti-any-N operator checks if a specific range of expressions are true.
|
|
108
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#anyN
|
|
109
|
+
*
|
|
110
|
+
* Takes 1 or more sub-expressions with base-type boolean and single cardinality.
|
|
111
|
+
* Attributes 'min' and 'max' define the required range of true values.
|
|
112
|
+
* Returns true if true count is within [min, max], false if outside this range.
|
|
113
|
+
* Special cases: Returns NULL if validity cannot be determined due to NULL arguments.
|
|
114
|
+
*/
|
|
115
|
+
declare class QtiAnyN extends QtiExpression<boolean | null> {
|
|
116
|
+
min: number;
|
|
117
|
+
max: number;
|
|
118
|
+
getResult(): boolean | null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare class QtiBaseValue extends QtiExpression<string> {
|
|
122
|
+
baseType: BaseType;
|
|
123
|
+
getResult(): string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @summary The qti-container-size operator returns the count of items in a container.
|
|
128
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#containerSize
|
|
129
|
+
*
|
|
130
|
+
* Takes 1 sub-expression with multiple or ordered cardinality.
|
|
131
|
+
* Returns a single integer representing the number of items.
|
|
132
|
+
* Special cases: Returns 0 if the sub-expression is NULL.
|
|
133
|
+
*/
|
|
134
|
+
declare class QtiContainerSize extends QtiExpression<number> {
|
|
135
|
+
getResult(): number;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
declare class QtiContains extends QtiConditionExpression {
|
|
139
|
+
getResult(): boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @summary The qti-correct operator retrieves the defined correct response for a variable.
|
|
144
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#correct
|
|
145
|
+
*
|
|
146
|
+
* Looks up the declaration for the identified response variable.
|
|
147
|
+
* Returns the associated correctResponse value(s).
|
|
148
|
+
* Special cases: Returns NULL if no correct response was declared.
|
|
149
|
+
*/
|
|
150
|
+
declare class QtiCorrect extends QtiExpression<string | string[]> {
|
|
151
|
+
get interpretation(): string;
|
|
152
|
+
getResult(): string | string[];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @summary The qti-default operator retrieves the defined default value for a variable.
|
|
157
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#default
|
|
158
|
+
*
|
|
159
|
+
* Looks up the declaration for the identified item variable.
|
|
160
|
+
* Returns the associated defaultValue.
|
|
161
|
+
* Special cases: Returns NULL if no default value was declared.
|
|
162
|
+
*/
|
|
163
|
+
declare class QtiDefault extends QtiExpression<any> {
|
|
164
|
+
identifier: string;
|
|
165
|
+
protected context?: ItemContext;
|
|
166
|
+
protected _testContext?: TestContext;
|
|
167
|
+
getResult(): any;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @summary The qti-equal-rounded operator compares two values after rounding.
|
|
172
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#equalRounded
|
|
173
|
+
*
|
|
174
|
+
* Takes 2 sub-expressions with numerical base-types and single cardinality.
|
|
175
|
+
* Requires 'figures' and 'rounding-mode' (decimalPlaces or significantFigures) attributes.
|
|
176
|
+
* Returns true if equal after specified rounding, false otherwise.
|
|
177
|
+
* Special cases: Returns NULL if either sub-expression is NULL.
|
|
178
|
+
*/
|
|
179
|
+
declare class QtiEqualRounded extends QtiExpression<boolean> {
|
|
180
|
+
roundingMode: 'decimalPlaces' | 'significantFigures';
|
|
181
|
+
get figures(): number;
|
|
182
|
+
getResult(): boolean;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @summary The qti-round operator rounds a numerical value to the nearest integer.
|
|
187
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#round
|
|
188
|
+
*
|
|
189
|
+
* Takes 1 numerical sub-expression of single cardinality.
|
|
190
|
+
* Returns integer n for input in range [n-0.5, n+0.5).
|
|
191
|
+
* Special cases: Returns NULL if input is NULL or NaN.
|
|
192
|
+
*/
|
|
193
|
+
declare class QtiRound extends QtiExpression<number | null> {
|
|
194
|
+
getResult(): number | null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @summary The qti-round-to operator rounds a numerical value to specified precision.
|
|
199
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.round-to
|
|
200
|
+
*
|
|
201
|
+
* Takes one sub-expression with single cardinality and numerical base-type.
|
|
202
|
+
* Returns a single float rounded by the specified method to the specified precision.
|
|
203
|
+
* Supports rounding to decimal places or significant figures.
|
|
204
|
+
*/
|
|
205
|
+
declare class QtiRoundTo extends QtiExpression<number | null> {
|
|
206
|
+
#private;
|
|
207
|
+
roundingMode: 'decimalPlaces' | 'significantFigures';
|
|
208
|
+
figures: number;
|
|
209
|
+
getResult(): number | null;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @summary The qti-equal operator checks if two numerical expressions are equal.
|
|
214
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#equal
|
|
215
|
+
*
|
|
216
|
+
* Takes 2 sub-expressions with numerical base-types and single cardinality.
|
|
217
|
+
* Supports tolerance-mode (exact, absolute, relative) for floating-point comparisons.
|
|
218
|
+
* Returns true if numerically equal within specified tolerance, false otherwise.
|
|
219
|
+
* Special cases: Returns NULL if either sub-expression is NULL.
|
|
220
|
+
*/
|
|
221
|
+
declare class QtiEqual extends QtiExpression<boolean> {
|
|
222
|
+
toleranceMode: 'exact' | 'relative' | 'absolute';
|
|
223
|
+
getResult(): boolean;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @summary The qti-divide operator performs numerical division.
|
|
228
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#divide
|
|
229
|
+
*
|
|
230
|
+
* Takes exactly 2 sub-expressions with numerical base-types and single cardinality.
|
|
231
|
+
* Returns a single float representing (first / second).
|
|
232
|
+
* Special cases: Returns NULL if either sub-expression is NULL or if divisor is 0.
|
|
233
|
+
*/
|
|
234
|
+
declare class QtiDivide extends QtiExpression<number | null> {
|
|
235
|
+
#private;
|
|
236
|
+
getResult(): number | null;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare class QtiDurationGte extends QtiExpression<boolean | null> {
|
|
240
|
+
#private;
|
|
241
|
+
getResult(): boolean | null;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* @summary The qti-duration-lt operator compares two time durations.
|
|
246
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#durationLT
|
|
247
|
+
*
|
|
248
|
+
* Takes 2 sub-expressions with base-type duration and single cardinality.
|
|
249
|
+
* Returns true if the first duration is shorter than the second.
|
|
250
|
+
* Special cases: Returns NULL if either argument is NULL; handles variable precision.
|
|
251
|
+
*/
|
|
252
|
+
declare class QtiDurationLt extends QtiExpression<boolean | null> {
|
|
253
|
+
#private;
|
|
254
|
+
getResult(): boolean | null;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* @summary The qti-gcd operator calculates the greatest common divisor of integer values.
|
|
259
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.gcd
|
|
260
|
+
*
|
|
261
|
+
* Takes 1 or more sub-expressions with base-type integer and any cardinality.
|
|
262
|
+
* Returns a single integer equal to the greatest common divisor of all argument values.
|
|
263
|
+
* Special cases: gcd(0,0)=0, gcd(0,n)=n if n≠0, returns NULL if any argument is NULL or non-numerical.
|
|
264
|
+
*/
|
|
265
|
+
declare class QtiGcd extends QtiExpression<number | null> {
|
|
266
|
+
#private;
|
|
267
|
+
getResult(): number | null;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
declare class QtiGt extends QtiExpression<boolean> {
|
|
271
|
+
getResult(): boolean;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
declare class QtiGte extends QtiConditionExpression {
|
|
275
|
+
getResult(): boolean;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
declare class QtiInside extends QtiExpression<boolean | null> {
|
|
279
|
+
#private;
|
|
280
|
+
shape: string;
|
|
281
|
+
coords: string;
|
|
282
|
+
getResult(): boolean | null;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* @summary The qti-integer-divide operator performs integer division rounded down.
|
|
287
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#integerDivide
|
|
288
|
+
*
|
|
289
|
+
* Takes 2 sub-expressions with base-type integer and single cardinality.
|
|
290
|
+
* Returns result of (x / y) rounded down toward negative infinity.
|
|
291
|
+
* Special cases: Returns NULL if any argument is NULL or if divisor is 0.
|
|
292
|
+
*/
|
|
293
|
+
declare class QtiIntegerDivide extends QtiExpression<number | null> {
|
|
294
|
+
#private;
|
|
295
|
+
getResult(): number | null;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* @summary The qti-integer-modulus operator returns the remainder of integer division.
|
|
300
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#integerModulus
|
|
301
|
+
*
|
|
302
|
+
* Takes 2 sub-expressions with base-type integer and single cardinality.
|
|
303
|
+
* Returns the remainder (x % y).
|
|
304
|
+
* Special cases: Returns NULL if any argument is NULL or if divisor is 0.
|
|
305
|
+
*/
|
|
306
|
+
declare class QtiIntegerModulus extends QtiExpression<number | null> {
|
|
307
|
+
#private;
|
|
308
|
+
getResult(): number | null;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* @summary The qti-integer-to-float operator converts an integer to a float.
|
|
313
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#integerToFloat
|
|
314
|
+
*
|
|
315
|
+
* Takes 1 sub-expression with base-type integer and single cardinality.
|
|
316
|
+
* Returns a value of base-type float with the same numeric value.
|
|
317
|
+
* Special cases: Returns NULL if sub-expression is NULL.
|
|
318
|
+
*/
|
|
319
|
+
declare class QtiIntegerToFloat extends QtiExpression<number | null> {
|
|
320
|
+
getResult(): number | null;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
declare class QtiLcm extends QtiExpression<number | null> {
|
|
324
|
+
#private;
|
|
325
|
+
getResult(): number | null;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* @summary The qti-null expression returns the NULL value.
|
|
330
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.null
|
|
331
|
+
*
|
|
332
|
+
* A simple expression that returns the NULL value. The null value is treated
|
|
333
|
+
* as if it is of any desired base-type.
|
|
334
|
+
*/
|
|
335
|
+
declare class QtiNull extends QtiExpression<null> {
|
|
336
|
+
getResult(): null;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* @summary The qti-is-null operator checks if a variable or expression is missing its value.
|
|
341
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#isNull
|
|
342
|
+
*
|
|
343
|
+
* Takes 1 sub-expression with any base-type or cardinality.
|
|
344
|
+
* Returns true if the sub-expression is NULL, false otherwise.
|
|
345
|
+
* Special cases: Empty containers and empty strings are treated as NULL.
|
|
346
|
+
*/
|
|
347
|
+
declare class QtiIsNull extends QtiExpression<boolean> {
|
|
348
|
+
getResult(): boolean;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* @summary The qti-field-value operator retrieves a specific field from a record.
|
|
353
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#fieldValue
|
|
354
|
+
*
|
|
355
|
+
* Takes a sub-expression with record cardinality. 'field-identifier' identifies the field.
|
|
356
|
+
* Returns the value of the specified field.
|
|
357
|
+
* Special cases: Returns NULL if sub-expression is NULL or field does not exist.
|
|
358
|
+
*/
|
|
359
|
+
declare class QtiFieldValue extends QtiExpression<string | string[]> {
|
|
360
|
+
getResult(): any;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
declare class QtiLt extends QtiExpression<boolean> {
|
|
364
|
+
getResult(): boolean;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
declare class QtiLte extends QtiConditionExpression {
|
|
368
|
+
getResult(): boolean;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* @summary The qti-map-response operator applies a mapping to a candidate's response.
|
|
373
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#mapResponse
|
|
374
|
+
*
|
|
375
|
+
* Transforms the bound response variable using the declaration's qti-mapping.
|
|
376
|
+
* Returns a single float representing the mapped score (or sum of mapped values).
|
|
377
|
+
* Special cases: Returns 0.0 if response is NULL; counts identical values in containers once.
|
|
378
|
+
*/
|
|
379
|
+
declare class QtiMapResponse extends QtiExpression<number> {
|
|
380
|
+
identifier: string;
|
|
381
|
+
getResult(): number;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
declare class QtiMapResponsePoint extends QtiExpression<number> {
|
|
385
|
+
identifier: string;
|
|
386
|
+
getResult(): number;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* @summary The qti-math-operator performs mathematical operations on numerical values.
|
|
391
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.math-operator
|
|
392
|
+
*
|
|
393
|
+
* Takes 1 or more sub-expressions with single cardinality and numerical base-types.
|
|
394
|
+
* The result is a single float, except for signum, floor and ceil which return integers.
|
|
395
|
+
* Returns NULL if any argument is NULL or falls outside the function's natural domain.
|
|
396
|
+
*/
|
|
397
|
+
declare class QtiMathOperator extends QtiExpression<number | null> {
|
|
398
|
+
#private;
|
|
399
|
+
name: string;
|
|
400
|
+
getResult(): number | null;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* @summary The qti-match operator compares two expressions for exact value equality.
|
|
405
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#match
|
|
406
|
+
*
|
|
407
|
+
* Takes 2 sub-expressions which must have the same base-type and cardinality.
|
|
408
|
+
* Returns true if they represent the same value, false otherwise.
|
|
409
|
+
* Special cases: Must not be used for float or duration types; returns NULL if any argument is NULL.
|
|
410
|
+
*/
|
|
411
|
+
declare class QtiMatch extends QtiExpression<boolean> {
|
|
412
|
+
getResult(): boolean;
|
|
413
|
+
static match(valueToMap: ResponseVariable, correctValueInfo: ResponseVariable): boolean;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* @summary The qti-max operator finds the largest value in a numerical set.
|
|
418
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#max
|
|
419
|
+
*
|
|
420
|
+
* Takes 1 or more numerical sub-expressions of any cardinality.
|
|
421
|
+
* Returns the largest value in the collection.
|
|
422
|
+
* Special cases: Returns NULL if any argument is NULL or non-numerical.
|
|
423
|
+
*/
|
|
424
|
+
declare class QtiMax extends QtiExpression<number | null> {
|
|
425
|
+
#private;
|
|
426
|
+
getResult(): number | null;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
declare class QtiMember extends QtiExpression<boolean | null> {
|
|
430
|
+
getResult(): boolean;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* @summary The qti-min operator finds the smallest value in a numerical set.
|
|
435
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#min
|
|
436
|
+
*
|
|
437
|
+
* Takes 1 or more numerical sub-expressions of any cardinality.
|
|
438
|
+
* Returns the smallest value in the collection.
|
|
439
|
+
* Special cases: Returns NULL if any argument is NULL or non-numerical.
|
|
440
|
+
*/
|
|
441
|
+
declare class QtiMin extends QtiExpression<number | null> {
|
|
442
|
+
#private;
|
|
443
|
+
getResult(): number | null;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
|
|
447
|
+
getResult(): ResponseVariable[];
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* @summary The qti-not operator performs logical negation.
|
|
452
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#not
|
|
453
|
+
*
|
|
454
|
+
* Takes exactly 1 sub-expression with base-type boolean and single cardinality.
|
|
455
|
+
* Returns true if sub-expression is false, and false if sub-expression is true.
|
|
456
|
+
* Special cases: Returns NULL if sub-expression is NULL.
|
|
457
|
+
*/
|
|
458
|
+
declare class QtiNot extends QtiExpression<boolean> {
|
|
459
|
+
render(): lit.TemplateResult<1>;
|
|
460
|
+
getResult(): boolean;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @summary The qti-or operator evaluates if any provided boolean expressions are true.
|
|
465
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#or
|
|
466
|
+
*
|
|
467
|
+
* Takes 1 or more sub-expressions with base-type boolean and single cardinality.
|
|
468
|
+
* Returns true if at least one sub-expression is true, false if all are false.
|
|
469
|
+
* Special cases: Returns NULL if any sub-expression is NULL and all others are false.
|
|
470
|
+
*/
|
|
471
|
+
declare class QtiOr extends QtiConditionExpression {
|
|
472
|
+
getResult(): boolean;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
|
|
476
|
+
getResult(): ResponseVariable[];
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* @summary The qti-power operator raises the first expression to the power of the second.
|
|
481
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.power
|
|
482
|
+
*
|
|
483
|
+
* Takes 2 sub-expressions with single cardinality and numerical base-types.
|
|
484
|
+
* Returns a single float corresponding to the first expression raised to the power of the second.
|
|
485
|
+
* Returns NULL if either expression is NULL or if the result is outside the float value set.
|
|
486
|
+
*/
|
|
487
|
+
declare class QtiPower extends QtiExpression<number | null> {
|
|
488
|
+
getResult(): number | null;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* @summary The qti-pattern-match operator checks a string against a regular expression.
|
|
493
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#patternMatch
|
|
494
|
+
*
|
|
495
|
+
* Takes 1 string sub-expression; 'pattern' attribute contains the regex.
|
|
496
|
+
* Returns true if the string matches the pattern, false otherwise.
|
|
497
|
+
* Special cases: Returns NULL if sub-expression is NULL.
|
|
498
|
+
*/
|
|
499
|
+
declare class QtiPatternMatch extends QtiExpression<boolean | null> {
|
|
500
|
+
pattern: string;
|
|
501
|
+
getResult(): boolean | null;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
declare class QtiPrintedVariable extends LitElement {
|
|
505
|
+
identifier: string;
|
|
506
|
+
protected context?: ItemContext;
|
|
507
|
+
render(): lit.TemplateResult<1> | typeof nothing;
|
|
508
|
+
calculate(): VariableDeclaration<string | string[]>;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* @summary The qti-product operator calculates the product of multiple numerical values.
|
|
513
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#product
|
|
514
|
+
*
|
|
515
|
+
* Takes 1 or more sub-expressions with numerical base-types and any cardinality.
|
|
516
|
+
* Returns a single float (or integer if all arguments are integers).
|
|
517
|
+
* Special cases: Returns NULL if any sub-expression is NULL.
|
|
518
|
+
*/
|
|
519
|
+
declare class QtiProduct extends QtiExpression<number> {
|
|
520
|
+
getResult(): number;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* @summary The qti-repeat operator generates a container by repeating an expression.
|
|
525
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#repeat
|
|
526
|
+
*
|
|
527
|
+
* Attributes 'number-repeats' determines the count of iterations.
|
|
528
|
+
* Returns an ordered container filled with results of the evaluated sub-expressions.
|
|
529
|
+
* Special cases: Returns NULL if number-repeats < 1; ignores evaluated NULL values.
|
|
530
|
+
*/
|
|
531
|
+
declare class QtiRepeat extends QtiExpression<ResponseVariable[]> {
|
|
532
|
+
#private;
|
|
533
|
+
numberRepeats: string;
|
|
534
|
+
getResult(): ResponseVariable[];
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Web component that processes `setCorrectResponse` in QTI.
|
|
539
|
+
*/
|
|
540
|
+
declare class QtiSetCorrectResponse extends QtiRule {
|
|
541
|
+
#private;
|
|
542
|
+
/**
|
|
543
|
+
* Processes the QTI rule and dispatches a custom event with the computed correct response value.
|
|
544
|
+
*/
|
|
545
|
+
process(): void;
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Encapsulates the logic for processing QTI setCorrectResponse expressions.
|
|
549
|
+
*/
|
|
550
|
+
declare class QtiSetCorrectResponseRule<T> implements QtiRuleBase {
|
|
551
|
+
#private;
|
|
552
|
+
private expression;
|
|
553
|
+
constructor(expression: QtiExpressionBase<T>);
|
|
554
|
+
/**
|
|
555
|
+
* Evaluates the expression and returns its value.
|
|
556
|
+
*/
|
|
557
|
+
process(): unknown;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Web component that processes `setTemplateValue` in QTI.
|
|
562
|
+
*/
|
|
563
|
+
declare class QtiSetTemplateValue extends QtiRule {
|
|
564
|
+
#private;
|
|
565
|
+
/**
|
|
566
|
+
* Processes the QTI rule and dispatches a custom event with the computed template value.
|
|
567
|
+
*/
|
|
568
|
+
process(): void;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Encapsulates the logic for processing QTI setTemplateValue expressions.
|
|
572
|
+
*/
|
|
573
|
+
declare class QtiSetTemplateValueRule<T> implements QtiRuleBase {
|
|
574
|
+
#private;
|
|
575
|
+
private expression;
|
|
576
|
+
constructor(expression: QtiExpressionBase<T>);
|
|
577
|
+
/**
|
|
578
|
+
* Evaluates the expression and returns its value.
|
|
579
|
+
*/
|
|
580
|
+
process(): unknown;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* @summary The qti-stats-operator performs statistical calculations on a container.
|
|
585
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#statsOperator
|
|
586
|
+
*
|
|
587
|
+
* Takes 1 container (multiple/ordered) of numerical base-type.
|
|
588
|
+
* 'name' attribute identifies function (mean, popSD, popVariance, sampleSD, sampleVariance).
|
|
589
|
+
* Returns result as a single float.
|
|
590
|
+
* Special cases: Returns NULL if any values in container are NULL or non-numerical.
|
|
591
|
+
*/
|
|
592
|
+
declare class QtiStatsOperator extends QtiExpression<number | null> {
|
|
593
|
+
#private;
|
|
594
|
+
name: string;
|
|
595
|
+
getResult(): number | null;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
type Constructor<T> = new (...args: any[]) => T;
|
|
599
|
+
declare const QtiSubtract_base: {
|
|
600
|
+
new (...args: any[]): {
|
|
601
|
+
calculateChildren(children: Array<MockQtiExpression<any>>): number;
|
|
602
|
+
};
|
|
603
|
+
} & Constructor<QtiExpression<number>>;
|
|
604
|
+
/**
|
|
605
|
+
* @summary The qti-subtract operator performs numerical subtraction.
|
|
606
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#subtract
|
|
607
|
+
*
|
|
608
|
+
* Takes exactly 2 sub-expressions with numerical base-types and single cardinality.
|
|
609
|
+
* Returns (first - second) as a float, or integer if both inputs are integers.
|
|
610
|
+
* Special cases: Returns NULL if either sub-expression is NULL.
|
|
611
|
+
*/
|
|
612
|
+
declare class QtiSubtract extends QtiSubtract_base {
|
|
613
|
+
getResult(): number;
|
|
614
|
+
}
|
|
615
|
+
type MockQtiExpression<T> = {
|
|
616
|
+
calculate: () => T;
|
|
617
|
+
};
|
|
618
|
+
type MockConstructor = new (...args: any[]) => {};
|
|
619
|
+
declare function qtiSubtractMixin<TBase extends MockConstructor>(Base: TBase): {
|
|
620
|
+
new (...args: any[]): {
|
|
621
|
+
calculateChildren(children: Array<MockQtiExpression<any>>): number;
|
|
622
|
+
};
|
|
623
|
+
} & TBase;
|
|
624
|
+
|
|
625
|
+
declare global {
|
|
626
|
+
interface HTMLElementTagNameMap {
|
|
627
|
+
'qti-subtract': QtiSubtract;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* @summary The qti-substring operator checks if one string is contained within another.
|
|
633
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#substring
|
|
634
|
+
*
|
|
635
|
+
* Takes 2 sub-expressions with base-type string and single cardinality.
|
|
636
|
+
* Returns true if the first string is a substring of the second.
|
|
637
|
+
* Special cases: Returns NULL if either argument is NULL.
|
|
638
|
+
*/
|
|
639
|
+
declare class QtiSubstring extends QtiExpression<boolean | null> {
|
|
640
|
+
caseSensitive: string;
|
|
641
|
+
getResult(): boolean | null;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
declare class QtiStringMatch extends QtiExpression<boolean> {
|
|
645
|
+
caseSensitive: string;
|
|
646
|
+
getResult(): boolean;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* @summary The qti-sum operator calculates the total of multiple numerical values.
|
|
651
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#sum
|
|
652
|
+
*
|
|
653
|
+
* Takes 1 or more sub-expressions with numerical base-types and any cardinality.
|
|
654
|
+
* Returns a single float (or integer if all arguments are integers) representing the total.
|
|
655
|
+
* Special cases: Returns NULL if any sub-expression is NULL.
|
|
656
|
+
*/
|
|
657
|
+
declare class QtiSum extends QtiExpression<number> {
|
|
658
|
+
getResult(): number;
|
|
659
|
+
}
|
|
660
|
+
declare class QtiSumExpression implements QtiExpressionBase<number> {
|
|
661
|
+
private expressions;
|
|
662
|
+
constructor(expressions: QtiExpressionBase<number>[]);
|
|
663
|
+
calculate(): number;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/**
|
|
667
|
+
* @summary The qti-truncate operator removes fractional parts of a number.
|
|
668
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#truncate
|
|
669
|
+
*
|
|
670
|
+
* Takes 1 numerical sub-expression of single cardinality.
|
|
671
|
+
* Returns integer formed by truncating value toward zero.
|
|
672
|
+
* Special cases: Returns NULL if input is NULL or NaN.
|
|
673
|
+
*/
|
|
674
|
+
declare class QtiTruncate extends QtiExpression<number | null> {
|
|
675
|
+
getResult(): number | null;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
declare class QtiVariable extends QtiExpression<string | string[]> {
|
|
679
|
+
getResult(): Readonly<string | string[]>;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* @summary The qti-random-integer operator selects a random integer from a specified range.
|
|
684
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.random-integer
|
|
685
|
+
*
|
|
686
|
+
* Selects a random integer from the range [min,max] satisfying min + step * n for some integer n.
|
|
687
|
+
* For example, with min=2, max=11 and step=3 the values {2,5,8,11} are possible.
|
|
688
|
+
*/
|
|
689
|
+
declare class QtiRandomInteger extends QtiExpression<number> {
|
|
690
|
+
min: number;
|
|
691
|
+
max: number;
|
|
692
|
+
step: number;
|
|
693
|
+
getResult(): number;
|
|
694
|
+
/**
|
|
695
|
+
* Get all possible values for testing purposes
|
|
696
|
+
*/
|
|
697
|
+
getPossibleValues(): number[];
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
declare class QtiRandom extends QtiExpression<string> {
|
|
701
|
+
getResult(): any;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* @summary The qti-delete operator removes all instances of a value from a container.
|
|
706
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#delete
|
|
707
|
+
*
|
|
708
|
+
* Takes a single value (1st) and a container (2nd) of the same base-type.
|
|
709
|
+
* Returns a new container derived from the 2nd with all instances of 1st removed.
|
|
710
|
+
* Special cases: Returns NULL if either argument is NULL.
|
|
711
|
+
*/
|
|
712
|
+
declare class QtiDelete extends QtiExpression<string[] | null> {
|
|
713
|
+
getResult(): string[] | null;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* @summary The qti-index operator retrieves a specific item from an ordered container.
|
|
718
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#index
|
|
719
|
+
*
|
|
720
|
+
* Takes 1 ordered container sub-expression; 'n' attribute specifies 1-based index.
|
|
721
|
+
* Returns the nth value from the container with original base-type and single cardinality.
|
|
722
|
+
* Special cases: Returns NULL if container is NULL or n exceeds container size.
|
|
723
|
+
*/
|
|
724
|
+
declare class QtiIndex extends QtiExpression<any> {
|
|
725
|
+
#private;
|
|
726
|
+
n: string;
|
|
727
|
+
getResult(): any;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
export { QtiAnd, QtiAnyN, QtiBaseValue, QtiContainerSize, QtiContains, QtiCorrect, QtiDefault, QtiDelete, QtiDivide, QtiDurationGte, QtiDurationLt, QtiEqual, QtiEqualRounded, QtiFieldValue, QtiGcd, QtiGt, QtiGte, QtiIndex, QtiInside, QtiIntegerDivide, QtiIntegerModulus, QtiIntegerToFloat, QtiIsNull, QtiLcm, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMathOperator, QtiMax, QtiMember, QtiMin, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrdered, QtiPatternMatch, QtiPower, QtiPrintedVariable, QtiProduct, QtiRandom, QtiRandomInteger, QtiRepeat, QtiResponseCondition, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRound, QtiRoundTo, QtiSetCorrectResponse, QtiSetCorrectResponseRule, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiSetTemplateValue, QtiSetTemplateValueRule, QtiStatsOperator, QtiStringMatch, QtiSubstring, QtiSubtract, QtiSum, QtiSumExpression, QtiTruncate, QtiVariable, qtiAndMixin, qtiSubtractMixin };
|