@citolab/qti-components 10.0.0-next.3 → 10.0.0-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +4334 -2688
- package/dist/base.d.ts +39 -13
- package/dist/base.js +14 -1
- package/dist/{chunk-D3BYGEQU.js → chunk-2ZT47EUK.js} +117 -92
- package/dist/chunk-2ZT47EUK.js.map +1 -0
- package/dist/{chunk-RU6332MD.js → chunk-566LB3G2.js} +4 -4
- package/dist/{chunk-MI7774NV.js → chunk-5BP2A7BI.js} +2 -2
- package/dist/{chunk-OQDBARD5.js → chunk-5KNTKBP6.js} +2 -2
- package/dist/chunk-7ISPUOJG.js +209 -0
- package/dist/chunk-7ISPUOJG.js.map +1 -0
- package/dist/{chunk-GBZNFSFY.js → chunk-ADTCTKXS.js} +2 -2
- package/dist/{chunk-FD4AB6TM.js → chunk-BBP7QV32.js} +2 -2
- package/dist/{chunk-LFVPS7KB.js → chunk-CFTWXYBO.js} +2 -2
- package/dist/{chunk-35WWWFS6.js → chunk-DAESCCLR.js} +2 -2
- package/dist/chunk-DJ7PB252.js +7 -0
- package/dist/chunk-DJ7PB252.js.map +1 -0
- package/dist/{chunk-6U3YPHXU.js → chunk-GAPMCYR5.js} +277 -154
- package/dist/chunk-GAPMCYR5.js.map +1 -0
- package/dist/{chunk-TDWJ6WZA.js → chunk-GPC53O7P.js} +166 -10
- package/dist/chunk-GPC53O7P.js.map +1 -0
- package/dist/{chunk-6K3QWJHH.js → chunk-LPYZVKHX.js} +48 -7
- package/dist/chunk-LPYZVKHX.js.map +1 -0
- package/dist/{chunk-TLAVOBEM.js → chunk-O2XRZPKA.js} +356 -62
- package/dist/chunk-O2XRZPKA.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/{chunk-RSMYGGQK.js → chunk-TZCOXFPB.js} +1590 -610
- package/dist/chunk-TZCOXFPB.js.map +1 -0
- package/dist/chunk-UCXLDQYA.js +56 -0
- package/dist/chunk-UCXLDQYA.js.map +1 -0
- package/dist/chunk-WWY2H2YO.js +7 -0
- package/dist/chunk-WWY2H2YO.js.map +1 -0
- package/dist/{chunk-SIE3E4FG.js → chunk-YRR6D6UP.js} +753 -2095
- package/dist/chunk-YRR6D6UP.js.map +1 -0
- package/dist/computed.types.d-BPzPFX3Z.d.ts +91 -0
- package/dist/{config.context.d-BvU9r-Mg.d.ts → config.context.d-Dm11aAuw.d.ts} +21 -3
- package/dist/corrections.d.ts +137 -24
- package/dist/corrections.js +12 -12
- package/dist/corrections.js.map +1 -1
- package/dist/elements.d.ts +66 -73
- package/dist/elements.js +9 -6
- package/dist/index.d.ts +21 -17
- package/dist/index.js +50 -61
- package/dist/interactions.d.ts +98 -19
- package/dist/interactions.js +8 -3
- package/dist/item.css +1948 -1946
- package/dist/item.d.ts +8 -6
- package/dist/item.js +6 -5
- package/dist/item.types.d-Zc6ZQDhu.d.ts +25 -0
- package/dist/loader.d.ts +5 -3
- package/dist/loader.js +3 -2
- package/dist/processing.d.ts +19 -7
- package/dist/processing.js +4 -3
- package/dist/public-events.d-3dGip9pd.d.ts +105 -0
- package/dist/qti-components-jsx.d.ts +1725 -1777
- package/dist/{qti-condition-expression.d-VJH6cWxf.d.ts → qti-condition-expression.d-7Kd4LBxn.d.ts} +1 -1
- package/dist/{qti-expression.d-BPxEp8HU.d.ts → qti-expression.d-iH3w6mqf.d.ts} +2 -1
- package/dist/{qti-feedback.d-wMYNVkkj.d.ts → qti-feedback.d-CT0W-8Gm.d.ts} +8 -1
- package/dist/{qti-item.d-DgC1AQbY.d.ts → qti-item.d-CxP6KtCH.d.ts} +3 -2
- package/dist/{qti-rule-base.d-Bdzg8eGH.d.ts → qti-rule-base.d-CeKP0Ooi.d.ts} +2 -2
- package/dist/qti-test-state-ybQ6ausy.d.ts +81 -0
- package/dist/qti-test-state.d-CjvdranT.d.ts +61 -0
- package/dist/{qti-test.d-86TlaMlI.d.ts → qti-test.d-BbtCG7A-.d.ts} +91 -487
- package/dist/{qti-text-entry-interaction.d-q8u5BiVK.d.ts → qti-text-entry-interaction.d-m0EFv9no.d.ts} +221 -73
- package/dist/{qti-transform-test.d-BL7GGFJj.d.ts → qti-transform-test.d-CtNaWJr8.d.ts} +9 -0
- package/dist/{interaction.d-g6XG0T0Z.d.ts → record.d-N1Bq7e1f.d.ts} +67 -4
- package/dist/{session.context.d-D5080LVx.d.ts → session.context.d-9gRdGK4T.d.ts} +7 -1
- package/dist/test-plugin-api.d.ts +143 -0
- package/dist/test-plugin-api.js +21 -0
- package/dist/test-plugin-api.js.map +1 -0
- package/dist/test.d.ts +72 -57
- package/dist/test.js +22 -48
- package/dist/transformers.d.ts +1 -1
- package/dist/transformers.js +2 -1
- package/dist/{item.types.d-B55QkJ92.d.ts → variables.d-DWHlTszN.d.ts} +8 -24
- package/package.json +16 -11
- package/dist/chunk-6K3QWJHH.js.map +0 -1
- package/dist/chunk-6U3YPHXU.js.map +0 -1
- package/dist/chunk-D3BYGEQU.js.map +0 -1
- package/dist/chunk-RSMYGGQK.js.map +0 -1
- package/dist/chunk-SIE3E4FG.js.map +0 -1
- package/dist/chunk-TDWJ6WZA.js.map +0 -1
- package/dist/chunk-TLAVOBEM.js.map +0 -1
- package/dist/chunk-ZP6QQYSU.js +0 -7
- package/dist/chunk-ZP6QQYSU.js.map +0 -1
- package/dist/computed.types.d-gJrBeUMG.d.ts +0 -42
- /package/dist/{chunk-RU6332MD.js.map → chunk-566LB3G2.js.map} +0 -0
- /package/dist/{chunk-MI7774NV.js.map → chunk-5BP2A7BI.js.map} +0 -0
- /package/dist/{chunk-OQDBARD5.js.map → chunk-5KNTKBP6.js.map} +0 -0
- /package/dist/{chunk-GBZNFSFY.js.map → chunk-ADTCTKXS.js.map} +0 -0
- /package/dist/{chunk-FD4AB6TM.js.map → chunk-BBP7QV32.js.map} +0 -0
- /package/dist/{chunk-LFVPS7KB.js.map → chunk-CFTWXYBO.js.map} +0 -0
- /package/dist/{chunk-35WWWFS6.js.map → chunk-DAESCCLR.js.map} +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { V as View, C as ComputedItemContext } from './session.context.d-9gRdGK4T.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* QTI 3 `qti-item-session-control`, resolved per attribute: each comes from the closest level that
|
|
5
|
+
* declares it (the item-ref, its enclosing sections, the test part), its QTI default only when none
|
|
6
|
+
* does (implementation guide §4.4.2). These are the values QTI gives; whether the player applies
|
|
7
|
+
* each one is roadmap 1's T3 (`allowReview`, `allowComment` and `validateResponses` have no effect
|
|
8
|
+
* yet, and `allowSkipping` and `validateResponses` apply only in a part with individual submission).
|
|
9
|
+
*/
|
|
10
|
+
type SessionControl = {
|
|
11
|
+
/** `max-attempts`: 0 means unlimited; 1 when no level declares it. Ignored for an adaptive item. */
|
|
12
|
+
maxAttempts: number;
|
|
13
|
+
/** `show-feedback`; default false. */
|
|
14
|
+
showFeedback: boolean;
|
|
15
|
+
/** `allow-review`; default true. */
|
|
16
|
+
allowReview: boolean;
|
|
17
|
+
/** `show-solution`; default false. */
|
|
18
|
+
showSolution: boolean;
|
|
19
|
+
/** `allow-comment`; default false. */
|
|
20
|
+
allowComment: boolean;
|
|
21
|
+
/** `allow-skipping`; default true. Individual submission only. */
|
|
22
|
+
allowSkipping: boolean;
|
|
23
|
+
/** `validate-responses`; default false. Individual submission only. */
|
|
24
|
+
validateResponses: boolean;
|
|
25
|
+
};
|
|
26
|
+
type ComputedItem = ComputedItemContext & {
|
|
27
|
+
categories?: string[];
|
|
28
|
+
type?: 'info' | 'regular';
|
|
29
|
+
/** The item's number in the test's document order, counting no info items; null for an info item. */
|
|
30
|
+
index?: number;
|
|
31
|
+
active?: boolean;
|
|
32
|
+
/** The item's `qti-item-session-control`, resolved (see `SessionControl`). */
|
|
33
|
+
sessionControl: SessionControl;
|
|
34
|
+
numAttempts?: number;
|
|
35
|
+
valid?: boolean;
|
|
36
|
+
isDefaultResponse?: boolean;
|
|
37
|
+
done?: boolean;
|
|
38
|
+
/** Last *ended attempt* reached the optimal outcome (best achievable score / correct response). */
|
|
39
|
+
optimal?: boolean;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The test as plugins and hosts read it: its structure, the resolved rules, facts about each item and
|
|
43
|
+
* the candidate's state, in one object. Provided by `test-navigation`, which derives it anew on every
|
|
44
|
+
* update from the test, the item facts, the candidate's state and `initContext`; never edited, so
|
|
45
|
+
* read it and do not write to it (a write is gone at the next update).
|
|
46
|
+
*/
|
|
47
|
+
type ComputedContext = {
|
|
48
|
+
view: View;
|
|
49
|
+
/** What test plugins keep, by plugin name (`QtiTestState.session.plugins`). Read-only; write with `qc-test-update-plugin-state`. */
|
|
50
|
+
plugins?: Readonly<Record<string, unknown>>;
|
|
51
|
+
identifier: string;
|
|
52
|
+
title: string;
|
|
53
|
+
testParts: {
|
|
54
|
+
active?: boolean;
|
|
55
|
+
identifier: string;
|
|
56
|
+
navigationMode: 'linear' | 'nonlinear';
|
|
57
|
+
submissionMode: 'individual' | 'simultaneous';
|
|
58
|
+
allowSkipping?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The item-ref identifiers of the part in the test's document order, info items included: the
|
|
61
|
+
* order a candidate takes them in. `sections` is depth first, so where a section's item-refs and
|
|
62
|
+
* subsections interleave, flattening `sections` gives another order; read the items in order with
|
|
63
|
+
* `itemsInOrder(testPart)` from `@qti-components/test`.
|
|
64
|
+
*/
|
|
65
|
+
itemOrder?: string[];
|
|
66
|
+
/**
|
|
67
|
+
* Every section of the part once, nested ones included, depth first (a section before its
|
|
68
|
+
* subsections), each with only its own item-refs, so every item is listed once. Where a
|
|
69
|
+
* section's item-refs and subsections interleave, this order is not the test's; `index` is.
|
|
70
|
+
*/
|
|
71
|
+
sections: {
|
|
72
|
+
active?: boolean;
|
|
73
|
+
identifier: string;
|
|
74
|
+
title: string;
|
|
75
|
+
/** Every item in the section and its subsections is completed. */
|
|
76
|
+
completed?: boolean;
|
|
77
|
+
/** This section's own item-refs, not those of its subsections; empty for a section that only holds sections. */
|
|
78
|
+
items: ComputedItem[];
|
|
79
|
+
allowSkipping?: boolean;
|
|
80
|
+
}[];
|
|
81
|
+
}[];
|
|
82
|
+
/**
|
|
83
|
+
* The rendered `qti-assessment-item` for an item-ref identifier, or null when it is not on the
|
|
84
|
+
* page. Looked up when called, so it is never a stale element; ask again after the context
|
|
85
|
+
* updates (it does when an item is rendered). A function, so `JSON.stringify` leaves it out.
|
|
86
|
+
* Set by `test-navigation`; for plugins that read an item's content (e.g. text-to-speech).
|
|
87
|
+
*/
|
|
88
|
+
itemElement?: (identifier: string) => HTMLElement | null;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export type { ComputedContext as C, SessionControl as S, ComputedItem as a };
|
|
@@ -57,7 +57,8 @@ interface ConfigContext {
|
|
|
57
57
|
validationDisplayMode?: ValidationDisplayMode;
|
|
58
58
|
/**
|
|
59
59
|
* If true, disables further user actions when an interaction reaches its configured maximum.
|
|
60
|
-
* Applies to both choice-based and drag/drop interactions.
|
|
60
|
+
* Applies to both choice-based and drag/drop interactions. Defaults to false: QTI lets the candidate
|
|
61
|
+
* go over the maximum and reports it with the max-selections message.
|
|
61
62
|
*/
|
|
62
63
|
disableAfterMaxReached?: boolean;
|
|
63
64
|
/**
|
|
@@ -77,12 +78,29 @@ interface ConfigContext {
|
|
|
77
78
|
*/
|
|
78
79
|
inlineChoicePrompt?: string;
|
|
79
80
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
81
|
+
* The inline choice interaction measures the widest option and sizes the trigger to match, so
|
|
82
|
+
* choosing an option never changes the field's width. Defaults to true; set false to size the
|
|
83
|
+
* field to the option shown.
|
|
82
84
|
* When a `qti-input-width-*` class is present on the interaction, that class width always takes
|
|
83
85
|
* precedence and autosizing is skipped regardless of this setting.
|
|
84
86
|
*/
|
|
85
87
|
inlineChoiceAutosize?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Attributes for the iframe every portable custom interaction runs in, read when the frame is created (a running PCI is
|
|
90
|
+
* not reloaded when this changes). Set it on `qti-test` for every item of the test, or on `qti-item` for one item.
|
|
91
|
+
* Absent, the frame has neither: it is same-origin with the page, as before.
|
|
92
|
+
* - `sandbox`: the frame's `sandbox` attribute. `'allow-scripts'` gives the PCI an opaque origin, so its code cannot
|
|
93
|
+
* reach the host page's DOM, storage or cookies; the PCI still works, all its communication is postMessage. Without
|
|
94
|
+
* `allow-scripts` the PCI does not run at all. Note that an opaque origin never gets the camera or microphone, whatever
|
|
95
|
+
* `allow` says: a host that sandboxes cannot run a PCI that records.
|
|
96
|
+
* - `allow`: the frame's permissions policy, e.g. `'microphone; autoplay'` (a PCI that records an answer). Without a
|
|
97
|
+
* sandbox the frame shares the page's origin and already gets what the page is allowed.
|
|
98
|
+
* Example: `{ sandbox: 'allow-scripts' }` for PCIs from a source the host does not trust.
|
|
99
|
+
*/
|
|
100
|
+
pciIframe?: {
|
|
101
|
+
sandbox?: string;
|
|
102
|
+
allow?: string;
|
|
103
|
+
};
|
|
86
104
|
}
|
|
87
105
|
declare const configContext: {
|
|
88
106
|
__context__: Readonly<ConfigContext>;
|
package/dist/corrections.d.ts
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { I as Interaction } from './
|
|
1
|
+
import { I as Interaction } from './record.d-N1Bq7e1f.js';
|
|
2
2
|
import { R as ResponseValue } from './response.d-_8y4kjGP.js';
|
|
3
3
|
import * as lit from 'lit';
|
|
4
|
-
import { LitElement } from 'lit';
|
|
5
|
-
import { g as QtiGapText, k as QtiHotspotChoice, m as QtiHottext, v as QtiSimpleAssociableChoice, w as QtiSimpleChoice, a as QtiAssociateInteraction, b as QtiChoiceInteraction, c as QtiExtendedTextInteraction, f as QtiGapMatchInteraction, h as QtiGraphicAssociateInteraction, i as QtiGraphicGapMatchInteraction, j as QtiGraphicOrderInteraction, C as Choice, l as QtiHotspotInteraction, n as QtiHottextInteraction, p as QtiInlineChoiceInteraction, q as QtiMatchInteraction, r as QtiOrderInteraction, s as QtiPortableCustomInteraction, u as QtiSelectPointInteraction, x as QtiSliderInteraction, y as QtiTextEntryInteraction } from './qti-text-entry-interaction.d-
|
|
4
|
+
import { PropertyValues, LitElement } from 'lit';
|
|
5
|
+
import { g as QtiGapText, k as QtiHotspotChoice, m as QtiHottext, v as QtiSimpleAssociableChoice, w as QtiSimpleChoice, a as QtiAssociateInteraction, b as QtiChoiceInteraction, c as QtiExtendedTextInteraction, f as QtiGapMatchInteraction, h as QtiGraphicAssociateInteraction, i as QtiGraphicGapMatchInteraction, j as QtiGraphicOrderInteraction, C as Choice, l as QtiHotspotInteraction, n as QtiHottextInteraction, p as QtiInlineChoiceInteraction, q as QtiMatchInteraction, r as QtiOrderInteraction, s as QtiPortableCustomInteraction, u as QtiSelectPointInteraction, x as QtiSliderInteraction, y as QtiTextEntryInteraction } from './qti-text-entry-interaction.d-m0EFv9no.js';
|
|
6
6
|
import { QtiAssessmentItem } from './elements.js';
|
|
7
|
-
import { Q as QtiItem } from './qti-item.d-
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import './
|
|
7
|
+
import { Q as QtiItem } from './qti-item.d-CxP6KtCH.js';
|
|
8
|
+
import './public-events.d-3dGip9pd.js';
|
|
9
|
+
import { V as View, C as ComputedItemContext } from './session.context.d-9gRdGK4T.js';
|
|
10
|
+
import { l as QtiTest, r as TestNavigation } from './qti-test.d-BbtCG7A-.js';
|
|
11
|
+
import { a as ComputedItem, C as ComputedContext } from './computed.types.d-BPzPFX3Z.js';
|
|
12
|
+
import './config.context.d-Dm11aAuw.js';
|
|
12
13
|
import './interaction.interface.d-CvjHM2bi.js';
|
|
13
|
-
import './
|
|
14
|
+
import './variables.d-DWHlTszN.js';
|
|
15
|
+
import './item.types.d-Zc6ZQDhu.js';
|
|
14
16
|
import './qti.context.d-CejJMlfZ.js';
|
|
15
17
|
import 'lit/directives/ref.js';
|
|
16
|
-
import './qti-feedback.d-
|
|
17
|
-
import './qti-rule-base.d-
|
|
18
|
-
import './qti-transform-test.d-
|
|
19
|
-
import './qti-expression.d-
|
|
18
|
+
import './qti-feedback.d-CT0W-8Gm.js';
|
|
19
|
+
import './qti-rule-base.d-CeKP0Ooi.js';
|
|
20
|
+
import './qti-transform-test.d-CtNaWJr8.js';
|
|
21
|
+
import './qti-expression.d-iH3w6mqf.js';
|
|
20
22
|
import '@heximal/templates';
|
|
23
|
+
import './qti-test-state.d-CjvdranT.js';
|
|
21
24
|
|
|
22
25
|
type AbstractConstructor$2<T = {}> = abstract new (...args: any[]) => T;
|
|
23
26
|
declare enum Correctness {
|
|
@@ -29,6 +32,13 @@ declare enum Correctness {
|
|
|
29
32
|
* Adds correct-response and full-correct-response behaviour
|
|
30
33
|
* on top of any `Interaction` subclass.
|
|
31
34
|
*
|
|
35
|
+
* @cssstate answer-key - This host IS the answer key: the clone the full mode inserts after the
|
|
36
|
+
* interaction.
|
|
37
|
+
* @cssstate answer-key-shown - This host shows its answer key inline, next to the candidate's
|
|
38
|
+
* answer (internal mode; alias `show-correct-response` for one major). The clone also carries the `answer-key` attribute and sits in a
|
|
39
|
+
* `div.full-correct-response` wrapper, which a `<div>` has no internals to replace.
|
|
40
|
+
* @csspart correction - The verdict badge, bare `correction` until a verdict is set.
|
|
41
|
+
*
|
|
32
42
|
* Usage:
|
|
33
43
|
* ```ts
|
|
34
44
|
* export abstract class CorrectableInteraction extends CorrectResponseMixin(Interaction) {}
|
|
@@ -64,8 +74,9 @@ interface CorrectResponseInterface {
|
|
|
64
74
|
*
|
|
65
75
|
* The component decides where the badge sits in the markup — last, after the label — and how big
|
|
66
76
|
* its box is. It decides nothing about how it looks. The disc, the tick, the cross, and whether it
|
|
67
|
-
* is lifted out of flow at all are the theme's, keyed on ::part(correction-correct) /
|
|
68
|
-
* ::part(correction-incorrect).
|
|
77
|
+
* is lifted out of flow at all are the theme's, keyed on ::part(correction candidate-correct) /
|
|
78
|
+
* ::part(correction candidate-incorrect) / ::part(correction candidate-partial) (CONTRACT.md §3; the
|
|
79
|
+
* old single tokens correction-correct etc. stay on the part for one major).
|
|
69
80
|
*
|
|
70
81
|
* It replaces six implementations of one idea: four ::after glyph blocks in kennisnet, an
|
|
71
82
|
* ::before/::after pair in order-interaction, and a .correct-option span that gap-match and match
|
|
@@ -75,17 +86,25 @@ interface CorrectResponseInterface {
|
|
|
75
86
|
*
|
|
76
87
|
* Reachable everywhere. A chip has three homes, and inside a drop target's shadow root the document
|
|
77
88
|
* cannot see its badge: parts do not chain, so ::part(drag)::part(correction) is inert. A part
|
|
78
|
-
* token survives exportparts, so one bare ::part(correction-correct) reaches the badge in the drag
|
|
89
|
+
* token survives exportparts, so one bare ::part(correction candidate-correct) reaches the badge in the drag
|
|
79
90
|
* bank, on the floating clone, and inside a gap. Verified in Chromium.
|
|
80
91
|
*
|
|
81
92
|
* Deliberately not anchored, and not absolutely positioned. Both were tried; both left
|
|
82
93
|
* qti-choice-interaction unable to reach layout stability, and the VRT stability detector spent 20
|
|
83
94
|
* seconds waiting before capturing a half-settled frame. A theme that wants a corner badge can
|
|
84
|
-
* position ::part(correction-correct) itself — it is a part, that is the point.
|
|
95
|
+
* position ::part(correction candidate-correct) itself — it is a part, that is the point.
|
|
85
96
|
*/
|
|
86
97
|
declare const correctionPart: lit.CSSResult;
|
|
87
98
|
|
|
88
99
|
type AbstractConstructor$1<T = {}> = abstract new (...args: any[]) => T;
|
|
100
|
+
/**
|
|
101
|
+
* Judges the interaction's own response against its correct response and exposes the verdict.
|
|
102
|
+
*
|
|
103
|
+
* @cssstate candidate-correct - The candidate's response is correct.
|
|
104
|
+
* @cssstate candidate-incorrect - The candidate's response is incorrect.
|
|
105
|
+
* @cssstate candidate-partial - The candidate's response is partially correct (alias `candidate-partially-correct`, one major).
|
|
106
|
+
* @csspart correction - The verdict badge; its second token is the verdict state (`candidate-correct`, `candidate-incorrect`, `candidate-partial`), followed by the old `correction-<verdict>` token for one major.
|
|
107
|
+
*/
|
|
89
108
|
declare const CandidateCorrectionMixin: <T extends AbstractConstructor$1<Interaction>>(superClass: T) => AbstractConstructor$1<CorrectResponseInterface> & T;
|
|
90
109
|
|
|
91
110
|
type AbstractConstructor<T = {}> = abstract new (...args: any[]) => T;
|
|
@@ -93,7 +112,14 @@ type ChoicesCorrectionBase = Interaction & {
|
|
|
93
112
|
readonly response: string | string[] | null;
|
|
94
113
|
readonly internals: ElementInternals;
|
|
95
114
|
};
|
|
96
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* Adds per-choice candidate marking to interactions built on `ChoicesMixin`.
|
|
117
|
+
*
|
|
118
|
+
* Each choice gets its own states (CONTRACT.md §3): the verdict through its `candidateCorrection`
|
|
119
|
+
* (`ActiveElementCorrectionMixin`), and `answer-key` when it is part of the correct response (alias
|
|
120
|
+
* `correct-response`, one major). A choice outside the key gets nothing; the old `incorrect-response`
|
|
121
|
+
* was never styled and is gone.
|
|
122
|
+
*/
|
|
97
123
|
declare const ChoiceCorrectionMixin: <T extends AbstractConstructor<ChoicesCorrectionBase>>(superClass: T) => AbstractConstructor<CorrectResponseInterface> & T;
|
|
98
124
|
|
|
99
125
|
/** Presentation policy understood by correction-capable elements. */
|
|
@@ -110,29 +136,76 @@ interface ActiveElementCorrectionInterface {
|
|
|
110
136
|
}
|
|
111
137
|
|
|
112
138
|
declare const QtiGapTextCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiGapText;
|
|
139
|
+
/**
|
|
140
|
+
* `qti-gap-text` with a verdict badge after its label; the verdict states come from `ActiveElementCorrectionMixin`.
|
|
141
|
+
*
|
|
142
|
+
* @cssstate candidate-correct - The candidate's answer on this element is correct.
|
|
143
|
+
* @cssstate candidate-incorrect - The candidate's answer on this element is incorrect.
|
|
144
|
+
* @cssstate candidate-partial - The candidate's answer on this element is partially correct (alias `candidate-partially-correct`, one major).
|
|
145
|
+
* @csspart correction - The verdict badge; its second token is the verdict state (`candidate-correct`, `candidate-incorrect`, `candidate-partial`), followed by the old `correction-<verdict>` token for one major.
|
|
146
|
+
*/
|
|
113
147
|
declare class QtiGapTextCorrection extends QtiGapTextCorrection_base {
|
|
114
148
|
static styles: lit.CSSResultGroup[];
|
|
115
149
|
render(): lit.TemplateResult<1>;
|
|
116
150
|
}
|
|
117
151
|
|
|
118
152
|
declare const QtiHotspotChoiceCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiHotspotChoice;
|
|
153
|
+
/**
|
|
154
|
+
* A hotspot choice that carries a verdict and, in graphic-order, its position in the answer key.
|
|
155
|
+
*
|
|
156
|
+
* The position is the attribute `data-order-correct` (a hotspot paints it as a pin in CSS, so it is
|
|
157
|
+
* an attribute, not a state: the theme reads it as `[data-order-correct]`). The property still
|
|
158
|
+
* reflects to its old name `aria-ordercorrectvalue` for one major; `updated()` mirrors it.
|
|
159
|
+
*
|
|
160
|
+
* @cssstate candidate-correct - This hotspot's answer is correct.
|
|
161
|
+
* @cssstate candidate-incorrect - This hotspot's answer is incorrect.
|
|
162
|
+
* @cssstate candidate-partial - This hotspot's answer is partially correct (alias `candidate-partially-correct`, one major).
|
|
163
|
+
* @cssstate answer-key - In a hotspot interaction, this hotspot is part of the correct response (alias `correct-response`, one major).
|
|
164
|
+
*/
|
|
119
165
|
declare class QtiHotspotChoiceCorrection extends QtiHotspotChoiceCorrection_base {
|
|
120
166
|
orderCorrect: number | null;
|
|
167
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
121
168
|
}
|
|
122
169
|
|
|
123
170
|
declare const QtiHottextCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiHottext;
|
|
171
|
+
/**
|
|
172
|
+
* `qti-hottext` with a verdict badge after its label; the verdict states come from `ActiveElementCorrectionMixin`.
|
|
173
|
+
*
|
|
174
|
+
* @cssstate candidate-correct - The candidate's answer on this element is correct.
|
|
175
|
+
* @cssstate candidate-incorrect - The candidate's answer on this element is incorrect.
|
|
176
|
+
* @cssstate candidate-partial - The candidate's answer on this element is partially correct (alias `candidate-partially-correct`, one major).
|
|
177
|
+
* @cssstate answer-key - This element is part of the correct response (alias `correct-response`, one major).
|
|
178
|
+
* @csspart correction - The verdict badge; its second token is the verdict state (`candidate-correct`, `candidate-incorrect`, `candidate-partial`), followed by the old `correction-<verdict>` token for one major.
|
|
179
|
+
*/
|
|
124
180
|
declare class QtiHottextCorrection extends QtiHottextCorrection_base {
|
|
125
181
|
static styles: lit.CSSResultGroup[];
|
|
126
182
|
render(): lit.TemplateResult<1>;
|
|
127
183
|
}
|
|
128
184
|
|
|
129
185
|
declare const QtiSimpleAssociableChoiceCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiSimpleAssociableChoice;
|
|
186
|
+
/**
|
|
187
|
+
* `qti-simple-associable-choice` with a verdict badge after its label; the verdict states come from `ActiveElementCorrectionMixin`.
|
|
188
|
+
*
|
|
189
|
+
* @cssstate candidate-correct - The candidate's answer on this element is correct.
|
|
190
|
+
* @cssstate candidate-incorrect - The candidate's answer on this element is incorrect.
|
|
191
|
+
* @cssstate candidate-partial - The candidate's answer on this element is partially correct (alias `candidate-partially-correct`, one major).
|
|
192
|
+
* @csspart correction - The verdict badge; its second token is the verdict state (`candidate-correct`, `candidate-incorrect`, `candidate-partial`), followed by the old `correction-<verdict>` token for one major.
|
|
193
|
+
*/
|
|
130
194
|
declare class QtiSimpleAssociableChoiceCorrection extends QtiSimpleAssociableChoiceCorrection_base {
|
|
131
195
|
static styles: lit.CSSResultGroup[];
|
|
132
196
|
render(): lit.TemplateResult<1>;
|
|
133
197
|
}
|
|
134
198
|
|
|
135
199
|
declare const QtiSimpleChoiceCorrection_base: (abstract new (...args: any[]) => ActiveElementCorrectionInterface) & typeof QtiSimpleChoice;
|
|
200
|
+
/**
|
|
201
|
+
* `qti-simple-choice` with a verdict badge after its label; the verdict states come from `ActiveElementCorrectionMixin`.
|
|
202
|
+
*
|
|
203
|
+
* @cssstate candidate-correct - The candidate's answer on this element is correct.
|
|
204
|
+
* @cssstate candidate-incorrect - The candidate's answer on this element is incorrect.
|
|
205
|
+
* @cssstate candidate-partial - The candidate's answer on this element is partially correct (alias `candidate-partially-correct`, one major).
|
|
206
|
+
* @cssstate answer-key - This element is part of the correct response (alias `correct-response`, one major).
|
|
207
|
+
* @csspart correction - The verdict badge; its second token is the verdict state (`candidate-correct`, `candidate-incorrect`, `candidate-partial`), followed by the old `correction-<verdict>` token for one major.
|
|
208
|
+
*/
|
|
136
209
|
declare class QtiSimpleChoiceCorrection extends QtiSimpleChoiceCorrection_base {
|
|
137
210
|
static styles: lit.CSSResultGroup[];
|
|
138
211
|
render(): lit.TemplateResult<1>;
|
|
@@ -185,10 +258,6 @@ declare class TestNavigationCorrection extends TestNavigation {
|
|
|
185
258
|
declare class QtiTestCorrection extends QtiTest {
|
|
186
259
|
updateAssessmentItemView(assessmentItem: QtiAssessmentItem, view: View): void;
|
|
187
260
|
}
|
|
188
|
-
/** Check-item extension that reveals the correct response after scoring. */
|
|
189
|
-
declare class TestCheckItemCorrection extends TestCheckItem {
|
|
190
|
-
constructor();
|
|
191
|
-
}
|
|
192
261
|
|
|
193
262
|
declare class ItemCorrectResponseMode extends LitElement {
|
|
194
263
|
#private;
|
|
@@ -241,12 +310,22 @@ declare global {
|
|
|
241
310
|
}
|
|
242
311
|
|
|
243
312
|
/**
|
|
244
|
-
*
|
|
313
|
+
* A button that shows and hides the correct response of the active item. Put it inside
|
|
314
|
+
* `<test-navigation>`: it reads the active item from there, and it is disabled when that item
|
|
315
|
+
* declares no correct response or mapping. It switches back to "show" when the candidate moves on.
|
|
316
|
+
*
|
|
317
|
+
* Needs the corrections build (`@citolab/qti-components/corrections`), whose `<test-navigation>`
|
|
318
|
+
* passes the request to the active item's `showCorrectResponse(show)`.
|
|
319
|
+
*
|
|
320
|
+
* @customElement test-show-correct-response
|
|
321
|
+
* @fires test-show-correct-response - `detail` is `true` to show the correct response, `false` to hide it.
|
|
245
322
|
*/
|
|
246
323
|
declare class TestShowCorrectResponse extends LitElement {
|
|
247
324
|
#private;
|
|
248
325
|
computedContext?: ComputedContext;
|
|
249
326
|
static styles: lit.CSSResult;
|
|
327
|
+
constructor();
|
|
328
|
+
connectedCallback(): void;
|
|
250
329
|
shown: boolean;
|
|
251
330
|
disabled: boolean;
|
|
252
331
|
showCorrectText: string;
|
|
@@ -303,6 +382,11 @@ declare const QtiExtendedTextInteractionCorrection_base: (abstract new (...args:
|
|
|
303
382
|
* - The verdict survives typing. It is a property, not the `showCandidateCorrection` toggle, so
|
|
304
383
|
* `afterResponseVariableUpdated()` does not clear it. If a stale grade should be dropped when the
|
|
305
384
|
* candidate edits their answer, that is an explicit decision for the host app to make.
|
|
385
|
+
*
|
|
386
|
+
* @cssstate candidate-correct - The verdict pushed in is `correct`.
|
|
387
|
+
* @cssstate candidate-incorrect - The verdict pushed in is `incorrect`.
|
|
388
|
+
* @cssstate candidate-partial - The verdict pushed in is `partially-correct` (alias `candidate-partially-correct`, one major).
|
|
389
|
+
* @csspart correction - The verdict badge in the field's top end corner; its second token is the verdict state, followed by the old `correction-<verdict>` token for one major.
|
|
306
390
|
*/
|
|
307
391
|
declare class QtiExtendedTextInteractionCorrection extends QtiExtendedTextInteractionCorrection_base {
|
|
308
392
|
static styles: lit.CSSResultGroup[];
|
|
@@ -325,6 +409,10 @@ declare class QtiGapMatchInteractionCorrection extends QtiGapMatchInteractionCor
|
|
|
325
409
|
}
|
|
326
410
|
|
|
327
411
|
declare const QtiGraphicAssociateInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiGraphicAssociateInteraction;
|
|
412
|
+
/**
|
|
413
|
+
* @csspart line - An association line; the answer key's lines carry the `answer-key` token
|
|
414
|
+
* (`line answer-key`), followed by the old `correct-line` token for one major.
|
|
415
|
+
*/
|
|
328
416
|
declare class QtiGraphicAssociateInteractionCorrection extends QtiGraphicAssociateInteractionCorrection_base {
|
|
329
417
|
#private;
|
|
330
418
|
toggleInternalCorrectResponse(show: boolean): void;
|
|
@@ -339,6 +427,11 @@ type OrderedHotspot = Choice & {
|
|
|
339
427
|
order: number | null;
|
|
340
428
|
};
|
|
341
429
|
declare const QtiGraphicOrderInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiGraphicOrderInteraction;
|
|
430
|
+
/**
|
|
431
|
+
* Judges each hotspot's position in the order and paints its pin from the hotspot's verdict state.
|
|
432
|
+
* The answer key is the hotspot's `orderCorrect` (`data-order-correct`), set by
|
|
433
|
+
* `toggleInternalCorrectResponse`; it sets no state on the hotspot.
|
|
434
|
+
*/
|
|
342
435
|
declare class QtiGraphicOrderInteractionCorrection extends QtiGraphicOrderInteractionCorrection_base {
|
|
343
436
|
protected resolvePinColor(choice: OrderedHotspot): string;
|
|
344
437
|
toggleInternalCorrectResponse(show: boolean): void;
|
|
@@ -354,6 +447,9 @@ declare class QtiHottextInteractionCorrection extends QtiHottextInteractionCorre
|
|
|
354
447
|
}
|
|
355
448
|
|
|
356
449
|
declare const QtiInlineChoiceInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiInlineChoiceInteraction;
|
|
450
|
+
/**
|
|
451
|
+
* @csspart correction - The verdict badge after the validation message; see `CandidateCorrectionMixin` for its tokens.
|
|
452
|
+
*/
|
|
357
453
|
declare class QtiInlineChoiceInteractionCorrection extends QtiInlineChoiceInteractionCorrection_base {
|
|
358
454
|
static get styles(): (lit.CSSResult | lit.CSSResultGroup[])[];
|
|
359
455
|
/**
|
|
@@ -389,6 +485,11 @@ declare class QtiInlineChoiceInteractionCorrection extends QtiInlineChoiceIntera
|
|
|
389
485
|
}
|
|
390
486
|
|
|
391
487
|
declare const QtiMatchInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiMatchInteraction;
|
|
488
|
+
/**
|
|
489
|
+
* @csspart control - A tabular cell; once judged, a checked cell carries the verdict token
|
|
490
|
+
* (`control … candidate-correct` / `candidate-incorrect`), followed by the old bare `correct` /
|
|
491
|
+
* `incorrect` token for one major. `control-mark` carries the same tokens.
|
|
492
|
+
*/
|
|
392
493
|
declare class QtiMatchInteractionCorrection extends QtiMatchInteractionCorrection_base {
|
|
393
494
|
#private;
|
|
394
495
|
toggleCandidateCorrection(show: boolean): void;
|
|
@@ -406,6 +507,10 @@ declare class QtiPortableCustomInteractionCorrection extends QtiPortableCustomIn
|
|
|
406
507
|
}
|
|
407
508
|
|
|
408
509
|
declare const QtiSelectPointInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiSelectPointInteraction;
|
|
510
|
+
/**
|
|
511
|
+
* @csspart point - A placed marker; once judged it carries the verdict token (`point candidate-correct`,
|
|
512
|
+
* `point candidate-incorrect`), followed by the old bare `correct` / `incorrect` token for one major.
|
|
513
|
+
*/
|
|
409
514
|
declare class QtiSelectPointInteractionCorrection extends QtiSelectPointInteractionCorrection_base {
|
|
410
515
|
#private;
|
|
411
516
|
static styles: lit.CSSResultGroup[];
|
|
@@ -417,6 +522,10 @@ declare class QtiSelectPointInteractionCorrection extends QtiSelectPointInteract
|
|
|
417
522
|
}
|
|
418
523
|
|
|
419
524
|
declare const QtiSliderInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiSliderInteraction;
|
|
525
|
+
/**
|
|
526
|
+
* @csspart knob - The ghost knob at the correct response position carries the `answer-key` token
|
|
527
|
+
* (`knob answer-key`), followed by the old `knob-correct` token for one major.
|
|
528
|
+
*/
|
|
420
529
|
declare class QtiSliderInteractionCorrection extends QtiSliderInteractionCorrection_base {
|
|
421
530
|
#private;
|
|
422
531
|
static styles: lit.CSSResultGroup[];
|
|
@@ -425,6 +534,10 @@ declare class QtiSliderInteractionCorrection extends QtiSliderInteractionCorrect
|
|
|
425
534
|
}
|
|
426
535
|
|
|
427
536
|
declare const QtiTextEntryInteractionCorrection_base: (abstract new (...args: any[]) => CorrectResponseInterface) & typeof QtiTextEntryInteraction;
|
|
537
|
+
/**
|
|
538
|
+
* @csspart correction - The verdict badge between the field and the validation message; see
|
|
539
|
+
* `CandidateCorrectionMixin` for its tokens. The answer key itself is the base's `answer-key` part.
|
|
540
|
+
*/
|
|
428
541
|
declare class QtiTextEntryInteractionCorrection extends QtiTextEntryInteractionCorrection_base {
|
|
429
542
|
static styles: lit.CSSResultGroup[];
|
|
430
543
|
get correctness(): Readonly<Correctness | null>;
|
|
@@ -433,4 +546,4 @@ declare class QtiTextEntryInteractionCorrection extends QtiTextEntryInteractionC
|
|
|
433
546
|
render(): lit.TemplateResult<1>;
|
|
434
547
|
}
|
|
435
548
|
|
|
436
|
-
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,
|
|
549
|
+
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, TestNavigationCorrection, TestShowCorrectResponse, correctionPart };
|
package/dist/corrections.js
CHANGED
|
@@ -30,37 +30,38 @@ import {
|
|
|
30
30
|
QtiSliderInteractionCorrection,
|
|
31
31
|
QtiTestCorrection,
|
|
32
32
|
QtiTextEntryInteractionCorrection,
|
|
33
|
-
TestCheckItemCorrection,
|
|
34
33
|
TestNavigationCorrection,
|
|
35
34
|
TestShowCorrectResponse,
|
|
36
35
|
correctionPart
|
|
37
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-2ZT47EUK.js";
|
|
38
37
|
import {
|
|
39
38
|
qtiTestElements
|
|
40
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-YRR6D6UP.js";
|
|
40
|
+
import "./chunk-7ISPUOJG.js";
|
|
41
41
|
import {
|
|
42
42
|
qtiContentElements
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-GAPMCYR5.js";
|
|
44
|
+
import "./chunk-UCXLDQYA.js";
|
|
44
45
|
import {
|
|
45
46
|
qtiInteractionElements
|
|
46
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-TZCOXFPB.js";
|
|
47
48
|
import {
|
|
48
49
|
qtiItemElements
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import "./chunk-
|
|
50
|
+
} from "./chunk-566LB3G2.js";
|
|
51
|
+
import "./chunk-WWY2H2YO.js";
|
|
51
52
|
import "./chunk-4DB4SC5K.js";
|
|
52
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-O2XRZPKA.js";
|
|
53
54
|
import {
|
|
54
55
|
qtiProcessingElements
|
|
55
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-LPYZVKHX.js";
|
|
56
57
|
import {
|
|
57
58
|
qtiBaseElements
|
|
58
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-GPC53O7P.js";
|
|
60
|
+
import "./chunk-PZ5AY32C.js";
|
|
59
61
|
|
|
60
62
|
// ../qti-corrections/dist/elements.js
|
|
61
63
|
var qtiCorrectionElements = [
|
|
62
64
|
{ tag: "test-show-correct-response", ctor: TestShowCorrectResponse },
|
|
63
|
-
{ tag: "test-check-item", ctor: TestCheckItemCorrection },
|
|
64
65
|
{ tag: "test-navigation", ctor: TestNavigationCorrection },
|
|
65
66
|
{ tag: "qti-test", ctor: QtiTestCorrection },
|
|
66
67
|
{ tag: "item-correct-response-mode", ctor: ItemCorrectResponseMode },
|
|
@@ -150,7 +151,6 @@ export {
|
|
|
150
151
|
QtiSliderInteractionCorrection,
|
|
151
152
|
QtiTestCorrection,
|
|
152
153
|
QtiTextEntryInteractionCorrection,
|
|
153
|
-
TestCheckItemCorrection,
|
|
154
154
|
TestNavigationCorrection,
|
|
155
155
|
TestShowCorrectResponse,
|
|
156
156
|
correctionPart
|
package/dist/corrections.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../qti-corrections/src/elements.ts","../src/corrections.ts"],"sourcesContent":["import { ItemCorrectResponseMode } from './components/item-correct-response-mode/item-correct-response-mode';\nimport { ItemShowCandidateCorrection } from './components/item-show-candidate-correction/item-show-candidate-correction';\nimport { ItemShowCorrectResponse } from './components/item-show-correct-response/item-show-correct-response';\nimport { TestShowCorrectResponse } from './components/test-show-correct-response/test-show-correct-response';\nimport {\n QtiGapTextCorrection,\n QtiHotspotChoiceCorrection,\n QtiHottextCorrection,\n QtiSimpleAssociableChoiceCorrection,\n QtiSimpleChoiceCorrection\n} from './elements/index';\nimport {\n QtiAssociateInteractionCorrection,\n QtiChoiceInteractionCorrection,\n QtiExtendedTextInteractionCorrection,\n QtiGapMatchInteractionCorrection,\n QtiGraphicAssociateInteractionCorrection,\n QtiGraphicGapMatchInteractionCorrection,\n QtiGraphicOrderInteractionCorrection,\n QtiHotspotInteractionCorrection,\n QtiHottextInteractionCorrection,\n QtiInlineChoiceInteractionCorrection,\n QtiMatchInteractionCorrection,\n QtiOrderInteractionCorrection,\n QtiPortableCustomInteractionCorrection,\n QtiSelectPointInteractionCorrection,\n QtiSliderInteractionCorrection,\n QtiTextEntryInteractionCorrection\n} from './interactions';\nimport { QtiAssessmentItemCorrection } from './components/qti-assessment-item-correction';\nimport { QtiItemCorrection } from './components/qti-item-correction';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../qti-corrections/src/elements.ts","../src/corrections.ts"],"sourcesContent":["import { ItemCorrectResponseMode } from './components/item-correct-response-mode/item-correct-response-mode';\nimport { ItemShowCandidateCorrection } from './components/item-show-candidate-correction/item-show-candidate-correction';\nimport { ItemShowCorrectResponse } from './components/item-show-correct-response/item-show-correct-response';\nimport { TestShowCorrectResponse } from './components/test-show-correct-response/test-show-correct-response';\nimport {\n QtiGapTextCorrection,\n QtiHotspotChoiceCorrection,\n QtiHottextCorrection,\n QtiSimpleAssociableChoiceCorrection,\n QtiSimpleChoiceCorrection\n} from './elements/index';\nimport {\n QtiAssociateInteractionCorrection,\n QtiChoiceInteractionCorrection,\n QtiExtendedTextInteractionCorrection,\n QtiGapMatchInteractionCorrection,\n QtiGraphicAssociateInteractionCorrection,\n QtiGraphicGapMatchInteractionCorrection,\n QtiGraphicOrderInteractionCorrection,\n QtiHotspotInteractionCorrection,\n QtiHottextInteractionCorrection,\n QtiInlineChoiceInteractionCorrection,\n QtiMatchInteractionCorrection,\n QtiOrderInteractionCorrection,\n QtiPortableCustomInteractionCorrection,\n QtiSelectPointInteractionCorrection,\n QtiSliderInteractionCorrection,\n QtiTextEntryInteractionCorrection\n} from './interactions';\nimport { QtiAssessmentItemCorrection } from './components/qti-assessment-item-correction';\nimport { QtiItemCorrection } from './components/qti-item-correction';\nimport { QtiTestCorrection, TestNavigationCorrection } from './components/test-correction-elements';\n\n/** Correction constructors keyed by their standard QTI tag names. */\nexport const qtiCorrectionElements = [\n { tag: 'test-show-correct-response', ctor: TestShowCorrectResponse },\n { tag: 'test-navigation', ctor: TestNavigationCorrection },\n { tag: 'qti-test', ctor: QtiTestCorrection },\n { tag: 'item-correct-response-mode', ctor: ItemCorrectResponseMode },\n { tag: 'item-show-candidate-correction', ctor: ItemShowCandidateCorrection },\n { tag: 'item-show-correct-response', ctor: ItemShowCorrectResponse },\n { tag: 'qti-item', ctor: QtiItemCorrection },\n { tag: 'qti-assessment-item', ctor: QtiAssessmentItemCorrection },\n { tag: 'qti-associate-interaction', ctor: QtiAssociateInteractionCorrection },\n { tag: 'qti-choice-interaction', ctor: QtiChoiceInteractionCorrection },\n { tag: 'qti-extended-text-interaction', ctor: QtiExtendedTextInteractionCorrection },\n { tag: 'qti-gap-match-interaction', ctor: QtiGapMatchInteractionCorrection },\n { tag: 'qti-graphic-associate-interaction', ctor: QtiGraphicAssociateInteractionCorrection },\n { tag: 'qti-graphic-gap-match-interaction', ctor: QtiGraphicGapMatchInteractionCorrection },\n { tag: 'qti-graphic-order-interaction', ctor: QtiGraphicOrderInteractionCorrection },\n { tag: 'qti-hotspot-interaction', ctor: QtiHotspotInteractionCorrection },\n { tag: 'qti-hottext-interaction', ctor: QtiHottextInteractionCorrection },\n { tag: 'qti-inline-choice-interaction', ctor: QtiInlineChoiceInteractionCorrection },\n { tag: 'qti-match-interaction', ctor: QtiMatchInteractionCorrection },\n { tag: 'qti-order-interaction', ctor: QtiOrderInteractionCorrection },\n { tag: 'qti-portable-custom-interaction', ctor: QtiPortableCustomInteractionCorrection },\n { tag: 'qti-select-point-interaction', ctor: QtiSelectPointInteractionCorrection },\n { tag: 'qti-slider-interaction', ctor: QtiSliderInteractionCorrection },\n { tag: 'qti-text-entry-interaction', ctor: QtiTextEntryInteractionCorrection },\n { tag: 'qti-gap-text', ctor: QtiGapTextCorrection },\n { tag: 'qti-hotspot-choice', ctor: QtiHotspotChoiceCorrection },\n { tag: 'qti-hottext', ctor: QtiHottextCorrection },\n { tag: 'qti-simple-associable-choice', ctor: QtiSimpleAssociableChoiceCorrection },\n { tag: 'qti-simple-choice', ctor: QtiSimpleChoiceCorrection }\n] as const;\n","/**\n * Correction-mode entry point: the standard delivery elements with the correction variants\n * substituted, registered globally.\n *\n * <script type=\"module\">import '@citolab/qti-components/corrections';</script>\n *\n * The sibling of the package root. `@citolab/qti-components` registers the standard elements;\n * this registers the same set with the correction variants winning for the tags they cover, plus\n * the correction-only controls (`item-show-correct-response`, `test-show-correct-response`,\n * `item-correct-response-mode`, `item-show-candidate-correction`). Import ONE of the two.\n *\n * Why substitution rather than \"corrections on top\": the correction classes are keyed by the\n * STANDARD tag names — `QtiChoiceInteractionCorrection` is `ChoiceCorrectionMixin(\n * QtiChoiceInteraction)` registered as `qti-choice-interaction`. A registry holds one constructor\n * per tag, so this is a replacement, never an addition. Everything without a correction variant —\n * the processing operators, most test controls, interactions like media and upload — still gets\n * its standard constructor, because a page needs those to work at all.\n *\n * Every import below is a `/elements` subpath, deliberately. The package ROOTS run their\n * `register.ts` on evaluation and would define the standard constructors before this file gets to\n * choose; `/elements` exports the `{ tag, ctor }` arrays and defines nothing.\n */\nimport { qtiBaseElements } from '@qti-components/base/elements';\nimport { qtiContentElements } from '@qti-components/elements/elements';\nimport { qtiItemElements } from '@qti-components/item/elements';\nimport { qtiProcessingElements } from '@qti-components/processing/elements';\nimport { qtiTestElements } from '@qti-components/test/elements';\nimport { qtiInteractionElements } from '@qti-components/interactions/elements';\nimport { qtiCorrectionElements } from '@qti-components/corrections/elements';\n\nconst standardElements = [\n ...qtiBaseElements,\n ...qtiProcessingElements,\n ...qtiContentElements,\n ...qtiItemElements,\n ...qtiTestElements,\n ...qtiInteractionElements\n];\n\n// Keyed as `string`, not the inferred literal union: the lookup below is driven by the standard\n// tag lists, most of whose tags have no correction variant.\nconst correctionByTag = new Map<string, CustomElementConstructor>(\n qtiCorrectionElements.map(({ tag, ctor }) => [tag, ctor])\n);\n\n/**\n * Registration is first-wins and silent — every `register.ts` in the workspace guards with\n * `if (!customElements.get(tag))` so that a module graph holding two copies of a package does not\n * throw `NotSupportedError` on the second define.\n *\n * That guard makes the failure mode here invisible: if anything already pulled in\n * `@citolab/qti-components` (or a package root) the standard constructor holds the tag, this file\n * skips it, and the page renders correctly EXCEPT that nothing ever shows a correct answer.\n * Nothing throws and nothing logs. So say it out loud.\n */\nconst alreadyTaken = qtiCorrectionElements\n .filter(({ tag, ctor }) => {\n const registered = customElements.get(tag);\n return registered !== undefined && registered !== ctor;\n })\n .map(({ tag }) => tag);\n\nif (alreadyTaken.length > 0) {\n console.warn(\n `[@citolab/qti-components/corrections] ${alreadyTaken.length} tag(s) were already registered ` +\n `by another entry point, so the correction variants for them are inactive: ` +\n `${alreadyTaken.join(', ')}. Import EITHER '@citolab/qti-components' OR ` +\n `'@citolab/qti-components/corrections', not both.`\n );\n}\n\nfor (const { tag, ctor } of standardElements) {\n if (!customElements.get(tag)) customElements.define(tag, correctionByTag.get(tag) ?? ctor);\n}\n\n// The correction-only controls, which replace no standard tag.\nfor (const { tag, ctor } of qtiCorrectionElements) {\n if (!customElements.get(tag)) customElements.define(tag, ctor);\n}\n\nexport * from '@qti-components/corrections';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,IAAM,wBAAwB;EACnC,EAAE,KAAK,8BAA8B,MAAM,wBAAuB;EAClE,EAAE,KAAK,mBAAmB,MAAM,yBAAwB;EACxD,EAAE,KAAK,YAAY,MAAM,kBAAiB;EAC1C,EAAE,KAAK,8BAA8B,MAAM,wBAAuB;EAClE,EAAE,KAAK,kCAAkC,MAAM,4BAA2B;EAC1E,EAAE,KAAK,8BAA8B,MAAM,wBAAuB;EAClE,EAAE,KAAK,YAAY,MAAM,kBAAiB;EAC1C,EAAE,KAAK,uBAAuB,MAAM,4BAA2B;EAC/D,EAAE,KAAK,6BAA6B,MAAM,kCAAiC;EAC3E,EAAE,KAAK,0BAA0B,MAAM,+BAA8B;EACrE,EAAE,KAAK,iCAAiC,MAAM,qCAAoC;EAClF,EAAE,KAAK,6BAA6B,MAAM,iCAAgC;EAC1E,EAAE,KAAK,qCAAqC,MAAM,yCAAwC;EAC1F,EAAE,KAAK,qCAAqC,MAAM,wCAAuC;EACzF,EAAE,KAAK,iCAAiC,MAAM,qCAAoC;EAClF,EAAE,KAAK,2BAA2B,MAAM,gCAA+B;EACvE,EAAE,KAAK,2BAA2B,MAAM,gCAA+B;EACvE,EAAE,KAAK,iCAAiC,MAAM,qCAAoC;EAClF,EAAE,KAAK,yBAAyB,MAAM,8BAA6B;EACnE,EAAE,KAAK,yBAAyB,MAAM,8BAA6B;EACnE,EAAE,KAAK,mCAAmC,MAAM,uCAAsC;EACtF,EAAE,KAAK,gCAAgC,MAAM,oCAAmC;EAChF,EAAE,KAAK,0BAA0B,MAAM,+BAA8B;EACrE,EAAE,KAAK,8BAA8B,MAAM,kCAAiC;EAC5E,EAAE,KAAK,gBAAgB,MAAM,qBAAoB;EACjD,EAAE,KAAK,sBAAsB,MAAM,2BAA0B;EAC7D,EAAE,KAAK,eAAe,MAAM,qBAAoB;EAChD,EAAE,KAAK,gCAAgC,MAAM,oCAAmC;EAChF,EAAE,KAAK,qBAAqB,MAAM,0BAAyB;;;;ACjC7D,IAAM,mBAAmB;AAAA,EACvB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAIA,IAAM,kBAAkB,IAAI;AAAA,EAC1B,sBAAsB,IAAI,CAAC,EAAE,KAAK,KAAK,MAAM,CAAC,KAAK,IAAI,CAAC;AAC1D;AAYA,IAAM,eAAe,sBAClB,OAAO,CAAC,EAAE,KAAK,KAAK,MAAM;AACzB,QAAM,aAAa,eAAe,IAAI,GAAG;AACzC,SAAO,eAAe,UAAa,eAAe;AACpD,CAAC,EACA,IAAI,CAAC,EAAE,IAAI,MAAM,GAAG;AAEvB,IAAI,aAAa,SAAS,GAAG;AAC3B,UAAQ;AAAA,IACN,yCAAyC,aAAa,MAAM,6GAEvD,aAAa,KAAK,IAAI,CAAC;AAAA,EAE9B;AACF;AAEA,WAAW,EAAE,KAAK,KAAK,KAAK,kBAAkB;AAC5C,MAAI,CAAC,eAAe,IAAI,GAAG,EAAG,gBAAe,OAAO,KAAK,gBAAgB,IAAI,GAAG,KAAK,IAAI;AAC3F;AAGA,WAAW,EAAE,KAAK,KAAK,KAAK,uBAAuB;AACjD,MAAI,CAAC,eAAe,IAAI,GAAG,EAAG,gBAAe,OAAO,KAAK,IAAI;AAC/D;","names":[]}
|