@citolab/qti-components 7.27.2 → 7.27.4
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 +230 -212
- package/custom-elements.json +4214 -1176
- package/dist/base.d.ts +3 -2
- package/dist/base.js +1 -1
- package/dist/{chunk-TZMDZQFG.js → chunk-3HJE3KRM.js} +469 -221
- package/dist/chunk-3HJE3KRM.js.map +1 -0
- package/dist/{chunk-75ME6QG5.js → chunk-424AWLRU.js} +18 -18
- package/dist/{chunk-QUWFDFGZ.js → chunk-FFESMKSD.js} +277 -21
- package/dist/chunk-FFESMKSD.js.map +1 -0
- package/dist/{chunk-G5ZUC3OT.js → chunk-LQZCSHN5.js} +23 -23
- package/dist/chunk-LQZCSHN5.js.map +1 -0
- package/dist/{chunk-DG5TP35K.js → chunk-N7S3GNUP.js} +5 -5
- package/dist/{chunk-DG5TP35K.js.map → chunk-N7S3GNUP.js.map} +1 -1
- package/dist/{chunk-RXRKP6P7.js → chunk-SX63OCDZ.js} +2 -2
- package/dist/{chunk-K7HR6ZAY.js → chunk-UKPCQKPF.js} +2 -2
- package/dist/chunk-UKPCQKPF.js.map +1 -0
- package/dist/{chunk-KY3II5OX.js → chunk-XYTJOQRZ.js} +240 -202
- package/dist/chunk-XYTJOQRZ.js.map +1 -0
- package/dist/{chunk-GG36UR7F.js → chunk-YLIYPNMK.js} +1004 -12
- package/dist/chunk-YLIYPNMK.js.map +1 -0
- package/dist/{chunk-TORB5UN2.js → chunk-Z2SUBRH5.js} +304 -243
- package/dist/chunk-Z2SUBRH5.js.map +1 -0
- package/dist/elements.d.ts +67 -2
- package/dist/elements.js +10 -6
- package/dist/index.d.ts +5 -4
- package/dist/index.js +55 -11
- package/dist/interactions.d.ts +8 -7
- package/dist/interactions.js +3 -3
- package/dist/item.js +4 -4
- package/dist/loader.d.ts +2 -1
- package/dist/loader.js +2 -2
- package/dist/processing.d.ts +374 -17
- package/dist/processing.js +42 -2
- package/dist/qti-components-jsx.d.ts +1183 -126
- package/dist/{qti-rule-base-DGhWN-as.d.ts → qti-condition-expression-B1BYmCcq.d.ts} +1 -14
- package/dist/{qti-feedback-BZjWNyxP.d.ts → qti-feedback-ChmXhZuf.d.ts} +1 -1
- package/dist/qti-rule-base-ajOnfGXY.d.ts +16 -0
- package/dist/test.d.ts +2 -1
- package/dist/test.js +6 -6
- package/dist/transformers.js +1 -1
- package/package.json +11 -11
- package/dist/chunk-G5ZUC3OT.js.map +0 -1
- package/dist/chunk-GG36UR7F.js.map +0 -1
- package/dist/chunk-K7HR6ZAY.js.map +0 -1
- package/dist/chunk-KY3II5OX.js.map +0 -1
- package/dist/chunk-QUWFDFGZ.js.map +0 -1
- package/dist/chunk-TORB5UN2.js.map +0 -1
- package/dist/chunk-TZMDZQFG.js.map +0 -1
- /package/dist/{chunk-75ME6QG5.js.map → chunk-424AWLRU.js.map} +0 -0
- /package/dist/{chunk-RXRKP6P7.js.map → chunk-SX63OCDZ.js.map} +0 -0
package/dist/processing.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement, nothing } from 'lit';
|
|
3
|
-
import {
|
|
3
|
+
import { Q as QtiRuleBase } from './qti-rule-base-ajOnfGXY.js';
|
|
4
4
|
import { I as ItemContext } from './item.context-CkUeDcaO.js';
|
|
5
|
+
import { a as QtiExpression, b as QtiExpressionBase, Q as QtiConditionExpression } from './qti-condition-expression-B1BYmCcq.js';
|
|
5
6
|
import { B as BaseType, f as ResponseVariable, V as VariableDeclaration } from './variables-CMYcDbyW.js';
|
|
6
7
|
import { T as TestContext } from './test.context-CByZZjkR.js';
|
|
7
8
|
import './qti.context-B8PSyIWm.js';
|
|
@@ -82,6 +83,14 @@ declare const QtiAnd_base: {
|
|
|
82
83
|
calculateChildren(children: Array<MockQtiExpression$1<any>>): boolean;
|
|
83
84
|
};
|
|
84
85
|
} & Constructor$1<QtiConditionExpression>;
|
|
86
|
+
/**
|
|
87
|
+
* @summary The qti-and operator evaluates multiple boolean expressions.
|
|
88
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#and
|
|
89
|
+
*
|
|
90
|
+
* Takes 1 or more sub-expressions with base-type boolean and single cardinality.
|
|
91
|
+
* Returns true if all sub-expressions are true, false if any are false.
|
|
92
|
+
* Special cases: Returns NULL if any sub-expression is NULL and all others are true.
|
|
93
|
+
*/
|
|
85
94
|
declare class QtiAnd extends QtiAnd_base {
|
|
86
95
|
calculate(): boolean;
|
|
87
96
|
}
|
|
@@ -95,18 +104,33 @@ declare function qtiAndMixin<TBase extends MockConstructor$1>(Base: TBase): {
|
|
|
95
104
|
};
|
|
96
105
|
} & TBase;
|
|
97
106
|
|
|
107
|
+
/**
|
|
108
|
+
* @summary The qti-any-N operator checks if a specific range of expressions are true.
|
|
109
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#anyN
|
|
110
|
+
*
|
|
111
|
+
* Takes 1 or more sub-expressions with base-type boolean and single cardinality.
|
|
112
|
+
* Attributes 'min' and 'max' define the required range of true values.
|
|
113
|
+
* Returns true if true count is within [min, max], false if outside this range.
|
|
114
|
+
* Special cases: Returns NULL if validity cannot be determined due to NULL arguments.
|
|
115
|
+
*/
|
|
116
|
+
declare class QtiAnyN extends QtiExpression<boolean | null> {
|
|
117
|
+
min: number;
|
|
118
|
+
max: number;
|
|
119
|
+
getResult(): boolean | null;
|
|
120
|
+
}
|
|
121
|
+
|
|
98
122
|
declare class QtiBaseValue extends QtiExpression<string> {
|
|
99
123
|
baseType: BaseType;
|
|
100
124
|
getResult(): string;
|
|
101
125
|
}
|
|
102
126
|
|
|
103
127
|
/**
|
|
104
|
-
* @summary The qti-container-size operator returns the
|
|
105
|
-
* @documentation https://www.imsglobal.org/spec/qti/v3p0/
|
|
128
|
+
* @summary The qti-container-size operator returns the count of items in a container.
|
|
129
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#containerSize
|
|
106
130
|
*
|
|
107
|
-
* Takes
|
|
108
|
-
* Returns
|
|
109
|
-
* Returns 0 if the sub-expression is NULL.
|
|
131
|
+
* Takes 1 sub-expression with multiple or ordered cardinality.
|
|
132
|
+
* Returns a single integer representing the number of items.
|
|
133
|
+
* Special cases: Returns 0 if the sub-expression is NULL.
|
|
110
134
|
*/
|
|
111
135
|
declare class QtiContainerSize extends QtiExpression<number> {
|
|
112
136
|
getResult(): number;
|
|
@@ -116,18 +140,26 @@ declare class QtiContains extends QtiConditionExpression {
|
|
|
116
140
|
getResult(): boolean;
|
|
117
141
|
}
|
|
118
142
|
|
|
143
|
+
/**
|
|
144
|
+
* @summary The qti-correct operator retrieves the defined correct response for a variable.
|
|
145
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#correct
|
|
146
|
+
*
|
|
147
|
+
* Looks up the declaration for the identified response variable.
|
|
148
|
+
* Returns the associated correctResponse value(s).
|
|
149
|
+
* Special cases: Returns NULL if no correct response was declared.
|
|
150
|
+
*/
|
|
119
151
|
declare class QtiCorrect extends QtiExpression<string | string[]> {
|
|
120
152
|
get interpretation(): string;
|
|
121
153
|
getResult(): string | string[];
|
|
122
154
|
}
|
|
123
155
|
|
|
124
156
|
/**
|
|
125
|
-
* @summary The qti-default
|
|
126
|
-
* @documentation https://www.imsglobal.org/spec/qti/v3p0/
|
|
157
|
+
* @summary The qti-default operator retrieves the defined default value for a variable.
|
|
158
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#default
|
|
127
159
|
*
|
|
128
|
-
* Looks up the declaration
|
|
129
|
-
*
|
|
130
|
-
*
|
|
160
|
+
* Looks up the declaration for the identified item variable.
|
|
161
|
+
* Returns the associated defaultValue.
|
|
162
|
+
* Special cases: Returns NULL if no default value was declared.
|
|
131
163
|
*/
|
|
132
164
|
declare class QtiDefault extends QtiExpression<any> {
|
|
133
165
|
identifier: string;
|
|
@@ -136,6 +168,15 @@ declare class QtiDefault extends QtiExpression<any> {
|
|
|
136
168
|
getResult(): any;
|
|
137
169
|
}
|
|
138
170
|
|
|
171
|
+
/**
|
|
172
|
+
* @summary The qti-equal-rounded operator compares two values after rounding.
|
|
173
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#equalRounded
|
|
174
|
+
*
|
|
175
|
+
* Takes 2 sub-expressions with numerical base-types and single cardinality.
|
|
176
|
+
* Requires 'figures' and 'rounding-mode' (decimalPlaces or significantFigures) attributes.
|
|
177
|
+
* Returns true if equal after specified rounding, false otherwise.
|
|
178
|
+
* Special cases: Returns NULL if either sub-expression is NULL.
|
|
179
|
+
*/
|
|
139
180
|
declare class QtiEqualRounded extends QtiExpression<boolean> {
|
|
140
181
|
roundingMode: 'decimalPlaces' | 'significantFigures';
|
|
141
182
|
get figures(): number;
|
|
@@ -144,12 +185,11 @@ declare class QtiEqualRounded extends QtiExpression<boolean> {
|
|
|
144
185
|
|
|
145
186
|
/**
|
|
146
187
|
* @summary The qti-round operator rounds a numerical value to the nearest integer.
|
|
147
|
-
* @documentation https://www.imsglobal.org/spec/qti/v3p0/
|
|
188
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#round
|
|
148
189
|
*
|
|
149
|
-
* Takes
|
|
150
|
-
* Returns
|
|
151
|
-
*
|
|
152
|
-
* 6.49 rounds to 6, and -6.5 rounds to -6.
|
|
190
|
+
* Takes 1 numerical sub-expression of single cardinality.
|
|
191
|
+
* Returns integer n for input in range [n-0.5, n+0.5).
|
|
192
|
+
* Special cases: Returns NULL if input is NULL or NaN.
|
|
153
193
|
*/
|
|
154
194
|
declare class QtiRound extends QtiExpression<number | null> {
|
|
155
195
|
getResult(): number | null;
|
|
@@ -170,11 +210,51 @@ declare class QtiRoundTo extends QtiExpression<number | null> {
|
|
|
170
210
|
getResult(): number | null;
|
|
171
211
|
}
|
|
172
212
|
|
|
213
|
+
/**
|
|
214
|
+
* @summary The qti-equal operator checks if two numerical expressions are equal.
|
|
215
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#equal
|
|
216
|
+
*
|
|
217
|
+
* Takes 2 sub-expressions with numerical base-types and single cardinality.
|
|
218
|
+
* Supports tolerance-mode (exact, absolute, relative) for floating-point comparisons.
|
|
219
|
+
* Returns true if numerically equal within specified tolerance, false otherwise.
|
|
220
|
+
* Special cases: Returns NULL if either sub-expression is NULL.
|
|
221
|
+
*/
|
|
173
222
|
declare class QtiEqual extends QtiExpression<boolean> {
|
|
174
223
|
toleranceMode: 'exact' | 'relative' | 'absolute';
|
|
175
224
|
getResult(): boolean;
|
|
176
225
|
}
|
|
177
226
|
|
|
227
|
+
/**
|
|
228
|
+
* @summary The qti-divide operator performs numerical division.
|
|
229
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#divide
|
|
230
|
+
*
|
|
231
|
+
* Takes exactly 2 sub-expressions with numerical base-types and single cardinality.
|
|
232
|
+
* Returns a single float representing (first / second).
|
|
233
|
+
* Special cases: Returns NULL if either sub-expression is NULL or if divisor is 0.
|
|
234
|
+
*/
|
|
235
|
+
declare class QtiDivide extends QtiExpression<number | null> {
|
|
236
|
+
#private;
|
|
237
|
+
getResult(): number | null;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
declare class QtiDurationGte extends QtiExpression<boolean | null> {
|
|
241
|
+
#private;
|
|
242
|
+
getResult(): boolean | null;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* @summary The qti-duration-lt operator compares two time durations.
|
|
247
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#durationLT
|
|
248
|
+
*
|
|
249
|
+
* Takes 2 sub-expressions with base-type duration and single cardinality.
|
|
250
|
+
* Returns true if the first duration is shorter than the second.
|
|
251
|
+
* Special cases: Returns NULL if either argument is NULL; handles variable precision.
|
|
252
|
+
*/
|
|
253
|
+
declare class QtiDurationLt extends QtiExpression<boolean | null> {
|
|
254
|
+
#private;
|
|
255
|
+
getResult(): boolean | null;
|
|
256
|
+
}
|
|
257
|
+
|
|
178
258
|
/**
|
|
179
259
|
* @summary The qti-gcd operator calculates the greatest common divisor of integer values.
|
|
180
260
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.gcd
|
|
@@ -196,6 +276,56 @@ declare class QtiGte extends QtiConditionExpression {
|
|
|
196
276
|
getResult(): boolean;
|
|
197
277
|
}
|
|
198
278
|
|
|
279
|
+
declare class QtiInside extends QtiExpression<boolean | null> {
|
|
280
|
+
#private;
|
|
281
|
+
shape: string;
|
|
282
|
+
coords: string;
|
|
283
|
+
getResult(): boolean | null;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @summary The qti-integer-divide operator performs integer division rounded down.
|
|
288
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#integerDivide
|
|
289
|
+
*
|
|
290
|
+
* Takes 2 sub-expressions with base-type integer and single cardinality.
|
|
291
|
+
* Returns result of (x / y) rounded down toward negative infinity.
|
|
292
|
+
* Special cases: Returns NULL if any argument is NULL or if divisor is 0.
|
|
293
|
+
*/
|
|
294
|
+
declare class QtiIntegerDivide extends QtiExpression<number | null> {
|
|
295
|
+
#private;
|
|
296
|
+
getResult(): number | null;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @summary The qti-integer-modulus operator returns the remainder of integer division.
|
|
301
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#integerModulus
|
|
302
|
+
*
|
|
303
|
+
* Takes 2 sub-expressions with base-type integer and single cardinality.
|
|
304
|
+
* Returns the remainder (x % y).
|
|
305
|
+
* Special cases: Returns NULL if any argument is NULL or if divisor is 0.
|
|
306
|
+
*/
|
|
307
|
+
declare class QtiIntegerModulus extends QtiExpression<number | null> {
|
|
308
|
+
#private;
|
|
309
|
+
getResult(): number | null;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @summary The qti-integer-to-float operator converts an integer to a float.
|
|
314
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#integerToFloat
|
|
315
|
+
*
|
|
316
|
+
* Takes 1 sub-expression with base-type integer and single cardinality.
|
|
317
|
+
* Returns a value of base-type float with the same numeric value.
|
|
318
|
+
* Special cases: Returns NULL if sub-expression is NULL.
|
|
319
|
+
*/
|
|
320
|
+
declare class QtiIntegerToFloat extends QtiExpression<number | null> {
|
|
321
|
+
getResult(): number | null;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
declare class QtiLcm extends QtiExpression<number | null> {
|
|
325
|
+
#private;
|
|
326
|
+
getResult(): number | null;
|
|
327
|
+
}
|
|
328
|
+
|
|
199
329
|
/**
|
|
200
330
|
* @summary The qti-null expression returns the NULL value.
|
|
201
331
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.null
|
|
@@ -207,10 +337,26 @@ declare class QtiNull extends QtiExpression<null> {
|
|
|
207
337
|
getResult(): null;
|
|
208
338
|
}
|
|
209
339
|
|
|
340
|
+
/**
|
|
341
|
+
* @summary The qti-is-null operator checks if a variable or expression is missing its value.
|
|
342
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#isNull
|
|
343
|
+
*
|
|
344
|
+
* Takes 1 sub-expression with any base-type or cardinality.
|
|
345
|
+
* Returns true if the sub-expression is NULL, false otherwise.
|
|
346
|
+
* Special cases: Empty containers and empty strings are treated as NULL.
|
|
347
|
+
*/
|
|
210
348
|
declare class QtiIsNull extends QtiExpression<boolean> {
|
|
211
349
|
getResult(): boolean;
|
|
212
350
|
}
|
|
213
351
|
|
|
352
|
+
/**
|
|
353
|
+
* @summary The qti-field-value operator retrieves a specific field from a record.
|
|
354
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#fieldValue
|
|
355
|
+
*
|
|
356
|
+
* Takes a sub-expression with record cardinality. 'field-identifier' identifies the field.
|
|
357
|
+
* Returns the value of the specified field.
|
|
358
|
+
* Special cases: Returns NULL if sub-expression is NULL or field does not exist.
|
|
359
|
+
*/
|
|
214
360
|
declare class QtiFieldValue extends QtiExpression<string | string[]> {
|
|
215
361
|
getResult(): any;
|
|
216
362
|
}
|
|
@@ -223,6 +369,14 @@ declare class QtiLte extends QtiConditionExpression {
|
|
|
223
369
|
getResult(): boolean;
|
|
224
370
|
}
|
|
225
371
|
|
|
372
|
+
/**
|
|
373
|
+
* @summary The qti-map-response operator applies a mapping to a candidate's response.
|
|
374
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#mapResponse
|
|
375
|
+
*
|
|
376
|
+
* Transforms the bound response variable using the declaration's qti-mapping.
|
|
377
|
+
* Returns a single float representing the mapped score (or sum of mapped values).
|
|
378
|
+
* Special cases: Returns 0.0 if response is NULL; counts identical values in containers once.
|
|
379
|
+
*/
|
|
226
380
|
declare class QtiMapResponse extends QtiExpression<number> {
|
|
227
381
|
identifier: string;
|
|
228
382
|
getResult(): number;
|
|
@@ -247,24 +401,74 @@ declare class QtiMathOperator extends QtiExpression<number | null> {
|
|
|
247
401
|
getResult(): number | null;
|
|
248
402
|
}
|
|
249
403
|
|
|
404
|
+
/**
|
|
405
|
+
* @summary The qti-match operator compares two expressions for exact value equality.
|
|
406
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#match
|
|
407
|
+
*
|
|
408
|
+
* Takes 2 sub-expressions which must have the same base-type and cardinality.
|
|
409
|
+
* Returns true if they represent the same value, false otherwise.
|
|
410
|
+
* Special cases: Must not be used for float or duration types; returns NULL if any argument is NULL.
|
|
411
|
+
*/
|
|
250
412
|
declare class QtiMatch extends QtiExpression<boolean> {
|
|
251
413
|
getResult(): boolean;
|
|
252
414
|
static match(valueToMap: ResponseVariable, correctValueInfo: ResponseVariable): boolean;
|
|
253
415
|
}
|
|
254
416
|
|
|
417
|
+
/**
|
|
418
|
+
* @summary The qti-max operator finds the largest value in a numerical set.
|
|
419
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#max
|
|
420
|
+
*
|
|
421
|
+
* Takes 1 or more numerical sub-expressions of any cardinality.
|
|
422
|
+
* Returns the largest value in the collection.
|
|
423
|
+
* Special cases: Returns NULL if any argument is NULL or non-numerical.
|
|
424
|
+
*/
|
|
425
|
+
declare class QtiMax extends QtiExpression<number | null> {
|
|
426
|
+
#private;
|
|
427
|
+
getResult(): number | null;
|
|
428
|
+
}
|
|
429
|
+
|
|
255
430
|
declare class QtiMember extends QtiExpression<boolean | null> {
|
|
256
431
|
getResult(): boolean;
|
|
257
432
|
}
|
|
258
433
|
|
|
434
|
+
/**
|
|
435
|
+
* @summary The qti-min operator finds the smallest value in a numerical set.
|
|
436
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#min
|
|
437
|
+
*
|
|
438
|
+
* Takes 1 or more numerical sub-expressions of any cardinality.
|
|
439
|
+
* Returns the smallest value in the collection.
|
|
440
|
+
* Special cases: Returns NULL if any argument is NULL or non-numerical.
|
|
441
|
+
*/
|
|
442
|
+
declare class QtiMin extends QtiExpression<number | null> {
|
|
443
|
+
#private;
|
|
444
|
+
getResult(): number | null;
|
|
445
|
+
}
|
|
446
|
+
|
|
259
447
|
declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
|
|
260
448
|
getResult(): ResponseVariable[];
|
|
261
449
|
}
|
|
262
450
|
|
|
451
|
+
/**
|
|
452
|
+
* @summary The qti-not operator performs logical negation.
|
|
453
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#not
|
|
454
|
+
*
|
|
455
|
+
* Takes exactly 1 sub-expression with base-type boolean and single cardinality.
|
|
456
|
+
* Returns true if sub-expression is false, and false if sub-expression is true.
|
|
457
|
+
* Special cases: Returns NULL if sub-expression is NULL.
|
|
458
|
+
*/
|
|
263
459
|
declare class QtiNot extends QtiExpression<boolean> {
|
|
264
460
|
render(): lit.TemplateResult<1>;
|
|
265
461
|
getResult(): boolean;
|
|
266
462
|
}
|
|
267
463
|
|
|
464
|
+
/**
|
|
465
|
+
* @summary The qti-or operator evaluates if any provided boolean expressions are true.
|
|
466
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#or
|
|
467
|
+
*
|
|
468
|
+
* Takes 1 or more sub-expressions with base-type boolean and single cardinality.
|
|
469
|
+
* Returns true if at least one sub-expression is true, false if all are false.
|
|
470
|
+
* Special cases: Returns NULL if any sub-expression is NULL and all others are false.
|
|
471
|
+
*/
|
|
268
472
|
declare class QtiOr extends QtiConditionExpression {
|
|
269
473
|
getResult(): boolean;
|
|
270
474
|
}
|
|
@@ -285,6 +489,19 @@ declare class QtiPower extends QtiExpression<number | null> {
|
|
|
285
489
|
getResult(): number | null;
|
|
286
490
|
}
|
|
287
491
|
|
|
492
|
+
/**
|
|
493
|
+
* @summary The qti-pattern-match operator checks a string against a regular expression.
|
|
494
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#patternMatch
|
|
495
|
+
*
|
|
496
|
+
* Takes 1 string sub-expression; 'pattern' attribute contains the regex.
|
|
497
|
+
* Returns true if the string matches the pattern, false otherwise.
|
|
498
|
+
* Special cases: Returns NULL if sub-expression is NULL.
|
|
499
|
+
*/
|
|
500
|
+
declare class QtiPatternMatch extends QtiExpression<boolean | null> {
|
|
501
|
+
pattern: string;
|
|
502
|
+
getResult(): boolean | null;
|
|
503
|
+
}
|
|
504
|
+
|
|
288
505
|
declare class QtiPrintedVariable extends LitElement {
|
|
289
506
|
identifier: string;
|
|
290
507
|
protected context?: ItemContext;
|
|
@@ -292,16 +509,107 @@ declare class QtiPrintedVariable extends LitElement {
|
|
|
292
509
|
calculate(): VariableDeclaration<string | string[]>;
|
|
293
510
|
}
|
|
294
511
|
|
|
512
|
+
/**
|
|
513
|
+
* @summary The qti-product operator calculates the product of multiple numerical values.
|
|
514
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#product
|
|
515
|
+
*
|
|
516
|
+
* Takes 1 or more sub-expressions with numerical base-types and any cardinality.
|
|
517
|
+
* Returns a single float (or integer if all arguments are integers).
|
|
518
|
+
* Special cases: Returns NULL if any sub-expression is NULL.
|
|
519
|
+
*/
|
|
295
520
|
declare class QtiProduct extends QtiExpression<number> {
|
|
296
521
|
getResult(): number;
|
|
297
522
|
}
|
|
298
523
|
|
|
524
|
+
/**
|
|
525
|
+
* @summary The qti-repeat operator generates a container by repeating an expression.
|
|
526
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#repeat
|
|
527
|
+
*
|
|
528
|
+
* Attributes 'number-repeats' determines the count of iterations.
|
|
529
|
+
* Returns an ordered container filled with results of the evaluated sub-expressions.
|
|
530
|
+
* Special cases: Returns NULL if number-repeats < 1; ignores evaluated NULL values.
|
|
531
|
+
*/
|
|
532
|
+
declare class QtiRepeat extends QtiExpression<ResponseVariable[]> {
|
|
533
|
+
#private;
|
|
534
|
+
numberRepeats: string;
|
|
535
|
+
getResult(): ResponseVariable[];
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Web component that processes `setCorrectResponse` in QTI.
|
|
540
|
+
*/
|
|
541
|
+
declare class QtiSetCorrectResponse extends QtiRule {
|
|
542
|
+
#private;
|
|
543
|
+
/**
|
|
544
|
+
* Processes the QTI rule and dispatches a custom event with the computed correct response value.
|
|
545
|
+
*/
|
|
546
|
+
process(): void;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Encapsulates the logic for processing QTI setCorrectResponse expressions.
|
|
550
|
+
*/
|
|
551
|
+
declare class QtiSetCorrectResponseRule<T> implements QtiRuleBase {
|
|
552
|
+
#private;
|
|
553
|
+
private expression;
|
|
554
|
+
constructor(expression: QtiExpressionBase<T>);
|
|
555
|
+
/**
|
|
556
|
+
* Evaluates the expression and returns its value.
|
|
557
|
+
*/
|
|
558
|
+
process(): unknown;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Web component that processes `setTemplateValue` in QTI.
|
|
563
|
+
*/
|
|
564
|
+
declare class QtiSetTemplateValue extends QtiRule {
|
|
565
|
+
#private;
|
|
566
|
+
/**
|
|
567
|
+
* Processes the QTI rule and dispatches a custom event with the computed template value.
|
|
568
|
+
*/
|
|
569
|
+
process(): void;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Encapsulates the logic for processing QTI setTemplateValue expressions.
|
|
573
|
+
*/
|
|
574
|
+
declare class QtiSetTemplateValueRule<T> implements QtiRuleBase {
|
|
575
|
+
#private;
|
|
576
|
+
private expression;
|
|
577
|
+
constructor(expression: QtiExpressionBase<T>);
|
|
578
|
+
/**
|
|
579
|
+
* Evaluates the expression and returns its value.
|
|
580
|
+
*/
|
|
581
|
+
process(): unknown;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* @summary The qti-stats-operator performs statistical calculations on a container.
|
|
586
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#statsOperator
|
|
587
|
+
*
|
|
588
|
+
* Takes 1 container (multiple/ordered) of numerical base-type.
|
|
589
|
+
* 'name' attribute identifies function (mean, popSD, popVariance, sampleSD, sampleVariance).
|
|
590
|
+
* Returns result as a single float.
|
|
591
|
+
* Special cases: Returns NULL if any values in container are NULL or non-numerical.
|
|
592
|
+
*/
|
|
593
|
+
declare class QtiStatsOperator extends QtiExpression<number | null> {
|
|
594
|
+
#private;
|
|
595
|
+
name: string;
|
|
596
|
+
getResult(): number | null;
|
|
597
|
+
}
|
|
598
|
+
|
|
299
599
|
type Constructor<T> = new (...args: any[]) => T;
|
|
300
600
|
declare const QtiSubtract_base: {
|
|
301
601
|
new (...args: any[]): {
|
|
302
602
|
calculateChildren(children: Array<MockQtiExpression<any>>): number;
|
|
303
603
|
};
|
|
304
604
|
} & Constructor<QtiExpression<number>>;
|
|
605
|
+
/**
|
|
606
|
+
* @summary The qti-subtract operator performs numerical subtraction.
|
|
607
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#subtract
|
|
608
|
+
*
|
|
609
|
+
* Takes exactly 2 sub-expressions with numerical base-types and single cardinality.
|
|
610
|
+
* Returns (first - second) as a float, or integer if both inputs are integers.
|
|
611
|
+
* Special cases: Returns NULL if either sub-expression is NULL.
|
|
612
|
+
*/
|
|
305
613
|
declare class QtiSubtract extends QtiSubtract_base {
|
|
306
614
|
getResult(): number;
|
|
307
615
|
}
|
|
@@ -321,11 +629,32 @@ declare global {
|
|
|
321
629
|
}
|
|
322
630
|
}
|
|
323
631
|
|
|
632
|
+
/**
|
|
633
|
+
* @summary The qti-substring operator checks if one string is contained within another.
|
|
634
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#substring
|
|
635
|
+
*
|
|
636
|
+
* Takes 2 sub-expressions with base-type string and single cardinality.
|
|
637
|
+
* Returns true if the first string is a substring of the second.
|
|
638
|
+
* Special cases: Returns NULL if either argument is NULL.
|
|
639
|
+
*/
|
|
640
|
+
declare class QtiSubstring extends QtiExpression<boolean | null> {
|
|
641
|
+
caseSensitive: string;
|
|
642
|
+
getResult(): boolean | null;
|
|
643
|
+
}
|
|
644
|
+
|
|
324
645
|
declare class QtiStringMatch extends QtiExpression<boolean> {
|
|
325
646
|
caseSensitive: string;
|
|
326
647
|
getResult(): boolean;
|
|
327
648
|
}
|
|
328
649
|
|
|
650
|
+
/**
|
|
651
|
+
* @summary The qti-sum operator calculates the total of multiple numerical values.
|
|
652
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#sum
|
|
653
|
+
*
|
|
654
|
+
* Takes 1 or more sub-expressions with numerical base-types and any cardinality.
|
|
655
|
+
* Returns a single float (or integer if all arguments are integers) representing the total.
|
|
656
|
+
* Special cases: Returns NULL if any sub-expression is NULL.
|
|
657
|
+
*/
|
|
329
658
|
declare class QtiSum extends QtiExpression<number> {
|
|
330
659
|
getResult(): number;
|
|
331
660
|
}
|
|
@@ -335,6 +664,18 @@ declare class QtiSumExpression implements QtiExpressionBase<number> {
|
|
|
335
664
|
calculate(): number;
|
|
336
665
|
}
|
|
337
666
|
|
|
667
|
+
/**
|
|
668
|
+
* @summary The qti-truncate operator removes fractional parts of a number.
|
|
669
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#truncate
|
|
670
|
+
*
|
|
671
|
+
* Takes 1 numerical sub-expression of single cardinality.
|
|
672
|
+
* Returns integer formed by truncating value toward zero.
|
|
673
|
+
* Special cases: Returns NULL if input is NULL or NaN.
|
|
674
|
+
*/
|
|
675
|
+
declare class QtiTruncate extends QtiExpression<number | null> {
|
|
676
|
+
getResult(): number | null;
|
|
677
|
+
}
|
|
678
|
+
|
|
338
679
|
declare class QtiVariable extends QtiExpression<string | string[]> {
|
|
339
680
|
getResult(): Readonly<string | string[]>;
|
|
340
681
|
}
|
|
@@ -361,14 +702,30 @@ declare class QtiRandom extends QtiExpression<string> {
|
|
|
361
702
|
getResult(): any;
|
|
362
703
|
}
|
|
363
704
|
|
|
705
|
+
/**
|
|
706
|
+
* @summary The qti-delete operator removes all instances of a value from a container.
|
|
707
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#delete
|
|
708
|
+
*
|
|
709
|
+
* Takes a single value (1st) and a container (2nd) of the same base-type.
|
|
710
|
+
* Returns a new container derived from the 2nd with all instances of 1st removed.
|
|
711
|
+
* Special cases: Returns NULL if either argument is NULL.
|
|
712
|
+
*/
|
|
364
713
|
declare class QtiDelete extends QtiExpression<string[] | null> {
|
|
365
714
|
getResult(): string[] | null;
|
|
366
715
|
}
|
|
367
716
|
|
|
717
|
+
/**
|
|
718
|
+
* @summary The qti-index operator retrieves a specific item from an ordered container.
|
|
719
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info/index.html#index
|
|
720
|
+
*
|
|
721
|
+
* Takes 1 ordered container sub-expression; 'n' attribute specifies 1-based index.
|
|
722
|
+
* Returns the nth value from the container with original base-type and single cardinality.
|
|
723
|
+
* Special cases: Returns NULL if container is NULL or n exceeds container size.
|
|
724
|
+
*/
|
|
368
725
|
declare class QtiIndex extends QtiExpression<any> {
|
|
369
726
|
#private;
|
|
370
727
|
n: string;
|
|
371
728
|
getResult(): any;
|
|
372
729
|
}
|
|
373
730
|
|
|
374
|
-
export { QtiAnd, QtiBaseValue, QtiContainerSize, QtiContains, QtiCorrect, QtiDefault, QtiDelete, QtiEqual, QtiEqualRounded, QtiFieldValue, QtiGcd, QtiGt, QtiGte, QtiIndex, QtiIsNull, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMathOperator, QtiMember, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrdered, QtiPower, QtiPrintedVariable, QtiProduct, QtiRandom, QtiRandomInteger, QtiResponseCondition, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRound, QtiRoundTo, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiStringMatch, QtiSubtract, QtiSum, QtiSumExpression, QtiVariable, qtiAndMixin, qtiSubtractMixin };
|
|
731
|
+
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 };
|