@pie-element/mc-populated-blank 0.2.4 → 0.2.6
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/dist/controller/index.d.ts +1 -0
- package/dist/controller/index.d.ts.map +1 -1
- package/dist/controller/index.js +9 -8
- package/dist/controller/index.js.map +1 -1
- package/dist/delivery/index.js +18 -23
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.iife.d.ts +2 -0
- package/dist/index.iife.d.ts.map +1 -1
- package/dist/index.iife.js +4 -4
- package/dist/index.js +1031 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/controller/index.ts +9 -7
- package/src/delivery/McPopulatedBlank.svelte +23 -20
- package/src/index.iife.ts +2 -0
- package/src/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
1
13
|
//#region ../../../node_modules/.bun/svelte@5.55.1/node_modules/svelte/src/internal/disclose-version.js
|
|
2
14
|
if (typeof window !== "undefined") {
|
|
3
15
|
var _window$__svelte, _window;
|
|
@@ -5161,7 +5173,7 @@ var root_23 = /* @__PURE__ */ from_html(`<span class="choice-label pie-choice-la
|
|
|
5161
5173
|
var root_21 = /* @__PURE__ */ from_html(`<input type="radio" class="choice-radio-inline pie-choice-radio pie-choice-radio-inline svelte-6wlbb4"/> <label class="cursor-pointer flex-1 pie-choice-label-wrap"><!></label>`, 1);
|
|
5162
5174
|
var root_24 = /* @__PURE__ */ from_html(`<span aria-hidden="true"> </span>`);
|
|
5163
5175
|
var root_17 = /* @__PURE__ */ from_html(`<div style="gap:var(--mpb-choice-row-gap, 0.5rem);"><!> <!></div>`);
|
|
5164
|
-
var root = /* @__PURE__ */ from_html(`<div><!> <!> <!> <!> <!> <!> <fieldset class="border-0 p-0 m-0 pie-choices-fieldset svelte-6wlbb4"><legend class="sr-only pie-choices-legend svelte-6wlbb4"> </legend> <div style="gap:var(--mpb-choice-group-gap, 0.5rem);" role="radiogroup" tabindex="-1"></div></fieldset></div>`);
|
|
5176
|
+
var root$1 = /* @__PURE__ */ from_html(`<div><!> <!> <!> <!> <!> <!> <fieldset class="border-0 p-0 m-0 pie-choices-fieldset svelte-6wlbb4"><legend class="sr-only pie-choices-legend svelte-6wlbb4"> </legend> <div style="gap:var(--mpb-choice-group-gap, 0.5rem);" role="radiogroup" tabindex="-1"></div></fieldset></div>`);
|
|
5165
5177
|
var $$css = {
|
|
5166
5178
|
hash: "svelte-6wlbb4",
|
|
5167
5179
|
code: ".sr-only.svelte-6wlbb4 {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.mc-populated-blank-root.svelte-6wlbb4 .prose {max-width:none;}.blank-slot.svelte-6wlbb4:focus-within {outline:2px solid var(--pie-focus, #2563eb);outline-offset:2px;}.blank-slot.svelte-6wlbb4 {display:inline-flex;align-items:center;justify-content:center;text-align:center;vertical-align:baseline;}.pie-toggle-correct-answer.svelte-6wlbb4 {width:100%;cursor:pointer;border:0;background:transparent;padding:0;display:flex;justify-content:center;text-align:center;color:var(--pie-correct-answer-toggle-label-color, var(--pie-text, black));}.pie-correct-answer-toggle-row.svelte-6wlbb4 {width:100%;display:flex;justify-content:flex-end;}.pie-correct-answer-toggle-content.svelte-6wlbb4 {display:flex;margin:0 auto;align-items:center;}.pie-correct-answer-toggle-icon-holder.svelte-6wlbb4 {width:25px;margin-right:5px;display:inline-flex;align-items:center;justify-content:center;}.pie-correct-answer-toggle-svg.svelte-6wlbb4 {width:25px;height:25px;}.pie-correct-answer-toggle-label.svelte-6wlbb4 {width:fit-content;min-width:140px;align-self:center;vertical-align:middle;font-weight:400;user-select:none;}.pie-toggle-correct-answer.svelte-6wlbb4:hover .pie-correct-answer-toggle-label:where(.svelte-6wlbb4),\n .pie-toggle-correct-answer.svelte-6wlbb4:focus-visible .pie-correct-answer-toggle-label:where(.svelte-6wlbb4) {text-decoration:underline;}.template-line.svelte-6wlbb4 {white-space:pre-wrap;}.template-line.svelte-6wlbb4 p {margin:0;}.blank-inner-empty.svelte-6wlbb4 {display:inline-block;min-width:4ch;}.blank-slot-standalone.svelte-6wlbb4 {width:var(--mpb-blank-standalone-width, 7rem);}.listen-button.svelte-6wlbb4 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);border:0;padding:0;background-color:transparent;cursor:pointer;z-index:1;}.listen-button.svelte-6wlbb4:hover {background-color:#e2f1fe;}.listen-feature-icon.svelte-6wlbb4 {width:var(--mpb-listen-button-size, 128px);height:var(--mpb-listen-button-size, 128px);object-fit:contain;display:none;}.listen-feature-icon.listen-active.svelte-6wlbb4 {display:block;}.choice-row-horizontal.svelte-6wlbb4 {flex-direction:column;align-items:center;width:min(var(--mpb-choice-width-px, 170px), var(--mpb-choice-width-vw, 30vw));gap:0;}.choice-tile.svelte-6wlbb4 {display:flex;flex-direction:column;justify-content:space-between;align-items:center;width:100%;min-height:var(--mpb-choice-tile-min-height, 11rem);padding:0.8rem 0.65rem 0.5rem;border-radius:8px;background:transparent;transition:background-color 120ms ease-in-out;}.choice-tile-content.svelte-6wlbb4 {width:100%;display:flex;align-items:center;justify-content:center;min-height:var(--mpb-choice-content-min-height, 7.5rem);}.choice-row-horizontal.svelte-6wlbb4:hover .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-hover-bg, #ececec);}.choice-row-horizontal.is-selected.svelte-6wlbb4 .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-selected-bg, #f1f1f1);}.choice-row-horizontal.is-selected.svelte-6wlbb4:hover .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-selected-bg, #f1f1f1);}.pie-choice.choice-correct.svelte-6wlbb4 {border-left:3px solid var(--pie-correct-answer-choice-correct-border, #0ea449);}.pie-choice.choice-incorrect.svelte-6wlbb4 {border-left:3px solid var(--pie-correct-answer-choice-incorrect-border, #bf0d00);}.pie-choice-horizontal.choice-correct.svelte-6wlbb4 .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-correct-bg, #e8f5e9);}.pie-choice-horizontal.choice-incorrect.svelte-6wlbb4 .choice-tile:where(.svelte-6wlbb4) {background:var(--pie-correct-answer-choice-incorrect-bg, #ffebee);}.pie-choice-feedback-badge.svelte-6wlbb4 {margin-left:auto;display:inline-flex;align-items:center;justify-content:center;width:1.1rem;height:1.1rem;border-radius:9999px;font-size:0.72rem;line-height:1;font-weight:700;color:var(--pie-correct-answer-feedback-glyph-color, #fff);}.pie-choice-feedback-correct.svelte-6wlbb4 {background:var(--pie-correct-answer-feedback-correct-bg, #087d38);}.pie-choice-feedback-incorrect.svelte-6wlbb4 {background:var(--pie-correct-answer-feedback-incorrect-bg, #bf0d00);}.choice-row-horizontal.svelte-6wlbb4 p {margin:0;text-align:center;}.choice-label.svelte-6wlbb4 p,\n .blank-inner.svelte-6wlbb4 p {margin:0;}.blank-inner.svelte-6wlbb4 {width:100%;display:inline-flex;align-items:center;justify-content:center;text-align:center;}.choice-radio-bottom.svelte-6wlbb4 {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}.choice-radio-inline.svelte-6wlbb4 {margin-top:var(--mpb-horizontal-choice-radio-top-margin, 0.5rem);}.layout-audio_blank_only.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {display:flex;width:min(100%, var(--mpb-audio-instructions-max-width, 875px));margin-left:auto;margin-right:auto;justify-content:flex-end;}.layout-audio_blank_only.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {text-align:center;margin:var(--mpb-audio-blank-template-margin-top, 0.8rem) 0\n var(--mpb-audio-blank-template-margin-bottom, 1.8rem);}.layout-audio_blank_only.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4) {width:var(--mpb-blank-wide-width, 10rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);}.layout-stimulus_image_blank.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-stimulus-min-column, 210px), 1fr) auto;grid-template-areas:'sentence audio'\n '. template'\n 'choices choices';column-gap:var(--mpb-stimulus-grid-column-gap, 2rem);row-gap:var(--mpb-stimulus-grid-row-gap, 0.7rem);align-items:start;}.layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;}.layout-stimulus_image_blank.svelte-6wlbb4 .sentence-line:where(.svelte-6wlbb4) {grid-area:sentence;margin:var(--mpb-stimulus-sentence-margin-top, 0.2rem) 0 0;}.layout-stimulus_image_blank.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:0;text-align:center;justify-self:center;}.layout-stimulus_image_blank.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-stimulus-choices-margin-top, 0.9rem);}.layout-token_sequence.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'template audio'\n 'choices choices';column-gap:var(--mpb-token-grid-column-gap, 1.5rem);row-gap:var(--mpb-token-grid-row-gap, 0.8rem);align-items:start;}.layout-token_sequence.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;justify-self:end;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-token-template-margin-top, 0.6rem) 0 0;justify-self:center;text-align:center;}.layout-token_sequence.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) span + span {margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 .blank-slot:where(.svelte-6wlbb4) {width:var(--mpb-blank-standalone-width, 7rem);border-bottom-width:var(--mpb-blank-underline-wide-width, 4px);margin-left:var(--mpb-token-inline-token-gap, 0.35rem);}.layout-token_sequence.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-token-choices-margin-top, 0.2rem);}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 {display:grid;grid-template-columns:minmax(var(--mpb-text-min-column, 260px), 1fr) auto;grid-template-areas:'template audio'\n 'choices choices';column-gap:var(--mpb-inline-grid-column-gap, 1.5rem);row-gap:var(--mpb-inline-grid-row-gap, 0.65rem);align-items:start;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {grid-area:audio;margin:0;justify-self:end;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .template-line:where(.svelte-6wlbb4) {grid-area:template;margin:var(--mpb-inline-template-margin-top, 0.45rem) 0 0;text-align:center;justify-self:center;}.layout-inline_sentence.has-inline-audio.svelte-6wlbb4 fieldset:where(.svelte-6wlbb4) {grid-area:choices;margin-top:var(--mpb-inline-choices-margin-top, 0.25rem);}\n\n /* Match Learnosity responsive behavior for CQT audio-blank layouts:\n at smaller widths, audio control shifts left and answer tiles stack. */\n @media (max-width: 760px) {.layout-audio_blank_only.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .audio-container:where(.svelte-6wlbb4) {width:100%;margin-left:0;margin-right:0;justify-content:flex-start;justify-self:start;}.layout-audio_blank_only.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .pie-choices:where(.svelte-6wlbb4) {flex-direction:column;align-items:flex-start;justify-content:flex-start;}.layout-audio_blank_only.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-token_sequence.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-stimulus_image_blank.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4),\n .layout-inline_sentence.has-inline-audio.svelte-6wlbb4 .choice-row-horizontal:where(.svelte-6wlbb4) {width:min(100%, var(--mpb-narrow-choice-max-width, 230px));align-items:flex-start;}\n }"
|
|
@@ -5243,7 +5255,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5243
5255
|
listenLabelEn: "Listen",
|
|
5244
5256
|
listenLabelEs: "Escuchar"
|
|
5245
5257
|
};
|
|
5246
|
-
let model = prop($$props, "model", 7), session = prop($$props, "session", 7)
|
|
5258
|
+
let model = prop($$props, "model", 7), session = prop($$props, "session", 7);
|
|
5247
5259
|
let audioEl = /* @__PURE__ */ state(null);
|
|
5248
5260
|
let isMediaPlaying = /* @__PURE__ */ state(false);
|
|
5249
5261
|
let localChoiceId = /* @__PURE__ */ state("");
|
|
@@ -5378,12 +5390,9 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5378
5390
|
const selectedId = /* @__PURE__ */ user_derived(() => session()?.choiceId || get(localChoiceId) || "");
|
|
5379
5391
|
const radioGroupName = /* @__PURE__ */ user_derived(() => `${instanceId}-choice-group-${model()?.id || "1"}`);
|
|
5380
5392
|
let showCorrectAnswer = /* @__PURE__ */ state(false);
|
|
5381
|
-
const
|
|
5382
|
-
const canRevealCorrectAnswer = /* @__PURE__ */ user_derived(() => !!model()?.correctChoiceId && (get(isEvaluateMode) || get(alwaysShowCorrect)));
|
|
5383
|
-
const shouldShowCorrectAnswer = /* @__PURE__ */ user_derived(() => get(alwaysShowCorrect) || get(showCorrectAnswer));
|
|
5384
|
-
const shouldShowCorrectAnswerToggle = /* @__PURE__ */ user_derived(() => get(isEvaluateMode) && !get(isResponseCorrect) && !!model()?.correctChoiceId && !get(alwaysShowCorrect));
|
|
5393
|
+
const shouldShowCorrectAnswerToggle = /* @__PURE__ */ user_derived(() => get(isEvaluateMode) && !get(isResponseCorrect) && !!model()?.correctChoiceId);
|
|
5385
5394
|
const displayChoiceId = /* @__PURE__ */ user_derived(() => {
|
|
5386
|
-
if (get(
|
|
5395
|
+
if (get(isEvaluateMode) && get(showCorrectAnswer) && model()?.correctChoiceId) return model().correctChoiceId;
|
|
5387
5396
|
return get(selectedId);
|
|
5388
5397
|
});
|
|
5389
5398
|
const displayChoice = /* @__PURE__ */ user_derived(() => get(choices).find((c) => c.id === get(displayChoiceId)));
|
|
@@ -5415,7 +5424,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5415
5424
|
});
|
|
5416
5425
|
const audioErrorMessage = /* @__PURE__ */ user_derived(() => get(hasAudioButMissingResource) ? get(uiText).audioResourceUnavailable : "");
|
|
5417
5426
|
const resultText = /* @__PURE__ */ user_derived(() => {
|
|
5418
|
-
if (!get(isEvaluateMode) || get(
|
|
5427
|
+
if (!get(isEvaluateMode) || get(showCorrectAnswer)) return "";
|
|
5419
5428
|
if (get(isCorrect)) return "Correct answer selected";
|
|
5420
5429
|
if (get(isIncorrect) && get(selectedId)) return "Incorrect answer selected";
|
|
5421
5430
|
return "";
|
|
@@ -5425,8 +5434,13 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5425
5434
|
const correctChoiceId = String(model()?.correctChoiceId || "");
|
|
5426
5435
|
const activeSelectedId = String(get(selectedId) || "");
|
|
5427
5436
|
if (!get(isEvaluateMode) || !correctChoiceId) return map;
|
|
5428
|
-
if (get(
|
|
5429
|
-
|
|
5437
|
+
if (get(showCorrectAnswer)) {
|
|
5438
|
+
if (activeSelectedId === correctChoiceId) {
|
|
5439
|
+
map.set(correctChoiceId, "correct");
|
|
5440
|
+
return map;
|
|
5441
|
+
}
|
|
5442
|
+
if (activeSelectedId) map.set(activeSelectedId, "incorrect");
|
|
5443
|
+
map.set(correctChoiceId, "incorrect");
|
|
5430
5444
|
return map;
|
|
5431
5445
|
}
|
|
5432
5446
|
if (!activeSelectedId) {
|
|
@@ -5473,7 +5487,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5473
5487
|
set(showCorrectAnswer, !get(showCorrectAnswer));
|
|
5474
5488
|
}
|
|
5475
5489
|
user_effect(() => {
|
|
5476
|
-
if (!get(isEvaluateMode) || get(isResponseCorrect)
|
|
5490
|
+
if (!get(isEvaluateMode) || get(isResponseCorrect)) set(showCorrectAnswer, false);
|
|
5477
5491
|
});
|
|
5478
5492
|
function onRadioGroupKeydown(e) {
|
|
5479
5493
|
if (model()?.disabled) return;
|
|
@@ -5615,16 +5629,9 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5615
5629
|
set session($$value) {
|
|
5616
5630
|
session($$value);
|
|
5617
5631
|
flushSync();
|
|
5618
|
-
},
|
|
5619
|
-
get options() {
|
|
5620
|
-
return options();
|
|
5621
|
-
},
|
|
5622
|
-
set options($$value) {
|
|
5623
|
-
options($$value);
|
|
5624
|
-
flushSync();
|
|
5625
5632
|
}
|
|
5626
5633
|
};
|
|
5627
|
-
var div = root();
|
|
5634
|
+
var div = root$1();
|
|
5628
5635
|
var node = child(div);
|
|
5629
5636
|
var consequent = ($$anchor) => {
|
|
5630
5637
|
var div_1 = root_1();
|
|
@@ -5650,7 +5657,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5650
5657
|
append($$anchor, root_4());
|
|
5651
5658
|
};
|
|
5652
5659
|
if_block(node_2, ($$render) => {
|
|
5653
|
-
if (get(
|
|
5660
|
+
if (get(showCorrectAnswer)) $$render(consequent_1);
|
|
5654
5661
|
else $$render(alternate, -1);
|
|
5655
5662
|
});
|
|
5656
5663
|
reset(span_1);
|
|
@@ -5662,8 +5669,8 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5662
5669
|
bind_this(button, ($$value) => set(toggleCorrectAnswerButtonEl, $$value), () => get(toggleCorrectAnswerButtonEl));
|
|
5663
5670
|
reset(div_2);
|
|
5664
5671
|
template_effect(() => {
|
|
5665
|
-
set_attribute(button, "aria-pressed", get(
|
|
5666
|
-
set_text(text, get(
|
|
5672
|
+
set_attribute(button, "aria-pressed", get(showCorrectAnswer));
|
|
5673
|
+
set_text(text, get(showCorrectAnswer) ? get(uiText).hideCorrectAnswer : get(uiText).showCorrectAnswer);
|
|
5667
5674
|
});
|
|
5668
5675
|
append($$anchor, div_2);
|
|
5669
5676
|
};
|
|
@@ -5860,7 +5867,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5860
5867
|
set_attribute(input_1, "name", get(radioGroupName));
|
|
5861
5868
|
set_attribute(input_1, "id", `${instanceId}-opt-${get(c).id}`);
|
|
5862
5869
|
set_value(input_1, get(c).id);
|
|
5863
|
-
set_checked(input_1, (get(
|
|
5870
|
+
set_checked(input_1, (get(showCorrectAnswer) ? model()?.correctChoiceId : get(selectedId)) === get(c).id);
|
|
5864
5871
|
input_1.disabled = model()?.disabled;
|
|
5865
5872
|
});
|
|
5866
5873
|
append($$anchor, label);
|
|
@@ -5894,7 +5901,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5894
5901
|
set_attribute(input_2, "name", get(radioGroupName));
|
|
5895
5902
|
set_attribute(input_2, "id", `${instanceId}-opt-${get(c).id}`);
|
|
5896
5903
|
set_value(input_2, get(c).id);
|
|
5897
|
-
set_checked(input_2, (get(
|
|
5904
|
+
set_checked(input_2, (get(showCorrectAnswer) ? model()?.correctChoiceId : get(selectedId)) === get(c).id);
|
|
5898
5905
|
input_2.disabled = model()?.disabled;
|
|
5899
5906
|
set_attribute(label_1, "for", `${instanceId}-opt-${get(c).id}`);
|
|
5900
5907
|
});
|
|
@@ -5919,7 +5926,7 @@ function McPopulatedBlank($$anchor, $$props) {
|
|
|
5919
5926
|
if (get(isEvaluateMode) && get(choiceCorrectness)) $$render(consequent_17);
|
|
5920
5927
|
});
|
|
5921
5928
|
reset(div_7);
|
|
5922
|
-
template_effect(() => set_class(div_7, 1, `flex items-start choice-row pie-choice ${get(isHorizontalChoices) ? "choice-row-horizontal pie-choice-horizontal" : ""} ${(get(
|
|
5929
|
+
template_effect(() => set_class(div_7, 1, `flex items-start choice-row pie-choice ${get(isHorizontalChoices) ? "choice-row-horizontal pie-choice-horizontal" : ""} ${(get(showCorrectAnswer) ? model()?.correctChoiceId : get(selectedId)) === get(c).id ? "is-selected pie-choice-selected" : ""} ${get(choiceCorrectness) ? `choice-${get(choiceCorrectness)} pie-choice-${get(choiceCorrectness)}` : ""}`, "svelte-6wlbb4"));
|
|
5923
5930
|
append($$anchor, div_7);
|
|
5924
5931
|
});
|
|
5925
5932
|
reset(div_6);
|
|
@@ -5947,7 +5954,787 @@ customElements.define("mc-populated-blank", create_custom_element(McPopulatedBla
|
|
|
5947
5954
|
options: { type: "Object" }
|
|
5948
5955
|
}, [], []));
|
|
5949
5956
|
//#endregion
|
|
5957
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js
|
|
5958
|
+
/** Detect free variable `global` from Node.js. */
|
|
5959
|
+
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
5960
|
+
//#endregion
|
|
5961
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_root.js
|
|
5962
|
+
/** Detect free variable `self`. */
|
|
5963
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
5964
|
+
/** Used as a reference to the global object. */
|
|
5965
|
+
var root = freeGlobal || freeSelf || Function("return this")();
|
|
5966
|
+
//#endregion
|
|
5967
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js
|
|
5968
|
+
/** Built-in value references. */
|
|
5969
|
+
var Symbol$1 = root.Symbol;
|
|
5970
|
+
//#endregion
|
|
5971
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js
|
|
5972
|
+
/** Used for built-in method references. */
|
|
5973
|
+
var objectProto$3 = Object.prototype;
|
|
5974
|
+
/** Used to check objects for own properties. */
|
|
5975
|
+
var hasOwnProperty$4 = objectProto$3.hasOwnProperty;
|
|
5976
|
+
/**
|
|
5977
|
+
* Used to resolve the
|
|
5978
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
5979
|
+
* of values.
|
|
5980
|
+
*/
|
|
5981
|
+
var nativeObjectToString$1 = objectProto$3.toString;
|
|
5982
|
+
/** Built-in value references. */
|
|
5983
|
+
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
5984
|
+
/**
|
|
5985
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
5986
|
+
*
|
|
5987
|
+
* @private
|
|
5988
|
+
* @param {*} value The value to query.
|
|
5989
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
5990
|
+
*/
|
|
5991
|
+
function getRawTag(value) {
|
|
5992
|
+
var isOwn = hasOwnProperty$4.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
5993
|
+
try {
|
|
5994
|
+
value[symToStringTag$1] = void 0;
|
|
5995
|
+
var unmasked = true;
|
|
5996
|
+
} catch (e) {}
|
|
5997
|
+
var result = nativeObjectToString$1.call(value);
|
|
5998
|
+
if (unmasked) if (isOwn) value[symToStringTag$1] = tag;
|
|
5999
|
+
else delete value[symToStringTag$1];
|
|
6000
|
+
return result;
|
|
6001
|
+
}
|
|
6002
|
+
//#endregion
|
|
6003
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js
|
|
6004
|
+
/**
|
|
6005
|
+
* Used to resolve the
|
|
6006
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
6007
|
+
* of values.
|
|
6008
|
+
*/
|
|
6009
|
+
var nativeObjectToString = Object.prototype.toString;
|
|
6010
|
+
/**
|
|
6011
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
6012
|
+
*
|
|
6013
|
+
* @private
|
|
6014
|
+
* @param {*} value The value to convert.
|
|
6015
|
+
* @returns {string} Returns the converted string.
|
|
6016
|
+
*/
|
|
6017
|
+
function objectToString(value) {
|
|
6018
|
+
return nativeObjectToString.call(value);
|
|
6019
|
+
}
|
|
6020
|
+
//#endregion
|
|
6021
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js
|
|
6022
|
+
/** `Object#toString` result references. */
|
|
6023
|
+
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
6024
|
+
/** Built-in value references. */
|
|
6025
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
6026
|
+
/**
|
|
6027
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
6028
|
+
*
|
|
6029
|
+
* @private
|
|
6030
|
+
* @param {*} value The value to query.
|
|
6031
|
+
* @returns {string} Returns the `toStringTag`.
|
|
6032
|
+
*/
|
|
6033
|
+
function baseGetTag(value) {
|
|
6034
|
+
if (value == null) return value === void 0 ? undefinedTag : nullTag;
|
|
6035
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
6036
|
+
}
|
|
6037
|
+
//#endregion
|
|
6038
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js
|
|
6039
|
+
/**
|
|
6040
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
6041
|
+
* and has a `typeof` result of "object".
|
|
6042
|
+
*
|
|
6043
|
+
* @static
|
|
6044
|
+
* @memberOf _
|
|
6045
|
+
* @since 4.0.0
|
|
6046
|
+
* @category Lang
|
|
6047
|
+
* @param {*} value The value to check.
|
|
6048
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
6049
|
+
* @example
|
|
6050
|
+
*
|
|
6051
|
+
* _.isObjectLike({});
|
|
6052
|
+
* // => true
|
|
6053
|
+
*
|
|
6054
|
+
* _.isObjectLike([1, 2, 3]);
|
|
6055
|
+
* // => true
|
|
6056
|
+
*
|
|
6057
|
+
* _.isObjectLike(_.noop);
|
|
6058
|
+
* // => false
|
|
6059
|
+
*
|
|
6060
|
+
* _.isObjectLike(null);
|
|
6061
|
+
* // => false
|
|
6062
|
+
*/
|
|
6063
|
+
function isObjectLike(value) {
|
|
6064
|
+
return value != null && typeof value == "object";
|
|
6065
|
+
}
|
|
6066
|
+
//#endregion
|
|
6067
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArray.js
|
|
6068
|
+
/**
|
|
6069
|
+
* Checks if `value` is classified as an `Array` object.
|
|
6070
|
+
*
|
|
6071
|
+
* @static
|
|
6072
|
+
* @memberOf _
|
|
6073
|
+
* @since 0.1.0
|
|
6074
|
+
* @category Lang
|
|
6075
|
+
* @param {*} value The value to check.
|
|
6076
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
6077
|
+
* @example
|
|
6078
|
+
*
|
|
6079
|
+
* _.isArray([1, 2, 3]);
|
|
6080
|
+
* // => true
|
|
6081
|
+
*
|
|
6082
|
+
* _.isArray(document.body.children);
|
|
6083
|
+
* // => false
|
|
6084
|
+
*
|
|
6085
|
+
* _.isArray('abc');
|
|
6086
|
+
* // => false
|
|
6087
|
+
*
|
|
6088
|
+
* _.isArray(_.noop);
|
|
6089
|
+
* // => false
|
|
6090
|
+
*/
|
|
6091
|
+
var isArray = Array.isArray;
|
|
6092
|
+
//#endregion
|
|
6093
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isObject.js
|
|
6094
|
+
/**
|
|
6095
|
+
* Checks if `value` is the
|
|
6096
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
6097
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
6098
|
+
*
|
|
6099
|
+
* @static
|
|
6100
|
+
* @memberOf _
|
|
6101
|
+
* @since 0.1.0
|
|
6102
|
+
* @category Lang
|
|
6103
|
+
* @param {*} value The value to check.
|
|
6104
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
6105
|
+
* @example
|
|
6106
|
+
*
|
|
6107
|
+
* _.isObject({});
|
|
6108
|
+
* // => true
|
|
6109
|
+
*
|
|
6110
|
+
* _.isObject([1, 2, 3]);
|
|
6111
|
+
* // => true
|
|
6112
|
+
*
|
|
6113
|
+
* _.isObject(_.noop);
|
|
6114
|
+
* // => true
|
|
6115
|
+
*
|
|
6116
|
+
* _.isObject(null);
|
|
6117
|
+
* // => false
|
|
6118
|
+
*/
|
|
6119
|
+
function isObject(value) {
|
|
6120
|
+
var type = typeof value;
|
|
6121
|
+
return value != null && (type == "object" || type == "function");
|
|
6122
|
+
}
|
|
6123
|
+
//#endregion
|
|
6124
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js
|
|
6125
|
+
/** `Object#toString` result references. */
|
|
6126
|
+
var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
6127
|
+
/**
|
|
6128
|
+
* Checks if `value` is classified as a `Function` object.
|
|
6129
|
+
*
|
|
6130
|
+
* @static
|
|
6131
|
+
* @memberOf _
|
|
6132
|
+
* @since 0.1.0
|
|
6133
|
+
* @category Lang
|
|
6134
|
+
* @param {*} value The value to check.
|
|
6135
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
6136
|
+
* @example
|
|
6137
|
+
*
|
|
6138
|
+
* _.isFunction(_);
|
|
6139
|
+
* // => true
|
|
6140
|
+
*
|
|
6141
|
+
* _.isFunction(/abc/);
|
|
6142
|
+
* // => false
|
|
6143
|
+
*/
|
|
6144
|
+
function isFunction(value) {
|
|
6145
|
+
if (!isObject(value)) return false;
|
|
6146
|
+
var tag = baseGetTag(value);
|
|
6147
|
+
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
6148
|
+
}
|
|
6149
|
+
//#endregion
|
|
6150
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js
|
|
6151
|
+
/** Used to detect overreaching core-js shims. */
|
|
6152
|
+
var coreJsData = root["__core-js_shared__"];
|
|
6153
|
+
//#endregion
|
|
6154
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js
|
|
6155
|
+
/** Used to detect methods masquerading as native. */
|
|
6156
|
+
var maskSrcKey = function() {
|
|
6157
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
6158
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
6159
|
+
}();
|
|
6160
|
+
/**
|
|
6161
|
+
* Checks if `func` has its source masked.
|
|
6162
|
+
*
|
|
6163
|
+
* @private
|
|
6164
|
+
* @param {Function} func The function to check.
|
|
6165
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
6166
|
+
*/
|
|
6167
|
+
function isMasked(func) {
|
|
6168
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
6169
|
+
}
|
|
6170
|
+
//#endregion
|
|
6171
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js
|
|
6172
|
+
/** Used to resolve the decompiled source of functions. */
|
|
6173
|
+
var funcToString$1 = Function.prototype.toString;
|
|
6174
|
+
/**
|
|
6175
|
+
* Converts `func` to its source code.
|
|
6176
|
+
*
|
|
6177
|
+
* @private
|
|
6178
|
+
* @param {Function} func The function to convert.
|
|
6179
|
+
* @returns {string} Returns the source code.
|
|
6180
|
+
*/
|
|
6181
|
+
function toSource(func) {
|
|
6182
|
+
if (func != null) {
|
|
6183
|
+
try {
|
|
6184
|
+
return funcToString$1.call(func);
|
|
6185
|
+
} catch (e) {}
|
|
6186
|
+
try {
|
|
6187
|
+
return func + "";
|
|
6188
|
+
} catch (e) {}
|
|
6189
|
+
}
|
|
6190
|
+
return "";
|
|
6191
|
+
}
|
|
6192
|
+
//#endregion
|
|
6193
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js
|
|
6194
|
+
/**
|
|
6195
|
+
* Used to match `RegExp`
|
|
6196
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
6197
|
+
*/
|
|
6198
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
6199
|
+
/** Used to detect host constructors (Safari). */
|
|
6200
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
6201
|
+
/** Used for built-in method references. */
|
|
6202
|
+
var funcProto = Function.prototype, objectProto$2 = Object.prototype;
|
|
6203
|
+
/** Used to resolve the decompiled source of functions. */
|
|
6204
|
+
var funcToString = funcProto.toString;
|
|
6205
|
+
/** Used to check objects for own properties. */
|
|
6206
|
+
var hasOwnProperty$3 = objectProto$2.hasOwnProperty;
|
|
6207
|
+
/** Used to detect if a method is native. */
|
|
6208
|
+
var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty$3).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
6209
|
+
/**
|
|
6210
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
6211
|
+
*
|
|
6212
|
+
* @private
|
|
6213
|
+
* @param {*} value The value to check.
|
|
6214
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
6215
|
+
* else `false`.
|
|
6216
|
+
*/
|
|
6217
|
+
function baseIsNative(value) {
|
|
6218
|
+
if (!isObject(value) || isMasked(value)) return false;
|
|
6219
|
+
return (isFunction(value) ? reIsNative : reIsHostCtor).test(toSource(value));
|
|
6220
|
+
}
|
|
6221
|
+
//#endregion
|
|
6222
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js
|
|
6223
|
+
/**
|
|
6224
|
+
* Gets the value at `key` of `object`.
|
|
6225
|
+
*
|
|
6226
|
+
* @private
|
|
6227
|
+
* @param {Object} [object] The object to query.
|
|
6228
|
+
* @param {string} key The key of the property to get.
|
|
6229
|
+
* @returns {*} Returns the property value.
|
|
6230
|
+
*/
|
|
6231
|
+
function getValue(object, key) {
|
|
6232
|
+
return object == null ? void 0 : object[key];
|
|
6233
|
+
}
|
|
6234
|
+
//#endregion
|
|
6235
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js
|
|
6236
|
+
/**
|
|
6237
|
+
* Gets the native function at `key` of `object`.
|
|
6238
|
+
*
|
|
6239
|
+
* @private
|
|
6240
|
+
* @param {Object} object The object to query.
|
|
6241
|
+
* @param {string} key The key of the method to get.
|
|
6242
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
6243
|
+
*/
|
|
6244
|
+
function getNative(object, key) {
|
|
6245
|
+
var value = getValue(object, key);
|
|
6246
|
+
return baseIsNative(value) ? value : void 0;
|
|
6247
|
+
}
|
|
6248
|
+
//#endregion
|
|
6249
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js
|
|
6250
|
+
var WeakMap$1 = getNative(root, "WeakMap");
|
|
6251
|
+
//#endregion
|
|
6252
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isLength.js
|
|
6253
|
+
/** Used as references for various `Number` constants. */
|
|
6254
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
6255
|
+
/**
|
|
6256
|
+
* Checks if `value` is a valid array-like length.
|
|
6257
|
+
*
|
|
6258
|
+
* **Note:** This method is loosely based on
|
|
6259
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
6260
|
+
*
|
|
6261
|
+
* @static
|
|
6262
|
+
* @memberOf _
|
|
6263
|
+
* @since 4.0.0
|
|
6264
|
+
* @category Lang
|
|
6265
|
+
* @param {*} value The value to check.
|
|
6266
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
6267
|
+
* @example
|
|
6268
|
+
*
|
|
6269
|
+
* _.isLength(3);
|
|
6270
|
+
* // => true
|
|
6271
|
+
*
|
|
6272
|
+
* _.isLength(Number.MIN_VALUE);
|
|
6273
|
+
* // => false
|
|
6274
|
+
*
|
|
6275
|
+
* _.isLength(Infinity);
|
|
6276
|
+
* // => false
|
|
6277
|
+
*
|
|
6278
|
+
* _.isLength('3');
|
|
6279
|
+
* // => false
|
|
6280
|
+
*/
|
|
6281
|
+
function isLength(value) {
|
|
6282
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
6283
|
+
}
|
|
6284
|
+
//#endregion
|
|
6285
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js
|
|
6286
|
+
/**
|
|
6287
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
6288
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
6289
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
6290
|
+
*
|
|
6291
|
+
* @static
|
|
6292
|
+
* @memberOf _
|
|
6293
|
+
* @since 4.0.0
|
|
6294
|
+
* @category Lang
|
|
6295
|
+
* @param {*} value The value to check.
|
|
6296
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
6297
|
+
* @example
|
|
6298
|
+
*
|
|
6299
|
+
* _.isArrayLike([1, 2, 3]);
|
|
6300
|
+
* // => true
|
|
6301
|
+
*
|
|
6302
|
+
* _.isArrayLike(document.body.children);
|
|
6303
|
+
* // => true
|
|
6304
|
+
*
|
|
6305
|
+
* _.isArrayLike('abc');
|
|
6306
|
+
* // => true
|
|
6307
|
+
*
|
|
6308
|
+
* _.isArrayLike(_.noop);
|
|
6309
|
+
* // => false
|
|
6310
|
+
*/
|
|
6311
|
+
function isArrayLike(value) {
|
|
6312
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
6313
|
+
}
|
|
6314
|
+
//#endregion
|
|
6315
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js
|
|
6316
|
+
/** Used for built-in method references. */
|
|
6317
|
+
var objectProto$1 = Object.prototype;
|
|
6318
|
+
/**
|
|
6319
|
+
* Checks if `value` is likely a prototype object.
|
|
6320
|
+
*
|
|
6321
|
+
* @private
|
|
6322
|
+
* @param {*} value The value to check.
|
|
6323
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
6324
|
+
*/
|
|
6325
|
+
function isPrototype(value) {
|
|
6326
|
+
var Ctor = value && value.constructor;
|
|
6327
|
+
return value === (typeof Ctor == "function" && Ctor.prototype || objectProto$1);
|
|
6328
|
+
}
|
|
6329
|
+
//#endregion
|
|
6330
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js
|
|
6331
|
+
/** `Object#toString` result references. */
|
|
6332
|
+
var argsTag$1 = "[object Arguments]";
|
|
6333
|
+
/**
|
|
6334
|
+
* The base implementation of `_.isArguments`.
|
|
6335
|
+
*
|
|
6336
|
+
* @private
|
|
6337
|
+
* @param {*} value The value to check.
|
|
6338
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
6339
|
+
*/
|
|
6340
|
+
function baseIsArguments(value) {
|
|
6341
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag$1;
|
|
6342
|
+
}
|
|
6343
|
+
//#endregion
|
|
6344
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js
|
|
6345
|
+
/** Used for built-in method references. */
|
|
6346
|
+
var objectProto = Object.prototype;
|
|
6347
|
+
/** Used to check objects for own properties. */
|
|
6348
|
+
var hasOwnProperty$2 = objectProto.hasOwnProperty;
|
|
6349
|
+
/** Built-in value references. */
|
|
6350
|
+
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
6351
|
+
/**
|
|
6352
|
+
* Checks if `value` is likely an `arguments` object.
|
|
6353
|
+
*
|
|
6354
|
+
* @static
|
|
6355
|
+
* @memberOf _
|
|
6356
|
+
* @since 0.1.0
|
|
6357
|
+
* @category Lang
|
|
6358
|
+
* @param {*} value The value to check.
|
|
6359
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
6360
|
+
* else `false`.
|
|
6361
|
+
* @example
|
|
6362
|
+
*
|
|
6363
|
+
* _.isArguments(function() { return arguments; }());
|
|
6364
|
+
* // => true
|
|
6365
|
+
*
|
|
6366
|
+
* _.isArguments([1, 2, 3]);
|
|
6367
|
+
* // => false
|
|
6368
|
+
*/
|
|
6369
|
+
var isArguments = baseIsArguments(function() {
|
|
6370
|
+
return arguments;
|
|
6371
|
+
}()) ? baseIsArguments : function(value) {
|
|
6372
|
+
return isObjectLike(value) && hasOwnProperty$2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
6373
|
+
};
|
|
6374
|
+
//#endregion
|
|
6375
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js
|
|
6376
|
+
/**
|
|
6377
|
+
* This method returns `false`.
|
|
6378
|
+
*
|
|
6379
|
+
* @static
|
|
6380
|
+
* @memberOf _
|
|
6381
|
+
* @since 4.13.0
|
|
6382
|
+
* @category Util
|
|
6383
|
+
* @returns {boolean} Returns `false`.
|
|
6384
|
+
* @example
|
|
6385
|
+
*
|
|
6386
|
+
* _.times(2, _.stubFalse);
|
|
6387
|
+
* // => [false, false]
|
|
6388
|
+
*/
|
|
6389
|
+
function stubFalse() {
|
|
6390
|
+
return false;
|
|
6391
|
+
}
|
|
6392
|
+
//#endregion
|
|
6393
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js
|
|
6394
|
+
/** Detect free variable `exports`. */
|
|
6395
|
+
var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
6396
|
+
/** Detect free variable `module`. */
|
|
6397
|
+
var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
|
|
6398
|
+
/** Built-in value references. */
|
|
6399
|
+
var Buffer$1 = freeModule$1 && freeModule$1.exports === freeExports$1 ? root.Buffer : void 0;
|
|
6400
|
+
/**
|
|
6401
|
+
* Checks if `value` is a buffer.
|
|
6402
|
+
*
|
|
6403
|
+
* @static
|
|
6404
|
+
* @memberOf _
|
|
6405
|
+
* @since 4.3.0
|
|
6406
|
+
* @category Lang
|
|
6407
|
+
* @param {*} value The value to check.
|
|
6408
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
6409
|
+
* @example
|
|
6410
|
+
*
|
|
6411
|
+
* _.isBuffer(new Buffer(2));
|
|
6412
|
+
* // => true
|
|
6413
|
+
*
|
|
6414
|
+
* _.isBuffer(new Uint8Array(2));
|
|
6415
|
+
* // => false
|
|
6416
|
+
*/
|
|
6417
|
+
var isBuffer = (Buffer$1 ? Buffer$1.isBuffer : void 0) || stubFalse;
|
|
6418
|
+
//#endregion
|
|
6419
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js
|
|
6420
|
+
/** `Object#toString` result references. */
|
|
6421
|
+
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag$2 = "[object Map]", numberTag = "[object Number]", objectTag$1 = "[object Object]", regexpTag = "[object RegExp]", setTag$2 = "[object Set]", stringTag = "[object String]", weakMapTag$1 = "[object WeakMap]";
|
|
6422
|
+
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
6423
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
|
6424
|
+
var typedArrayTags = {};
|
|
6425
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
6426
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag] = typedArrayTags[objectTag$1] = typedArrayTags[regexpTag] = typedArrayTags[setTag$2] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag$1] = false;
|
|
6427
|
+
/**
|
|
6428
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
6429
|
+
*
|
|
6430
|
+
* @private
|
|
6431
|
+
* @param {*} value The value to check.
|
|
6432
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
6433
|
+
*/
|
|
6434
|
+
function baseIsTypedArray(value) {
|
|
6435
|
+
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
6436
|
+
}
|
|
6437
|
+
//#endregion
|
|
6438
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js
|
|
6439
|
+
/**
|
|
6440
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
6441
|
+
*
|
|
6442
|
+
* @private
|
|
6443
|
+
* @param {Function} func The function to cap arguments for.
|
|
6444
|
+
* @returns {Function} Returns the new capped function.
|
|
6445
|
+
*/
|
|
6446
|
+
function baseUnary(func) {
|
|
6447
|
+
return function(value) {
|
|
6448
|
+
return func(value);
|
|
6449
|
+
};
|
|
6450
|
+
}
|
|
6451
|
+
//#endregion
|
|
6452
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js
|
|
6453
|
+
/** Detect free variable `exports`. */
|
|
6454
|
+
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
6455
|
+
/** Detect free variable `module`. */
|
|
6456
|
+
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
6457
|
+
/** Detect free variable `process` from Node.js. */
|
|
6458
|
+
var freeProcess = freeModule && freeModule.exports === freeExports && freeGlobal.process;
|
|
6459
|
+
/** Used to access faster Node.js helpers. */
|
|
6460
|
+
var nodeUtil = function() {
|
|
6461
|
+
try {
|
|
6462
|
+
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
6463
|
+
if (types) return types;
|
|
6464
|
+
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
6465
|
+
} catch (e) {}
|
|
6466
|
+
}();
|
|
6467
|
+
//#endregion
|
|
6468
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js
|
|
6469
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
6470
|
+
/**
|
|
6471
|
+
* Checks if `value` is classified as a typed array.
|
|
6472
|
+
*
|
|
6473
|
+
* @static
|
|
6474
|
+
* @memberOf _
|
|
6475
|
+
* @since 3.0.0
|
|
6476
|
+
* @category Lang
|
|
6477
|
+
* @param {*} value The value to check.
|
|
6478
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
6479
|
+
* @example
|
|
6480
|
+
*
|
|
6481
|
+
* _.isTypedArray(new Uint8Array);
|
|
6482
|
+
* // => true
|
|
6483
|
+
*
|
|
6484
|
+
* _.isTypedArray([]);
|
|
6485
|
+
* // => false
|
|
6486
|
+
*/
|
|
6487
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
6488
|
+
//#endregion
|
|
6489
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js
|
|
6490
|
+
/**
|
|
6491
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
6492
|
+
*
|
|
6493
|
+
* @private
|
|
6494
|
+
* @param {Function} func The function to wrap.
|
|
6495
|
+
* @param {Function} transform The argument transform.
|
|
6496
|
+
* @returns {Function} Returns the new function.
|
|
6497
|
+
*/
|
|
6498
|
+
function overArg(func, transform) {
|
|
6499
|
+
return function(arg) {
|
|
6500
|
+
return func(transform(arg));
|
|
6501
|
+
};
|
|
6502
|
+
}
|
|
6503
|
+
//#endregion
|
|
6504
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js
|
|
6505
|
+
var nativeKeys = overArg(Object.keys, Object);
|
|
6506
|
+
//#endregion
|
|
6507
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js
|
|
6508
|
+
/** Used to check objects for own properties. */
|
|
6509
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
6510
|
+
/**
|
|
6511
|
+
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
6512
|
+
*
|
|
6513
|
+
* @private
|
|
6514
|
+
* @param {Object} object The object to query.
|
|
6515
|
+
* @returns {Array} Returns the array of property names.
|
|
6516
|
+
*/
|
|
6517
|
+
function baseKeys(object) {
|
|
6518
|
+
if (!isPrototype(object)) return nativeKeys(object);
|
|
6519
|
+
var result = [];
|
|
6520
|
+
for (var key in Object(object)) if (hasOwnProperty$1.call(object, key) && key != "constructor") result.push(key);
|
|
6521
|
+
return result;
|
|
6522
|
+
}
|
|
6523
|
+
//#endregion
|
|
6524
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Map.js
|
|
6525
|
+
var Map$1 = getNative(root, "Map");
|
|
6526
|
+
//#endregion
|
|
6527
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js
|
|
6528
|
+
var DataView = getNative(root, "DataView");
|
|
6529
|
+
//#endregion
|
|
6530
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js
|
|
6531
|
+
var Promise$1 = getNative(root, "Promise");
|
|
6532
|
+
//#endregion
|
|
6533
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_Set.js
|
|
6534
|
+
var Set$1 = getNative(root, "Set");
|
|
6535
|
+
//#endregion
|
|
6536
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js
|
|
6537
|
+
/** `Object#toString` result references. */
|
|
6538
|
+
var mapTag$1 = "[object Map]", objectTag = "[object Object]", promiseTag = "[object Promise]", setTag$1 = "[object Set]", weakMapTag = "[object WeakMap]";
|
|
6539
|
+
var dataViewTag = "[object DataView]";
|
|
6540
|
+
/** Used to detect maps, sets, and weakmaps. */
|
|
6541
|
+
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
|
|
6542
|
+
/**
|
|
6543
|
+
* Gets the `toStringTag` of `value`.
|
|
6544
|
+
*
|
|
6545
|
+
* @private
|
|
6546
|
+
* @param {*} value The value to query.
|
|
6547
|
+
* @returns {string} Returns the `toStringTag`.
|
|
6548
|
+
*/
|
|
6549
|
+
var getTag = baseGetTag;
|
|
6550
|
+
if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag(new Map$1()) != mapTag$1 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$1 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag) getTag = function(value) {
|
|
6551
|
+
var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
6552
|
+
if (ctorString) switch (ctorString) {
|
|
6553
|
+
case dataViewCtorString: return dataViewTag;
|
|
6554
|
+
case mapCtorString: return mapTag$1;
|
|
6555
|
+
case promiseCtorString: return promiseTag;
|
|
6556
|
+
case setCtorString: return setTag$1;
|
|
6557
|
+
case weakMapCtorString: return weakMapTag;
|
|
6558
|
+
}
|
|
6559
|
+
return result;
|
|
6560
|
+
};
|
|
6561
|
+
var _getTag_default = getTag;
|
|
6562
|
+
//#endregion
|
|
6563
|
+
//#region ../../../node_modules/.bun/lodash-es@4.17.23/node_modules/lodash-es/isEmpty.js
|
|
6564
|
+
/** `Object#toString` result references. */
|
|
6565
|
+
var mapTag = "[object Map]", setTag = "[object Set]";
|
|
6566
|
+
/** Used to check objects for own properties. */
|
|
6567
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
6568
|
+
/**
|
|
6569
|
+
* Checks if `value` is an empty object, collection, map, or set.
|
|
6570
|
+
*
|
|
6571
|
+
* Objects are considered empty if they have no own enumerable string keyed
|
|
6572
|
+
* properties.
|
|
6573
|
+
*
|
|
6574
|
+
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
|
|
6575
|
+
* jQuery-like collections are considered empty if they have a `length` of `0`.
|
|
6576
|
+
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
|
|
6577
|
+
*
|
|
6578
|
+
* @static
|
|
6579
|
+
* @memberOf _
|
|
6580
|
+
* @since 0.1.0
|
|
6581
|
+
* @category Lang
|
|
6582
|
+
* @param {*} value The value to check.
|
|
6583
|
+
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
|
6584
|
+
* @example
|
|
6585
|
+
*
|
|
6586
|
+
* _.isEmpty(null);
|
|
6587
|
+
* // => true
|
|
6588
|
+
*
|
|
6589
|
+
* _.isEmpty(true);
|
|
6590
|
+
* // => true
|
|
6591
|
+
*
|
|
6592
|
+
* _.isEmpty(1);
|
|
6593
|
+
* // => true
|
|
6594
|
+
*
|
|
6595
|
+
* _.isEmpty([1, 2, 3]);
|
|
6596
|
+
* // => false
|
|
6597
|
+
*
|
|
6598
|
+
* _.isEmpty({ 'a': 1 });
|
|
6599
|
+
* // => false
|
|
6600
|
+
*/
|
|
6601
|
+
function isEmpty(value) {
|
|
6602
|
+
if (value == null) return true;
|
|
6603
|
+
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) return !value.length;
|
|
6604
|
+
var tag = _getTag_default(value);
|
|
6605
|
+
if (tag == mapTag || tag == setTag) return !value.size;
|
|
6606
|
+
if (isPrototype(value)) return !baseKeys(value).length;
|
|
6607
|
+
for (var key in value) if (hasOwnProperty.call(value, key)) return false;
|
|
6608
|
+
return true;
|
|
6609
|
+
}
|
|
6610
|
+
//#endregion
|
|
6611
|
+
//#region src/controller/defaults.ts
|
|
6612
|
+
/** Token authors must include exactly once in `template` (HTML). */
|
|
6613
|
+
var BLANK_TOKEN = "{{blank}}";
|
|
6614
|
+
/** Baseline values tuned to match historical CQT visuals; override via model.layoutLimits. */
|
|
6615
|
+
var DEFAULT_LAYOUT_LIMITS = {
|
|
6616
|
+
blankStandaloneWidthRem: 7,
|
|
6617
|
+
blankWideWidthRem: 10,
|
|
6618
|
+
blankUnderlineWidthPx: 2,
|
|
6619
|
+
blankUnderlineWideWidthPx: 4,
|
|
6620
|
+
horizontalChoiceWidthPx: 170,
|
|
6621
|
+
horizontalChoiceWidthVw: 30,
|
|
6622
|
+
horizontalChoiceTileMinHeightRem: 11,
|
|
6623
|
+
horizontalChoiceContentMinHeightRem: 7.5,
|
|
6624
|
+
selectedImageMaxHeightRem: 4,
|
|
6625
|
+
choiceImageMaxHeightRem: 5,
|
|
6626
|
+
listenButtonSizePx: 128,
|
|
6627
|
+
stimulusMinColumnPx: 210,
|
|
6628
|
+
textMinColumnPx: 260,
|
|
6629
|
+
legendMaxChars: 120,
|
|
6630
|
+
choiceGroupGapRem: .5,
|
|
6631
|
+
choiceRowGapRem: .5,
|
|
6632
|
+
toggleButtonGapRem: .5,
|
|
6633
|
+
horizontalChoiceRadioTopMarginRem: .5,
|
|
6634
|
+
audioBlankTemplateMarginTopRem: .8,
|
|
6635
|
+
audioBlankTemplateMarginBottomRem: 1.8,
|
|
6636
|
+
audioInstructionsMaxWidthPx: 875,
|
|
6637
|
+
narrowHorizontalChoiceMaxWidthPx: 230,
|
|
6638
|
+
stimulusGridColumnGapRem: 2,
|
|
6639
|
+
stimulusGridRowGapRem: .7,
|
|
6640
|
+
stimulusSentenceMarginTopRem: .2,
|
|
6641
|
+
stimulusChoicesMarginTopRem: .9,
|
|
6642
|
+
tokenGridColumnGapRem: 1.5,
|
|
6643
|
+
tokenGridRowGapRem: .8,
|
|
6644
|
+
tokenTemplateMarginTopRem: .6,
|
|
6645
|
+
tokenInlineTokenGapRem: .35,
|
|
6646
|
+
tokenChoicesMarginTopRem: .2,
|
|
6647
|
+
inlineGridColumnGapRem: 1.5,
|
|
6648
|
+
inlineGridRowGapRem: .65,
|
|
6649
|
+
inlineTemplateMarginTopRem: .45,
|
|
6650
|
+
inlineChoicesMarginTopRem: .25
|
|
6651
|
+
};
|
|
6652
|
+
var defaults_default = {
|
|
6653
|
+
model: {
|
|
6654
|
+
id: "1",
|
|
6655
|
+
element: "mc-populated-blank",
|
|
6656
|
+
prompt: "<p><strong>Demo prompt</strong></p>",
|
|
6657
|
+
promptEnabled: true,
|
|
6658
|
+
interactionMode: "populate_blank",
|
|
6659
|
+
layoutProfile: "",
|
|
6660
|
+
choiceLayout: "",
|
|
6661
|
+
layoutProfilePresets: {},
|
|
6662
|
+
layoutLimits: { ...DEFAULT_LAYOUT_LIMITS },
|
|
6663
|
+
audioButtonSkin: null,
|
|
6664
|
+
audioButtonSkinsByLocale: {},
|
|
6665
|
+
uiText: {
|
|
6666
|
+
answerChoices: "Answer choices",
|
|
6667
|
+
selectedAnswerInSentence: "Selected answer in sentence",
|
|
6668
|
+
showCorrectAnswer: "Show correct answer",
|
|
6669
|
+
hideCorrectAnswer: "Hide correct answer",
|
|
6670
|
+
clickToEnableAutoplay: "Click to enable audio autoplay",
|
|
6671
|
+
audioResourceUnavailable: "Audio is enabled but no playable audio URL is configured.",
|
|
6672
|
+
transcriptLabel: "Transcript",
|
|
6673
|
+
listenLabelEn: "Listen",
|
|
6674
|
+
listenLabelEs: "Escuchar"
|
|
6675
|
+
},
|
|
6676
|
+
sentenceHtml: "",
|
|
6677
|
+
template: `<p>The answer is ${BLANK_TOKEN}.</p>`,
|
|
6678
|
+
choiceMode: "text",
|
|
6679
|
+
choices: [
|
|
6680
|
+
{
|
|
6681
|
+
id: "c1",
|
|
6682
|
+
labelHtml: "<p>Option A</p>"
|
|
6683
|
+
},
|
|
6684
|
+
{
|
|
6685
|
+
id: "c2",
|
|
6686
|
+
labelHtml: "<p>Option B</p>"
|
|
6687
|
+
},
|
|
6688
|
+
{
|
|
6689
|
+
id: "c3",
|
|
6690
|
+
labelHtml: "<p>Option C</p>"
|
|
6691
|
+
}
|
|
6692
|
+
],
|
|
6693
|
+
correctChoiceId: "c2",
|
|
6694
|
+
hasAudio: false,
|
|
6695
|
+
autoplayAudioEnabled: false,
|
|
6696
|
+
completeAudioEnabled: false,
|
|
6697
|
+
audioUrl: "",
|
|
6698
|
+
audioTranscript: "",
|
|
6699
|
+
showVisibleTranscript: false,
|
|
6700
|
+
locale: "",
|
|
6701
|
+
teacherInstructions: "",
|
|
6702
|
+
teacherInstructionsEnabled: false
|
|
6703
|
+
},
|
|
6704
|
+
configuration: { prompt: {
|
|
6705
|
+
label: "Prompt",
|
|
6706
|
+
settings: true
|
|
6707
|
+
} }
|
|
6708
|
+
};
|
|
6709
|
+
//#endregion
|
|
5950
6710
|
//#region src/controller/index.ts
|
|
6711
|
+
var controller_exports = /* @__PURE__ */ __exportAll({
|
|
6712
|
+
countBlankTokens: () => countBlankTokens,
|
|
6713
|
+
createCorrectResponseSession: () => createCorrectResponseSession,
|
|
6714
|
+
createDefaultModel: () => createDefaultModel,
|
|
6715
|
+
getCorrectness: () => getCorrectness,
|
|
6716
|
+
getPartialScore: () => getPartialScore,
|
|
6717
|
+
isComplete: () => isComplete,
|
|
6718
|
+
model: () => model,
|
|
6719
|
+
normalize: () => normalize,
|
|
6720
|
+
normalizeSession: () => normalizeSession,
|
|
6721
|
+
outcome: () => outcome,
|
|
6722
|
+
validate: () => validate
|
|
6723
|
+
});
|
|
6724
|
+
function countBlankTokens(template) {
|
|
6725
|
+
if (!template) return 0;
|
|
6726
|
+
return (template.match(/\{\{blank\}\}/g) || []).length;
|
|
6727
|
+
}
|
|
6728
|
+
var getCorrectness = (question, session) => {
|
|
6729
|
+
if (!session || !session.choiceId) return "unanswered";
|
|
6730
|
+
const correct = question?.correctChoiceId || "";
|
|
6731
|
+
if (session.choiceId === correct) return "correct";
|
|
6732
|
+
return "incorrect";
|
|
6733
|
+
};
|
|
6734
|
+
var getPartialScore = (_question, session) => {
|
|
6735
|
+
if (!session || isEmpty(session) || !session.choiceId) return 0;
|
|
6736
|
+
return 1;
|
|
6737
|
+
};
|
|
5951
6738
|
var isComplete = (question, session, audioComplete = false) => {
|
|
5952
6739
|
if (!session || !session.choiceId) return false;
|
|
5953
6740
|
const autoplayAudioEnabled = !!question?.autoplayAudioEnabled;
|
|
@@ -5955,6 +6742,224 @@ var isComplete = (question, session, audioComplete = false) => {
|
|
|
5955
6742
|
if (autoplayAudioEnabled && completeAudioEnabled && !!question?.hasAudio && !audioComplete) return false;
|
|
5956
6743
|
return true;
|
|
5957
6744
|
};
|
|
6745
|
+
var outcome = (question, session, env) => new Promise((resolve) => {
|
|
6746
|
+
if (!session || isEmpty(session)) {
|
|
6747
|
+
resolve({
|
|
6748
|
+
score: 0,
|
|
6749
|
+
empty: true,
|
|
6750
|
+
traceLog: ["Student did not select any answers. Score is 0."]
|
|
6751
|
+
});
|
|
6752
|
+
return;
|
|
6753
|
+
}
|
|
6754
|
+
session = normalizeSession(session);
|
|
6755
|
+
const correctness = getCorrectness(question, session);
|
|
6756
|
+
if (correctness === "unanswered") {
|
|
6757
|
+
resolve({
|
|
6758
|
+
score: 0,
|
|
6759
|
+
empty: true,
|
|
6760
|
+
traceLog: ["Student did not select any answers. Score is 0."]
|
|
6761
|
+
});
|
|
6762
|
+
return;
|
|
6763
|
+
}
|
|
6764
|
+
const score = correctness === "correct" ? 1 : 0;
|
|
6765
|
+
resolve({
|
|
6766
|
+
score,
|
|
6767
|
+
empty: false,
|
|
6768
|
+
traceLog: [
|
|
6769
|
+
`Mode: ${env?.mode || "unknown"}.`,
|
|
6770
|
+
`Student selected choice: ${session.choiceId}.`,
|
|
6771
|
+
`Correct choice: ${question?.correctChoiceId || "none"}.`,
|
|
6772
|
+
`Final score: ${score}.`
|
|
6773
|
+
]
|
|
6774
|
+
});
|
|
6775
|
+
});
|
|
6776
|
+
var createDefaultModel = (model = {}) => ({
|
|
6777
|
+
...defaults_default.model,
|
|
6778
|
+
...model,
|
|
6779
|
+
layoutLimits: {
|
|
6780
|
+
...DEFAULT_LAYOUT_LIMITS,
|
|
6781
|
+
...model?.layoutLimits || {}
|
|
6782
|
+
}
|
|
6783
|
+
});
|
|
6784
|
+
var normalize = (question = {}) => createDefaultModel(question);
|
|
6785
|
+
var normalizeSession = (s) => ({ ...s });
|
|
6786
|
+
var shouldShuffleChoices = (question) => !!question?.shuffle;
|
|
6787
|
+
var shouldLockChoices = (question, env) => {
|
|
6788
|
+
if (question?.lockChoiceOrder) return true;
|
|
6789
|
+
if (env?.["@pie-element"]?.lockChoiceOrder) return true;
|
|
6790
|
+
return env?.role === "instructor";
|
|
6791
|
+
};
|
|
6792
|
+
function shuffleArray(items) {
|
|
6793
|
+
const out = [...items];
|
|
6794
|
+
for (let i = out.length - 1; i > 0; i--) {
|
|
6795
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
6796
|
+
[out[i], out[j]] = [out[j], out[i]];
|
|
6797
|
+
}
|
|
6798
|
+
return out;
|
|
6799
|
+
}
|
|
6800
|
+
var getStoredShuffle = (session) => Array.isArray(session?.data?.shuffledValues) ? session.data.shuffledValues : Array.isArray(session?.shuffledValues) ? session.shuffledValues : [];
|
|
6801
|
+
var applyShuffledValues = (choices, shuffledValues, choiceKey) => {
|
|
6802
|
+
const orderedChoices = shuffledValues.map((value) => choices.find((choice) => choice?.[choiceKey] === value)).filter(Boolean);
|
|
6803
|
+
if (orderedChoices.length === choices.length) return orderedChoices;
|
|
6804
|
+
const orderedValues = new Set(orderedChoices.map((choice) => choice[choiceKey]));
|
|
6805
|
+
const leftovers = choices.filter((choice) => !orderedValues.has(choice?.[choiceKey]));
|
|
6806
|
+
return [...orderedChoices, ...leftovers];
|
|
6807
|
+
};
|
|
6808
|
+
var getOrderedChoices = async (question, session, env, updateSession) => {
|
|
6809
|
+
const choices = Array.isArray(question?.choices) ? [...question.choices] : [];
|
|
6810
|
+
if (!choices.length || !shouldShuffleChoices(question)) return choices;
|
|
6811
|
+
if (shouldLockChoices(question, env || {})) return choices;
|
|
6812
|
+
const shuffledValues = getStoredShuffle(session);
|
|
6813
|
+
if (shuffledValues.length) return applyShuffledValues(choices, shuffledValues, "id");
|
|
6814
|
+
const shuffledChoices = shuffleArray(choices);
|
|
6815
|
+
if (updateSession && typeof updateSession === "function" && session?.id && session?.element) {
|
|
6816
|
+
const shuffledIds = shuffledChoices.map((choice) => choice?.id).filter(Boolean);
|
|
6817
|
+
if (shuffledIds.length) await updateSession(session.id, session.element, { shuffledValues: shuffledIds });
|
|
6818
|
+
}
|
|
6819
|
+
return shuffledChoices;
|
|
6820
|
+
};
|
|
6821
|
+
var model = async (question, session, env, updateSession) => {
|
|
6822
|
+
session = session || {};
|
|
6823
|
+
const safeEnv = env || {};
|
|
6824
|
+
const normalizedQuestion = normalize(question);
|
|
6825
|
+
const choices = await getOrderedChoices(normalizedQuestion, session, safeEnv, updateSession);
|
|
6826
|
+
const out = {
|
|
6827
|
+
prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,
|
|
6828
|
+
interactionMode: normalizedQuestion.interactionMode || "populate_blank",
|
|
6829
|
+
layoutProfile: normalizedQuestion.layoutProfile || "",
|
|
6830
|
+
choiceLayout: normalizedQuestion.choiceLayout || "",
|
|
6831
|
+
layoutProfilePresets: normalizedQuestion.layoutProfilePresets && typeof normalizedQuestion.layoutProfilePresets === "object" ? normalizedQuestion.layoutProfilePresets : {},
|
|
6832
|
+
layoutLimits: normalizedQuestion.layoutLimits || { ...DEFAULT_LAYOUT_LIMITS },
|
|
6833
|
+
audioButtonSkin: normalizedQuestion.audioButtonSkin && typeof normalizedQuestion.audioButtonSkin === "object" ? normalizedQuestion.audioButtonSkin : null,
|
|
6834
|
+
audioButtonSkinsByLocale: normalizedQuestion.audioButtonSkinsByLocale && typeof normalizedQuestion.audioButtonSkinsByLocale === "object" ? normalizedQuestion.audioButtonSkinsByLocale : {},
|
|
6835
|
+
uiText: normalizedQuestion.uiText && typeof normalizedQuestion.uiText === "object" ? normalizedQuestion.uiText : {},
|
|
6836
|
+
sentenceHtml: normalizedQuestion.sentenceHtml || null,
|
|
6837
|
+
template: normalizedQuestion.template,
|
|
6838
|
+
choiceMode: normalizedQuestion.choiceMode,
|
|
6839
|
+
choices,
|
|
6840
|
+
hasAudio: normalizedQuestion.hasAudio,
|
|
6841
|
+
autoplayAudioEnabled: !!normalizedQuestion.autoplayAudioEnabled,
|
|
6842
|
+
completeAudioEnabled: !!normalizedQuestion.completeAudioEnabled,
|
|
6843
|
+
audioUrl: normalizedQuestion.hasAudio ? normalizedQuestion.audioUrl : null,
|
|
6844
|
+
audioTranscript: normalizedQuestion.hasAudio ? normalizedQuestion.audioTranscript : null,
|
|
6845
|
+
showVisibleTranscript: !!normalizedQuestion.showVisibleTranscript,
|
|
6846
|
+
useFeatureButtonAudio: typeof normalizedQuestion.useFeatureButtonAudio === "boolean" ? normalizedQuestion.useFeatureButtonAudio : void 0,
|
|
6847
|
+
locale: normalizedQuestion.locale || "",
|
|
6848
|
+
disabled: safeEnv.mode !== "gather",
|
|
6849
|
+
mode: safeEnv.mode
|
|
6850
|
+
};
|
|
6851
|
+
if (safeEnv.mode === "evaluate") {
|
|
6852
|
+
const correctness = getCorrectness(normalizedQuestion, session);
|
|
6853
|
+
out.correctness = correctness;
|
|
6854
|
+
out.responseCorrect = correctness === "correct";
|
|
6855
|
+
out.correctChoiceId = normalizedQuestion.correctChoiceId;
|
|
6856
|
+
}
|
|
6857
|
+
if (safeEnv.role === "instructor" && (safeEnv.mode === "view" || safeEnv.mode === "evaluate")) out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;
|
|
6858
|
+
else out.teacherInstructions = null;
|
|
6859
|
+
return out;
|
|
6860
|
+
};
|
|
6861
|
+
var createCorrectResponseSession = (question, env) => {
|
|
6862
|
+
return new Promise((resolve) => {
|
|
6863
|
+
if (env.mode !== "evaluate" && env.role === "instructor") resolve({
|
|
6864
|
+
id: "1",
|
|
6865
|
+
element: "mc-populated-blank",
|
|
6866
|
+
choiceId: question?.correctChoiceId || ""
|
|
6867
|
+
});
|
|
6868
|
+
else resolve(null);
|
|
6869
|
+
});
|
|
6870
|
+
};
|
|
6871
|
+
var validate = (model = {}, _config = {}) => {
|
|
6872
|
+
const errors = {};
|
|
6873
|
+
if (model.promptEnabled) {
|
|
6874
|
+
const p = model.prompt?.trim() || "";
|
|
6875
|
+
if (!p || p === "<p></p>") errors.prompt = "Prompt is required when prompt is enabled";
|
|
6876
|
+
}
|
|
6877
|
+
const interactionMode = model.interactionMode || "populate_blank";
|
|
6878
|
+
const n = countBlankTokens(model.template || "");
|
|
6879
|
+
if (interactionMode === "audio_mc_only") {
|
|
6880
|
+
if (n > 0) errors.template = `Template cannot contain ${BLANK_TOKEN} in audio-only mode`;
|
|
6881
|
+
} else if (interactionMode === "populate_blank") {
|
|
6882
|
+
if (n === 0) errors.template = `Template must contain exactly one ${BLANK_TOKEN} placeholder`;
|
|
6883
|
+
else if (n > 1) errors.template = `Template must contain only one ${BLANK_TOKEN} placeholder`;
|
|
6884
|
+
} else errors.interactionMode = "Unknown interaction mode";
|
|
6885
|
+
const choices = Array.isArray(model.choices) ? model.choices : [];
|
|
6886
|
+
if (choices.length < 2) errors.choices = "At least two choices are required";
|
|
6887
|
+
const mode = model.choiceMode || "text";
|
|
6888
|
+
for (let i = 0; i < choices.length; i++) {
|
|
6889
|
+
const c = choices[i];
|
|
6890
|
+
if (!c?.id) {
|
|
6891
|
+
errors.choices = `Choice ${i + 1} is missing an id`;
|
|
6892
|
+
break;
|
|
6893
|
+
}
|
|
6894
|
+
if (mode === "text") {
|
|
6895
|
+
const lbl = (c.labelHtml || "").trim();
|
|
6896
|
+
if (!lbl || lbl === "<p></p>") {
|
|
6897
|
+
errors.choices = `Choice ${i + 1} needs label text`;
|
|
6898
|
+
break;
|
|
6899
|
+
}
|
|
6900
|
+
} else {
|
|
6901
|
+
if (!c.imageUrl?.trim()) {
|
|
6902
|
+
errors.choices = `Choice ${i + 1} needs an image URL`;
|
|
6903
|
+
break;
|
|
6904
|
+
}
|
|
6905
|
+
if (!c.imageAlt?.trim()) {
|
|
6906
|
+
errors.choices = `Choice ${i + 1} needs image alt text`;
|
|
6907
|
+
break;
|
|
6908
|
+
}
|
|
6909
|
+
}
|
|
6910
|
+
}
|
|
6911
|
+
const correct = model.correctChoiceId;
|
|
6912
|
+
if (!correct || !choices.some((c) => c.id === correct)) errors.correctChoiceId = "Correct choice must match one of the choice ids";
|
|
6913
|
+
if (model.hasAudio) {
|
|
6914
|
+
if (!!!model.audioUrl?.trim()) errors.audioUrl = "A playable audio URL is required when audio is enabled";
|
|
6915
|
+
}
|
|
6916
|
+
const limits = model?.layoutLimits;
|
|
6917
|
+
if (limits && typeof limits === "object") for (const key of [
|
|
6918
|
+
"blankStandaloneWidthRem",
|
|
6919
|
+
"blankWideWidthRem",
|
|
6920
|
+
"blankUnderlineWidthPx",
|
|
6921
|
+
"blankUnderlineWideWidthPx",
|
|
6922
|
+
"horizontalChoiceWidthPx",
|
|
6923
|
+
"horizontalChoiceWidthVw",
|
|
6924
|
+
"horizontalChoiceTileMinHeightRem",
|
|
6925
|
+
"horizontalChoiceContentMinHeightRem",
|
|
6926
|
+
"selectedImageMaxHeightRem",
|
|
6927
|
+
"choiceImageMaxHeightRem",
|
|
6928
|
+
"listenButtonSizePx",
|
|
6929
|
+
"stimulusMinColumnPx",
|
|
6930
|
+
"textMinColumnPx",
|
|
6931
|
+
"legendMaxChars",
|
|
6932
|
+
"choiceGroupGapRem",
|
|
6933
|
+
"choiceRowGapRem",
|
|
6934
|
+
"toggleButtonGapRem",
|
|
6935
|
+
"horizontalChoiceRadioTopMarginRem",
|
|
6936
|
+
"audioBlankTemplateMarginTopRem",
|
|
6937
|
+
"audioBlankTemplateMarginBottomRem",
|
|
6938
|
+
"audioInstructionsMaxWidthPx",
|
|
6939
|
+
"narrowHorizontalChoiceMaxWidthPx",
|
|
6940
|
+
"stimulusGridColumnGapRem",
|
|
6941
|
+
"stimulusGridRowGapRem",
|
|
6942
|
+
"stimulusSentenceMarginTopRem",
|
|
6943
|
+
"stimulusChoicesMarginTopRem",
|
|
6944
|
+
"tokenGridColumnGapRem",
|
|
6945
|
+
"tokenGridRowGapRem",
|
|
6946
|
+
"tokenTemplateMarginTopRem",
|
|
6947
|
+
"tokenInlineTokenGapRem",
|
|
6948
|
+
"tokenChoicesMarginTopRem",
|
|
6949
|
+
"inlineGridColumnGapRem",
|
|
6950
|
+
"inlineGridRowGapRem",
|
|
6951
|
+
"inlineTemplateMarginTopRem",
|
|
6952
|
+
"inlineChoicesMarginTopRem"
|
|
6953
|
+
]) {
|
|
6954
|
+
if (limits[key] === void 0 || limits[key] === null || limits[key] === "") continue;
|
|
6955
|
+
const value = Number(limits[key]);
|
|
6956
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
6957
|
+
errors.layoutLimits = `${key} must be a positive number when provided`;
|
|
6958
|
+
break;
|
|
6959
|
+
}
|
|
6960
|
+
}
|
|
6961
|
+
return errors;
|
|
6962
|
+
};
|
|
5958
6963
|
//#endregion
|
|
5959
6964
|
//#region src/delivery/index.ts
|
|
5960
6965
|
var SvelteElementClass = McPopulatedBlank.element;
|
|
@@ -6041,6 +7046,6 @@ var McPopulatedBlankElement = class extends SvelteElementClass {
|
|
|
6041
7046
|
}
|
|
6042
7047
|
};
|
|
6043
7048
|
//#endregion
|
|
6044
|
-
export { McPopulatedBlankElement as default };
|
|
7049
|
+
export { controller_exports as controller, McPopulatedBlankElement as default };
|
|
6045
7050
|
|
|
6046
7051
|
//# sourceMappingURL=index.js.map
|