@citolab/qti-components 7.16.0 → 7.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/base.d.ts +48 -8
  2. package/dist/base.js +49 -2
  3. package/dist/base.js.map +1 -1
  4. package/dist/chunk-2DOYPVF5.js +481 -0
  5. package/dist/chunk-2DOYPVF5.js.map +1 -0
  6. package/dist/chunk-2ZEJ3RR5.js +89 -0
  7. package/dist/chunk-2ZEJ3RR5.js.map +1 -0
  8. package/dist/chunk-352OTVTY.js +3330 -0
  9. package/dist/chunk-352OTVTY.js.map +1 -0
  10. package/dist/chunk-C2HQFI2C.js +5927 -0
  11. package/dist/chunk-C2HQFI2C.js.map +1 -0
  12. package/dist/chunk-DWIRLYDS.js +20 -0
  13. package/dist/chunk-DWIRLYDS.js.map +1 -0
  14. package/dist/chunk-EUXUH3YW.js +15 -0
  15. package/dist/chunk-EUXUH3YW.js.map +1 -0
  16. package/dist/chunk-F44CI35W.js +145 -0
  17. package/dist/chunk-F44CI35W.js.map +1 -0
  18. package/dist/chunk-INKI27D5.js +493 -0
  19. package/dist/chunk-INKI27D5.js.map +1 -0
  20. package/dist/chunk-JEUY3MYB.js +2010 -0
  21. package/dist/chunk-JEUY3MYB.js.map +1 -0
  22. package/dist/chunk-O4XIWHTF.js +1139 -0
  23. package/dist/chunk-O4XIWHTF.js.map +1 -0
  24. package/dist/chunk-RI47B4ZT.js +1753 -0
  25. package/dist/chunk-RI47B4ZT.js.map +1 -0
  26. package/dist/chunk-VEV4DGPH.js +31 -0
  27. package/dist/chunk-VEV4DGPH.js.map +1 -0
  28. package/dist/chunk-W4SQRNWO.js +3844 -0
  29. package/dist/chunk-W4SQRNWO.js.map +1 -0
  30. package/dist/computed-item.context-CiddHLPz.d.ts +22 -0
  31. package/dist/computed.context-CH09_LCR.d.ts +45 -0
  32. package/dist/config.context-DAdkDDf5.d.ts +14 -0
  33. package/dist/elements.d.ts +318 -1
  34. package/dist/elements.js +41 -2
  35. package/dist/elements.js.map +1 -1
  36. package/dist/index.d.ts +21 -8
  37. package/dist/index.js +327 -9
  38. package/dist/index.js.map +1 -1
  39. package/dist/interaction-C5Up6-68.d.ts +56 -0
  40. package/dist/interactions.d.ts +913 -1
  41. package/dist/interactions.js +71 -2
  42. package/dist/interactions.js.map +1 -1
  43. package/dist/item.context-BRKXBC3m.d.ts +10 -0
  44. package/dist/item.d.ts +147 -1
  45. package/dist/item.js +22 -2
  46. package/dist/item.js.map +1 -1
  47. package/dist/loader.d.ts +21 -1
  48. package/dist/loader.js +10 -2
  49. package/dist/loader.js.map +1 -1
  50. package/dist/processing.d.ts +393 -1
  51. package/dist/processing.js +102 -2
  52. package/dist/processing.js.map +1 -1
  53. package/dist/qti-feedback-B4cMzOcq.d.ts +21 -0
  54. package/dist/qti-rule-base-dL4opfvi.d.ts +39 -0
  55. package/dist/qti-transform-test-Bz9A3hmD.d.ts +63 -0
  56. package/dist/test.context-Bpw1HNAZ.d.ts +28 -0
  57. package/dist/test.d.ts +569 -1
  58. package/dist/test.js +60 -2
  59. package/dist/test.js.map +1 -1
  60. package/dist/transformers.d.ts +18 -1
  61. package/dist/transformers.js +11 -2
  62. package/dist/transformers.js.map +1 -1
  63. package/dist/variables-CusMRnyJ.d.ts +69 -0
  64. package/package.json +8 -14
@@ -1 +1,393 @@
1
- export * from '@qti-components/processing';
1
+ import * as lit from 'lit';
2
+ import { LitElement, nothing } from 'lit';
3
+ import { c as QtiRuleBase, b as QtiExpression, a as QtiExpressionBase, Q as QtiConditionExpression } from './qti-rule-base-dL4opfvi.js';
4
+ import { I as ItemContext } from './item.context-BRKXBC3m.js';
5
+ import { B as BaseType, k as ResponseVariable, h as VariableDeclaration } from './variables-CusMRnyJ.js';
6
+ import { T as TestContext } from './test.context-Bpw1HNAZ.js';
7
+
8
+ declare class QtiRule extends LitElement implements QtiRuleBase {
9
+ render(): lit.TemplateResult<1>;
10
+ process(): void;
11
+ }
12
+ declare global {
13
+ interface HTMLElementTagNameMap {
14
+ 'qti-rule': QtiRule;
15
+ }
16
+ }
17
+
18
+ /**
19
+ * The lookupOutcomeValue rule sets the value of an outcome variable to the value obtained
20
+ * by looking up the value of the associated expression in the lookupTable associated
21
+ * with the outcome's declaration.
22
+ */
23
+ declare class QtiLookupOutcomeValue extends QtiRule {
24
+ identifier: string;
25
+ protected context?: ItemContext;
26
+ get childExpression(): QtiExpression<string>;
27
+ process(): number;
28
+ }
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ 'qti-lookup-outcome-value': QtiLookupOutcomeValue;
32
+ }
33
+ }
34
+
35
+ declare class QtiResponseCondition extends QtiRule {
36
+ render(): lit.TemplateResult<1>;
37
+ process(): void;
38
+ }
39
+
40
+ /**
41
+ * Web component that processes `setOutcomeValue` in QTI.
42
+ */
43
+ declare class QtiSetOutcomeValue extends QtiRule {
44
+ /**
45
+ * Processes the QTI rule and dispatches a custom event with the computed outcome value.
46
+ */
47
+ process(): void;
48
+ /**
49
+ * Formats the computed value before dispatching.
50
+ * Ensures numbers are converted to a universal format.
51
+ */
52
+ private formatValue;
53
+ }
54
+ /**
55
+ * Encapsulates the logic for processing QTI setOutcomeValue expressions.
56
+ */
57
+ declare class QtiSetOutcomeValueRule<T> implements QtiRuleBase {
58
+ private expression;
59
+ constructor(expression: QtiExpressionBase<T>);
60
+ /**
61
+ * Evaluates the expression and returns its value.
62
+ */
63
+ process(): string | string[] | null;
64
+ }
65
+
66
+ declare class QtiResponseElse extends LitElement {
67
+ render(): lit.TemplateResult<1>;
68
+ calculate(): boolean;
69
+ getSubRules(): QtiRule[];
70
+ process(): void;
71
+ }
72
+
73
+ declare class QtiResponseIf extends QtiResponseElse {
74
+ calculate(): boolean;
75
+ getSubRules(): QtiRule[];
76
+ }
77
+
78
+ declare class QtiResponseElseIf extends QtiResponseIf {
79
+ render(): lit.TemplateResult<1>;
80
+ }
81
+
82
+ type Constructor$1<T> = new (...args: any[]) => T;
83
+ declare const QtiAnd_base: {
84
+ new (...args: any[]): {
85
+ calculateChildren(children: Array<MockQtiExpression$1<any>>): boolean;
86
+ };
87
+ } & Constructor$1<QtiConditionExpression>;
88
+ declare class QtiAnd extends QtiAnd_base {
89
+ calculate(): boolean;
90
+ }
91
+ type MockQtiExpression$1<T> = {
92
+ calculate: () => T;
93
+ };
94
+ type MockConstructor$1 = new (...args: any[]) => {};
95
+ declare function qtiAndMixin<TBase extends MockConstructor$1>(Base: TBase): {
96
+ new (...args: any[]): {
97
+ calculateChildren(children: Array<MockQtiExpression$1<any>>): boolean;
98
+ };
99
+ } & TBase;
100
+
101
+ declare class QtiBaseValue extends QtiExpression<string> {
102
+ baseType: BaseType;
103
+ getResult(): string;
104
+ }
105
+
106
+ /**
107
+ * @summary The qti-container-size operator returns the number of values in a container.
108
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.container-size
109
+ *
110
+ * Takes a sub-expression with any base-type and either multiple or ordered cardinality.
111
+ * Returns an integer giving the number of values in the container.
112
+ * Returns 0 if the sub-expression is NULL.
113
+ */
114
+ declare class QtiContainerSize extends QtiExpression<number> {
115
+ getResult(): number;
116
+ }
117
+
118
+ declare class QtiContains extends QtiConditionExpression {
119
+ getResult(): boolean;
120
+ }
121
+
122
+ declare class QtiCorrect extends QtiExpression<string | string[]> {
123
+ get interpretation(): string;
124
+ getResult(): string | string[];
125
+ }
126
+
127
+ /**
128
+ * @summary The qti-default expression returns the default value of a declared variable.
129
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.default
130
+ *
131
+ * Looks up the declaration of an itemVariable and returns the associated defaultValue
132
+ * or NULL if no default value was declared. Supports item identifier prefixing
133
+ * for obtaining default values from individual items in outcomes processing.
134
+ */
135
+ declare class QtiDefault extends QtiExpression<any> {
136
+ identifier: string;
137
+ protected context?: ItemContext;
138
+ protected _testContext?: TestContext;
139
+ getResult(): any;
140
+ }
141
+
142
+ declare class QtiEqualRounded extends QtiExpression<boolean> {
143
+ roundingMode: 'decimalPlaces' | 'significantFigures';
144
+ get figures(): number;
145
+ getResult(): boolean;
146
+ }
147
+
148
+ /**
149
+ * @summary The qti-round operator rounds a numerical value to the nearest integer.
150
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.round
151
+ *
152
+ * Takes a single sub-expression with single cardinality and numerical base-type.
153
+ * Returns an integer formed by rounding the value using the rule: n for all input
154
+ * values in the range [n-0.5, n+0.5). For example, 6.8 and 6.5 both round to 7,
155
+ * 6.49 rounds to 6, and -6.5 rounds to -6.
156
+ */
157
+ declare class QtiRound extends QtiExpression<number | null> {
158
+ getResult(): number | null;
159
+ }
160
+
161
+ /**
162
+ * @summary The qti-round-to operator rounds a numerical value to specified precision.
163
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.round-to
164
+ *
165
+ * Takes one sub-expression with single cardinality and numerical base-type.
166
+ * Returns a single float rounded by the specified method to the specified precision.
167
+ * Supports rounding to decimal places or significant figures.
168
+ */
169
+ declare class QtiRoundTo extends QtiExpression<number | null> {
170
+ roundingMode: 'decimalPlaces' | 'significantFigures';
171
+ figures: number;
172
+ getResult(): number | null;
173
+ /**
174
+ * Round to specified number of decimal places
175
+ */
176
+ private _roundToDecimalPlaces;
177
+ /**
178
+ * Round to specified number of significant figures
179
+ */
180
+ private _roundToSignificantFigures;
181
+ }
182
+
183
+ declare class QtiEqual extends QtiExpression<boolean> {
184
+ toleranceMode: 'exact' | 'relative' | 'absolute';
185
+ getResult(): boolean;
186
+ }
187
+
188
+ /**
189
+ * @summary The qti-gcd operator calculates the greatest common divisor of integer values.
190
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.gcd
191
+ *
192
+ * Takes 1 or more sub-expressions with base-type integer and any cardinality.
193
+ * Returns a single integer equal to the greatest common divisor of all argument values.
194
+ * Special cases: gcd(0,0)=0, gcd(0,n)=n if n≠0, returns NULL if any argument is NULL or non-numerical.
195
+ */
196
+ declare class QtiGcd extends QtiExpression<number | null> {
197
+ getResult(): number | null;
198
+ /**
199
+ * Calculate the greatest common divisor of an array of integers
200
+ */
201
+ private _calculateGcd;
202
+ /**
203
+ * Calculate GCD of two numbers using Euclidean algorithm
204
+ */
205
+ private _gcdTwoNumbers;
206
+ }
207
+
208
+ declare class QtiGt extends QtiExpression<boolean> {
209
+ getResult(): boolean;
210
+ }
211
+
212
+ declare class QtiGte extends QtiConditionExpression {
213
+ getResult(): boolean;
214
+ }
215
+
216
+ /**
217
+ * @summary The qti-null expression returns the NULL value.
218
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.null
219
+ *
220
+ * A simple expression that returns the NULL value. The null value is treated
221
+ * as if it is of any desired base-type.
222
+ */
223
+ declare class QtiNull extends QtiExpression<null> {
224
+ getResult(): null;
225
+ }
226
+
227
+ declare class QtiIsNull extends QtiExpression<boolean> {
228
+ getResult(): boolean;
229
+ }
230
+
231
+ declare class QtiFieldValue extends QtiExpression<string | string[]> {
232
+ getResult(): any;
233
+ }
234
+
235
+ declare class QtiLt extends QtiExpression<boolean> {
236
+ getResult(): boolean;
237
+ }
238
+
239
+ declare class QtiLte extends QtiConditionExpression {
240
+ getResult(): boolean;
241
+ }
242
+
243
+ declare class QtiMapResponse extends QtiExpression<number> {
244
+ identifier: string;
245
+ getResult(): number;
246
+ }
247
+
248
+ declare class QtiMapResponsePoint extends QtiExpression<number> {
249
+ identifier: string;
250
+ getResult(): number;
251
+ }
252
+
253
+ /**
254
+ * @summary The qti-math-operator performs mathematical operations on numerical values.
255
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.math-operator
256
+ *
257
+ * Takes 1 or more sub-expressions with single cardinality and numerical base-types.
258
+ * The result is a single float, except for signum, floor and ceil which return integers.
259
+ * Returns NULL if any argument is NULL or falls outside the function's natural domain.
260
+ */
261
+ declare class QtiMathOperator extends QtiExpression<number | null> {
262
+ name: string;
263
+ getResult(): number | null;
264
+ private _performOperation;
265
+ }
266
+
267
+ declare class QtiMatch extends QtiExpression<boolean> {
268
+ getResult(): boolean;
269
+ static match(valueToMap: ResponseVariable, correctValueInfo: ResponseVariable): boolean;
270
+ }
271
+
272
+ declare class QtiMember extends QtiExpression<boolean | null> {
273
+ getResult(): boolean;
274
+ }
275
+
276
+ declare class QtiMultiple extends QtiExpression<VariableDeclaration<string | string[]>[]> {
277
+ getResult(): ResponseVariable[];
278
+ }
279
+
280
+ declare class QtiNot extends QtiExpression<boolean> {
281
+ render(): lit.TemplateResult<1>;
282
+ getResult(): boolean;
283
+ }
284
+
285
+ declare class QtiOr extends QtiConditionExpression {
286
+ getResult(): boolean;
287
+ }
288
+
289
+ declare class QtiOrdered extends QtiExpression<ResponseVariable[]> {
290
+ getResult(): ResponseVariable[];
291
+ }
292
+
293
+ /**
294
+ * @summary The qti-power operator raises the first expression to the power of the second.
295
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.power
296
+ *
297
+ * Takes 2 sub-expressions with single cardinality and numerical base-types.
298
+ * Returns a single float corresponding to the first expression raised to the power of the second.
299
+ * Returns NULL if either expression is NULL or if the result is outside the float value set.
300
+ */
301
+ declare class QtiPower extends QtiExpression<number | null> {
302
+ getResult(): number | null;
303
+ }
304
+
305
+ declare class QtiPrintedVariable extends LitElement {
306
+ identifier: string;
307
+ protected context?: ItemContext;
308
+ render(): lit.TemplateResult<1> | typeof nothing;
309
+ calculate(): VariableDeclaration<string | string[]>;
310
+ }
311
+
312
+ declare class QtiProduct extends QtiExpression<number> {
313
+ getResult(): number;
314
+ }
315
+
316
+ type Constructor<T> = new (...args: any[]) => T;
317
+ declare const QtiSubtract_base: {
318
+ new (...args: any[]): {
319
+ calculateChildren(children: Array<MockQtiExpression<any>>): number;
320
+ };
321
+ } & Constructor<QtiExpression<number>>;
322
+ declare class QtiSubtract extends QtiSubtract_base {
323
+ getResult(): number;
324
+ }
325
+ type MockQtiExpression<T> = {
326
+ calculate: () => T;
327
+ };
328
+ type MockConstructor = new (...args: any[]) => {};
329
+ declare function qtiSubtractMixin<TBase extends MockConstructor>(Base: TBase): {
330
+ new (...args: any[]): {
331
+ calculateChildren(children: Array<MockQtiExpression<any>>): number;
332
+ };
333
+ } & TBase;
334
+
335
+ declare global {
336
+ interface HTMLElementTagNameMap {
337
+ 'qti-subtract': QtiSubtract;
338
+ }
339
+ }
340
+
341
+ declare class QtiStringMatch extends QtiExpression<boolean> {
342
+ caseSensitive: string;
343
+ getResult(): boolean;
344
+ }
345
+
346
+ declare class QtiSum extends QtiExpression<number> {
347
+ private _expression;
348
+ constructor();
349
+ getResult(): number;
350
+ }
351
+ declare class QtiSumExpression implements QtiExpressionBase<number> {
352
+ private expressions;
353
+ constructor(expressions: QtiExpressionBase<number>[]);
354
+ calculate(): number;
355
+ }
356
+
357
+ declare class QtiVariable extends QtiExpression<string | string[]> {
358
+ getResult(): Readonly<string | string[]>;
359
+ }
360
+
361
+ /**
362
+ * @summary The qti-random-integer operator selects a random integer from a specified range.
363
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.random-integer
364
+ *
365
+ * Selects a random integer from the range [min,max] satisfying min + step * n for some integer n.
366
+ * For example, with min=2, max=11 and step=3 the values {2,5,8,11} are possible.
367
+ */
368
+ declare class QtiRandomInteger extends QtiExpression<number> {
369
+ min: number;
370
+ max: number;
371
+ step: number;
372
+ getResult(): number;
373
+ /**
374
+ * Get all possible values for testing purposes
375
+ */
376
+ getPossibleValues(): number[];
377
+ }
378
+
379
+ declare class QtiRandom extends QtiExpression<string> {
380
+ getResult(): any;
381
+ }
382
+
383
+ declare class QtiDelete extends QtiExpression<string[] | null> {
384
+ getResult(): string[] | null;
385
+ }
386
+
387
+ declare class QtiIndex extends QtiExpression<any> {
388
+ n: string;
389
+ getResult(): any;
390
+ private lookupVariableValue;
391
+ }
392
+
393
+ 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 };
@@ -1,3 +1,103 @@
1
- // src/processing.ts
2
- export * from "@qti-components/processing";
1
+ import {
2
+ QtiAnd,
3
+ QtiBaseValue,
4
+ QtiContainerSize,
5
+ QtiContains,
6
+ QtiCorrect,
7
+ QtiDefault,
8
+ QtiDelete,
9
+ QtiEqual,
10
+ QtiEqualRounded,
11
+ QtiFieldValue,
12
+ QtiGcd,
13
+ QtiGt,
14
+ QtiGte,
15
+ QtiIndex,
16
+ QtiIsNull,
17
+ QtiLookupOutcomeValue,
18
+ QtiLt,
19
+ QtiLte,
20
+ QtiMapResponse,
21
+ QtiMapResponsePoint,
22
+ QtiMatch,
23
+ QtiMathOperator,
24
+ QtiMember,
25
+ QtiMultiple,
26
+ QtiNot,
27
+ QtiNull,
28
+ QtiOr,
29
+ QtiOrdered,
30
+ QtiPower,
31
+ QtiPrintedVariable,
32
+ QtiProduct,
33
+ QtiRandom,
34
+ QtiRandomInteger,
35
+ QtiResponseCondition,
36
+ QtiResponseElse,
37
+ QtiResponseElseIf,
38
+ QtiResponseIf,
39
+ QtiRound,
40
+ QtiRoundTo,
41
+ QtiSetOutcomeValue,
42
+ QtiSetOutcomeValueRule,
43
+ QtiStringMatch,
44
+ QtiSubtract,
45
+ QtiSum,
46
+ QtiSumExpression,
47
+ QtiVariable,
48
+ qtiAndMixin,
49
+ qtiSubtractMixin
50
+ } from "./chunk-RI47B4ZT.js";
51
+ import "./chunk-JEUY3MYB.js";
52
+ import "./chunk-EUXUH3YW.js";
53
+ export {
54
+ QtiAnd,
55
+ QtiBaseValue,
56
+ QtiContainerSize,
57
+ QtiContains,
58
+ QtiCorrect,
59
+ QtiDefault,
60
+ QtiDelete,
61
+ QtiEqual,
62
+ QtiEqualRounded,
63
+ QtiFieldValue,
64
+ QtiGcd,
65
+ QtiGt,
66
+ QtiGte,
67
+ QtiIndex,
68
+ QtiIsNull,
69
+ QtiLookupOutcomeValue,
70
+ QtiLt,
71
+ QtiLte,
72
+ QtiMapResponse,
73
+ QtiMapResponsePoint,
74
+ QtiMatch,
75
+ QtiMathOperator,
76
+ QtiMember,
77
+ QtiMultiple,
78
+ QtiNot,
79
+ QtiNull,
80
+ QtiOr,
81
+ QtiOrdered,
82
+ QtiPower,
83
+ QtiPrintedVariable,
84
+ QtiProduct,
85
+ QtiRandom,
86
+ QtiRandomInteger,
87
+ QtiResponseCondition,
88
+ QtiResponseElse,
89
+ QtiResponseElseIf,
90
+ QtiResponseIf,
91
+ QtiRound,
92
+ QtiRoundTo,
93
+ QtiSetOutcomeValue,
94
+ QtiSetOutcomeValueRule,
95
+ QtiStringMatch,
96
+ QtiSubtract,
97
+ QtiSum,
98
+ QtiSumExpression,
99
+ QtiVariable,
100
+ qtiAndMixin,
101
+ qtiSubtractMixin
102
+ };
3
103
  //# sourceMappingURL=processing.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/processing.ts"],"sourcesContent":["export * from '@qti-components/processing';\n"],"mappings":";AAAA,cAAc;","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,21 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement } from 'lit';
3
+ import { a as Cardinality } from './variables-CusMRnyJ.js';
4
+
5
+ declare abstract class QtiVariableDeclaration extends LitElement {
6
+ render(): lit.TemplateResult<1>;
7
+ protected defaultValues(cardinality: Cardinality): string | string[];
8
+ }
9
+
10
+ declare abstract class QtiFeedback extends LitElement {
11
+ protected showHide: string;
12
+ outcomeIdentifier: string;
13
+ protected identifier: string;
14
+ showStatus: string;
15
+ private _context?;
16
+ connectedCallback(): void;
17
+ checkShowFeedback(outcomeIdentifier: string): void;
18
+ private showFeedback;
19
+ }
20
+
21
+ export { QtiVariableDeclaration as Q, QtiFeedback as a };
@@ -0,0 +1,39 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement } from 'lit';
3
+ import { a as QtiContext, Q as QtiContextType } from './test.context-Bpw1HNAZ.js';
4
+ import { k as ResponseVariable, h as VariableDeclaration } from './variables-CusMRnyJ.js';
5
+ import { I as ItemContext } from './item.context-BRKXBC3m.js';
6
+
7
+ interface QtiExpressionBase<T> {
8
+ calculate(): Readonly<T>;
9
+ }
10
+ declare abstract class QtiExpression<T> extends LitElement implements QtiExpressionBase<T> {
11
+ protected result: any;
12
+ static styles: lit.CSSResult;
13
+ render(): lit.TemplateResult<1>;
14
+ calculate(): Readonly<T>;
15
+ protected getResult(): Readonly<T>;
16
+ protected context?: ItemContext;
17
+ protected qtiContext?: QtiContext;
18
+ getVariables: () => (ResponseVariable | VariableDeclaration<QtiContextType>)[];
19
+ }
20
+
21
+ declare abstract class QtiConditionExpression extends QtiExpression<boolean> {
22
+ calculate(): Readonly<boolean>;
23
+ getResult(): Readonly<boolean>;
24
+ }
25
+
26
+ /**
27
+ * Interface for any object that can process QTI rules
28
+ */
29
+ interface QtiRuleBase {
30
+ process(): any;
31
+ }
32
+ /**
33
+ * Abstract base class for QTI rule DOM elements
34
+ */
35
+ declare abstract class QtiRuleElement extends LitElement implements QtiRuleBase {
36
+ abstract process(): any;
37
+ }
38
+
39
+ export { QtiConditionExpression as Q, type QtiExpressionBase as a, QtiExpression as b, type QtiRuleBase as c, QtiRuleElement as d };
@@ -0,0 +1,63 @@
1
+ interface ModuleResolutionConfig {
2
+ waitSeconds?: number;
3
+ context?: string;
4
+ catchError?: boolean;
5
+ urlArgs?: string;
6
+ paths: {
7
+ [key: string]: string | string[];
8
+ };
9
+ shim?: {
10
+ [key: string]: {
11
+ deps?: string[];
12
+ exports?: string;
13
+ };
14
+ };
15
+ }
16
+ type transformItemApi = {
17
+ load: (uri: string, signal?: AbortSignal) => Promise<transformItemApi>;
18
+ parse: (xmlString: string) => transformItemApi;
19
+ path: (location: string) => transformItemApi;
20
+ fn: (fn: (xmlFragment: XMLDocument) => void) => transformItemApi;
21
+ pciHooks: (uri: string) => transformItemApi;
22
+ configurePci: (baseUrl: string, getModuleResolutionConfig: (baseUrl: string, fileUrl: string) => Promise<ModuleResolutionConfig>, selector?: string) => Promise<transformItemApi>;
23
+ extendElementName: (elementName: string, extend: string) => transformItemApi;
24
+ extendElementsWithClass: (param?: string) => transformItemApi;
25
+ customInteraction: (baseRef: string, baseItem: string) => transformItemApi;
26
+ convertCDATAtoComment: () => transformItemApi;
27
+ shuffleInteractions: () => transformItemApi;
28
+ stripStyleSheets: () => transformItemApi;
29
+ html: () => string;
30
+ xml: () => string;
31
+ htmlDoc: () => DocumentFragment;
32
+ xmlDoc: () => XMLDocument;
33
+ };
34
+ declare const qtiTransformItem: (cache?: boolean) => transformItemApi;
35
+
36
+ /**
37
+ * Returns an object with methods to load, parse and transform QTI tests.
38
+ * @returns An object with methods to load, parse and transform QTI tests.
39
+ * @example
40
+ * const qtiTransformer = qtiTransformTest();
41
+ * await qtiTransformer.load('https://example.com/test.xml');
42
+ * const items = qtiTransformer.items();
43
+ * const html = qtiTransformer.html();
44
+ * const xml = qtiTransformer.xml();
45
+ */
46
+ type transformTestApi = {
47
+ load: (uri: string, signal?: AbortSignal) => Promise<transformTestApi>;
48
+ parse: (xmlString: string) => transformTestApi;
49
+ path: (location: string) => transformTestApi;
50
+ fn: (fn: (xmlFragment: XMLDocument) => void) => transformTestApi;
51
+ items: () => {
52
+ identifier: string;
53
+ href: string;
54
+ category: string;
55
+ }[];
56
+ html: () => string;
57
+ xml: () => string;
58
+ htmlDoc: () => DocumentFragment;
59
+ xmlDoc: () => XMLDocument;
60
+ };
61
+ declare const qtiTransformTest: () => transformTestApi;
62
+
63
+ export { type ModuleResolutionConfig as M, type transformTestApi as a, qtiTransformTest as b, qtiTransformItem as q, type transformItemApi as t };
@@ -0,0 +1,28 @@
1
+ import { I as ItemContext } from './item.context-BRKXBC3m.js';
2
+ import { h as VariableDeclaration } from './variables-CusMRnyJ.js';
3
+
4
+ type QtiContextType = {
5
+ testIdentifier: string;
6
+ candidateIdentifier: string;
7
+ environmentIdentifier: string;
8
+ [key: string]: string | string[];
9
+ };
10
+ interface QtiContext {
11
+ QTI_CONTEXT: QtiContextType;
12
+ }
13
+ declare const qtiContext: {
14
+ __context__: Readonly<QtiContext>;
15
+ };
16
+
17
+ interface TestContext {
18
+ items: (ItemContext & {
19
+ category?: string;
20
+ })[];
21
+ testOutcomeVariables?: VariableDeclaration<string | string[] | null>[];
22
+ }
23
+ declare const INITIAL_TEST_CONTEXT: Readonly<TestContext>;
24
+ declare const testContext: {
25
+ __context__: Readonly<TestContext>;
26
+ };
27
+
28
+ export { INITIAL_TEST_CONTEXT as I, type QtiContextType as Q, type TestContext as T, type QtiContext as a, qtiContext as q, testContext as t };