@pie-element/mc-populated-blank 0.2.13 → 0.3.0-next.11
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/README.md +9 -6
- package/author.js +2 -0
- package/configure.js +2 -0
- package/dist/author/defaults.d.ts +74 -0
- package/dist/author/index.d.ts +0 -1
- package/dist/author/index.js +1732 -1553
- package/dist/author/index.js.map +1 -1
- package/dist/browser/McPopulatedBlank-DbmR6UWn.js +2542 -0
- package/dist/browser/McPopulatedBlank-DbmR6UWn.js.map +1 -0
- package/dist/browser/author/index.js +41 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/client-CWh3mUUV.js +2385 -0
- package/dist/browser/client-CWh3mUUV.js.map +1 -0
- package/dist/browser/controller/index.js +2 -0
- package/dist/browser/controller-D_ITRCYG.js +209 -0
- package/dist/browser/controller-D_ITRCYG.js.map +1 -0
- package/dist/browser/delivery/index.js +124 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/layoutLimits-Bp17YP2V.js +42 -0
- package/dist/browser/layoutLimits-Bp17YP2V.js.map +1 -0
- package/dist/browser/print/index.js +129 -0
- package/dist/browser/print/index.js.map +1 -0
- package/dist/controller/defaults.d.ts +8 -30
- package/dist/controller/index.d.ts +79 -63
- package/dist/controller/index.js +108 -85
- package/dist/controller/index.js.map +1 -1
- package/dist/delivery/computeAudioMode.d.ts +0 -1
- package/dist/delivery/computeChoiceCorrectness.d.ts +0 -1
- package/dist/delivery/computeDisplayState.d.ts +7 -8
- package/dist/delivery/computeLayoutProfile.d.ts +0 -1
- package/dist/delivery/computeLayoutStyle.d.ts +0 -2
- package/dist/delivery/i18n.d.ts +8 -0
- package/dist/delivery/index.d.ts +8 -17
- package/dist/delivery/index.js +6138 -3662
- package/dist/delivery/index.js.map +1 -1
- package/dist/delivery/variant-css-map.d.ts +15 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -156
- package/dist/index.iife.js +139 -38
- package/dist/index.js +2 -6811
- package/dist/print/index.d.ts +4 -1
- package/dist/print/index.js +8158 -3655
- package/dist/print/index.js.map +1 -1
- package/dist/print/preparePrint.d.ts +15 -0
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +14 -0
- package/dist/runtime-support.js.map +1 -0
- package/dist/shared/layoutLimits.d.ts +1 -2
- package/dist/shared/types.d.ts +21 -19
- package/module/print.js +5192 -0
- package/module/print.js.map +1 -0
- package/package.json +42 -14
- package/print.js +2 -0
- package/dist/author/index.d.ts.map +0 -1
- package/dist/controller/defaults.d.ts.map +0 -1
- package/dist/controller/index.d.ts.map +0 -1
- package/dist/delivery/computeAudioMode.d.ts.map +0 -1
- package/dist/delivery/computeChoiceCorrectness.d.ts.map +0 -1
- package/dist/delivery/computeDisplayState.d.ts.map +0 -1
- package/dist/delivery/computeLayoutProfile.d.ts.map +0 -1
- package/dist/delivery/computeLayoutStyle.d.ts.map +0 -1
- package/dist/delivery/index.d.ts.map +0 -1
- package/dist/delivery/variant-css-map.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.iife.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/print/index.d.ts.map +0 -1
- package/dist/shared/layoutLimits.d.ts.map +0 -1
- package/dist/shared/types.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -56,12 +56,14 @@ Notes:
|
|
|
56
56
|
- **`correctChoiceId`**
|
|
57
57
|
- **`hasAudio`**, **`audioUrl`**, **`audioTranscript`** (`audioUrl` required when `hasAudio=true`)
|
|
58
58
|
- **`autoplayAudioEnabled`**, **`completeAudioEnabled`** (optional integration flags)
|
|
59
|
-
- **`showVisibleTranscript`** (optional): profile-driven default; override when transcript should always show/hide
|
|
60
59
|
- **`layoutLimits`** (optional): numeric visual constraints; defaults are based on current CQT parity behavior and can be overridden per item
|
|
61
60
|
- **`layoutProfilePresets`** (optional): named preset map by `layoutProfile`; use profile as a template and override with `layoutLimits`
|
|
62
61
|
- **`audioButtonSkin`** / **`audioButtonSkinsByLocale`** (optional): override listen-button skin URLs
|
|
63
|
-
- **`
|
|
62
|
+
- **`language`** (optional): the language of the learner-facing strings (`en_US`, `es_ES`, …), which come from `@pie-lib/translator` as in the React elements; `locale` stands in when it is unset
|
|
64
63
|
- **`choiceGroupLabel`** (optional): accessibility label used when no visible prompt is present
|
|
64
|
+
- **`lockChoiceOrder`** (optional): `false` shuffles the choices for a student, as in multiple-choice; `shuffle: true` is the older spelling and counts only when `lockChoiceOrder` is unset
|
|
65
|
+
- **`teacherInstructions`** and **`teacherInstructionsEnabled`** (optional): shown to instructors in view and evaluate mode, and in an instructor's printout; unset `teacherInstructionsEnabled` shows them
|
|
66
|
+
- **`printAnswerKey`** (optional): `false` leaves the answer key out of an instructor's printout; a student's printout never has it
|
|
65
67
|
|
|
66
68
|
### `layoutLimits` keys (all optional, positive numbers)
|
|
67
69
|
|
|
@@ -73,8 +75,8 @@ Notes:
|
|
|
73
75
|
- `horizontalChoiceWidthVw`
|
|
74
76
|
- `horizontalChoiceTileMinHeightRem`
|
|
75
77
|
- `horizontalChoiceContentMinHeightRem`
|
|
76
|
-
- `selectedImageMaxHeightRem`
|
|
77
78
|
- `choiceImageMaxHeightRem`
|
|
79
|
+
- `choiceImageMaxWidthRem` (shared by the choice tile image and the selected-answer image inside the cloze blank, so they always render at the same size)
|
|
78
80
|
- `listenButtonSizePx`
|
|
79
81
|
- `stimulusMinColumnPx`
|
|
80
82
|
- `textMinColumnPx`
|
|
@@ -113,9 +115,10 @@ Notes:
|
|
|
113
115
|
- **Layout limits are model-driven:** delivery reads `model.layoutLimits` (blank widths/underline widths, choice tile sizing, image max heights, listen button size, layout column minimums); defaults are CQT-informed but overrideable.
|
|
114
116
|
- **Responsive parity controls:** `audioInstructionsMaxWidthPx` and `narrowHorizontalChoiceMaxWidthPx` are explicitly configurable to tune desktop vs narrow-width CQT behavior.
|
|
115
117
|
- **Evaluate mode behavior:** when evaluate/correct-answer mode is enabled, delivery can render `correctChoiceId` in the blank/choice state.
|
|
116
|
-
- **Audio error behavior:** no TTS fallback is used; when `hasAudio=true` and no playable `audioUrl` is provided, delivery shows an explicit error message
|
|
118
|
+
- **Audio error behavior:** no TTS fallback is used; when `hasAudio=true` and no playable `audioUrl` is provided, delivery shows an explicit error message.
|
|
117
119
|
- **Prompt-off accessibility:** when `prompt` is empty, delivery uses `choiceGroupLabel` (or fallback UI text) as the radiogroup accessible name.
|
|
118
|
-
- **Print parity:** print
|
|
120
|
+
- **Print parity:** print renders the delivery component as a player shows the printout's `role` in `view` mode, with the choices in authored order; an instructor's key is the correct-response session, filling the blank and checking the key's choice. Teacher instructions print expanded, and audio prints as its URL and transcript in place of a player.
|
|
121
|
+
- **Delivery renders no transcript:** it is an accessibility-catalog alternate, so on `pie-section-player` the assessment toolkit resolves the `transcript` card against the learner's personal needs profile and renders it in a labelled region above this element (PIE-902) — the same path signing takes. `model.audioTranscript` stays on the model for the print view, which has no toolkit, and as the source the Learnosity import writes the card from. A host that wants a transcript delivers the toolkit; there is no element-specific CSS class to apply.
|
|
119
122
|
|
|
120
123
|
## Theming hooks (`pie-*` classes)
|
|
121
124
|
|
|
@@ -137,7 +140,7 @@ To avoid runtime dependency on cross-origin Learnosity stylesheet loading, this
|
|
|
137
140
|
- Variant mapping: `src/delivery/variant-css-map.ts`
|
|
138
141
|
- Applied by `model.customType` (for example `sel_r1-_plusggg`)
|
|
139
142
|
|
|
140
|
-
|
|
143
|
+
Every selector in a variant CSS file starts at `.mc-populated-blank-root` (`variant-css-scope.test.ts` enforces it), so the styles cannot leak into other PIE elements. At injection each root selector is narrowed to roots whose `data-mpb-css` carries a hash of this build's sheets, so two versions of the element on one page style only their own instances. The sheets go into the document head, or into the shadow root the element renders in.
|
|
141
144
|
|
|
142
145
|
### Maintenance workflow
|
|
143
146
|
|
package/author.js
ADDED
package/configure.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** The model a new item starts from: a valid question an author edits in place. */
|
|
2
|
+
declare const _default: {
|
|
3
|
+
model: {
|
|
4
|
+
prompt: string;
|
|
5
|
+
template: string;
|
|
6
|
+
choices: {
|
|
7
|
+
id: string;
|
|
8
|
+
labelHtml: string;
|
|
9
|
+
}[];
|
|
10
|
+
correctChoiceId: string;
|
|
11
|
+
promptEnabled: boolean;
|
|
12
|
+
interactionMode: "populate_blank";
|
|
13
|
+
layoutProfile: string;
|
|
14
|
+
choiceLayout: string;
|
|
15
|
+
layoutProfilePresets: {};
|
|
16
|
+
layoutLimits: {
|
|
17
|
+
blankStandaloneWidthRem: number;
|
|
18
|
+
blankWideWidthRem: number;
|
|
19
|
+
blankUnderlineWidthPx: number;
|
|
20
|
+
blankUnderlineWideWidthPx: number;
|
|
21
|
+
horizontalChoiceWidthPx: number;
|
|
22
|
+
horizontalChoiceWidthVw: number;
|
|
23
|
+
horizontalChoiceTileMinHeightRem: number;
|
|
24
|
+
horizontalChoiceContentMinHeightRem: number;
|
|
25
|
+
choiceImageMaxHeightRem: number;
|
|
26
|
+
choiceImageMaxWidthRem: number;
|
|
27
|
+
listenButtonSizePx: number;
|
|
28
|
+
stimulusMinColumnPx: number;
|
|
29
|
+
textMinColumnPx: number;
|
|
30
|
+
legendMaxChars: number;
|
|
31
|
+
choiceGroupGapRem: number;
|
|
32
|
+
choiceRowGapRem: number;
|
|
33
|
+
toggleButtonGapRem: number;
|
|
34
|
+
horizontalChoiceRadioTopMarginRem: number;
|
|
35
|
+
audioBlankTemplateMarginTopRem: number;
|
|
36
|
+
audioBlankTemplateMarginBottomRem: number;
|
|
37
|
+
audioInstructionsMaxWidthPx: number;
|
|
38
|
+
narrowHorizontalChoiceMaxWidthPx: number;
|
|
39
|
+
stimulusGridColumnGapRem: number;
|
|
40
|
+
stimulusGridRowGapRem: number;
|
|
41
|
+
stimulusSentenceMarginTopRem: number;
|
|
42
|
+
stimulusChoicesMarginTopRem: number;
|
|
43
|
+
tokenGridColumnGapRem: number;
|
|
44
|
+
tokenGridRowGapRem: number;
|
|
45
|
+
tokenTemplateMarginTopRem: number;
|
|
46
|
+
tokenInlineTokenGapRem: number;
|
|
47
|
+
tokenChoicesMarginTopRem: number;
|
|
48
|
+
inlineGridColumnGapRem: number;
|
|
49
|
+
inlineGridRowGapRem: number;
|
|
50
|
+
inlineTemplateMarginTopRem: number;
|
|
51
|
+
inlineChoicesMarginTopRem: number;
|
|
52
|
+
};
|
|
53
|
+
audioButtonSkin: null;
|
|
54
|
+
audioButtonSkinsByLocale: {};
|
|
55
|
+
sentenceHtml: string;
|
|
56
|
+
choiceMode: "text";
|
|
57
|
+
choiceGroupLabel: string;
|
|
58
|
+
hasAudio: boolean;
|
|
59
|
+
autoplayAudioEnabled: boolean;
|
|
60
|
+
completeAudioEnabled: boolean;
|
|
61
|
+
audioUrl: string;
|
|
62
|
+
audioTranscript: string;
|
|
63
|
+
locale: string;
|
|
64
|
+
teacherInstructions: string;
|
|
65
|
+
teacherInstructionsEnabled: boolean;
|
|
66
|
+
};
|
|
67
|
+
configuration: {
|
|
68
|
+
prompt: {
|
|
69
|
+
label: string;
|
|
70
|
+
settings: boolean;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export default _default;
|
package/dist/author/index.d.ts
CHANGED