@pie-element/mc-populated-blank 0.3.0-next.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +51 -21
  2. package/author.js +2 -0
  3. package/dist/author/defaults.d.ts +73 -0
  4. package/dist/author/index.d.ts +2 -10
  5. package/dist/author/index.js +139 -165
  6. package/dist/author/index.js.map +1 -1
  7. package/dist/browser/McPopulatedBlank-LqV-pdXv.js +2541 -0
  8. package/dist/browser/McPopulatedBlank-LqV-pdXv.js.map +1 -0
  9. package/dist/browser/author/index.js +11 -32
  10. package/dist/browser/author/index.js.map +1 -1
  11. package/dist/browser/{client-BmZWrsT3.js → client-Dfdyltec.js} +655 -643
  12. package/dist/browser/client-Dfdyltec.js.map +1 -0
  13. package/dist/browser/controller/index.js +2 -220
  14. package/dist/browser/controller-DSkEI2th.js +222 -0
  15. package/dist/browser/controller-DSkEI2th.js.map +1 -0
  16. package/dist/browser/delivery/index.js +71 -1005
  17. package/dist/browser/delivery/index.js.map +1 -1
  18. package/dist/browser/{layoutLimits-Bp17YP2V.js → layoutLimits-C2D60jW0.js} +1 -2
  19. package/dist/browser/layoutLimits-C2D60jW0.js.map +1 -0
  20. package/dist/browser/print/index.js +94 -103
  21. package/dist/browser/print/index.js.map +1 -1
  22. package/dist/controller/defaults.d.ts +8 -30
  23. package/dist/controller/index.d.ts +80 -65
  24. package/dist/controller/index.js +142 -115
  25. package/dist/controller/index.js.map +1 -1
  26. package/dist/delivery/assets/audioButtonSkinAssets.d.ts +4 -0
  27. package/dist/delivery/computeDisplayState.d.ts +12 -7
  28. package/dist/delivery/computeLayoutProfile.d.ts +8 -0
  29. package/dist/delivery/computeLayoutStyle.d.ts +1 -1
  30. package/dist/delivery/i18n.d.ts +8 -0
  31. package/dist/delivery/index.d.ts +8 -16
  32. package/dist/delivery/index.js +3229 -719
  33. package/dist/delivery/index.js.map +1 -1
  34. package/dist/delivery/variant-css-map.d.ts +15 -2
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.iife.d.ts +1 -154
  37. package/dist/index.iife.js +414 -163
  38. package/dist/index.js +2 -6818
  39. package/dist/print/index.d.ts +3 -7
  40. package/dist/print/index.js +4667 -349
  41. package/dist/print/index.js.map +1 -1
  42. package/dist/print/preparePrint.d.ts +15 -0
  43. package/dist/runtime-support.js +5 -5
  44. package/dist/runtime-support.js.map +1 -1
  45. package/dist/shared/layoutLimits.d.ts +0 -1
  46. package/dist/shared/types.d.ts +14 -20
  47. package/module/print.js +3781 -918
  48. package/module/print.js.map +1 -1
  49. package/package.json +14 -4
  50. package/dist/browser/client-BmZWrsT3.js.map +0 -1
  51. package/dist/browser/controller/index.js.map +0 -1
  52. package/dist/browser/layoutLimits-Bp17YP2V.js.map +0 -1
  53. package/dist/index.js.map +0 -1
@@ -0,0 +1,15 @@
1
+ import type { McpbQuestion, McpbRole, McpbSession } from '../shared/types.js';
2
+ export interface PrintView {
3
+ model: Record<string, unknown>;
4
+ session: McpbSession | null;
5
+ teacherInstructions: string;
6
+ audioUrl: string;
7
+ audioTranscript: string;
8
+ }
9
+ /**
10
+ * `pie-print` hands over the item's own model and `options.role`, so print asks
11
+ * the controller for what a player shows that role in `view` mode, in the
12
+ * authored choice order. An instructor's key is the correct-response session,
13
+ * the same path a player shows it through; `printAnswerKey: false` withholds it.
14
+ */
15
+ export declare function preparePrint(question: McpbQuestion, role: McpbRole | undefined): Promise<PrintView>;
@@ -1,14 +1,14 @@
1
1
  //#region src/runtime-support.ts
2
- var e = {
2
+ var runtimeSupport = {
3
3
  schemaVersion: 1,
4
4
  packageName: "@pie-element/mc-populated-blank",
5
5
  supports: { esm: {
6
- delivery: !0,
7
- author: !0,
8
- print: !0
6
+ delivery: true,
7
+ author: false,
8
+ print: true
9
9
  } }
10
10
  };
11
11
  //#endregion
12
- export { e as default, e as runtimeSupport };
12
+ export { runtimeSupport as default, runtimeSupport };
13
13
 
14
14
  //# sourceMappingURL=runtime-support.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-support.js","names":[],"sources":["../src/runtime-support.ts"],"sourcesContent":["export const runtimeSupport = {\n schemaVersion: 1,\n packageName: '@pie-element/mc-populated-blank',\n supports: {\n esm: {\n delivery: true,\n author: true,\n print: true,\n },\n },\n};\n\nexport default runtimeSupport;\n"],"mappings":";AAAA,IAAa,IAAiB;CAC5B,eAAe;CACf,aAAa;CACb,UAAU,EACR,KAAK;EACH,UAAU;EACV,QAAQ;EACR,OAAO;CACT,EACF;AACF"}
1
+ {"version":3,"file":"runtime-support.js","names":[],"sources":["../src/runtime-support.ts"],"sourcesContent":["export const runtimeSupport = {\n schemaVersion: 1,\n packageName: '@pie-element/mc-populated-blank',\n supports: {\n esm: {\n delivery: true,\n author: false,\n print: true,\n },\n },\n};\n\nexport default runtimeSupport;\n"],"mappings":";AAAA,IAAa,iBAAiB;CAC5B,eAAe;CACf,aAAa;CACb,UAAU,EACR,KAAK;EACH,UAAU;EACV,QAAQ;EACR,OAAO;CACT,EACF;AACF"}
@@ -20,7 +20,6 @@ export type LayoutLimits = {
20
20
  audioBlankTemplateMarginTopRem: number;
21
21
  audioBlankTemplateMarginBottomRem: number;
22
22
  audioInstructionsMaxWidthPx: number;
23
- narrowHorizontalChoiceMaxWidthPx: number;
24
23
  stimulusGridColumnGapRem: number;
25
24
  stimulusGridRowGapRem: number;
26
25
  stimulusSentenceMarginTopRem: number;
@@ -1,4 +1,4 @@
1
- import type { LayoutLimits } from './layoutLimits';
1
+ import type { LayoutLimits } from './layoutLimits.js';
2
2
  export type McpbChoiceMode = 'text' | 'image';
3
3
  export type McpbInteractionMode = 'populate_blank' | 'audio_mc_only';
4
4
  export type McpbDeliveryMode = 'gather' | 'view' | 'evaluate' | 'authoring' | 'print';
@@ -14,22 +14,6 @@ export interface McpbAudioButtonSkin {
14
14
  silentUrl: string;
15
15
  playingUrl: string;
16
16
  }
17
- export interface McpbUiText {
18
- answerChoices?: string;
19
- selectedAnswerInSentence?: string;
20
- blankPreSelectionHint?: string;
21
- showCorrectAnswer?: string;
22
- hideCorrectAnswer?: string;
23
- clickToEnableAutoplay?: string;
24
- audioResourceUnavailable?: string;
25
- transcriptLabel?: string;
26
- listenLabelEn?: string;
27
- listenLabelEs?: string;
28
- listenSilentAlt?: string;
29
- listenPlayingAlt?: string;
30
- listenSilentAltEs?: string;
31
- listenPlayingAltEs?: string;
32
- }
33
17
  export interface McpbQuestion {
34
18
  id?: string;
35
19
  element?: string;
@@ -42,11 +26,12 @@ export interface McpbQuestion {
42
26
  layoutLimits?: Partial<LayoutLimits>;
43
27
  audioButtonSkin?: McpbAudioButtonSkin | null;
44
28
  audioButtonSkinsByLocale?: Record<string, McpbAudioButtonSkin>;
45
- uiText?: McpbUiText;
46
29
  sentenceHtml?: string;
47
30
  template?: string;
48
31
  choiceMode?: McpbChoiceMode;
49
32
  choices?: McpbChoice[];
33
+ /** The choice group's accessible name when the item has no prompt to label it. */
34
+ choiceGroupLabel?: string;
50
35
  correctChoiceId?: string;
51
36
  hasAudio?: boolean;
52
37
  autoplayAudioEnabled?: boolean;
@@ -59,15 +44,23 @@ export interface McpbQuestion {
59
44
  * the item's accessibility catalog, gated by the learner's profile (PIE-902).
60
45
  * It stays on the model for the print view, which has no toolkit and renders it
61
46
  * unconditionally until print resolves catalogs itself (PIE-904), and as the
62
- * source the Learnosity import writes the card from.
47
+ * source the pie-api-aws import writes the card from.
63
48
  */
64
49
  audioTranscript?: string;
65
50
  useFeatureButtonAudio?: boolean;
51
+ /** Picks the audio button skin; also the learner-facing strings' language when `language` is unset. */
66
52
  locale?: string;
67
- shuffle?: boolean;
53
+ /** The learner-facing strings' language, as `@pie-lib/translator` reads it (`en_US`, `es_ES`, …). */
54
+ language?: string;
55
+ /** `false` shuffles the choices for a student; unset or `true` keeps the authored order. */
68
56
  lockChoiceOrder?: boolean;
57
+ /** The older spelling of `lockChoiceOrder: false`, read only when `lockChoiceOrder` is unset. */
58
+ shuffle?: boolean;
69
59
  teacherInstructions?: string;
60
+ /** `false` hides `teacherInstructions`; unset shows them, as in multiple-choice. */
70
61
  teacherInstructionsEnabled?: boolean;
62
+ /** `false` leaves the answer key out of an instructor's printout; a student's never has it. */
63
+ printAnswerKey?: boolean;
71
64
  customType?: string;
72
65
  }
73
66
  export interface McpbSession {
@@ -76,6 +69,7 @@ export interface McpbSession {
76
69
  choiceId?: string;
77
70
  audioStartTime?: number;
78
71
  audioEndTime?: number;
72
+ waitTime?: number;
79
73
  shuffledValues?: string[];
80
74
  data?: {
81
75
  shuffledValues?: string[];