@pie-element/mc-populated-blank 0.2.11 → 0.2.12
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/package.json +3 -14
- package/dist/controller/index.test.d.ts +0 -63
- package/dist/controller/index.test.d.ts.map +0 -1
- package/dist/delivery/AudioPlayer.test.d.ts +0 -2
- package/dist/delivery/AudioPlayer.test.d.ts.map +0 -1
- package/dist/delivery/ChoiceRow.test.d.ts +0 -2
- package/dist/delivery/ChoiceRow.test.d.ts.map +0 -1
- package/dist/delivery/ClozeMarker.test.d.ts +0 -2
- package/dist/delivery/ClozeMarker.test.d.ts.map +0 -1
- package/dist/delivery/McPopulatedBlank.transcript.test.d.ts +0 -2
- package/dist/delivery/McPopulatedBlank.transcript.test.d.ts.map +0 -1
- package/dist/delivery/computeAudioMode.test.d.ts +0 -2
- package/dist/delivery/computeAudioMode.test.d.ts.map +0 -1
- package/dist/delivery/computeChoiceCorrectness.test.d.ts +0 -19
- package/dist/delivery/computeChoiceCorrectness.test.d.ts.map +0 -1
- package/dist/delivery/computeDisplayState.test.d.ts +0 -38
- package/dist/delivery/computeDisplayState.test.d.ts.map +0 -1
- package/dist/delivery/computeLayoutProfile.test.d.ts +0 -2
- package/dist/delivery/computeLayoutProfile.test.d.ts.map +0 -1
- package/dist/delivery/computeLayoutStyle.test.d.ts +0 -2
- package/dist/delivery/computeLayoutStyle.test.d.ts.map +0 -1
- package/src/author/Author.svelte +0 -41
- package/src/author/index.ts +0 -28
- package/src/controller/defaults.ts +0 -61
- package/src/controller/index.test.ts +0 -428
- package/src/controller/index.ts +0 -372
- package/src/delivery/AudioPlayer.svelte +0 -246
- package/src/delivery/AudioPlayer.test.ts +0 -149
- package/src/delivery/ChoiceRow.svelte +0 -222
- package/src/delivery/ChoiceRow.test.ts +0 -179
- package/src/delivery/ClozeMarker.svelte +0 -83
- package/src/delivery/ClozeMarker.test.ts +0 -128
- package/src/delivery/McPopulatedBlank.svelte +0 -739
- package/src/delivery/McPopulatedBlank.transcript.test.ts +0 -154
- package/src/delivery/computeAudioMode.test.ts +0 -40
- package/src/delivery/computeAudioMode.ts +0 -11
- package/src/delivery/computeChoiceCorrectness.test.ts +0 -120
- package/src/delivery/computeChoiceCorrectness.ts +0 -42
- package/src/delivery/computeDisplayState.test.ts +0 -274
- package/src/delivery/computeDisplayState.ts +0 -101
- package/src/delivery/computeLayoutProfile.test.ts +0 -163
- package/src/delivery/computeLayoutProfile.ts +0 -72
- package/src/delivery/computeLayoutStyle.test.ts +0 -168
- package/src/delivery/computeLayoutStyle.ts +0 -128
- package/src/delivery/cqt-css/sel-r1-base.css +0 -59
- package/src/delivery/cqt-css/sel-r1-g-stem.css +0 -14
- package/src/delivery/cqt-css/sel-r1-gg-plus.css +0 -12
- package/src/delivery/cqt-css/sel-r1-ggplus.css +0 -17
- package/src/delivery/cqt-css/sel-r1-gplusggg.css +0 -25
- package/src/delivery/cqt-css/sel-r1-plusggg.css +0 -17
- package/src/delivery/cqt-css/sel-r1-s3.css +0 -85
- package/src/delivery/cqt-css/sel-vic.css +0 -99
- package/src/delivery/cqt-css/sr-vic.css +0 -63
- package/src/delivery/index.ts +0 -94
- package/src/delivery/variant-css-map.ts +0 -124
- package/src/index.iife.ts +0 -13
- package/src/index.ts +0 -1
- package/src/print/Print.svelte +0 -95
- package/src/print/index.ts +0 -18
- package/src/shared/layoutLimits.ts +0 -76
- package/src/shared/types.ts +0 -84
- package/src/types/css-raw.d.ts +0 -4
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/* Shared base styles for all sel_r1-*_plusggg variants.
|
|
2
|
-
Applied via the data-mpb-variant="sel-r1-base" style element.
|
|
3
|
-
Uses [class*="variant-sel-r1-"] so it covers every r1 variant class.
|
|
4
|
-
Source: web-ItemBankViewer/learnosity/templates/Renaissance/r1.scss */
|
|
5
|
-
|
|
6
|
-
/* r1.scss: Starial font throughout */
|
|
7
|
-
[class*="variant-sel-r1-"] {
|
|
8
|
-
font-family: Starial, Arial, sans-serif;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/* r1.scss: .rli-r1-audio-transcript { font-family:Roboto; font-size:16px } */
|
|
12
|
-
[class*="variant-sel-r1-"] .pie-audio-transcript {
|
|
13
|
-
font-family: Roboto, Arial, sans-serif;
|
|
14
|
-
font-size: 16px;
|
|
15
|
-
font-style: normal;
|
|
16
|
-
font-weight: 400;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/* r1.scss: .rli-r1-content-element { font-size: 1.9em } wraps all stem tokens.
|
|
20
|
-
Makes inline font-size spans in the template multiply on top of this base. */
|
|
21
|
-
[class*="variant-sel-r1-"] .pie-template-line {
|
|
22
|
-
font-size: 1.9em;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* r1.scss: .rli-r1-stem { display:flex; flex-direction:row; justify-content:center }
|
|
26
|
-
r1.scss: .rli-r1-content-element { margin-right:2px; margin-left:2px } — 4px total gap.
|
|
27
|
-
column-gap:4px replicates the 2px+2px per-element margin. */
|
|
28
|
-
[class*="variant-sel-r1-"] .pie-template-line {
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: row;
|
|
31
|
-
align-items: baseline;
|
|
32
|
-
justify-content: center;
|
|
33
|
-
column-gap: 4px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[class*="variant-sel-r1-"] .pie-template-line p {
|
|
37
|
-
margin: 0;
|
|
38
|
-
display: flex;
|
|
39
|
-
flex-direction: row;
|
|
40
|
-
align-items: baseline;
|
|
41
|
-
gap: 4px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* r1.scss: .rli-r1-content-element { min-width:150px; max-width:150px; min-height:150px;
|
|
45
|
-
line-height:89px } — every stem token (blank slot and adjacent spans) is a 150px box.
|
|
46
|
-
Scoped to token_sequence layout so the audio_blank_only standalone blank (160px) is unaffected. */
|
|
47
|
-
[class*="variant-sel-r1-"].layout-token_sequence .pie-template-line span:not([class]),
|
|
48
|
-
[class*="variant-sel-r1-"].layout-token_sequence .pie-template-line .pie-blank-slot {
|
|
49
|
-
min-width: 150px;
|
|
50
|
-
max-width: 150px;
|
|
51
|
-
min-height: 150px;
|
|
52
|
-
line-height: 89px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/* r1.scss: .rli-r1-content-element { font-size:1.9em; line-height:89px } on distractors */
|
|
56
|
-
[class*="variant-sel-r1-"] .pie-choice-label {
|
|
57
|
-
font-size: 1.9em;
|
|
58
|
-
line-height: 89px;
|
|
59
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-g_plusggg/0.0.1/question.css */
|
|
2
|
-
/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */
|
|
3
|
-
.mc-populated-blank-root.variant-sel-r1-g-stem {
|
|
4
|
-
max-width: 875px;
|
|
5
|
-
margin-inline: auto;
|
|
6
|
-
--mpb-listen-button-size: 128px;
|
|
7
|
-
--mpb-choice-width-px: 155px;
|
|
8
|
-
--mpb-choice-tile-min-height: 11.25rem;
|
|
9
|
-
--mpb-choice-content-min-height: 9.375rem;
|
|
10
|
-
--mpb-choice-hover-bg: #f2f2f2;
|
|
11
|
-
--mpb-choice-selected-bg: #fcfcd3;
|
|
12
|
-
/* r1.scss: .rli-r1-cloze { border-bottom: 6px solid } */
|
|
13
|
-
--mpb-blank-underline-wide-width: 6px;
|
|
14
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-gg_plusggg/0.0.1/question.css */
|
|
2
|
-
/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */
|
|
3
|
-
.mc-populated-blank-root.variant-sel-r1-gg-plus {
|
|
4
|
-
max-width: 875px;
|
|
5
|
-
margin-inline: auto;
|
|
6
|
-
--mpb-listen-button-size: 128px;
|
|
7
|
-
--mpb-choice-width-px: 155px;
|
|
8
|
-
--mpb-choice-tile-min-height: 11.25rem;
|
|
9
|
-
--mpb-choice-content-min-height: 9.375rem;
|
|
10
|
-
--mpb-choice-hover-bg: #f2f2f2;
|
|
11
|
-
--mpb-choice-selected-bg: #fcfcd3;
|
|
12
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_ggplusggg/0.0.1/question.css */
|
|
2
|
-
/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */
|
|
3
|
-
.mc-populated-blank-root.variant-sel-r1-ggplus {
|
|
4
|
-
max-width: 875px;
|
|
5
|
-
margin-inline: auto;
|
|
6
|
-
--mpb-listen-button-size: 128px;
|
|
7
|
-
--mpb-choice-width-px: 155px;
|
|
8
|
-
--mpb-choice-tile-min-height: 11.25rem;
|
|
9
|
-
--mpb-choice-content-min-height: 9.375rem;
|
|
10
|
-
--mpb-choice-hover-bg: #f2f2f2;
|
|
11
|
-
--mpb-choice-selected-bg: #fcfcd3;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/* In this variant, the blank appears before trailing tokens; avoid left-margin offset. */
|
|
15
|
-
.mc-populated-blank-root.variant-sel-r1-ggplus.layout-token_sequence .pie-blank-slot {
|
|
16
|
-
margin-left: 0;
|
|
17
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_gplusggg/0.0.1/question.css */
|
|
2
|
-
/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */
|
|
3
|
-
.mc-populated-blank-root.variant-sel-r1-gplusggg {
|
|
4
|
-
max-width: 875px;
|
|
5
|
-
margin-inline: auto;
|
|
6
|
-
--mpb-listen-button-size: 128px;
|
|
7
|
-
--mpb-choice-width-px: 155px;
|
|
8
|
-
--mpb-choice-tile-min-height: 11.25rem;
|
|
9
|
-
--mpb-choice-content-min-height: 9.375rem;
|
|
10
|
-
--mpb-choice-group-gap: 1rem;
|
|
11
|
-
--mpb-choice-hover-bg: #f2f2f2;
|
|
12
|
-
--mpb-choice-selected-bg: #fcfcd3;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/* r1.scss: .rli-r1-content-element boxes all have fixed line-height:89px, so every
|
|
16
|
-
token in the stem row shares a stable baseline regardless of content. In PIE,
|
|
17
|
-
the blank slot's baseline shifts when the empty placeholder (short ) is
|
|
18
|
-
replaced by the filled value span (full text height), dragging adjacent tokens
|
|
19
|
-
down by ~9px. Switching to align-items:center is safe here because gplusggg has
|
|
20
|
-
only one row of content (blank + "four"), so vertical centering and baseline
|
|
21
|
-
alignment produce the same visual result. The :is() wrapper raises specificity
|
|
22
|
-
above the base [class*=] rule without needing !important. */
|
|
23
|
-
:is(.mc-populated-blank-root.variant-sel-r1-gplusggg) .pie-template-line {
|
|
24
|
-
align-items: center;
|
|
25
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css */
|
|
2
|
-
/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */
|
|
3
|
-
.mc-populated-blank-root.variant-sel-r1-plusggg {
|
|
4
|
-
max-width: 875px;
|
|
5
|
-
margin-inline: auto;
|
|
6
|
-
--mpb-listen-button-size: 128px;
|
|
7
|
-
--mpb-choice-width-px: 155px;
|
|
8
|
-
--mpb-choice-tile-min-height: 11.25rem;
|
|
9
|
-
--mpb-choice-content-min-height: 9.375rem;
|
|
10
|
-
--mpb-choice-group-gap: 1rem;
|
|
11
|
-
--mpb-choice-hover-bg: #f2f2f2;
|
|
12
|
-
--mpb-choice-selected-bg: #fcfcd3;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.mc-populated-blank-root.variant-sel-r1-plusggg {
|
|
16
|
-
--mpb-choice-radio-padding: 20px;
|
|
17
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css */
|
|
2
|
-
/* Shared r1 base styles (font, template-line flex, choice-label) are in sel-r1-base.css */
|
|
3
|
-
.mc-populated-blank-root.variant-sel-r1-s3 {
|
|
4
|
-
max-width: 860px;
|
|
5
|
-
margin-inline: auto;
|
|
6
|
-
--mpb-listen-button-size: 128px;
|
|
7
|
-
--mpb-choice-width-px: 155px;
|
|
8
|
-
--mpb-choice-tile-min-height: 11.25rem;
|
|
9
|
-
--mpb-choice-content-min-height: 9.375rem;
|
|
10
|
-
--mpb-choice-group-gap: 0.35rem;
|
|
11
|
-
--mpb-choice-row-gap: 0.35rem;
|
|
12
|
-
--mpb-horizontal-choice-radio-top-margin: 0.25rem;
|
|
13
|
-
--mpb-stimulus-min-column: 240px;
|
|
14
|
-
--mpb-stimulus-grid-column-gap: 1.1rem;
|
|
15
|
-
--mpb-stimulus-choices-margin-top: 0.85rem;
|
|
16
|
-
--mpb-audio-blank-template-margin-bottom: 0.9rem;
|
|
17
|
-
--mpb-blank-wide-width: 6.8rem;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* s3 overrides base choice-label with font-weight:500 */
|
|
21
|
-
.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-label,
|
|
22
|
-
.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-label :is(span, p, div) {
|
|
23
|
-
font-size: 1.9em;
|
|
24
|
-
line-height: 89px;
|
|
25
|
-
font-weight: 500;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.mc-populated-blank-root.variant-sel-r1-s3 .pie-blank-value,
|
|
29
|
-
.mc-populated-blank-root.variant-sel-r1-s3 .pie-blank-value :is(span, p, div) {
|
|
30
|
-
line-height: 1.1;
|
|
31
|
-
white-space: nowrap;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal .pie-choice-tile {
|
|
35
|
-
border-radius: 6px;
|
|
36
|
-
background: #f1f1f1;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank {
|
|
40
|
-
grid-template-columns: minmax(220px, auto) auto auto;
|
|
41
|
-
grid-template-areas:
|
|
42
|
-
"transcript transcript transcript"
|
|
43
|
-
"sentence template audio"
|
|
44
|
-
"choices choices choices";
|
|
45
|
-
justify-content: center;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-template-line {
|
|
49
|
-
grid-area: template;
|
|
50
|
-
justify-self: center;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-sentence-line {
|
|
54
|
-
justify-self: end;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-audio-container {
|
|
58
|
-
justify-self: start;
|
|
59
|
-
align-self: start;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.mc-populated-blank-root.variant-sel-r1-s3.layout-stimulus_image_blank .pie-choices-fieldset {
|
|
63
|
-
justify-self: center;
|
|
64
|
-
width: fit-content;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.mc-populated-blank-root.variant-sel-r1-s3 .pie-sentence-line img {
|
|
68
|
-
max-width: 100%;
|
|
69
|
-
height: auto;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal:hover .pie-choice-tile {
|
|
73
|
-
background: #e2e2e2;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal.is-selected .pie-choice-tile,
|
|
77
|
-
.mc-populated-blank-root.variant-sel-r1-s3
|
|
78
|
-
.pie-choice-horizontal.is-selected:hover
|
|
79
|
-
.pie-choice-tile {
|
|
80
|
-
background: #fcfcd3;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.mc-populated-blank-root.variant-sel-r1-s3 .pie-choice-horizontal .pie-choice-radio {
|
|
84
|
-
transform: scale(0.85);
|
|
85
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_vic/0.0.1/question.css */
|
|
2
|
-
/* Reference layout: web-ItemBankViewer/learnosity/templates/Renaissance/sel_vic/scss/main.scss + vic.scss */
|
|
3
|
-
.mc-populated-blank-root.variant-sel-vic {
|
|
4
|
-
font-family: Starial, Arial, sans-serif;
|
|
5
|
-
font-size: 1.5em;
|
|
6
|
-
max-width: 800px;
|
|
7
|
-
margin-inline: auto;
|
|
8
|
-
--mpb-inline-grid-column-gap: 1rem;
|
|
9
|
-
--mpb-inline-grid-row-gap: 0.5rem;
|
|
10
|
-
--mpb-inline-template-margin-top: 0.2rem;
|
|
11
|
-
--mpb-inline-choices-margin-top: 0.2rem;
|
|
12
|
-
--pie-correct-answer-choice-hover-bg: #e2e2e2;
|
|
13
|
-
--pie-correct-answer-choice-selected-bg: #fcfcd3;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.mc-populated-blank-root.variant-sel-vic .pie-audio-transcript {
|
|
17
|
-
font-family: Roboto, Arial, sans-serif;
|
|
18
|
-
font-size: 16px;
|
|
19
|
-
font-style: normal;
|
|
20
|
-
font-weight: 400;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.mc-populated-blank-root.variant-sel-vic .pie-template-line,
|
|
24
|
-
.mc-populated-blank-root.variant-sel-vic .pie-blank-value,
|
|
25
|
-
.mc-populated-blank-root.variant-sel-vic .pie-choice-label {
|
|
26
|
-
line-height: 123%;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/* sel_vic/main.scss: template left ~75%, audio right ~25% on the same row.
|
|
30
|
-
Svelte scoping prevents the component-internal grid-area rule from reaching
|
|
31
|
-
.audio-container inside AudioPlayer, so we override it here via the global
|
|
32
|
-
.pie-audio-container class which is not subject to scope hashing. */
|
|
33
|
-
.mc-populated-blank-root.variant-sel-vic .pie-audio-container {
|
|
34
|
-
grid-area: audio;
|
|
35
|
-
margin: 0;
|
|
36
|
-
justify-self: end;
|
|
37
|
-
align-self: start;
|
|
38
|
-
min-height: 128px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/* vic.scss: sentence and cloze sit inline — the <p> wrapper must not break to
|
|
42
|
-
a new line before the blank slot. */
|
|
43
|
-
.mc-populated-blank-root.variant-sel-vic .pie-template-line p {
|
|
44
|
-
display: inline;
|
|
45
|
-
margin: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* vic.scss: .rli-vic-cloze > .rli-vic-content-element { color: #cc3333 } */
|
|
49
|
-
.mc-populated-blank-root.variant-sel-vic .pie-blank-value {
|
|
50
|
-
color: #cc3333;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* sel_vic/main.scss: .sel-vic { max-width: 800px } — the fieldset/choices must
|
|
54
|
-
also be constrained so rows don't span beyond 800px. */
|
|
55
|
-
.mc-populated-blank-root.variant-sel-vic .pie-choices-fieldset {
|
|
56
|
-
max-width: 800px;
|
|
57
|
-
width: 100%;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* vic.scss: distractor label text sits to the right of the radio — no centering. */
|
|
61
|
-
.mc-populated-blank-root.variant-sel-vic .pie-choice-label {
|
|
62
|
-
text-align: left;
|
|
63
|
-
justify-content: flex-start;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/* vic.scss: .rli-vic-selected { background-color: #fcfcd3 } on the full row. */
|
|
67
|
-
.mc-populated-blank-root.variant-sel-vic .pie-choice.is-selected {
|
|
68
|
-
background-color: #fcfcd3;
|
|
69
|
-
border-radius: 6px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.mc-populated-blank-root.variant-sel-vic .pie-choice.is-selected .pie-choice-label-wrap {
|
|
73
|
-
background-color: transparent;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/* Selected state must win over hover. */
|
|
77
|
-
.mc-populated-blank-root.variant-sel-vic .pie-choice:not(.pie-choice-horizontal).is-selected:hover {
|
|
78
|
-
background-color: #fcfcd3;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* vic.scss: .rli-vic-distractor:hover { background-color: #F2F2F2 } on the full row. */
|
|
82
|
-
.mc-populated-blank-root.variant-sel-vic .pie-choice:not(.pie-choice-horizontal):hover {
|
|
83
|
-
background-color: #f2f2f2;
|
|
84
|
-
border-radius: 6px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.mc-populated-blank-root.variant-sel-vic
|
|
88
|
-
.pie-choice:not(.pie-choice-horizontal):hover
|
|
89
|
-
.pie-choice-label-wrap {
|
|
90
|
-
background-color: transparent;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@media (min-width: 620px) {
|
|
94
|
-
.mc-populated-blank-root.variant-sel-vic .pie-audio-transcript {
|
|
95
|
-
min-width: 620px;
|
|
96
|
-
max-width: 800px;
|
|
97
|
-
transform: translateX(-55px);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/* Source baseline: https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sr-vic/0.0.1/question.css */
|
|
2
|
-
/* Reference layout: web-ItemBankViewer/learnosity/templates/Renaissance/vic.scss */
|
|
3
|
-
.mc-populated-blank-root.variant-sr-vic {
|
|
4
|
-
font-family: Starial, Arial, sans-serif;
|
|
5
|
-
--mpb-inline-grid-column-gap: 1rem;
|
|
6
|
-
--mpb-inline-grid-row-gap: 0.5rem;
|
|
7
|
-
--mpb-inline-template-margin-top: 0.2rem;
|
|
8
|
-
--mpb-inline-choices-margin-top: 0.2rem;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.mc-populated-blank-root.variant-sr-vic .pie-template-line,
|
|
12
|
-
.mc-populated-blank-root.variant-sr-vic .pie-blank-value,
|
|
13
|
-
.mc-populated-blank-root.variant-sr-vic .pie-choice-label {
|
|
14
|
-
line-height: 123%;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/* vic.scss: .rli-vic-answer uses display:flex so sentence and cloze stay on
|
|
18
|
-
one line. The template HTML wraps text in <p>, which is block by default and
|
|
19
|
-
breaks to a new line. Making <p> inline keeps the sentence and blank inline. */
|
|
20
|
-
.mc-populated-blank-root.variant-sr-vic .pie-template-line p {
|
|
21
|
-
display: inline;
|
|
22
|
-
margin: 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* vic.scss: .rli-vic-cloze > .rli-vic-content-element { color: #cc3333 } */
|
|
26
|
-
.mc-populated-blank-root.variant-sr-vic .pie-blank-value {
|
|
27
|
-
color: #cc3333;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* vic.scss: .rli-vic-selected { background-color: #fcfcd3 } applied to the
|
|
31
|
-
whole distractor row (radio + label), not just the label wrapper. */
|
|
32
|
-
.mc-populated-blank-root.variant-sr-vic .pie-choice.is-selected {
|
|
33
|
-
background-color: #fcfcd3;
|
|
34
|
-
border-radius: 6px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.mc-populated-blank-root.variant-sr-vic .pie-choice.is-selected .pie-choice-label-wrap {
|
|
38
|
-
background-color: transparent;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/* vic.scss: distractor label text sits to the right of the radio — no centering. */
|
|
42
|
-
.mc-populated-blank-root.variant-sr-vic .pie-choice-label {
|
|
43
|
-
text-align: left;
|
|
44
|
-
justify-content: flex-start;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/* vic.scss: .rli-vic-distractor:hover { background-color: #F2F2F2 } applied to
|
|
48
|
-
the full row element, not only the inner label wrapper. */
|
|
49
|
-
.mc-populated-blank-root.variant-sr-vic .pie-choice:not(.pie-choice-horizontal):hover {
|
|
50
|
-
background-color: #f2f2f2;
|
|
51
|
-
border-radius: 6px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.mc-populated-blank-root.variant-sr-vic
|
|
55
|
-
.pie-choice:not(.pie-choice-horizontal):hover
|
|
56
|
-
.pie-choice-label-wrap {
|
|
57
|
-
background-color: transparent;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* Selected state must win over hover — yellow persists when hovering a chosen row. */
|
|
61
|
-
.mc-populated-blank-root.variant-sr-vic .pie-choice:not(.pie-choice-horizontal).is-selected:hover {
|
|
62
|
-
background-color: #fcfcd3;
|
|
63
|
-
}
|
package/src/delivery/index.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import McPopulatedBlankComponent from './McPopulatedBlank.svelte';
|
|
2
|
-
import { ModelSetEvent, SessionChangedEvent } from '@pie-lib/delivery-events-svelte';
|
|
3
|
-
|
|
4
|
-
function isComplete(model: any, session: any, audioComplete = false): boolean {
|
|
5
|
-
if (!session?.choiceId) return false;
|
|
6
|
-
const requiresAudioCompletion =
|
|
7
|
-
!!model?.autoplayAudioEnabled && !!model?.completeAudioEnabled && !!model?.hasAudio;
|
|
8
|
-
if (requiresAudioCompletion && !audioComplete) return false;
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const SvelteElementClass = (McPopulatedBlankComponent as any).element;
|
|
13
|
-
|
|
14
|
-
class McPopulatedBlankElement extends SvelteElementClass {
|
|
15
|
-
_internalSession: any = null;
|
|
16
|
-
_model: any = null;
|
|
17
|
-
_options: any = null;
|
|
18
|
-
audioComplete = false;
|
|
19
|
-
|
|
20
|
-
_dispatchModelSet = () => {
|
|
21
|
-
this.dispatchEvent(
|
|
22
|
-
new ModelSetEvent(this.tagName.toLowerCase(), this._isComplete(), this._model !== undefined)
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
_dispatchSessionChanged = () => {
|
|
27
|
-
this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this._isComplete()));
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
set model(m: any) {
|
|
31
|
-
this._model = m;
|
|
32
|
-
this.audioComplete = false;
|
|
33
|
-
super.model = m;
|
|
34
|
-
this._dispatchModelSet();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
get model() {
|
|
38
|
-
return this._model;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
set session(s: any) {
|
|
42
|
-
this._internalSession = s;
|
|
43
|
-
super.session = s;
|
|
44
|
-
this._dispatchSessionChanged();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
get session() {
|
|
48
|
-
return this._internalSession;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
set options(o: any) {
|
|
52
|
-
this._options = o;
|
|
53
|
-
super.options = o;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
get options() {
|
|
57
|
-
return this._options;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
onSessionChange = (updatedSession: any) => {
|
|
61
|
-
this._internalSession = updatedSession;
|
|
62
|
-
super.session = updatedSession;
|
|
63
|
-
this._dispatchSessionChanged();
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
onAudioStarted = () => {
|
|
67
|
-
this._internalSession = {
|
|
68
|
-
...(this._internalSession || {}),
|
|
69
|
-
audioStartTime: Date.now(),
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
onAudioEnded = () => {
|
|
74
|
-
this.audioComplete = true;
|
|
75
|
-
this._internalSession = {
|
|
76
|
-
...(this._internalSession || {}),
|
|
77
|
-
audioEndTime: Date.now(),
|
|
78
|
-
};
|
|
79
|
-
this._dispatchSessionChanged();
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
_isComplete = () => {
|
|
83
|
-
return isComplete(this._model, this._internalSession, this.audioComplete);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
connectedCallback() {
|
|
87
|
-
super.connectedCallback();
|
|
88
|
-
(this as any).onSessionChange = this.onSessionChange;
|
|
89
|
-
(this as any).onAudioStarted = this.onAudioStarted;
|
|
90
|
-
(this as any).onAudioEnded = this.onAudioEnded;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export default McPopulatedBlankElement;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import selR1BaseCss from './cqt-css/sel-r1-base.css?raw';
|
|
2
|
-
import selR1PlusgggCss from './cqt-css/sel-r1-plusggg.css?raw';
|
|
3
|
-
import srVicCss from './cqt-css/sr-vic.css?raw';
|
|
4
|
-
import selVicCss from './cqt-css/sel-vic.css?raw';
|
|
5
|
-
import selR1GplusgggCss from './cqt-css/sel-r1-gplusggg.css?raw';
|
|
6
|
-
import selR1GStemCss from './cqt-css/sel-r1-g-stem.css?raw';
|
|
7
|
-
import selR1GgPlusCss from './cqt-css/sel-r1-gg-plus.css?raw';
|
|
8
|
-
import selR1GgplusCss from './cqt-css/sel-r1-ggplus.css?raw';
|
|
9
|
-
import selR1S3Css from './cqt-css/sel-r1-s3.css?raw';
|
|
10
|
-
|
|
11
|
-
export type VariantCssConfig = {
|
|
12
|
-
variantId: string;
|
|
13
|
-
variantClass: string;
|
|
14
|
-
sourceUrl: string;
|
|
15
|
-
cssText: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const VARIANT_BY_CUSTOM_TYPE: Record<string, VariantCssConfig> = {
|
|
19
|
-
'sel_r1-_plusggg': {
|
|
20
|
-
variantId: 'sel-r1-plusggg',
|
|
21
|
-
variantClass: 'variant-sel-r1-plusggg',
|
|
22
|
-
sourceUrl:
|
|
23
|
-
'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_plusggg/0.0.1/question.css',
|
|
24
|
-
cssText: selR1PlusgggCss,
|
|
25
|
-
},
|
|
26
|
-
'sr-vic': {
|
|
27
|
-
variantId: 'sr-vic',
|
|
28
|
-
variantClass: 'variant-sr-vic',
|
|
29
|
-
sourceUrl:
|
|
30
|
-
'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sr-vic/0.0.1/question.css',
|
|
31
|
-
cssText: srVicCss,
|
|
32
|
-
},
|
|
33
|
-
sel_vic: {
|
|
34
|
-
variantId: 'sel-vic',
|
|
35
|
-
variantClass: 'variant-sel-vic',
|
|
36
|
-
sourceUrl:
|
|
37
|
-
'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_vic/0.0.1/question.css',
|
|
38
|
-
cssText: selVicCss,
|
|
39
|
-
},
|
|
40
|
-
'sel_r1-_gplusggg': {
|
|
41
|
-
variantId: 'sel-r1-gplusggg',
|
|
42
|
-
variantClass: 'variant-sel-r1-gplusggg',
|
|
43
|
-
sourceUrl:
|
|
44
|
-
'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_gplusggg/0.0.1/question.css',
|
|
45
|
-
cssText: selR1GplusgggCss,
|
|
46
|
-
},
|
|
47
|
-
'sel_r1-g_plusggg': {
|
|
48
|
-
variantId: 'sel-r1-g-stem',
|
|
49
|
-
variantClass: 'variant-sel-r1-g-stem',
|
|
50
|
-
sourceUrl:
|
|
51
|
-
'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-g_plusggg/0.0.1/question.css',
|
|
52
|
-
cssText: selR1GStemCss,
|
|
53
|
-
},
|
|
54
|
-
'sel_r1-gg_plusggg': {
|
|
55
|
-
variantId: 'sel-r1-gg-plus',
|
|
56
|
-
variantClass: 'variant-sel-r1-gg-plus',
|
|
57
|
-
sourceUrl:
|
|
58
|
-
'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-gg_plusggg/0.0.1/question.css',
|
|
59
|
-
cssText: selR1GgPlusCss,
|
|
60
|
-
},
|
|
61
|
-
'sel_r1-_ggplusggg': {
|
|
62
|
-
variantId: 'sel-r1-ggplus',
|
|
63
|
-
variantClass: 'variant-sel-r1-ggplus',
|
|
64
|
-
sourceUrl:
|
|
65
|
-
'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-_ggplusggg/0.0.1/question.css',
|
|
66
|
-
cssText: selR1GgplusCss,
|
|
67
|
-
},
|
|
68
|
-
'sel_r1-s3_plusggg': {
|
|
69
|
-
variantId: 'sel-r1-s3',
|
|
70
|
-
variantClass: 'variant-sel-r1-s3',
|
|
71
|
-
sourceUrl:
|
|
72
|
-
'https://global-pr-ibvcustomfiles.renaissance-go.com/learnosity/sel_r1-s3_plusggg/0.0.1/question.css',
|
|
73
|
-
cssText: selR1S3Css,
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const normalizeCustomType = (value: unknown): string => {
|
|
78
|
-
const normalized = String(value || '')
|
|
79
|
-
.trim()
|
|
80
|
-
.toLowerCase();
|
|
81
|
-
// Accept both base custom types and version-suffixed tags like "...v0.0.1".
|
|
82
|
-
return normalized.replace(/v\d+\.\d+\.\d+$/i, '');
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const getVariantCssConfig = (customType: unknown): VariantCssConfig | undefined => {
|
|
86
|
-
const normalized = normalizeCustomType(customType);
|
|
87
|
-
return VARIANT_BY_CUSTOM_TYPE[normalized];
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const getVariantRootClass = (customType: unknown): string => {
|
|
91
|
-
return getVariantCssConfig(customType)?.variantClass || '';
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const SEL_R1_VARIANT_IDS = new Set([
|
|
95
|
-
'sel-r1-plusggg',
|
|
96
|
-
'sel-r1-gplusggg',
|
|
97
|
-
'sel-r1-g-stem',
|
|
98
|
-
'sel-r1-gg-plus',
|
|
99
|
-
'sel-r1-ggplus',
|
|
100
|
-
'sel-r1-s3',
|
|
101
|
-
]);
|
|
102
|
-
|
|
103
|
-
const injectStyleOnce = (id: string, variantName: string, cssText: string): void => {
|
|
104
|
-
const existing = document.getElementById(id) as HTMLStyleElement | null;
|
|
105
|
-
if (existing) {
|
|
106
|
-
if (existing.textContent !== cssText) existing.textContent = cssText;
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const style = document.createElement('style');
|
|
110
|
-
style.id = id;
|
|
111
|
-
style.setAttribute('data-mpb-variant', variantName);
|
|
112
|
-
style.textContent = cssText;
|
|
113
|
-
document.head.appendChild(style);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const ensureVariantCssInjected = (config?: VariantCssConfig): void => {
|
|
117
|
-
if (!config?.cssText || typeof document === 'undefined') {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (SEL_R1_VARIANT_IDS.has(config.variantId)) {
|
|
121
|
-
injectStyleOnce('mc-populated-blank-css-sel-r1-base', 'sel-r1-base', selR1BaseCss);
|
|
122
|
-
}
|
|
123
|
-
injectStyleOnce(`mc-populated-blank-css-${config.variantId}`, config.variantId, config.cssText);
|
|
124
|
-
};
|
package/src/index.iife.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IIFE entry for mc-populated-blank delivery.
|
|
3
|
-
* Registration is handled by PIE players/loaders, not by the element bundle itself.
|
|
4
|
-
*/
|
|
5
|
-
import Element from './delivery';
|
|
6
|
-
import * as controllerModule from './controller';
|
|
7
|
-
|
|
8
|
-
// Ensure the IIFE package exposes a plain controller object with callable
|
|
9
|
-
// `model`/`outcome` functions on the top-level `controller` property.
|
|
10
|
-
const controller = { ...controllerModule };
|
|
11
|
-
|
|
12
|
-
export { controller };
|
|
13
|
-
export default Element;
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './delivery/index';
|