@citolab/qti-components 7.28.1 → 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 (88) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +6316 -2710
  3. package/dist/base.d.ts +100 -15
  4. package/dist/base.js +27 -6
  5. package/dist/chunk-3AJOQCDU.js +11 -0
  6. package/dist/chunk-3AJOQCDU.js.map +1 -0
  7. package/dist/chunk-64XSIBGO.js +241 -0
  8. package/dist/chunk-64XSIBGO.js.map +1 -0
  9. package/dist/chunk-7HC5SMCU.js +102 -0
  10. package/dist/chunk-7HC5SMCU.js.map +1 -0
  11. package/dist/{chunk-SP6S2WMG.js → chunk-7V4HJFHW.js} +3 -3
  12. package/dist/{chunk-SP6S2WMG.js.map → chunk-7V4HJFHW.js.map} +1 -1
  13. package/dist/chunk-CAO4JRLY.js +11 -0
  14. package/dist/chunk-CAO4JRLY.js.map +1 -0
  15. package/dist/{chunk-MPC7LIPC.js → chunk-F4BNJWYN.js} +4264 -3647
  16. package/dist/chunk-F4BNJWYN.js.map +1 -0
  17. package/dist/{chunk-3XV26R5M.js → chunk-H3J7LFRO.js} +829 -1005
  18. package/dist/chunk-H3J7LFRO.js.map +1 -0
  19. package/dist/{chunk-3WBG257S.js → chunk-IJD53WY6.js} +96 -74
  20. package/dist/chunk-IJD53WY6.js.map +1 -0
  21. package/dist/chunk-LVBIQDPM.js +1374 -0
  22. package/dist/chunk-LVBIQDPM.js.map +1 -0
  23. package/dist/{chunk-REI3AMCZ.js → chunk-NA2N2WSG.js} +1303 -1193
  24. package/dist/chunk-NA2N2WSG.js.map +1 -0
  25. package/dist/chunk-QECOPVPO.js +294 -0
  26. package/dist/chunk-QECOPVPO.js.map +1 -0
  27. package/dist/{chunk-HFCZFWSH.js → chunk-RXGDQDOV.js} +1993 -1764
  28. package/dist/chunk-RXGDQDOV.js.map +1 -0
  29. package/dist/chunk-V5G7X53Y.js +11 -0
  30. package/dist/chunk-V5G7X53Y.js.map +1 -0
  31. package/dist/{chunk-WDO2TRFM.js → chunk-WVVMNF74.js} +851 -925
  32. package/dist/chunk-WVVMNF74.js.map +1 -0
  33. package/dist/{chunk-FLJAKWXL.js → chunk-X3E5HXG2.js} +2 -2
  34. package/dist/chunk-XU7HNT4F.js +1608 -0
  35. package/dist/chunk-XU7HNT4F.js.map +1 -0
  36. package/dist/{computed-item.context-DfsW_96S.d.ts → computed-item.types.d-BKZdSLLJ.d.ts} +2 -5
  37. package/dist/{computed.context-DHbxad0N.d.ts → computed.types.d-rKLSPvVG.d.ts} +2 -5
  38. package/dist/config.context.d-BvU9r-Mg.d.ts +91 -0
  39. package/dist/corrections.d.ts +432 -0
  40. package/dist/corrections.js +84 -0
  41. package/dist/elements.d.ts +8 -14
  42. package/dist/elements.js +6 -5
  43. package/dist/index.d.ts +51 -16
  44. package/dist/index.js +193 -76
  45. package/dist/interaction.d-D4MstYRz.d.ts +115 -0
  46. package/dist/interaction.interface.d-CvjHM2bi.d.ts +46 -0
  47. package/dist/interactions.d.ts +1206 -552
  48. package/dist/interactions.js +19 -15
  49. package/dist/item.css +4228 -1656
  50. package/dist/item.d.ts +13 -55
  51. package/dist/item.js +6 -11
  52. package/dist/{variables-CMYcDbyW.d.ts → item.types.d-QU7LljEK.d.ts} +13 -1
  53. package/dist/loader.d.ts +4 -4
  54. package/dist/loader.js +2 -3
  55. package/dist/processing.d.ts +6 -7
  56. package/dist/processing.js +2 -3
  57. package/dist/qti-components-jsx.d.ts +5348 -2709
  58. package/dist/qti-components-jsx.js +1 -0
  59. package/dist/qti-condition-expression.d-aMvBvpc6.d.ts +8 -0
  60. package/dist/{qti-condition-expression-Dam-RER6.d.ts → qti-expression.d-BietT_8b.d.ts} +14 -9
  61. package/dist/{qti-feedback-ChmXhZuf.d.ts → qti-feedback.d-DZbad0RN.d.ts} +1 -1
  62. package/dist/{qti-transform-test-DoZaWItm.d.ts → qti-transform-test.d-BL7GGFJj.d.ts} +2 -2
  63. package/dist/response.d-_8y4kjGP.d.ts +106 -0
  64. package/dist/test.d.ts +199 -39
  65. package/dist/test.js +34 -11
  66. package/dist/transformers.d.ts +1 -1
  67. package/dist/transformers.js +1 -2
  68. package/package.json +24 -17
  69. package/custom-elements.json +0 -43251
  70. package/dist/chunk-3WBG257S.js.map +0 -1
  71. package/dist/chunk-3XV26R5M.js.map +0 -1
  72. package/dist/chunk-AQ5RJFM6.js +0 -3673
  73. package/dist/chunk-AQ5RJFM6.js.map +0 -1
  74. package/dist/chunk-HFCZFWSH.js.map +0 -1
  75. package/dist/chunk-MPC7LIPC.js.map +0 -1
  76. package/dist/chunk-QXBXORM3.js +0 -27
  77. package/dist/chunk-REI3AMCZ.js.map +0 -1
  78. package/dist/chunk-RLTYVS2I.js +0 -530
  79. package/dist/chunk-RLTYVS2I.js.map +0 -1
  80. package/dist/chunk-WDO2TRFM.js.map +0 -1
  81. package/dist/config.context-BjZ2bZSY.d.ts +0 -42
  82. package/dist/interaction-Bgzlw7Iu.d.ts +0 -110
  83. package/dist/item.context-CkUeDcaO.d.ts +0 -15
  84. package/dist/test.context-CByZZjkR.d.ts +0 -15
  85. /package/dist/{chunk-FLJAKWXL.js.map → chunk-X3E5HXG2.js.map} +0 -0
  86. /package/dist/{chunk-QXBXORM3.js.map → corrections.js.map} +0 -0
  87. /package/dist/{qti-rule-base-ajOnfGXY.d.ts → qti-rule-base.d-ajOnfGXY.d.ts} +0 -0
  88. /package/dist/{qti.context-CejJMlfZ.d.ts → qti.context.d-CejJMlfZ.d.ts} +0 -0
@@ -0,0 +1,432 @@
1
+ import { I as Interaction } from './interaction.d-D4MstYRz.js';
2
+ import { R as ResponseValue } from './response.d-_8y4kjGP.js';
3
+ import * as lit from 'lit';
4
+ import { LitElement } from 'lit';
5
+ import { QtiGapText } from '@qti-components/interactions-core/elements/qti-gap-text';
6
+ import { QtiHotspotChoice } from '@qti-components/interactions-core/elements/qti-hotspot-choice';
7
+ import { QtiHottext } from '@qti-components/interactions-core/elements/qti-hottext';
8
+ import { QtiSimpleAssociableChoice } from '@qti-components/interactions-core/elements/qti-simple-associable-choice';
9
+ import { QtiSimpleChoice } from '@qti-components/interactions-core/elements/qti-simple-choice';
10
+ import { QtiAssessmentItem } from '@qti-components/elements/elements';
11
+ import { QtiItem } from '@qti-components/item/elements';
12
+ import { QtiTest, TestCheckItem, TestNavigation } from '@qti-components/test/elements';
13
+ import { V as View, C as ComputedContext } from './computed.types.d-rKLSPvVG.js';
14
+ import { QtiAssessmentItem as QtiAssessmentItem$1 } from './elements.js';
15
+ import { C as ComputedItemContext } from './computed-item.types.d-BKZdSLLJ.js';
16
+ import { QtiAssociateInteraction } from '@qti-components/associate-interaction/elements';
17
+ import { QtiChoiceInteraction } from '@qti-components/choice-interaction/elements';
18
+ import { QtiExtendedTextInteraction } from '@qti-components/extended-text-interaction/elements';
19
+ import { QtiGapMatchInteraction } from '@qti-components/gap-match-interaction/elements';
20
+ import { QtiGraphicAssociateInteraction } from '@qti-components/graphic-associate-interaction/elements';
21
+ import { QtiGraphicGapMatchInteraction } from '@qti-components/graphic-gap-match-interaction/elements';
22
+ import { QtiGraphicOrderInteraction } from '@qti-components/graphic-order-interaction/elements';
23
+ import { Choice } from '@qti-components/interactions-core/mixins/choices/choices.mixin';
24
+ import { QtiHotspotInteraction } from '@qti-components/hotspot-interaction/elements';
25
+ import { QtiHottextInteraction } from '@qti-components/hottext-interaction/elements';
26
+ import { QtiInlineChoiceInteraction } from '@qti-components/inline-choice-interaction/elements';
27
+ import { QtiMatchInteraction } from '@qti-components/match-interaction/elements';
28
+ import { QtiOrderInteraction } from '@qti-components/order-interaction/elements';
29
+ import { QtiPortableCustomInteraction } from '@qti-components/portable-custom-interaction/elements';
30
+ import { QtiSelectPointInteraction } from '@qti-components/select-point-interaction/elements';
31
+ import { QtiSliderInteraction } from '@qti-components/slider-interaction/elements';
32
+ import { QtiTextEntryInteraction } from '@qti-components/text-entry-interaction/elements';
33
+ import './config.context.d-BvU9r-Mg.js';
34
+ import './interaction.interface.d-CvjHM2bi.js';
35
+ import './item.types.d-QU7LljEK.js';
36
+ import './qti-feedback.d-DZbad0RN.js';
37
+ import './qti-rule-base.d-ajOnfGXY.js';
38
+
39
+ type AbstractConstructor$2<T = {}> = abstract new (...args: any[]) => T;
40
+ declare enum Correctness {
41
+ Correct = "correct",
42
+ PartiallyCorrect = "partially-correct",
43
+ Incorrect = "incorrect"
44
+ }
45
+ /**
46
+ * Adds correct-response and full-correct-response behaviour
47
+ * on top of any `Interaction` subclass.
48
+ *
49
+ * Usage:
50
+ * ```ts
51
+ * export abstract class CorrectableInteraction extends CorrectResponseMixin(Interaction) {}
52
+ * ```
53
+ *
54
+ * Interactions that genuinely have no correct-response concept
55
+ * (extended-text, upload, media) should extend `Interaction` directly
56
+ * and omit this mixin.
57
+ */
58
+ declare const CorrectResponseMixin: <T extends AbstractConstructor$2<Interaction>>(superClass: T) => AbstractConstructor$2<CorrectResponseInterface> & T;
59
+ /** Public type surface exposed by `CorrectResponseMixin`. */
60
+ interface CorrectResponseInterface {
61
+ correctResponseAttr: ResponseValue;
62
+ showCorrectResponse: boolean;
63
+ showFullCorrectResponse: boolean;
64
+ showCandidateCorrection: boolean;
65
+ isFullCorrectResponse: boolean;
66
+ correctResponse: Readonly<string | string[] | null>;
67
+ readonly correctness: Readonly<Correctness | null>;
68
+ readonly correctionPart: string;
69
+ toggleCorrectResponse(show: boolean): void;
70
+ toggleCandidateCorrection(show: boolean): void;
71
+ /** Protected at runtime; exposed here so subclasses can call `super.toggleInternalCorrectResponse()`. */
72
+ toggleInternalCorrectResponse(show: boolean): void;
73
+ /** Protected at runtime. */
74
+ toggleFullCorrectResponse(show: boolean): Promise<void>;
75
+ /** Protected at runtime; declared here so a subclass can `override` it. */
76
+ readonly withholdsFullCorrectResponseWhenCorrect: boolean;
77
+ }
78
+
79
+ /**
80
+ * The candidate-correction badge shared by correction-package elements.
81
+ *
82
+ * The component decides where the badge sits in the markup — last, after the label — and how big
83
+ * its box is. It decides nothing about how it looks. The disc, the tick, the cross, and whether it
84
+ * is lifted out of flow at all are the theme's, keyed on ::part(correction-correct) /
85
+ * ::part(correction-incorrect).
86
+ *
87
+ * It replaces six implementations of one idea: four ::after glyph blocks in kennisnet, an
88
+ * ::before/::after pair in order-interaction, and a .correct-option span that gap-match and match
89
+ * built in JavaScript with inline styles. Several of those set margin-left and width inside a
90
+ * :state(candidate-*) rule — a transient state doing layout, which is the bug this contract exists
91
+ * to prevent.
92
+ *
93
+ * Reachable everywhere. A chip has three homes, and inside a drop target's shadow root the document
94
+ * cannot see its badge: parts do not chain, so ::part(drag)::part(correction) is inert. A part
95
+ * token survives exportparts, so one bare ::part(correction-correct) reaches the badge in the drag
96
+ * bank, on the floating clone, and inside a gap. Verified in Chromium.
97
+ *
98
+ * Deliberately not anchored, and not absolutely positioned. Both were tried; both left
99
+ * qti-choice-interaction unable to reach layout stability, and the VRT stability detector spent 20
100
+ * seconds waiting before capturing a half-settled frame. A theme that wants a corner badge can
101
+ * position ::part(correction-correct) itself — it is a part, that is the point.
102
+ */
103
+ declare const correctionPart: lit.CSSResult;
104
+
105
+ type AbstractConstructor$1<T = {}> = abstract new (...args: any[]) => T;
106
+ declare const CandidateCorrectionMixin: <T extends AbstractConstructor$1<Interaction>>(superClass: T) => AbstractConstructor$1<CorrectResponseInterface> & T;
107
+
108
+ type AbstractConstructor<T = {}> = abstract new (...args: any[]) => T;
109
+ type ChoicesCorrectionBase = Interaction & {
110
+ readonly response: string | string[] | null;
111
+ readonly internals: ElementInternals;
112
+ };
113
+ /** Adds per-choice candidate marking to interactions built on `ChoicesMixin`. */
114
+ declare const ChoiceCorrectionMixin: <T extends AbstractConstructor<ChoicesCorrectionBase>>(superClass: T) => AbstractConstructor<CorrectResponseInterface> & T;
115
+
116
+ /** Presentation policy understood by correction-capable elements. */
117
+ type CorrectResponseMode = 'internal' | 'full';
118
+ interface CorrectionConfig {
119
+ correctResponseMode?: CorrectResponseMode;
120
+ fullCorrectResponseOnlyWhenIncorrect?: boolean;
121
+ }
122
+
123
+ type CandidateCorrection = 'correct' | 'incorrect' | 'partially-correct' | null;
124
+ interface ActiveElementCorrectionInterface {
125
+ candidateCorrection: CandidateCorrection;
126
+ readonly correctionPart: string;
127
+ }
128
+
129
+ declare const QtiGapTextCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiGapText;
130
+ declare class QtiGapTextCorrection extends QtiGapTextCorrection_base {
131
+ static styles: lit.CSSResultGroup[];
132
+ render(): lit.TemplateResult<1>;
133
+ }
134
+
135
+ declare const QtiHotspotChoiceCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiHotspotChoice;
136
+ declare class QtiHotspotChoiceCorrection extends QtiHotspotChoiceCorrection_base {
137
+ orderCorrect: number | null;
138
+ }
139
+
140
+ declare const QtiHottextCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiHottext;
141
+ declare class QtiHottextCorrection extends QtiHottextCorrection_base {
142
+ static styles: lit.CSSResultGroup[];
143
+ render(): lit.TemplateResult<1>;
144
+ }
145
+
146
+ declare const QtiSimpleAssociableChoiceCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiSimpleAssociableChoice;
147
+ declare class QtiSimpleAssociableChoiceCorrection extends QtiSimpleAssociableChoiceCorrection_base {
148
+ static styles: lit.CSSResultGroup[];
149
+ render(): lit.TemplateResult<1>;
150
+ }
151
+
152
+ declare const QtiSimpleChoiceCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiSimpleChoice;
153
+ declare class QtiSimpleChoiceCorrection extends QtiSimpleChoiceCorrection_base {
154
+ static styles: lit.CSSResultGroup[];
155
+ render(): lit.TemplateResult<1>;
156
+ }
157
+
158
+ /** Assessment-item extension that coordinates correction-capable interactions. */
159
+ declare class QtiAssessmentItemCorrection extends QtiAssessmentItem {
160
+ showCorrectResponse(show: boolean): void;
161
+ showCandidateCorrection(show: boolean): void;
162
+ protected afterResponseVariableUpdated(): void;
163
+ private updateControlState;
164
+ }
165
+
166
+ /** Item host extension that handles correction controls and mode changes. */
167
+ declare class QtiItemCorrection extends QtiItem {
168
+ #private;
169
+ constructor();
170
+ private updateControlState;
171
+ disconnectedCallback(): void;
172
+ }
173
+
174
+ /** Test navigation extension that routes correction controls to the active item. */
175
+ declare class TestNavigationCorrection extends TestNavigation {
176
+ #private;
177
+ constructor();
178
+ disconnectedCallback(): void;
179
+ }
180
+ /** Test host extension that shows correct responses in scorer view. */
181
+ declare class QtiTestCorrection extends QtiTest {
182
+ updateAssessmentItemView(assessmentItem: QtiAssessmentItem$1, view: View): void;
183
+ }
184
+ /** Check-item extension that reveals the correct response after scoring. */
185
+ declare class TestCheckItemCorrection extends TestCheckItem {
186
+ constructor();
187
+ }
188
+
189
+ declare class ItemCorrectResponseMode extends LitElement {
190
+ #private;
191
+ private itemContext;
192
+ label: string;
193
+ private _options;
194
+ render(): lit.TemplateResult<1>;
195
+ }
196
+ declare global {
197
+ interface HTMLElementTagNameMap {
198
+ 'item-correct-response-mode': ItemCorrectResponseMode;
199
+ }
200
+ }
201
+
202
+ declare class ItemShowCandidateCorrection extends LitElement {
203
+ #private;
204
+ computedContext?: ComputedItemContext;
205
+ static styles: lit.CSSResult;
206
+ shown: boolean;
207
+ disabled: boolean;
208
+ showCandidateCorrectionText: string;
209
+ hideCandidateCorrectionText: string;
210
+ noCorrectResponseText: string;
211
+ constructor();
212
+ updated(): void;
213
+ render(): lit.TemplateResult<1>;
214
+ }
215
+ declare global {
216
+ interface HTMLElementTagNameMap {
217
+ 'item-show-candidate-correction': ItemShowCandidateCorrection;
218
+ }
219
+ }
220
+
221
+ declare class ItemShowCorrectResponse extends LitElement {
222
+ #private;
223
+ computedContext?: ComputedItemContext;
224
+ static styles: lit.CSSResult;
225
+ shown: boolean;
226
+ disabled: boolean;
227
+ showCorrectText: string;
228
+ hideCorrectText: string;
229
+ noCorrectResponseText: string;
230
+ updated(): void;
231
+ render(): lit.TemplateResult<1>;
232
+ }
233
+ declare global {
234
+ interface HTMLElementTagNameMap {
235
+ 'item-show-correct-response': ItemShowCorrectResponse;
236
+ }
237
+ }
238
+
239
+ /**
240
+ * @deprecated test-show-correct-response is deprecated and will be removed in the future.
241
+ */
242
+ declare class TestShowCorrectResponse extends LitElement {
243
+ #private;
244
+ computedContext?: ComputedContext;
245
+ static styles: lit.CSSResult;
246
+ shown: boolean;
247
+ disabled: boolean;
248
+ showCorrectText: string;
249
+ hideCorrectText: string;
250
+ noCorrectResponseText: string;
251
+ willUpdate(_changedProperties: Map<string | number | symbol, unknown>): void;
252
+ render(): lit.TemplateResult<1>;
253
+ }
254
+ declare global {
255
+ interface HTMLElementTagNameMap {
256
+ 'test-show-correct-response': TestShowCorrectResponse;
257
+ }
258
+ }
259
+
260
+ declare const QtiAssociateInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiAssociateInteraction;
261
+ declare class QtiAssociateInteractionCorrection extends QtiAssociateInteractionCorrection_base {
262
+ }
263
+
264
+ declare const QtiChoiceInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiChoiceInteraction;
265
+ /**
266
+ * Correction-capable `qti-choice-interaction` implementation.
267
+ *
268
+ * It is registered under the standard tag only inside a correction registry;
269
+ * the standard package constructor remains correction-free.
270
+ */
271
+ declare class QtiChoiceInteractionCorrection extends QtiChoiceInteractionCorrection_base {
272
+ }
273
+
274
+ declare const QtiExtendedTextInteractionCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiExtendedTextInteraction;
275
+ /**
276
+ * Extended-text, judged from OUTSIDE.
277
+ *
278
+ * Every other correction class in this folder derives its verdict: it is handed a `correct-response`
279
+ * and compares. Extended-text cannot — the response is free prose, there is nothing to compare it
280
+ * to, and that is exactly why the base component extends `Interaction` directly and carries no
281
+ * correction machinery (correct-response.mixin.ts says so for extended-text, upload and media).
282
+ *
283
+ * But an extended-text answer is still judged; just not here. A teacher, a marking service, or an app
284
+ * that already knows the score decides, and then has to tell the component. This class is that
285
+ * channel and nothing more: it computes no correctness, it only accepts one.
286
+ *
287
+ * Hence `ActiveElementCorrectionMixin` rather than `CandidateCorrectionMixin`. The two are otherwise
288
+ * the same bookkeeping — clear the three `candidate-*` states, add one, expose `correctionPart` — but
289
+ * `CandidateCorrectionMixin` sits on top of `CorrectResponseMixin` and drives everything off a
290
+ * computed `correctness` getter with no setter. `ActiveElementCorrectionMixin` is the settable one,
291
+ * written for chips whose parent interaction pushes a verdict into them. An externally-graded essay
292
+ * is the same shape: something else knows the answer.
293
+ *
294
+ * Two consequences worth knowing:
295
+ *
296
+ * - The `item-show-candidate-correction` button will not drive this. It disables itself unless a
297
+ * response variable declares a correctResponse / mapping / areaMapping, which a prose item never
298
+ * does. Correct: the verdict comes from the host application, which sets the attribute.
299
+ * - The verdict survives typing. It is a property, not the `showCandidateCorrection` toggle, so
300
+ * `afterResponseVariableUpdated()` does not clear it. If a stale grade should be dropped when the
301
+ * candidate edits their answer, that is an explicit decision for the host app to make.
302
+ */
303
+ declare class QtiExtendedTextInteractionCorrection extends QtiExtendedTextInteractionCorrection_base {
304
+ static styles: lit.CSSResultGroup[];
305
+ /**
306
+ * The verdict, pushed in from outside: `correct`, `partially-correct`, `incorrect`, or absent.
307
+ *
308
+ * `noAccessor` because the mixin already owns the accessor — its setter is what writes the
309
+ * `:state(candidate-*)` custom states — and Lit would otherwise replace it with a generated one and
310
+ * silently drop that bookkeeping. Same pattern as the `response` attribute on
311
+ * qti-inline-choice-interaction and qti-slider-interaction.
312
+ */
313
+ candidateCorrection: CandidateCorrection;
314
+ /** The badge goes between the field and the validation message; everything else is the base's. */
315
+ render(): lit.TemplateResult<1>;
316
+ }
317
+
318
+ declare const QtiGapMatchInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiGapMatchInteraction;
319
+ declare class QtiGapMatchInteractionCorrection extends QtiGapMatchInteractionCorrection_base {
320
+ toggleCandidateCorrection(show: boolean): void;
321
+ }
322
+
323
+ declare const QtiGraphicAssociateInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiGraphicAssociateInteraction;
324
+ declare class QtiGraphicAssociateInteractionCorrection extends QtiGraphicAssociateInteractionCorrection_base {
325
+ #private;
326
+ toggleInternalCorrectResponse(show: boolean): void;
327
+ protected renderSupplementalLines(): unknown;
328
+ }
329
+
330
+ declare const QtiGraphicGapMatchInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiGraphicGapMatchInteraction;
331
+ declare class QtiGraphicGapMatchInteractionCorrection extends QtiGraphicGapMatchInteractionCorrection_base {
332
+ }
333
+
334
+ type OrderedHotspot = Choice & {
335
+ order: number | null;
336
+ };
337
+ declare const QtiGraphicOrderInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiGraphicOrderInteraction;
338
+ declare class QtiGraphicOrderInteractionCorrection extends QtiGraphicOrderInteractionCorrection_base {
339
+ protected resolvePinColor(choice: OrderedHotspot): string;
340
+ toggleInternalCorrectResponse(show: boolean): void;
341
+ toggleCandidateCorrection(show: boolean): void;
342
+ }
343
+
344
+ declare const QtiHotspotInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiHotspotInteraction;
345
+ declare class QtiHotspotInteractionCorrection extends QtiHotspotInteractionCorrection_base {
346
+ }
347
+
348
+ declare const QtiHottextInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiHottextInteraction;
349
+ declare class QtiHottextInteractionCorrection extends QtiHottextInteractionCorrection_base {
350
+ }
351
+
352
+ declare const QtiInlineChoiceInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiInlineChoiceInteraction;
353
+ declare class QtiInlineChoiceInteractionCorrection extends QtiInlineChoiceInteractionCorrection_base {
354
+ static get styles(): (lit.CSSResult | lit.CSSResultGroup[])[];
355
+ /**
356
+ * Internal mode defers to the full correct response, exactly as text-entry does.
357
+ *
358
+ * There is no room beside a dropdown for an answer key: the interaction sits inside a line of
359
+ * running text, so a marker next to the field competes with the sentence around it, and when the
360
+ * candidate happened to pick the correct option it printed the same word twice. The full variant
361
+ * puts the key in a `div.full-correct-response-inline` after the field instead — one already-themed
362
+ * presentation for both inline interactions rather than a second one only these two use.
363
+ *
364
+ * `super` is deliberately not called: its `show-correct-response` host state paints the dashed
365
+ * outline in qti-states.css, and this element is no longer the thing presenting the key — the
366
+ * wrapper beside it is. Leaving the state off keeps internal mode looking identical to an item
367
+ * authored with `show-full-correct-response`.
368
+ *
369
+ * The guard stops the two entry points rendering two wrappers: `showFullCorrectResponse` has its
370
+ * own watcher, so with both flags set this would otherwise run a second time.
371
+ */
372
+ toggleInternalCorrectResponse(show: boolean): void;
373
+ /**
374
+ * The key is shown whether or not the candidate was right.
375
+ *
376
+ * The base withholds it from a correct candidate, on the reasoning that their answer already is
377
+ * the key. That reasoning does not survive contact with this element: asking for the correct
378
+ * response and being shown nothing is indistinguishable from the feature being broken, and it is
379
+ * the only inline interaction where the answer and the key are the same short phrase, so there is
380
+ * no visual clue either. Show it, and let the correctness badge say who was right.
381
+ */
382
+ get withholdsFullCorrectResponseWhenCorrect(): boolean;
383
+ /** The badge trails the validation message; everything else is the base's. */
384
+ render(): lit.TemplateResult<1>;
385
+ }
386
+
387
+ declare const QtiMatchInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiMatchInteraction;
388
+ declare class QtiMatchInteractionCorrection extends QtiMatchInteractionCorrection_base {
389
+ #private;
390
+ toggleCandidateCorrection(show: boolean): void;
391
+ protected getCellStateVariant(value: string, checked: boolean): string;
392
+ }
393
+
394
+ declare const QtiOrderInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiOrderInteraction;
395
+ declare class QtiOrderInteractionCorrection extends QtiOrderInteractionCorrection_base {
396
+ toggleCandidateCorrection(show: boolean): void;
397
+ }
398
+
399
+ declare const QtiPortableCustomInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiPortableCustomInteraction;
400
+ declare class QtiPortableCustomInteractionCorrection extends QtiPortableCustomInteractionCorrection_base {
401
+ toggleInternalCorrectResponse(show: boolean): void;
402
+ }
403
+
404
+ declare const QtiSelectPointInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiSelectPointInteraction;
405
+ declare class QtiSelectPointInteractionCorrection extends QtiSelectPointInteractionCorrection_base {
406
+ #private;
407
+ static styles: lit.CSSResultGroup[];
408
+ toggleCandidateCorrection(show: boolean): void;
409
+ toggleInternalCorrectResponse(show: boolean): void;
410
+ protected pointPart(_point: string, index: number): string;
411
+ protected renderSupplementalLayer(): unknown;
412
+ protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
413
+ }
414
+
415
+ declare const QtiSliderInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiSliderInteraction;
416
+ declare class QtiSliderInteractionCorrection extends QtiSliderInteractionCorrection_base {
417
+ #private;
418
+ static styles: lit.CSSResultGroup[];
419
+ toggleInternalCorrectResponse(show: boolean): void;
420
+ protected renderRailSupplement(): unknown;
421
+ }
422
+
423
+ declare const QtiTextEntryInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiTextEntryInteraction;
424
+ declare class QtiTextEntryInteractionCorrection extends QtiTextEntryInteractionCorrection_base {
425
+ static styles: lit.CSSResultGroup[];
426
+ get correctness(): Readonly<Correctness | null>;
427
+ toggleInternalCorrectResponse(show: boolean): void;
428
+ /** The badge goes between the field and the validation message; everything else is the base's. */
429
+ render(): lit.TemplateResult<1>;
430
+ }
431
+
432
+ export { CandidateCorrectionMixin, ChoiceCorrectionMixin, type CorrectResponseInterface, CorrectResponseMixin, type CorrectResponseMode, type 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 };
@@ -0,0 +1,84 @@
1
+ import {
2
+ CandidateCorrectionMixin,
3
+ ChoiceCorrectionMixin,
4
+ CorrectResponseMixin,
5
+ Correctness,
6
+ ItemCorrectResponseMode,
7
+ ItemShowCandidateCorrection,
8
+ ItemShowCorrectResponse,
9
+ QtiAssessmentItemCorrection,
10
+ QtiAssociateInteractionCorrection,
11
+ QtiChoiceInteractionCorrection,
12
+ QtiExtendedTextInteractionCorrection,
13
+ QtiGapMatchInteractionCorrection,
14
+ QtiGapTextCorrection,
15
+ QtiGraphicAssociateInteractionCorrection,
16
+ QtiGraphicGapMatchInteractionCorrection,
17
+ QtiGraphicOrderInteractionCorrection,
18
+ QtiHotspotChoiceCorrection,
19
+ QtiHotspotInteractionCorrection,
20
+ QtiHottextCorrection,
21
+ QtiHottextInteractionCorrection,
22
+ QtiInlineChoiceInteractionCorrection,
23
+ QtiItemCorrection,
24
+ QtiMatchInteractionCorrection,
25
+ QtiOrderInteractionCorrection,
26
+ QtiPortableCustomInteractionCorrection,
27
+ QtiSelectPointInteractionCorrection,
28
+ QtiSimpleAssociableChoiceCorrection,
29
+ QtiSimpleChoiceCorrection,
30
+ QtiSliderInteractionCorrection,
31
+ QtiTestCorrection,
32
+ QtiTextEntryInteractionCorrection,
33
+ TestCheckItemCorrection,
34
+ TestNavigationCorrection,
35
+ TestShowCorrectResponse,
36
+ correctionPart
37
+ } from "./chunk-XU7HNT4F.js";
38
+ import "./chunk-RXGDQDOV.js";
39
+ import "./chunk-WVVMNF74.js";
40
+ import "./chunk-F4BNJWYN.js";
41
+ import "./chunk-X3E5HXG2.js";
42
+ import "./chunk-QECOPVPO.js";
43
+ import "./chunk-7HC5SMCU.js";
44
+ import "./chunk-64XSIBGO.js";
45
+ import "./chunk-IJD53WY6.js";
46
+ import "./chunk-H3J7LFRO.js";
47
+ export {
48
+ CandidateCorrectionMixin,
49
+ ChoiceCorrectionMixin,
50
+ CorrectResponseMixin,
51
+ Correctness,
52
+ ItemCorrectResponseMode,
53
+ ItemShowCandidateCorrection,
54
+ ItemShowCorrectResponse,
55
+ QtiAssessmentItemCorrection,
56
+ QtiAssociateInteractionCorrection,
57
+ QtiChoiceInteractionCorrection,
58
+ QtiExtendedTextInteractionCorrection,
59
+ QtiGapMatchInteractionCorrection,
60
+ QtiGapTextCorrection,
61
+ QtiGraphicAssociateInteractionCorrection,
62
+ QtiGraphicGapMatchInteractionCorrection,
63
+ QtiGraphicOrderInteractionCorrection,
64
+ QtiHotspotChoiceCorrection,
65
+ QtiHotspotInteractionCorrection,
66
+ QtiHottextCorrection,
67
+ QtiHottextInteractionCorrection,
68
+ QtiInlineChoiceInteractionCorrection,
69
+ QtiItemCorrection,
70
+ QtiMatchInteractionCorrection,
71
+ QtiOrderInteractionCorrection,
72
+ QtiPortableCustomInteractionCorrection,
73
+ QtiSelectPointInteractionCorrection,
74
+ QtiSimpleAssociableChoiceCorrection,
75
+ QtiSimpleChoiceCorrection,
76
+ QtiSliderInteractionCorrection,
77
+ QtiTestCorrection,
78
+ QtiTextEntryInteractionCorrection,
79
+ TestCheckItemCorrection,
80
+ TestNavigationCorrection,
81
+ TestShowCorrectResponse,
82
+ correctionPart
83
+ };
84
+ //# sourceMappingURL=corrections.js.map
@@ -1,9 +1,9 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, CSSResultGroup, PropertyValueMap } from 'lit';
3
- import { g as VariableValue, 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 './variables-CMYcDbyW.js';
4
- import { I as ItemContext } from './item.context-CkUeDcaO.js';
5
- import { Q as QtiFeedback, a as QtiVariableDeclaration } from './qti-feedback-ChmXhZuf.js';
6
- import { Q as QtiRuleBase } from './qti-rule-base-ajOnfGXY.js';
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
7
 
8
8
  /**
9
9
  * @summary The qti-assessment-item element contains all the other QTI 3 item structures.
@@ -38,26 +38,20 @@ declare class QtiAssessmentItem extends LitElement {
38
38
  set variables(value: VariableValue<string | string[] | null>[]);
39
39
  get state(): ItemContext['state'];
40
40
  set state(value: ItemContext['state']);
41
+ /** Registered candidate-input interactions. Correction packages may extend their presentation behavior. */
42
+ protected interactionElements: RegisteredInteraction[];
41
43
  /** @deprecated use variables property instead */
42
44
  set responses(myResponses: ResponseInteraction[]);
43
45
  render(): lit.TemplateResult<1>;
44
46
  connectedCallback(): void;
45
47
  disconnectedCallback(): void;
46
- /**
47
- * Toggles the display of correct responses for all interactions.
48
- * @param show - A boolean indicating whether to show or hide correct responses.
49
- */
50
- showCorrectResponse(show: boolean): void;
51
- /**
52
- * Toggles the display of the candidate correction for all interactions.
53
- * @param show - A boolean indicating whether to show or hide candidate correction.
54
- */
55
- showCandidateCorrection(show: boolean): void;
56
48
  processResponse(countNumAttempts?: boolean, reportValidityAfterScoring?: boolean): boolean;
57
49
  resetResponses(): void;
58
50
  protected getResponse(identifier: string): Readonly<ResponseVariable>;
59
51
  getOutcome(identifier: string): Readonly<OutcomeVariable>;
60
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;
61
55
  /**
62
56
  * Updates the response variable with the specified identifier to the given value.
63
57
  *
package/dist/elements.js CHANGED
@@ -1,3 +1,4 @@
1
+ import "./chunk-V5G7X53Y.js";
1
2
  import {
2
3
  QtiAssessmentItem,
3
4
  QtiAssessmentStimulusRef,
@@ -18,11 +19,11 @@ import {
18
19
  QtiTemplateConstraint,
19
20
  QtiTemplateDeclaration,
20
21
  QtiTemplateProcessing
21
- } from "./chunk-WDO2TRFM.js";
22
- import "./chunk-FLJAKWXL.js";
23
- import "./chunk-3WBG257S.js";
24
- import "./chunk-3XV26R5M.js";
25
- import "./chunk-QXBXORM3.js";
22
+ } from "./chunk-WVVMNF74.js";
23
+ import "./chunk-X3E5HXG2.js";
24
+ import "./chunk-64XSIBGO.js";
25
+ import "./chunk-IJD53WY6.js";
26
+ import "./chunk-H3J7LFRO.js";
26
27
  export {
27
28
  QtiAssessmentItem,
28
29
  QtiAssessmentStimulusRef,