@citolab/qti-components 8.0.0 → 8.0.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 (53) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +591 -217
  3. package/dist/base.d.ts +135 -9
  4. package/dist/{chunk-MJVPNN7W.js → chunk-3AJOQCDU.js} +2 -2
  5. package/dist/chunk-7HC5SMCU.js +102 -0
  6. package/dist/chunk-7HC5SMCU.js.map +1 -0
  7. package/dist/{chunk-MGF5F3S2.js → chunk-CAO4JRLY.js} +2 -2
  8. package/dist/{chunk-5SJS36BI.js → chunk-F4BNJWYN.js} +1 -1
  9. package/dist/{chunk-5SJS36BI.js.map → chunk-F4BNJWYN.js.map} +1 -1
  10. package/dist/{chunk-5QYII4OZ.js → chunk-LVBIQDPM.js} +2 -2
  11. package/dist/{chunk-W4QZPCNC.js → chunk-QECOPVPO.js} +2 -2
  12. package/dist/{chunk-LZJHHZQ2.js → chunk-RXGDQDOV.js} +177 -173
  13. package/dist/chunk-RXGDQDOV.js.map +1 -0
  14. package/dist/{chunk-KYEZRYO6.js → chunk-XU7HNT4F.js} +4 -4
  15. package/dist/computed-item.types.d-BKZdSLLJ.d.ts +19 -0
  16. package/dist/computed.types.d-rKLSPvVG.d.ts +42 -0
  17. package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
  18. package/dist/corrections.d.ts +432 -1
  19. package/dist/corrections.js +5 -5
  20. package/dist/elements.d.ts +393 -1
  21. package/dist/index.d.ts +58 -9
  22. package/dist/index.js +16 -8
  23. package/dist/interaction.d-D4MstYRz.d.ts +115 -0
  24. package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
  25. package/dist/interactions.d.ts +1569 -1
  26. package/dist/interactions.js +2 -2
  27. package/dist/item.css +588 -214
  28. package/dist/item.d.ts +92 -1
  29. package/dist/item.js +3 -3
  30. package/dist/item.types.d-QU7LljEK.d.ts +82 -0
  31. package/dist/loader.d.ts +22 -1
  32. package/dist/processing.d.ts +730 -1
  33. package/dist/qti-components-jsx.d.ts +221 -231
  34. package/dist/qti-components-jsx.js +1 -0
  35. package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
  36. package/dist/qti-expression.d-BietT_8b.d.ts +31 -0
  37. package/dist/qti-feedback.d-DZbad0RN.d.ts +21 -0
  38. package/dist/qti-rule-base.d-ajOnfGXY.d.ts +16 -0
  39. package/dist/qti-transform-test.d-BL7GGFJj.d.ts +70 -0
  40. package/dist/qti.context.d-CejJMlfZ.d.ts +50 -0
  41. package/dist/response.d-_8y4kjGP.d.ts +106 -0
  42. package/dist/test.d.ts +699 -1
  43. package/dist/test.js +11 -3
  44. package/dist/transformers.d.ts +18 -1
  45. package/package.json +11 -8
  46. package/dist/chunk-LZJHHZQ2.js.map +0 -1
  47. package/dist/chunk-WCQ26LV7.js +0 -102
  48. package/dist/chunk-WCQ26LV7.js.map +0 -1
  49. /package/dist/{chunk-MJVPNN7W.js.map → chunk-3AJOQCDU.js.map} +0 -0
  50. /package/dist/{chunk-MGF5F3S2.js.map → chunk-CAO4JRLY.js.map} +0 -0
  51. /package/dist/{chunk-5QYII4OZ.js.map → chunk-LVBIQDPM.js.map} +0 -0
  52. /package/dist/{chunk-W4QZPCNC.js.map → chunk-QECOPVPO.js.map} +0 -0
  53. /package/dist/{chunk-KYEZRYO6.js.map → chunk-XU7HNT4F.js.map} +0 -0
@@ -1 +1,393 @@
1
- export * from '@qti-components/elements';
1
+ import * as lit from 'lit';
2
+ import { LitElement, CSSResultGroup, PropertyValueMap } from 'lit';
3
+ import { g as VariableValue, I as ItemContext, R as ResponseInteraction, f as ResponseVariable, b as OutcomeVariable, V as VariableDeclaration, C as Calculate, B as BaseType, a as Cardinality, T as TemplateVariable } from './item.types.d-QU7LljEK.js';
4
+ import { a as RegisteredInteraction } from './interaction.interface.d-CvjHM2bi.js';
5
+ import { Q as QtiFeedback, a as QtiVariableDeclaration } from './qti-feedback.d-DZbad0RN.js';
6
+ import { Q as QtiRuleBase } from './qti-rule-base.d-ajOnfGXY.js';
7
+
8
+ /**
9
+ * @summary The qti-assessment-item element contains all the other QTI 3 item structures.
10
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
11
+ *
12
+ * @dependency qti-feedback
13
+ * @dependency qti-responseprocessing
14
+ *
15
+ * @event qti-item-context-updated - Emitted when through a user action the itemContext is updated,
16
+ * typically on interaction with the interactions, or calling response processing.
17
+ */
18
+ declare class QtiAssessmentItem extends LitElement {
19
+ #private;
20
+ identifier: string;
21
+ adaptive: 'true' | 'false';
22
+ timeDependent: 'true' | 'false' | null;
23
+ get title(): string;
24
+ set title(value: string);
25
+ disabled: boolean;
26
+ protected _handleDisabledChange: (_: boolean, disabled: boolean) => void;
27
+ readonly: boolean;
28
+ protected _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
29
+ private _context;
30
+ /**
31
+ * Sets the identifier for the assessment item reference if this item is in a test.
32
+ *
33
+ * @param identifier - The identifier for the assessment item reference.
34
+ */
35
+ set assessmentItemRefId(identifier: string);
36
+ get assessmentItemRefId(): string;
37
+ get variables(): VariableValue<string | string[] | null>[];
38
+ set variables(value: VariableValue<string | string[] | null>[]);
39
+ get state(): ItemContext['state'];
40
+ set state(value: ItemContext['state']);
41
+ /** Registered candidate-input interactions. Correction packages may extend their presentation behavior. */
42
+ protected interactionElements: RegisteredInteraction[];
43
+ /** @deprecated use variables property instead */
44
+ set responses(myResponses: ResponseInteraction[]);
45
+ render(): lit.TemplateResult<1>;
46
+ connectedCallback(): void;
47
+ disconnectedCallback(): void;
48
+ processResponse(countNumAttempts?: boolean, reportValidityAfterScoring?: boolean): boolean;
49
+ resetResponses(): void;
50
+ protected getResponse(identifier: string): Readonly<ResponseVariable>;
51
+ getOutcome(identifier: string): Readonly<OutcomeVariable>;
52
+ protected getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;
53
+ /** Extension point for presentation packages reacting to a candidate response change. */
54
+ protected afterResponseVariableUpdated(): void;
55
+ /**
56
+ * Updates the response variable with the specified identifier to the given value.
57
+ *
58
+ * @protected
59
+ *
60
+ * This method is intended for internal use within the class and subclasses.
61
+ * It should not be called externally by third parties.
62
+ *
63
+ * @param identifier - The identifier of the response variable to update.
64
+ * @param value - The new value for the response variable.
65
+ */
66
+ updateResponseVariable(identifier: string, value: string | string[] | undefined): void;
67
+ /**
68
+ * Updates the template variable with the specified identifier to the given value.
69
+ */
70
+ updateTemplateVariable(identifier: string, value: string | string[] | undefined): void;
71
+ /**
72
+ * Updates the correct response for the specified response variable.
73
+ */
74
+ updateCorrectResponse(identifier: string, value: string | string[] | undefined): void;
75
+ setOutcomeVariable(identifier: string, value: string | string[] | undefined): void;
76
+ /**
77
+ * Updates the outcome variable with the specified identifier to the given value.
78
+ *
79
+ * @protected
80
+ *
81
+ * This method is intended for internal use within the class and subclasses.
82
+ * It should not be called externally by third parties.
83
+ *
84
+ * @param identifier - The identifier of the response variable to update.
85
+ * @param value - The new value for the response variable.
86
+ */
87
+ updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void;
88
+ validate(reportValidity?: boolean): boolean;
89
+ reportValidity(): void;
90
+ }
91
+ declare global {
92
+ interface HTMLElementTagNameMap {
93
+ 'qti-assessment-item': QtiAssessmentItem;
94
+ }
95
+ }
96
+
97
+ declare class QtiAssessmentStimulusRefConnectedEvent extends Event {
98
+ element: QtiAssessmentStimulusRef;
99
+ item: QtiAssessmentItem;
100
+ static eventName: string;
101
+ constructor(element: QtiAssessmentStimulusRef, item: QtiAssessmentItem);
102
+ }
103
+ /**
104
+ * Represents a custom element for referencing an assessment stimulus.
105
+ */
106
+ declare class QtiAssessmentStimulusRef extends LitElement {
107
+ identifier: string;
108
+ href: string;
109
+ /**
110
+ * Lifecycle method called when the element is connected to the DOM.
111
+ * First checks if there's a data-stimulus-idref element. If found, loads the stimulus directly.
112
+ * If not found, delegates to the delivery platform via an event.
113
+ */
114
+ connectedCallback(): Promise<void>;
115
+ /**
116
+ * Loads and appends the stimulus to the specified element.
117
+ * @param stimulusRef - The element to which the stimulus will be appended.
118
+ */
119
+ updateStimulusRef(stimulusRef: Element): Promise<void>;
120
+ }
121
+ declare global {
122
+ interface HTMLElementTagNameMap {
123
+ 'qti-assessment-stimulus-ref': QtiAssessmentStimulusRef;
124
+ }
125
+ }
126
+
127
+ declare class QtiCompanionMaterialsInfo extends LitElement {
128
+ }
129
+ declare global {
130
+ interface HTMLElementTagNameMap {
131
+ 'qti-companion-materials-info': QtiCompanionMaterialsInfo;
132
+ }
133
+ }
134
+
135
+ /**
136
+ * https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw
137
+ * <qti-custom-operator class="js.org">
138
+ <qti-base-value base-type="string"><![CDATA[
139
+ console.log(context.variables);
140
+ return 'B'
141
+ document.querySelector('qti-end-attempt-interaction').disabled = true;
142
+ ]]></qti-base-value>
143
+ </qti-custom-operator>
144
+ </qti-set-outcome-value>
145
+ */
146
+ declare class QtiCustomOperator extends LitElement implements Calculate {
147
+ #private;
148
+ private _context?;
149
+ render(): lit.TemplateResult<1>;
150
+ handleSlotChange(): void;
151
+ calculate(): any;
152
+ }
153
+ declare global {
154
+ interface HTMLElementTagNameMap {
155
+ 'qti-custom-operator': QtiCustomOperator;
156
+ }
157
+ }
158
+
159
+ declare class QtiFeedbackBlock extends QtiFeedback {
160
+ static styles: lit.CSSResult;
161
+ render(): lit.TemplateResult<1>;
162
+ connectedCallback(): void;
163
+ }
164
+ declare global {
165
+ interface HTMLElementTagNameMap {
166
+ 'qti-feedback-block': QtiFeedbackBlock;
167
+ }
168
+ }
169
+
170
+ declare class QtiFeedbackInline extends QtiFeedback {
171
+ static styles: lit.CSSResult;
172
+ render: () => lit.TemplateResult<1>;
173
+ connectedCallback(): void;
174
+ }
175
+ declare global {
176
+ interface HTMLElementTagNameMap {
177
+ 'qti-feedback-inline': QtiFeedbackInline;
178
+ }
179
+ }
180
+
181
+ declare class QtiModalFeedback extends QtiFeedback {
182
+ static styles: lit.CSSResult;
183
+ render(): lit.TemplateResult<1>;
184
+ openFeedback(): void;
185
+ closeFeedback(): void;
186
+ connectedCallback(): void;
187
+ protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
188
+ }
189
+ declare global {
190
+ interface HTMLElementTagNameMap {
191
+ 'qti-modal-feedback': QtiModalFeedback;
192
+ }
193
+ }
194
+
195
+ /**
196
+ * @summary The qti-item-body node contains the text, graphics, media objects and interactions that describe the item's content and information about how it is structured.
197
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
198
+ * @status stable
199
+ * @since 4.0
200
+ *
201
+ * @slot - item body content.
202
+ * @slot qti-rubric-block - the qti rubric block is placed above the item
203
+ * @part qti-rubric-block - the qti rubric block part
204
+ */
205
+ declare class QtiItemBody extends LitElement {
206
+ static styles: CSSResultGroup;
207
+ render(): lit.TemplateResult<1>;
208
+ }
209
+ declare global {
210
+ interface HTMLElementTagNameMap {
211
+ 'qti-item-body': QtiItemBody;
212
+ }
213
+ }
214
+
215
+ declare class QtiContentBody extends LitElement {
216
+ #private;
217
+ protected context?: ItemContext;
218
+ render(): lit.TemplateResult<1>;
219
+ connectedCallback(): void;
220
+ protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
221
+ }
222
+ declare global {
223
+ interface HTMLElementTagNameMap {
224
+ 'qti-content-body': QtiContentBody;
225
+ }
226
+ }
227
+
228
+ declare class QtiRubricBlock extends LitElement {
229
+ id: string;
230
+ use: 'instructions' | 'scoring' | 'navigation';
231
+ view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
232
+ classNames: string;
233
+ handleclassNamesChange(): void;
234
+ static styles: lit.CSSResult;
235
+ render(): lit.TemplateResult<1>;
236
+ }
237
+ declare global {
238
+ interface HTMLElementTagNameMap {
239
+ 'qti-rubric-block': QtiRubricBlock;
240
+ }
241
+ }
242
+
243
+ declare class QtiStylesheet extends LitElement {
244
+ #private;
245
+ protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
246
+ disconnectedCallback(): void;
247
+ }
248
+ declare global {
249
+ interface HTMLElementTagNameMap {
250
+ 'qti-stylesheet': QtiStylesheet;
251
+ }
252
+ }
253
+
254
+ declare class QtiResponseDeclaration extends QtiVariableDeclaration {
255
+ #private;
256
+ baseType: BaseType;
257
+ identifier: string;
258
+ cardinality: Cardinality;
259
+ itemContext?: ItemContext;
260
+ static styles: lit.CSSResult[];
261
+ render(): lit.TemplateResult<1>;
262
+ connectedCallback(): void;
263
+ }
264
+ declare global {
265
+ interface HTMLElementTagNameMap {
266
+ 'qti-response-declaration': QtiResponseDeclaration;
267
+ }
268
+ }
269
+
270
+ declare class QtiOutcomeDeclaration extends QtiVariableDeclaration {
271
+ baseType: BaseType;
272
+ externalScored: 'human' | 'externalMachine' | null;
273
+ identifier: string;
274
+ cardinality: Cardinality;
275
+ itemContext?: ItemContext;
276
+ static styles: lit.CSSResult[];
277
+ render(): lit.TemplateResult<1>;
278
+ get interpolationTable(): Map<number, number> | null;
279
+ connectedCallback(): void;
280
+ }
281
+ declare global {
282
+ interface HTMLElementTagNameMap {
283
+ 'qti-outcome-declaration': QtiOutcomeDeclaration;
284
+ }
285
+ }
286
+
287
+ declare class QtiResponseProcessing extends LitElement {
288
+ #private;
289
+ static styles: lit.CSSResult[];
290
+ render(): lit.TemplateResult<1>;
291
+ process(): void;
292
+ firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
293
+ }
294
+ declare global {
295
+ interface HTMLElementTagNameMap {
296
+ 'qti-response-processing': QtiResponseProcessing;
297
+ }
298
+ }
299
+
300
+ /**
301
+ * @summary The qti-template-declaration element declares template variables for item cloning.
302
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-declaration
303
+ */
304
+ declare class QtiTemplateDeclaration extends LitElement {
305
+ #private;
306
+ identifier: string;
307
+ cardinality: 'single' | 'multiple' | 'ordered' | 'record';
308
+ baseType: BaseType;
309
+ mathVariable: boolean;
310
+ paramVariable: boolean;
311
+ static styles: lit.CSSResult[];
312
+ render(): lit.TemplateResult<1>;
313
+ connectedCallback(): void;
314
+ /**
315
+ * Get the template variable definition
316
+ */
317
+ getTemplateVariable(): TemplateVariable;
318
+ }
319
+ declare global {
320
+ interface HTMLElementTagNameMap {
321
+ 'qti-template-declaration': QtiTemplateDeclaration;
322
+ }
323
+ }
324
+
325
+ /**
326
+ * @summary The qti-template-processing element contains template processing rules.
327
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing
328
+ */
329
+ declare class QtiTemplateProcessing extends LitElement {
330
+ #private;
331
+ static styles: lit.CSSResult[];
332
+ render(): lit.TemplateResult<1>;
333
+ /**
334
+ * Process template rules to set template variable values
335
+ */
336
+ process(): void;
337
+ firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
338
+ }
339
+ declare global {
340
+ interface HTMLElementTagNameMap {
341
+ 'qti-template-processing': QtiTemplateProcessing;
342
+ }
343
+ }
344
+
345
+ /**
346
+ * @summary The qti-template-constraint element is a processing rule available only in Template Processing.
347
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-constraint
348
+ *
349
+ * It terminates Template Processing and re-runs it from the beginning if the condition
350
+ * specified in the template constraint is not satisfied. This can be used to iterate
351
+ * the Template Processing with different randomly-generated values until a predetermined
352
+ * condition is satisfied.
353
+ */
354
+ declare class QtiTemplateConstraint extends LitElement implements QtiRuleBase {
355
+ render(): lit.TemplateResult<1>;
356
+ /**
357
+ * Evaluates the constraint condition
358
+ * @returns true if constraint is satisfied, false if template processing should restart
359
+ */
360
+ calculate(): boolean;
361
+ /**
362
+ * Template constraints don't have sub-rules like conditions
363
+ */
364
+ getSubRules(): QtiRuleBase[];
365
+ /**
366
+ * Process the template constraint
367
+ * @returns true if constraint is satisfied, false if template processing should restart
368
+ */
369
+ process(): boolean;
370
+ }
371
+ declare global {
372
+ interface HTMLElementTagNameMap {
373
+ 'qti-template-constraint': QtiTemplateConstraint;
374
+ }
375
+ }
376
+
377
+ /**
378
+ * @summary The qti-context-declaration element declares context variables for an item.
379
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.qti-context-declaration
380
+ */
381
+ declare class QtiContextDeclaration extends LitElement {
382
+ identifier: string;
383
+ cardinality: 'single' | 'multiple' | 'ordered' | 'record';
384
+ static styles: lit.CSSResult[];
385
+ render(): lit.TemplateResult<1>;
386
+ }
387
+ declare global {
388
+ interface HTMLElementTagNameMap {
389
+ 'qti-context-declaration': QtiContextDeclaration;
390
+ }
391
+ }
392
+
393
+ export { QtiAssessmentItem, QtiAssessmentStimulusRef, QtiAssessmentStimulusRefConnectedEvent, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,58 @@
1
- export * from '@qti-components/test';
2
- export * from '@qti-components/item';
3
- export * from '@qti-components/elements';
4
- export * from '@qti-components/interactions';
5
- export * from '@qti-components/transformers';
6
- export * from '@qti-components/loader';
7
- export * from '@qti-components/base';
8
- export * from '@qti-components/processing';
9
- export * from '@qti-components/corrections';
1
+ export { IMyQtiTest, IQtiTest, ITestNavigationMixin, ITestProcessingMixin, QtiAssessmentItemRef, QtiAssessmentSection, QtiAssessmentTest, QtiOutcomeProcessing, QtiOutcomeProcessingProcessor, QtiTest, QtiTestFeedback, QtiTestPart, QtiTestVariables, QtiTestVariablesExpression, SpeechState, TestCheckItem, TestContainer, TestEndAttempt, TestItemLink, TestItemToSpeech, TestNavigation, TestNext, TestPagingButtonsStamp, TestPrev, TestPrintContext, TestPrintVariables, TestScoringButtons, TestScoringFeedback, TestSectionButtonsStamp, TestSectionLink, TestStamp, TestTtsNext, TestTtsPause, TestTtsPlay, TestTtsPrev, TestTtsResume, TestTtsStop, TestView, TestViewToggle, TtsContext, ttsContext } from './test.js';
2
+ export { ItemContainer, ItemPrintVariables, QtiItem } from './item.js';
3
+ export { QtiAssessmentItem, QtiAssessmentStimulusRef, QtiAssessmentStimulusRefConnectedEvent, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing } from './elements.js';
4
+ export { Orientation, QtiAssociateInteraction, QtiChoiceInteraction, QtiCustomInteraction, QtiEndAttemptInteraction, QtiExtendedTextInteraction, QtiGapMatchInteraction, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiHotspotInteraction, QtiHottextInteraction, QtiInlineChoiceInteraction, QtiMatchInteraction, QtiMediaInteraction, QtiOrderInteraction, QtiPortableCustomInteraction, QtiPositionObjectInteraction, QtiPositionObjectStage, QtiSelectPointInteraction, QtiSliderInteraction, QtiTextEntryInteraction, QtiUploadInteraction, qtiInteractionElements } from './interactions.js';
5
+ export * from '@qti-components/interactions-core/elements/qti-gap-img';
6
+ export * from '@qti-components/interactions-core/elements/qti-gap-text';
7
+ export * from '@qti-components/interactions-core/elements/qti-gap';
8
+ export * from '@qti-components/interactions-core/elements/qti-inline-choice';
9
+ export * from '@qti-components/interactions-core/elements/qti-hottext';
10
+ export * from '@qti-components/interactions-core/elements/qti-simple-associable-choice';
11
+ export * from '@qti-components/interactions-core/elements/qti-simple-choice';
12
+ export * from '@qti-components/interactions-core/elements/qti-hotspot-choice';
13
+ export * from '@qti-components/interactions-core/elements/qti-associable-hotspot';
14
+ export * from '@qti-components/interactions-core/elements/qti-prompt';
15
+ export { M as ModuleResolutionConfig, q as qtiTransformItem, a as qtiTransformTest, t as transformItemApi, b as transformTestApi } from './qti-transform-test.d-BL7GGFJj.js';
16
+ export { qtiTransformManifest } from './transformers.js';
17
+ export { ManifestInfo, getItemByUri, getManifestInfo } from './loader.js';
18
+ export { IsNullOrUndefined, ScoringHelper, boxSizing, computedContext, computedItemContext, convertNumberToUniversalFormat, decimalSeparator, dropRegion, itemContext, removeDoubleSlashes, validationMessage } from './base.js';
19
+ export { C as ComputedItemContext } from './computed-item.types.d-BKZdSLLJ.js';
20
+ export { C as ComputedContext, a as ComputedItem, I as INITIAL_SESSION_CONTEXT, S as SessionContext, V as View, s as sessionContext } from './computed.types.d-rKLSPvVG.js';
21
+ export { C as ConfigContext, V as ValidationDisplayMode, c as configContext } from './config.context.d-BvU9r-Mg.js';
22
+ export { C as ChoiceRole, I as Interaction, a as InteractionContext, i as interactionContext } from './interaction.d-D4MstYRz.js';
23
+ export { B as BaseType, C as Calculate, a as Cardinality, I as ItemContext, M as Multiple, O as Ordered, b as OutcomeVariable, Q as QtiAreaMapEntry, c as QtiAreaMapping, d as QtiMapEntry, e as QtiMapping, R as ResponseInteraction, f as ResponseVariable, T as TemplateVariable, V as VariableDeclaration, g as VariableValue, h as areaShape, i as directedPair, j as float, k as integer, l as itemContextVariables } from './item.types.d-QU7LljEK.js';
24
+ export { Q as QtiContext, a as QtiContextType, S as Seed, b as asSeed, i as isSeed, q as qtiContext } from './qti.context.d-CejJMlfZ.js';
25
+ export { I as INITIAL_TEST_CONTEXT, Q as QtiExpression, a as QtiExpressionBase, T as TestContext, t as testContext } from './qti-expression.d-BietT_8b.js';
26
+ export { Q as QtiFeedback, a as QtiVariableDeclaration } from './qti-feedback.d-DZbad0RN.js';
27
+ export { Q as QtiConditionExpression } from './qti-condition-expression.d-aMvBvpc6.js';
28
+ export { D as DirectedPair, I as Identifier, P as Point, R as ResponseValue, i as iterResponseValues, p as parsePair, a as parsePoint, b as parseResponseAttribute, r as responseAttributeConverter, s as serializePair, c as serializePoint, d as serializeResponseAttribute } from './response.d-_8y4kjGP.js';
29
+ export { F as FormAssociatedInteraction, I as IInteraction, R as ReadonlyInteraction, a as RegisteredInteraction, b as ResettableInteraction, c as ResponseIdentifiedInteraction, d as ResponseInteractionElement, V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
30
+ export { Q as QtiRuleBase, a as QtiRuleElement } from './qti-rule-base.d-ajOnfGXY.js';
31
+ 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 } from './processing.js';
32
+ export { CandidateCorrectionMixin, ChoiceCorrectionMixin, CorrectResponseInterface, CorrectResponseMixin, CorrectResponseMode, CorrectionConfig, Correctness, ItemCorrectResponseMode, ItemShowCandidateCorrection, ItemShowCorrectResponse, QtiAssessmentItemCorrection, QtiAssociateInteractionCorrection, QtiChoiceInteractionCorrection, QtiExtendedTextInteractionCorrection, QtiGapMatchInteractionCorrection, QtiGapTextCorrection, QtiGraphicAssociateInteractionCorrection, QtiGraphicGapMatchInteractionCorrection, QtiGraphicOrderInteractionCorrection, QtiHotspotChoiceCorrection, QtiHotspotInteractionCorrection, QtiHottextCorrection, QtiHottextInteractionCorrection, QtiInlineChoiceInteractionCorrection, QtiItemCorrection, QtiMatchInteractionCorrection, QtiOrderInteractionCorrection, QtiPortableCustomInteractionCorrection, QtiSelectPointInteractionCorrection, QtiSimpleAssociableChoiceCorrection, QtiSimpleChoiceCorrection, QtiSliderInteractionCorrection, QtiTestCorrection, QtiTextEntryInteractionCorrection, TestCheckItemCorrection, TestNavigationCorrection, TestShowCorrectResponse, correctionPart } from './corrections.js';
33
+ import 'lit';
34
+ import '@heximal/templates';
35
+ import '@qti-components/elements/elements';
36
+ import 'lit/directives/ref.js';
37
+ import '@qti-components/portable-custom-interaction/qti-portable-custom-test-interaction.js';
38
+ import '@qti-components/interactions-core/mixins/drag-drop-observables';
39
+ import '@qti-components/interactions-core/mixins/menu-auto-size';
40
+ import '@qti-components/interactions-core/mixins/choices/choices.mixin';
41
+ import '@qti-components/item/elements';
42
+ import '@qti-components/test/elements';
43
+ import '@qti-components/associate-interaction/elements';
44
+ import '@qti-components/choice-interaction/elements';
45
+ import '@qti-components/extended-text-interaction/elements';
46
+ import '@qti-components/gap-match-interaction/elements';
47
+ import '@qti-components/graphic-associate-interaction/elements';
48
+ import '@qti-components/graphic-gap-match-interaction/elements';
49
+ import '@qti-components/graphic-order-interaction/elements';
50
+ import '@qti-components/hotspot-interaction/elements';
51
+ import '@qti-components/hottext-interaction/elements';
52
+ import '@qti-components/inline-choice-interaction/elements';
53
+ import '@qti-components/match-interaction/elements';
54
+ import '@qti-components/order-interaction/elements';
55
+ import '@qti-components/portable-custom-interaction/elements';
56
+ import '@qti-components/select-point-interaction/elements';
57
+ import '@qti-components/slider-interaction/elements';
58
+ import '@qti-components/text-entry-interaction/elements';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-MGF5F3S2.js";
1
+ import "./chunk-CAO4JRLY.js";
2
2
  import {
3
3
  CandidateCorrectionMixin,
4
4
  ChoiceCorrectionMixin,
@@ -35,14 +35,18 @@ import {
35
35
  TestNavigationCorrection,
36
36
  TestShowCorrectResponse,
37
37
  correctionPart
38
- } from "./chunk-KYEZRYO6.js";
38
+ } from "./chunk-XU7HNT4F.js";
39
39
  import {
40
40
  QtiAssessmentItemRef,
41
41
  QtiAssessmentSection,
42
42
  QtiAssessmentTest,
43
+ QtiOutcomeProcessing,
44
+ QtiOutcomeProcessingProcessor,
43
45
  QtiTest,
44
46
  QtiTestFeedback,
45
47
  QtiTestPart,
48
+ QtiTestVariables,
49
+ QtiTestVariablesExpression,
46
50
  TestCheckItem,
47
51
  TestContainer,
48
52
  TestEndAttempt,
@@ -68,7 +72,7 @@ import {
68
72
  TestView,
69
73
  TestViewToggle,
70
74
  ttsContext
71
- } from "./chunk-LZJHHZQ2.js";
75
+ } from "./chunk-RXGDQDOV.js";
72
76
  import "./chunk-V5G7X53Y.js";
73
77
  import {
74
78
  QtiAssessmentItem,
@@ -104,7 +108,7 @@ import {
104
108
  QtiPrompt,
105
109
  QtiUploadInteraction,
106
110
  qtiInteractionElements
107
- } from "./chunk-5QYII4OZ.js";
111
+ } from "./chunk-LVBIQDPM.js";
108
112
  import {
109
113
  QtiAssociateInteraction,
110
114
  QtiChoiceInteraction,
@@ -127,15 +131,15 @@ import {
127
131
  QtiSimpleChoice,
128
132
  QtiSliderInteraction,
129
133
  QtiTextEntryInteraction
130
- } from "./chunk-5SJS36BI.js";
134
+ } from "./chunk-F4BNJWYN.js";
131
135
  import "./chunk-X3E5HXG2.js";
132
- import "./chunk-MJVPNN7W.js";
136
+ import "./chunk-3AJOQCDU.js";
133
137
  import {
134
138
  ItemContainer,
135
139
  ItemPrintVariables,
136
140
  QtiItem
137
- } from "./chunk-W4QZPCNC.js";
138
- import "./chunk-WCQ26LV7.js";
141
+ } from "./chunk-QECOPVPO.js";
142
+ import "./chunk-7HC5SMCU.js";
139
143
  import "./chunk-64XSIBGO.js";
140
144
  import {
141
145
  getItemByUri,
@@ -364,6 +368,8 @@ export {
364
368
  QtiOrderInteractionCorrection,
365
369
  QtiOrdered,
366
370
  QtiOutcomeDeclaration,
371
+ QtiOutcomeProcessing,
372
+ QtiOutcomeProcessingProcessor,
367
373
  QtiPatternMatch,
368
374
  QtiPortableCustomInteraction,
369
375
  QtiPortableCustomInteractionCorrection,
@@ -414,6 +420,8 @@ export {
414
420
  QtiTestCorrection,
415
421
  QtiTestFeedback,
416
422
  QtiTestPart,
423
+ QtiTestVariables,
424
+ QtiTestVariablesExpression,
417
425
  QtiTextEntryInteraction,
418
426
  QtiTextEntryInteractionCorrection,
419
427
  QtiTruncate,
@@ -0,0 +1,115 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+ import { C as ConfigContext, V as ValidationDisplayMode } from './config.context.d-BvU9r-Mg.js';
3
+ import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
4
+ import { f as ResponseVariable } from './item.types.d-QU7LljEK.js';
5
+
6
+ /**
7
+ * What a choice element should render and behave as. The same element — `qti-simple-choice`,
8
+ * `qti-hottext` — is a radio in one interaction and a checkbox in another. It cannot know this
9
+ * by itself.
10
+ *
11
+ * Note "drag" is deliberately *not* a choiceRole. In `qti-match-interaction` the same element
12
+ * type is a drag in one match-set and a drop target in the other, so draggability is positional,
13
+ * not a property of the interaction. It is derived from `draggablesSelector` instead. It is also
14
+ * not a valid ARIA role, so it may only ever be a custom state.
15
+ */
16
+ type ChoiceRole = 'radio' | 'checkbox';
17
+ /**
18
+ * State an interaction publishes to the choice elements inside it.
19
+ *
20
+ * Provided by the `qti-*-interaction`, never by `qti-assessment-item`: interactions must work
21
+ * standalone — in a plain form, in a story, in a vendor's app — with no QTI ancestor. Consumers
22
+ * must therefore tolerate its absence and fall back to a sensible default:
23
+ *
24
+ * const role = this.interactionContext?.choiceRole ?? null;
25
+ */
26
+ interface InteractionContext {
27
+ /** `null` when the interaction assigns no particular role to its choices. */
28
+ choiceRole: ChoiceRole | null;
29
+ /**
30
+ * The selector this interaction uses to recognise its draggable chips. An element tests
31
+ * itself with `this.matches(draggablesSelector)` and takes `:state(chip)` if it matches.
32
+ *
33
+ * Published rather than pushed because draggability can be positional: match-interaction's
34
+ * selector distinguishes the source match-set from the target one, so two elements of the
35
+ * same tag get different answers.
36
+ */
37
+ draggablesSelector: string | null;
38
+ }
39
+ declare const interactionContext: {
40
+ __context__: Readonly<InteractionContext>;
41
+ };
42
+
43
+ /**
44
+ * Shared QTI interaction base. Formative correction behavior is supplied by the
45
+ * `@qti-components/corrections` package.
46
+ */
47
+ declare abstract class Interaction extends LitElement implements ValidatableInteraction {
48
+ #private;
49
+ private _context;
50
+ /**
51
+ * Delivery configuration, from the nearest provider — `qti-test` or `qti-item`.
52
+ *
53
+ * **Public so it can be assigned directly, which is the development-time route.** An interaction
54
+ * has to work standalone, and in a story or a spec there is usually no provider above it — so
55
+ * setting the field is all that is needed:
56
+ *
57
+ * orderInteraction.configContext = { allowReorder: false, validationDisplayMode: 'none' };
58
+ *
59
+ * With no provider, nothing ever overwrites it. That is the whole contract, and its limit: where a
60
+ * provider DOES exist it re-emits on its next update and wins, because `@consume` writes this same
61
+ * field. There is no merging — set the value on the provider in that case.
62
+ *
63
+ * In a lit-html template, bind it as a property rather than assigning after the fact:
64
+ *
65
+ * html`<qti-order-interaction .configContext=${{ allowReorder: false }}>…`
66
+ *
67
+ * The binding is committed on the detached template clone, before the fragment is inserted, so it
68
+ * is in place by `connectedCallback` — which matters for anything that reads config on connect.
69
+ *
70
+ * It was `protected`, which fooled nobody: every caller reached it anyway through an
71
+ * `as any` / `as { configContext?: … }` cast. Public says what was already true and removes the
72
+ * casts, rather than pretending at an encapsulation the type system was the only thing enforcing.
73
+ */
74
+ configContext: ConfigContext;
75
+ protected _interactionContext: Readonly<InteractionContext>;
76
+ static formAssociated: boolean;
77
+ protected _internals: ElementInternals;
78
+ get internals(): ElementInternals;
79
+ responseIdentifier: string;
80
+ disabled: boolean;
81
+ readonly: boolean;
82
+ name: any;
83
+ /** Extension point used by wrappers that should not register as candidate inputs. */
84
+ protected get registersWithItem(): boolean;
85
+ get isInline(): boolean;
86
+ get responseVariable(): ResponseVariable | undefined;
87
+ abstract validate(): boolean;
88
+ get value(): string | null;
89
+ set value(val: string | null);
90
+ abstract get response(): string | string[] | null;
91
+ abstract set response(val: string | string[] | null);
92
+ reportValidity(): boolean;
93
+ protected get validationDisplayMode(): ValidationDisplayMode;
94
+ protected resolveAllowReorder(options?: {
95
+ defaultWhenUnset?: boolean;
96
+ }): boolean;
97
+ protected resolveDisableAfterMaxReached(options?: {
98
+ defaultWhenUnset?: boolean;
99
+ }): boolean;
100
+ protected setInteractionValidity(isValid: boolean, validityMessage?: string, anchor?: HTMLElement | null, options?: {
101
+ suppressInline?: boolean;
102
+ }): void;
103
+ protected updateInlineValidationMessage(): void;
104
+ protected clearInlineValidationMessage(): void;
105
+ protected getValidationMessageElement(): HTMLElement | null;
106
+ reset(): void;
107
+ formResetCallback(): void;
108
+ connectedCallback(): void;
109
+ saveResponse(value: string | string[], state?: string | null): void;
110
+ constructor();
111
+ /** Optional lifecycle bridge for interaction subclasses that do not need changed-property data. */
112
+ protected firstUpdated(_changedProperties?: PropertyValues<this>): void;
113
+ }
114
+
115
+ export { type ChoiceRole as C, Interaction as I, type InteractionContext as a, interactionContext as i };