@pie-element/inline-dropdown 10.1.2-next.20 → 10.1.2-next.22
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/browser/{Close-DJv6MCxq.js → Close-BVNoz0Wj.js} +11 -5
- package/dist/browser/Close-BVNoz0Wj.js.map +1 -0
- package/dist/browser/author/index.js +1 -1
- package/dist/browser/controller/index.js +2 -2
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +1 -1
- package/dist/browser/editor-runtime/{Close-CYmIbifw.js → Close-DAVMI303.js} +11 -5
- package/dist/browser/editor-runtime/Close-DAVMI303.js.map +1 -0
- package/dist/browser/editor-runtime/author/index.js +1 -1
- package/dist/browser/editor-runtime/controller/index.js +2 -2
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/delivery/index.js +1 -1
- package/dist/index.iife.js +1 -1
- package/package.json +8 -8
- package/dist/browser/Close-DJv6MCxq.js.map +0 -1
- package/dist/browser/editor-runtime/Close-CYmIbifw.js.map +0 -1
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
})([["cb0f0518b022d739", (url) => "@font-face{font-family:Symbola;src:local(Symbola Regular),local(Symbola),url(\"" + url(() => new URL("../assets/Symbola-4c507403.woff2", import.meta.url)) + "\")format(\"woff2\")}.mq-editable-field{display:inline-block}.mq-editable-field .mq-cursor{z-index:1;border-left:1px solid #000;margin-left:-1px;padding:0;display:inline-block;position:relative}.mq-editable-field .mq-cursor.mq-blink{visibility:hidden}.mq-editable-field,.mq-math-mode .mq-editable-field{border:1px solid gray}.mq-editable-field.mq-focused,.mq-math-mode .mq-editable-field.mq-focused{border-color:#709ac0;border-radius:1px;box-shadow:0 0 1px 2px #8bd,inset 0 0 2px #6ae}.mq-math-mode .mq-editable-field{margin:1px}.mq-editable-field .mq-latex-command-input{color:inherit;border:1px solid gray;margin-left:2px;margin-right:1px;padding-right:1px;font-family:Courier New,monospace}.mq-editable-field .mq-latex-command-input.mq-empty{background:0 0}.mq-editable-field .mq-latex-command-input.mq-hasCursor{border-color:activeborder}.mq-editable-field.mq-empty:after,.mq-editable-field.mq-text-mode:after,.mq-math-mode .mq-empty:after,.mq-editable-field .mq-cursor:only-child:after,.mq-editable-field .mq-textarea+.mq-cursor:last-child:after{visibility:hidden;content:\"c\"}.mq-editable-field .mq-text-mode .mq-cursor:only-child:after{content:\"\"}.mq-editable-field.mq-text-mode{overflow:auto hidden}.mq-root-block,.mq-math-mode .mq-root-block{box-sizing:border-box;white-space:nowrap;vertical-align:middle;width:100%;padding:2px;display:inline-block;overflow:hidden}.mq-math-mode{font-variant:normal;font-size:115%;font-style:normal;font-weight:400;line-height:1;display:inline-block}.mq-math-mode .mq-non-leaf,.mq-math-mode .mq-scaled{display:inline-block}.mq-math-mode var,.mq-math-mode .mq-text-mode,.mq-math-mode .mq-nonSymbola{font-family:Times New Roman,Symbola,serif;line-height:.9}.mq-math-mode *{font-size:inherit;line-height:inherit;-webkit-user-select:none;user-select:none;box-sizing:border-box;border-color:#000;margin:0;padding:0}.mq-math-mode .mq-empty,.mq-math-mode.mq-empty{background:0 0}.mq-math-mode .mq-text-mode{white-space:pre;display:inline-block}.mq-math-mode .mq-text-mode.mq-hasCursor{min-width:1ex;margin:0 -.1em;padding:0 .1em;box-shadow:inset 0 .1em .2em #a9a9a9}.mq-math-mode .mq-font{font:1em Times New Roman,Symbola,serif}.mq-math-mode .mq-font *{font-family:inherit;font-style:inherit}.mq-math-mode b,.mq-math-mode b.mq-font{font-weight:bolder}.mq-math-mode var,.mq-math-mode i,.mq-math-mode i.mq-font{font-style:italic}.mq-math-mode var.mq-f{margin-left:.1em;margin-right:.2em}.mq-math-mode .mq-roman var.mq-f{margin:0}.mq-math-mode big{font-size:200%}.mq-math-mode .mq-int>big{vertical-align:-.16em;display:inline-block;transform:scaleX(.7)}.mq-math-mode .mq-int>.mq-supsub{vertical-align:-1.1em;padding-right:.2em;font-size:80%}.mq-math-mode .mq-int>.mq-supsub>.mq-sup>.mq-sup-inner{vertical-align:1.3em}.mq-math-mode .mq-int>.mq-supsub>.mq-sub{margin-left:-.35em}.mq-math-mode .mq-roman{font-style:normal}.mq-math-mode .mq-sans-serif{font-family:sans-serif,Symbola,serif}.mq-math-mode .mq-monospace{font-family:monospace,Symbola,serif}.mq-math-mode .mq-overleftrightarrow{margin-top:.35em;position:relative}.mq-math-mode .mq-overleftrightarrow .mq-overleftrightarrow-inner{text-align:center;border-top:.14em solid #4d4d4d;min-width:1em;margin:0 .1em;padding-top:.35em;display:inline-block;position:relative}.mq-math-mode .mq-overleftrightarrow .mq-overleftrightarrow-inner .mq-empty{min-width:1em;margin-top:.1em;display:inline-block}.mq-math-mode .mq-overleftrightarrow .mq-overleftrightarrow-inner .mq-overleftrightarrow-inner-right{text-align:right;font-family:LearnosityIconsRegular;font-size:.75em;line-height:1em;display:block;position:absolute;top:-.562em;right:-.4em}.mq-math-mode .mq-overleftrightarrow .mq-overleftrightarrow-inner .mq-overleftrightarrow-inner-left{text-align:left;font-family:LearnosityIconsRegular;font-size:.75em;line-height:1em;display:block;position:absolute;top:-.562em;left:-.4em}.mq-math-mode .mq-overline .mq-overline-inner{text-align:center;border-top:.14em solid #4d4d4d;margin-left:.1em;padding-top:.2em;padding-right:.1em;display:inline-block}.mq-math-mode .mq-overline .mq-overline-inner .mq-empty{min-width:1em;margin-top:.1em;display:inline-block}.mq-math-mode .mq-overline .mq-overline-inner .mq-overline-inner-right,.mq-math-mode .mq-overline .mq-overline-inner .mq-overline-inner-left{display:none}.mq-math-mode .mq-longdiv{padding-top:.2em}.mq-math-mode .mq-longdiv .mq-longdiv-curve-border{border-top-right-radius:100em;border-bottom-right-radius:100em;width:2px;max-width:2px;margin-right:-.12em;padding-top:.2em;font-size:1.4em;display:inline}.mq-math-mode .mq-longdiv .mq-longdiv-inner{text-align:center;border-top:1px solid gray;border-radius:0 0 0 10px;min-width:1em;margin-left:-.2em;margin-right:.15em;padding-top:.19em;padding-left:.44em;font-size:1em;display:inline}.mq-math-mode .mq-longdiv .mq-longdiv-inner .mq-empty{min-width:1.5em;display:inline-block}.mq-math-mode .mq-underline{border-bottom:1px solid #000;margin-bottom:1px}.mq-math-mode .mq-underline.mq-empty{min-width:1em}.mq-math-mode .mq-overarc{-moz-border-radius-topright:50% .3em;-moz-border-radius-topleft:50% .3em;border-top:1px solid #000;border-top-left-radius:50% .3em;border-top-right-radius:50% .3em;margin-top:1px;padding-top:.15em}.mq-math-mode .mq-overarrow{margin-top:.35em;position:relative}.mq-math-mode .mq-overarrow .mq-overarrow-inner{text-align:center;border-top:.14em solid #4d4d4d;min-width:1em;margin:0 .1em;padding-top:.35em;display:inline-block;position:relative}.mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-empty{min-width:1em;margin-top:.1em;display:inline-block}.mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-overarrow-inner-right{text-align:right;font-family:LearnosityIconsRegular;font-size:.75em;line-height:1em;display:block;position:absolute;top:-.562em;right:-.4em}.mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-overarrow-inner-left{text-align:left;font-family:LearnosityIconsRegular;font-size:.75em;line-height:1em;display:none;position:absolute;top:-.562em;left:-.4em}.mq-math-mode .mq-overarrow.mq-arrow-left .mq-overarrow-inner .mq-overarrow-inner-right{display:none}.mq-math-mode .mq-overarrow.mq-arrow-left .mq-overarrow-inner .mq-overarrow-inner-left{display:block}.mq-math-mode .mq-overarrow.mq-arrow-both{vertical-align:text-bottom}.mq-math-mode .mq-overarrow.mq-arrow-both.mq-empty{min-height:1.23em}.mq-math-mode .mq-overarrow.mq-arrow-both.mq-empty:after{top:-.34em}.mq-math-mode .mq-overarrow.mq-arrow-both:before{filter:FlipH;-ms-filter:\"FlipH\";transform:scaleX(-1)}.mq-math-mode .mq-overarrow.mq-arrow-both:after{content:\"➤\";visibility:visible;text-align:right;font-size:.5em;line-height:0;display:block;position:relative;top:-2.3em}.mq-math-mode .mq-xarrow{text-align:center;vertical-align:.9em;padding:0 .2em;font-size:70%;position:relative}.mq-math-mode .mq-xarrow .mq-xarrow-over{border-bottom:1px solid #000;padding:.1em .1em .2em;display:block;position:relative}.mq-math-mode .mq-xarrow .mq-xarrow-under{float:left;margin-bottom:.2em;padding:0 .1em .2em;position:relative;top:.2em}.mq-math-mode .mq-xarrow .mq-xarrow-over:before{content:\"➤\";height:1em;font-size:.6em;display:block;position:absolute;bottom:-.62em;right:-.3em}.mq-math-mode .mq-xarrow.mq-arrow-left .mq-xarrow-over:before{filter:FlipH;-ms-filter:\"FlipH\";left:-.3em;right:auto;transform:scaleX(-1)}.mq-math-mode .mq-binary-operator{padding:0 .2em;display:inline-block}.mq-math-mode .mq-supsub{text-align:left;vertical-align:-.5em;font-size:90%}.mq-math-mode .mq-supsub.mq-sup-only{vertical-align:.5em}.mq-math-mode .mq-supsub.mq-sup-only .mq-sup{vertical-align:text-bottom;display:inline-block}.mq-math-mode .mq-supsub .mq-sup{display:block}.mq-math-mode .mq-supsub .mq-sub{float:left;display:block}.mq-math-mode .mq-supsub .mq-binary-operator{padding:0 .1em}.mq-math-mode .mq-supsub .mq-fraction{font-size:70%}.mq-math-mode sup.mq-nthroot{vertical-align:.8em;min-width:.5em;margin-left:.2em;margin-right:-.6em;font-size:80%}.mq-math-mode .mq-paren{vertical-align:top;transform-origin:50% .06em;padding:0 .1em}.mq-math-mode .mq-paren.mq-ghost{color:silver}.mq-math-mode .mq-paren+span{margin-top:.1em;margin-bottom:.1em}.mq-math-mode .mq-array{vertical-align:middle;text-align:center}.mq-math-mode .mq-array>span{display:block}.mq-math-mode .mq-operator-name{font-family:Symbola,Times New Roman,serif;font-style:normal;line-height:.9}.mq-math-mode var.mq-operator-name.mq-first{padding-left:.2em}.mq-math-mode var.mq-operator-name.mq-last,.mq-math-mode .mq-supsub.mq-after-operator-name{padding-right:.2em}.mq-math-mode .mq-fraction{text-align:center;vertical-align:-.4em;padding:0 .2em;font-size:90%}.mq-math-mode .mq-fraction,.mq-math-mode .mq-large-operator{display:-moz-groupbox}.mq-math-mode x:-moz-any-link{display:-moz-groupbox}.mq-math-mode .mq-fraction,.mq-math-mode .mq-large-operator,.mq-math-mode x:default{display:inline-block}.mq-math-mode x:-moz-any-link{display:inline-block}.mq-math-mode .mq-underset.mq-tilde-vector .mq-under{line-height:.6em}.mq-math-mode .mq-numerator,.mq-math-mode .mq-denominator,.mq-math-mode .mq-dot-recurring,.mq-math-mode .mq-over,.mq-math-mode .mq-under{display:block}.mq-math-mode .mq-numerator,.mq-math-mode .mq-over{margin-bottom:.2em;padding:0 .1em}.mq-math-mode .mq-denominator{float:right;border-top:1px solid;width:100%;padding:.3em .1em .1em}.mq-math-mode .mq-dot-recurring{text-align:center;height:.6em}.mq-math-mode .mq-overunder{text-align:center;position:relative;top:.01em}.mq-math-mode .mq-overunder .mq-font{font-family:inherit}.mq-math-mode .mq-overunder.mq-underset{vertical-align:text-top}.mq-math-mode .mq-overunder.mq-underset .mq-under,.mq-math-mode .mq-overunder.mq-overset .mq-over{font-size:.7em;display:block}.mq-math-mode .mq-sqrt-prefix{vertical-align:top;transform-origin:top;padding-top:0;position:relative;top:.1em}.mq-math-mode .mq-sqrt-stem{border-top:1px solid;margin-top:1px;margin-right:.1em;padding-top:1px;padding-left:.15em;padding-right:.2em}.mq-math-mode .mq-diacritic-above{text-align:center;line-height:.4em;display:block}.mq-math-mode .mq-diacritic-stem{text-align:center;display:block}.mq-math-mode .mq-hat-prefix{text-align:center;margin-bottom:-.7em;line-height:.95em;display:block;transform:scaleX(1.5)}.mq-math-mode .mq-hat-stem{display:block}.mq-math-mode .mq-large-operator{vertical-align:-.2em;text-align:center;vertical-align:middle;padding:.2em}.mq-math-mode .mq-large-operator .mq-from,.mq-math-mode .mq-large-operator big,.mq-math-mode .mq-large-operator .mq-to{display:block}.mq-math-mode .mq-large-operator .mq-from,.mq-math-mode .mq-large-operator .mq-to{font-size:80%}.mq-math-mode .mq-large-operator .mq-from{float:right;width:100%}.mq-math-mode .mq-lim{text-align:center}.mq-math-mode .mq-lim span{display:block}.mq-math-mode .mq-lim .mq-approaches{float:right;width:100%;font-size:80%}.mq-math-mode .mq-lim .mq-approaches span>span{display:inline}.mq-math-mode .mq-matrix{vertical-align:middle;margin-left:.1em;margin-right:.1em}.mq-math-mode .mq-matrix table{border-spacing:3px;border-collapse:separate;border-bottom:none;width:auto}.mq-math-mode .mq-matrix table.mq-rows-1{vertical-align:middle;margin-bottom:1px}.mq-math-mode .mq-matrix td{vertical-align:baseline;border:1px dotted #fff;width:auto;padding:.1em .3em}.mq-math-mode .mq-matrix td.mq-empty{border:1px dotted #000}.mq-math-mode .mq-abs{border-left:1px solid #000;border-right:1px solid #000;margin-left:.1em;margin-right:.1em;padding-left:.2em;padding-right:.2em}.mq-math-mode .mq-lrnplaceholder{margin-left:.05em;margin-right:.05em}.mq-math-mode .mq-parallelogram{margin-top:-.5em;line-height:1em;position:relative;overflow:hidden}.mq-math-mode .mq-parallelogram .mq-parallelogram-inner{font-size:2em;position:relative;top:.23em}.mq-math-mode,.mq-math-mode .mq-editable-field{cursor:text;font-family:Symbola,Times New Roman,serif}.mq-math-mode .mq-longdiv .mq-longdiv-curve-border,.mq-math-mode .mq-editable-field .mq-longdiv .mq-longdiv-curve-border{font-size:1.33em}.mq-overarrow{text-align:center;border-top:1px solid #000;min-width:.5em;margin-top:1px;padding-top:.2em}.mq-overarrow:before{content:\"➤\";text-align:right;font-size:.5em;line-height:0;display:block;position:relative;top:-.34em}.mq-overarrow.mq-arrow-left:before{filter:FlipH;-ms-filter:\"FlipH\";transform:scaleX(-1)}.mq-overarrow.mq-arrow-both{vertical-align:text-bottom}.mq-overarrow.mq-arrow-both.mq-empty{min-height:1.23em}.mq-overarrow.mq-arrow-both.mq-empty:after{top:-.34em}.mq-overarrow.mq-arrow-both:before{filter:FlipH;-ms-filter:\"FlipH\";transform:scaleX(-1)}.mq-overarrow.mq-arrow-both:after{content:\"➤\";visibility:visible;text-align:right;font-size:.5em;line-height:0;display:block;position:relative;top:-2.3em}.mq-math-mode .mq-selection,.mq-editable-field .mq-selection,.mq-math-mode .mq-selection .mq-non-leaf,.mq-editable-field .mq-selection .mq-non-leaf,.mq-math-mode .mq-selection .mq-scaled,.mq-editable-field .mq-selection .mq-scaled{color:highlighttext;border-color:highlighttext;background:highlight!important}.mq-math-mode .mq-selection .mq-matrixed,.mq-editable-field .mq-selection .mq-matrixed{background:#39f!important}.mq-math-mode .mq-selection .mq-matrixed-container,.mq-editable-field .mq-selection .mq-matrixed-container{filter:progid:DXImageTransform.Microsoft.Chroma(color=\"#3399FF\")!important}.mq-math-mode .mq-selection.mq-blur,.mq-editable-field .mq-selection.mq-blur,.mq-math-mode .mq-selection.mq-blur .mq-non-leaf,.mq-editable-field .mq-selection.mq-blur .mq-non-leaf,.mq-math-mode .mq-selection.mq-blur .mq-scaled,.mq-editable-field .mq-selection.mq-blur .mq-scaled,.mq-math-mode .mq-selection.mq-blur .mq-matrixed,.mq-editable-field .mq-selection.mq-blur .mq-matrixed{color:#000;border-color:#000;background:#d4d4d4!important}.mq-math-mode .mq-selection.mq-blur .mq-matrixed-container,.mq-editable-field .mq-selection.mq-blur .mq-matrixed-container{filter:progid:DXImageTransform.Microsoft.Chroma(color=\"#D4D4D4\")!important}.mq-editable-field .mq-textarea,.mq-math-mode .mq-textarea{-webkit-user-select:text;user-select:text;position:relative}.mq-editable-field .mq-textarea>textarea,.mq-math-mode .mq-textarea>textarea{opacity:0;overflow:hidden}.mq-editable-field .mq-textarea *,.mq-math-mode .mq-textarea *,.mq-editable-field .mq-selectable,.mq-math-mode .mq-selectable{-webkit-user-select:text;user-select:text;clip:rect(1em 1em 1em 1em);resize:none;box-sizing:content-box;width:1px;height:1px;position:absolute;transform:scale(0)}.mq-math-mode .mq-matrixed{background:#fff;display:inline-block}.mq-math-mode .mq-matrixed-container{filter:progid:DXImageTransform.Microsoft.Chroma(color=\"white\");margin-top:-.1em}.mq-math-mode .mq-matrix table{border-spacing:2px}button .mq-math-mode .mq-matrix table.mq-rows-2 td,button .mq-math-mode .mq-matrix table.mq-rows-3 td{width:.9em;font-size:.3em}button .mq-math-mode .mq-matrix table.mq-rows-2{margin-bottom:-2px}button .mq-math-mode .mq-matrix table.mq-rows-1{margin-bottom:3px}button .mq-math-mode .mq-matrix table.mq-rows-1 td{width:1.1em;margin-bottom:3px;font-size:.6em}button .mq-math-mode .mq-matrix .matrix-edit-content-row{text-align:center;vertical-align:middle;display:inline-block}button .mq-math-mode .mq-matrix .matrix-edit-content-row p{font-size:.7em}button .mq-math-mode .mq-matrix .matrix-edit-content-col{text-align:center;vertical-align:middle;display:inline-block}button .mq-math-mode .mq-matrix .matrix-edit-content-col p{padding:0 .15em;font-size:.7em}button .mq-math-mode .mq-matrix .mq-paren{padding:0;display:inline-block;transform:scale(1.13,1.77)}button .matrix-edit .mq-empty{width:.8em;margin:.1em;padding:.1em;font-size:.4em}\n"]]);
|
|
19
19
|
import { i as e, r as t, t as n } from "../rolldown-runtime-CWhphoD1.js";
|
|
20
|
-
import { $ as r, A as i, At as a, B as o, C as s, Ct as c, D as l, Dt as u, E as d, Et as f, F as p, Ft as m, G as h, H as g, I as _, It as v, J as y, K as b, L as x, Lt as S, M as C, Mt as w, N as ee, Nt as T, O as te, Ot as E, P as ne, Pt as re, Q as D, R as O, Rt as ie, St as ae, T as oe, Tt as k, U as se, V as ce, W as le, X as ue, Y as de, Z as fe, _ as pe, _t as me, a as he, at as ge, b as _e, bt as A, c as ve, ct as ye, et as be, ft as xe, g as Se, gt as Ce, h as we, ht as Te, i as Ee, it as De, j as Oe, jt as ke, kt as Ae, l as je, lt as Me, mt as Ne, n as Pe, nt as Fe, ot as Ie, pt as j, q as Le, r as Re, rt as ze, s as Be, st as Ve, t as He, tt as Ue, u as We, ut as M, v as Ge, vt as Ke, w as qe, wt as Je, x as Ye, xt as Xe, y as Ze, yt as Qe, z as $e } from "../Close-
|
|
20
|
+
import { $ as r, A as i, At as a, B as o, C as s, Ct as c, D as l, Dt as u, E as d, Et as f, F as p, Ft as m, G as h, H as g, I as _, It as v, J as y, K as b, L as x, Lt as S, M as C, Mt as w, N as ee, Nt as T, O as te, Ot as E, P as ne, Pt as re, Q as D, R as O, Rt as ie, St as ae, T as oe, Tt as k, U as se, V as ce, W as le, X as ue, Y as de, Z as fe, _ as pe, _t as me, a as he, at as ge, b as _e, bt as A, c as ve, ct as ye, et as be, ft as xe, g as Se, gt as Ce, h as we, ht as Te, i as Ee, it as De, j as Oe, jt as ke, kt as Ae, l as je, lt as Me, mt as Ne, n as Pe, nt as Fe, ot as Ie, pt as j, q as Le, r as Re, rt as ze, s as Be, st as Ve, t as He, tt as Ue, u as We, ut as M, v as Ge, vt as Ke, w as qe, wt as Je, x as Ye, xt as Xe, y as Ze, yt as Qe, z as $e } from "../Close-BVNoz0Wj.js";
|
|
21
21
|
import { _ as et, a as tt, c as nt, d as rt, f as it, g as at, h as ot, i as st, m as ct, n as lt, o as ut, p as dt, r as ft, t as pt, u as mt, v as ht, y as gt } from "../dist-BJd6t-uW.js";
|
|
22
22
|
import * as N from "react";
|
|
23
23
|
import _t, { Component as vt, createContext as yt, createElement as bt, createRef as xt, forwardRef as St, memo as Ct, useCallback as wt, useContext as Tt, useDebugValue as Et, useEffect as Dt, useLayoutEffect as Ot, useMemo as kt, useRef as At, useState as jt, version as Mt } from "react";
|
|
@@ -32,7 +32,7 @@ async function l(e, t, n, r = "value") {
|
|
|
32
32
|
let a = s(e);
|
|
33
33
|
if (n && typeof n == "function") try {
|
|
34
34
|
let e = o(a.map((e) => e[r]));
|
|
35
|
-
c(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(a)}, key: ${r}`) :
|
|
35
|
+
c(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(a)}, key: ${r}`) : await n(t.id, t.element, { shuffledValues: e });
|
|
36
36
|
} catch (e) {
|
|
37
37
|
console.warn("Unable to save shuffled order for choices"), console.error(e);
|
|
38
38
|
}
|
|
@@ -40,7 +40,7 @@ async function l(e, t, n, r = "value") {
|
|
|
40
40
|
return a;
|
|
41
41
|
}
|
|
42
42
|
function u(e, t, n) {
|
|
43
|
-
return !!(e.lockChoiceOrder || n["@pie-element"]?.lockChoiceOrder
|
|
43
|
+
return !!(e.lockChoiceOrder || n?.["@pie-element"]?.lockChoiceOrder);
|
|
44
44
|
}
|
|
45
45
|
var d = /* @__PURE__ */ a({ enabled: () => f });
|
|
46
46
|
function f(e, t, n) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/controller-utils/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" && Object.keys(e).length === 0;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n != \"boolean\" || n;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/inline-dropdown/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n alternateResponse: {},\n choiceRationaleEnabled: true,\n choices: {},\n disabled: false,\n displayType: 'block',\n markup: '',\n mode: 'gather',\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n shuffle: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/inline-dropdown/controller/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { forEach } from '@pie-element/shared-lodash';\n\nexport const getAllCorrectResponses = ({ choices, alternateResponse }) => {\n alternateResponse = alternateResponse || {};\n const correctAnswers = {};\n\n forEach(choices, (respArea, key) => {\n if (!correctAnswers[key]) {\n correctAnswers[key] = [];\n }\n\n if (respArea) {\n respArea.forEach((choice) => {\n if (choice.correct) {\n correctAnswers[key].push(choice.value);\n\n if (alternateResponse[key]) {\n correctAnswers[key] = [...correctAnswers[key], ...alternateResponse[key]];\n }\n }\n });\n }\n });\n\n return correctAnswers;\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/inline-dropdown/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { isEmpty, map, reduce } from '@pie-element/shared-lodash';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-element/shared-controller-utils';\nimport defaults from './defaults.js';\n\nimport { getAllCorrectResponses } from './utils.js';\n\nconst getFeedback = (correct) => {\n if (correct) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport async function model(question, session, env, updateSession) {\n const normalizedQuestion = normalize(question);\n const { value = {} } = session || {};\n let choices = reduce(\n normalizedQuestion.choices,\n (obj, area, key) => {\n obj[key] = map(area, (choice) => choice);\n\n return obj;\n },\n {},\n );\n\n let feedback = {};\n\n if (env.mode === 'evaluate') {\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n const respAreaLength = Object.keys(allCorrectResponses).length;\n let correctResponses = 0;\n\n for (let i = 0; i < respAreaLength; i++) {\n const result = reduce(\n allCorrectResponses,\n (obj, choices, key) => {\n const answer = (value && value[key]) || '';\n const correctChoice = choices[i] || '';\n const isCorrect = answer && correctChoice && correctChoice === answer;\n\n obj.feedback[key] = getFeedback(isCorrect);\n\n if (isCorrect) {\n obj.correctResponses += 1;\n }\n\n return obj;\n },\n { correctResponses: 0, feedback: {} },\n );\n\n if (result.correctResponses >= correctResponses) {\n correctResponses = result.correctResponses;\n feedback = result.feedback;\n }\n\n if (result.correctResponses === respAreaLength) {\n break;\n }\n }\n }\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n const shuffledValues = {};\n const keys = Object.keys(choices);\n\n const us = (part) => (id, element, update) => {\n return new Promise((resolve) => {\n shuffledValues[part] = update.shuffledValues;\n resolve();\n });\n };\n\n let i;\n\n for (i = 0; i < keys.length; i++) {\n const key = keys[i];\n const storedValues = session?.shuffledValues?.[key];\n\n choices[key] = await getShuffledChoices(\n choices[key],\n // the shuffledValues structure was updated to an object like { choice_key: [] }\n // and we need to override shuffledValues if it's not an array\n { shuffledValues: Array.isArray(storedValues) ? storedValues : [] },\n us(key),\n 'value',\n );\n }\n\n if (!isEmpty(shuffledValues)) {\n if (session && updateSession && typeof updateSession === 'function') {\n updateSession(session.id, session.element, {\n shuffledValues,\n }).catch((e) => {\n // eslint-disable-next-line no-console\n console.error('update session failed', e);\n });\n }\n }\n }\n\n let teacherInstructions = null;\n let rationale = null;\n\n const choicesWillNullRationales = (Object.keys(choices) || []).reduce((acc, currentValue) => {\n acc[currentValue] = (choices[currentValue] || []).map((choice) => ({\n ...choice,\n rationale: null,\n }));\n\n return acc;\n }, {});\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n\n choices = normalizedQuestion.choiceRationaleEnabled ? normalizedQuestion.choices : choicesWillNullRationales;\n } else {\n rationale = null;\n teacherInstructions = null;\n choices = choicesWillNullRationales;\n }\n\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n displayType: normalizedQuestion.displayType,\n markup: normalizedQuestion.markup,\n choices,\n feedback,\n\n responseCorrect: env.mode === 'evaluate' ? getScore(normalizedQuestion, session) === 1 : undefined,\n rationale,\n teacherInstructions,\n language: normalizedQuestion.language,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n };\n\n return out;\n}\n\nexport const getScore = (config, session) => {\n const { value = {} } = session || {};\n const maxScore = config && config.choices ? Object.keys(config.choices).length : 0;\n const allCorrectResponses = getAllCorrectResponses(config);\n let correctCount = 0;\n\n for (let i = 0; i < maxScore; i++) {\n const result = reduce(\n allCorrectResponses,\n (total, choices, key) => {\n const answer = (value && value[key]) || '';\n const correctChoice = choices[i] || '';\n\n if (correctChoice && answer && correctChoice === answer) {\n return total;\n }\n\n return total - 1;\n },\n maxScore,\n );\n\n if (result > correctCount) {\n correctCount = result;\n }\n\n if (result === maxScore) {\n break;\n }\n }\n\n const str = (correctCount / maxScore).toFixed(2);\n\n return parseFloat(str);\n};\n\n/**\n * Generates detailed trace log for scoring evaluation\n * @param {Object} model - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array} traceLog - array of trace messages\n */\nexport const getLogTrace = (model, session, env) => {\n const traceLog = [];\n const { value = {} } = session || {};\n const allCorrectResponses = getAllCorrectResponses(model);\n const responseAreaKeys = Object.keys(allCorrectResponses);\n const totalAreas = responseAreaKeys.length;\n \n traceLog.push(`${totalAreas} dropdown response area(s) defined in this question.`);\n \n if (value && Object.keys(value).length > 0) {\n const selectedAreas = Object.entries(value).filter(([key, val]) => val && val.trim()).length;\n traceLog.push(`Student selected options in ${selectedAreas} out of ${totalAreas} dropdown(s).`);\n \n responseAreaKeys.forEach((areaKey) => {\n const studentSelection = (value && value[areaKey]) || '';\n const correctOptions = allCorrectResponses[areaKey] || [];\n \n if (studentSelection.trim()) {\n traceLog.push(`Dropdown ${parseInt(areaKey) + 1}: student selected '${studentSelection}' (correct options: [${correctOptions.map(opt => `'${opt}'`).join(', ')}]).`);\n } else {\n traceLog.push(`Dropdown ${parseInt(areaKey) + 1}: no selection made (correct options: [${correctOptions.map(opt => `'${opt}'`).join(', ')}]).`);\n }\n });\n } else {\n traceLog.push('Student did not make any selections in the dropdowns.');\n }\n\n const partialScoringEnabled = partialScoring.enabled(model, env);\n traceLog.push(\n `Scoring method: ${\n partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring'\n }.`\n );\n\n const score = getScore(model, session);\n traceLog.push(`Final score: ${score}.`);\n\n return traceLog;\n}\n\n/**\n *\n * The score is partial by default for checkbox mode, allOrNothing for radio mode.\n * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =\n * false. the value in `env` will override the value in `model`.\n * @param {Object} model - the main model\n * @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)\n * @param {*} session\n * @param {Object} env\n * @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides\n * `model.partialScoring`.\n */\nexport function outcome(model, session, env = {}) {\n return new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n traceLog: ['Student did not make any selections in the dropdowns. Score is 0.'] \n });\n } else {\n const traceLog = getLogTrace(model, session, env);\n const score = getScore(model, session);\n const partialScoringEnabled = partialScoring.enabled(model, env);\n\n resolve({\n score: partialScoringEnabled ? score : Math.floor(score),\n empty: false,\n traceLog\n });\n }\n });\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { choices } = question;\n const value = {};\n\n if (choices) {\n Object.keys(choices).forEach((key, i) => {\n const correctChoices = choices[key] && choices[key].filter((c) => c.correct);\n\n value[i] = correctChoices && correctChoices[0].value;\n });\n }\n\n resolve({\n id: '1',\n value,\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { markup, choices } = model;\n const { maxResponseAreas, maxResponseAreaChoices } = config;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const nbOfResponseAreas = ((markup || '').match(/\\{\\{(\\d+)\\}\\}/g) || []).length;\n\n if (nbOfResponseAreas > maxResponseAreas) {\n errors.responseAreasError = `No more than ${maxResponseAreas} response areas should be defined.`;\n } else if (nbOfResponseAreas < 1) {\n errors.responseAreasError = 'There should be defined at least 1 response area.';\n }\n\n (Object.keys(choices) || []).forEach((choiceKey) => {\n if (choices[choiceKey] && choices[choiceKey].length > maxResponseAreaChoices) {\n errors.responseAreaChoicesError = `No more than ${maxResponseAreaChoices} choices per response area should be defined.`;\n }\n });\n\n return errors;\n};\n"],"mappings":";;AACA,IAAI,IAAI,OAAO,gBAAgB,KAAK,GAAG,MAAM;CAC5C,IAAI,IAAI,CAAC;CACT,KAAK,IAAI,KAAK,GAAG,EAAE,GAAG,GAAG;EACxB,KAAK,EAAE;EACP,YAAY,CAAC;CACd,CAAC;CACD,OAAO,KAAK,EAAE,GAAG,OAAO,aAAa,EAAE,OAAO,SAAS,CAAC,GAAG;AAC5D;AAGA,SAAS,EAAE,GAAG;CACb,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,QAAQ,MAAM,KAAK,IAAI,IAAI,CAAC;AACzD;AACA,SAAS,EAAE,GAAG;CACb,IAAI,IAAI,CAAC,GAAG,CAAC;CACb,KAAK,IAAI,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,KAAK;EACtC,IAAI,IAAI,KAAK,MAAM,KAAK,OAAO,KAAK,IAAI,EAAE;EAC1C,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE;CAC3B;CACA,OAAO;AACR;AACA,SAAS,EAAE,GAAG;CACb,OAAO,KAAK,OAAO,CAAC,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,WAAW,IAAI,OAAO,KAAK,YAAY,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,CAAO,CAAC,CAAC,SAAS,GAAK,MAAM;GACvC,IAAM,IAAiB,EAAQ,MAAQ,EAAQ,EAAI,CAAC,QAAQ,MAAM,EAAE,OAAO;GAE3E,EAAM,KAAK,KAAkB,EAAe,EAAE,CAAC;EACjD,CAAC,GAGH,EAAQ;GACN,IAAI;GACJ;EACF,CAAC;CACH,OACE,EAAQ,IAAI;AAEhB,CAAC,GAOG,KAAc,OAAU,KAAQ,GAAA,CAAI,QAAQ,sCAAsC,EAAE,GAE7E,KAAY,IAAQ,CAAC,GAAG,IAAS,CAAC,MAAM;CACnD,IAAM,EAAE,WAAQ,eAAY,GACtB,EAAE,qBAAkB,8BAA2B,GAC/C,IAAS,CAAC;CAEhB;EAAC;EAAuB;EAAU;CAAW,CAAC,CAAC,SAAS,MAAU;EAChE,AAAI,EAAO,EAAM,EAAE,YAAY,CAAC,EAAW,EAAM,EAAM,MACrD,EAAO,KAAS;CAEpB,CAAC;CAED,IAAM,MAAsB,KAAU,GAAA,CAAI,MAAM,gBAAgB,KAAK,CAAC,EAAA,CAAG;CAczE,OAZI,IAAoB,IACtB,EAAO,qBAAqB,gBAAgB,EAAiB,sCACpD,IAAoB,MAC7B,EAAO,qBAAqB,uDAG7B,OAAO,KAAK,CAAO,KAAK,CAAC,EAAA,CAAG,SAAS,MAAc;EAClD,AAAI,EAAQ,MAAc,EAAQ,EAAU,CAAC,SAAS,MACpD,EAAO,2BAA2B,gBAAgB,EAAuB;CAE7E,CAAC,GAEM;AACT"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/controller-utils/dist/index.js","../../../src/controller/defaults.ts","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" && Object.keys(e).length === 0;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n?.[\"@pie-element\"]?.lockChoiceOrder);\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n != \"boolean\" || n;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/inline-dropdown/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n alternateResponse: {},\n choiceRationaleEnabled: true,\n choices: {},\n disabled: false,\n displayType: 'block',\n markup: '',\n mode: 'gather',\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n shuffle: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/inline-dropdown/controller/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { forEach } from '@pie-element/shared-lodash';\n\nexport const getAllCorrectResponses = ({ choices, alternateResponse }) => {\n alternateResponse = alternateResponse || {};\n const correctAnswers = {};\n\n forEach(choices, (respArea, key) => {\n if (!correctAnswers[key]) {\n correctAnswers[key] = [];\n }\n\n if (respArea) {\n respArea.forEach((choice) => {\n if (choice.correct) {\n correctAnswers[key].push(choice.value);\n\n if (alternateResponse[key]) {\n correctAnswers[key] = [...correctAnswers[key], ...alternateResponse[key]];\n }\n }\n });\n }\n });\n\n return correctAnswers;\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/inline-dropdown/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { isEmpty, map, reduce } from '@pie-element/shared-lodash';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-element/shared-controller-utils';\nimport defaults from './defaults.js';\n\nimport { getAllCorrectResponses } from './utils.js';\n\nconst getFeedback = (correct) => {\n if (correct) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport async function model(question, session, env, updateSession) {\n const normalizedQuestion = normalize(question);\n const { value = {} } = session || {};\n let choices = reduce(\n normalizedQuestion.choices,\n (obj, area, key) => {\n obj[key] = map(area, (choice) => choice);\n\n return obj;\n },\n {},\n );\n\n let feedback = {};\n\n if (env.mode === 'evaluate') {\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n const respAreaLength = Object.keys(allCorrectResponses).length;\n let correctResponses = 0;\n\n for (let i = 0; i < respAreaLength; i++) {\n const result = reduce(\n allCorrectResponses,\n (obj, choices, key) => {\n const answer = (value && value[key]) || '';\n const correctChoice = choices[i] || '';\n const isCorrect = answer && correctChoice && correctChoice === answer;\n\n obj.feedback[key] = getFeedback(isCorrect);\n\n if (isCorrect) {\n obj.correctResponses += 1;\n }\n\n return obj;\n },\n { correctResponses: 0, feedback: {} },\n );\n\n if (result.correctResponses >= correctResponses) {\n correctResponses = result.correctResponses;\n feedback = result.feedback;\n }\n\n if (result.correctResponses === respAreaLength) {\n break;\n }\n }\n }\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n const shuffledValues = {};\n const keys = Object.keys(choices);\n\n const us = (part) => (id, element, update) => {\n return new Promise((resolve) => {\n shuffledValues[part] = update.shuffledValues;\n resolve();\n });\n };\n\n let i;\n\n for (i = 0; i < keys.length; i++) {\n const key = keys[i];\n const storedValues = session?.shuffledValues?.[key];\n\n choices[key] = await getShuffledChoices(\n choices[key],\n // the shuffledValues structure was updated to an object like { choice_key: [] }\n // and we need to override shuffledValues if it's not an array\n { shuffledValues: Array.isArray(storedValues) ? storedValues : [] },\n us(key),\n 'value',\n );\n }\n\n if (!isEmpty(shuffledValues)) {\n if (session && updateSession && typeof updateSession === 'function') {\n updateSession(session.id, session.element, {\n shuffledValues,\n }).catch((e) => {\n // eslint-disable-next-line no-console\n console.error('update session failed', e);\n });\n }\n }\n }\n\n let teacherInstructions = null;\n let rationale = null;\n\n const choicesWillNullRationales = (Object.keys(choices) || []).reduce((acc, currentValue) => {\n acc[currentValue] = (choices[currentValue] || []).map((choice) => ({\n ...choice,\n rationale: null,\n }));\n\n return acc;\n }, {});\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n\n choices = normalizedQuestion.choiceRationaleEnabled ? normalizedQuestion.choices : choicesWillNullRationales;\n } else {\n rationale = null;\n teacherInstructions = null;\n choices = choicesWillNullRationales;\n }\n\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n displayType: normalizedQuestion.displayType,\n markup: normalizedQuestion.markup,\n choices,\n feedback,\n\n responseCorrect: env.mode === 'evaluate' ? getScore(normalizedQuestion, session) === 1 : undefined,\n rationale,\n teacherInstructions,\n language: normalizedQuestion.language,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n };\n\n return out;\n}\n\nexport const getScore = (config, session) => {\n const { value = {} } = session || {};\n const maxScore = config && config.choices ? Object.keys(config.choices).length : 0;\n const allCorrectResponses = getAllCorrectResponses(config);\n let correctCount = 0;\n\n for (let i = 0; i < maxScore; i++) {\n const result = reduce(\n allCorrectResponses,\n (total, choices, key) => {\n const answer = (value && value[key]) || '';\n const correctChoice = choices[i] || '';\n\n if (correctChoice && answer && correctChoice === answer) {\n return total;\n }\n\n return total - 1;\n },\n maxScore,\n );\n\n if (result > correctCount) {\n correctCount = result;\n }\n\n if (result === maxScore) {\n break;\n }\n }\n\n const str = (correctCount / maxScore).toFixed(2);\n\n return parseFloat(str);\n};\n\n/**\n * Generates detailed trace log for scoring evaluation\n * @param {Object} model - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array} traceLog - array of trace messages\n */\nexport const getLogTrace = (model, session, env) => {\n const traceLog = [];\n const { value = {} } = session || {};\n const allCorrectResponses = getAllCorrectResponses(model);\n const responseAreaKeys = Object.keys(allCorrectResponses);\n const totalAreas = responseAreaKeys.length;\n \n traceLog.push(`${totalAreas} dropdown response area(s) defined in this question.`);\n \n if (value && Object.keys(value).length > 0) {\n const selectedAreas = Object.entries(value).filter(([key, val]) => val && val.trim()).length;\n traceLog.push(`Student selected options in ${selectedAreas} out of ${totalAreas} dropdown(s).`);\n \n responseAreaKeys.forEach((areaKey) => {\n const studentSelection = (value && value[areaKey]) || '';\n const correctOptions = allCorrectResponses[areaKey] || [];\n \n if (studentSelection.trim()) {\n traceLog.push(`Dropdown ${parseInt(areaKey) + 1}: student selected '${studentSelection}' (correct options: [${correctOptions.map(opt => `'${opt}'`).join(', ')}]).`);\n } else {\n traceLog.push(`Dropdown ${parseInt(areaKey) + 1}: no selection made (correct options: [${correctOptions.map(opt => `'${opt}'`).join(', ')}]).`);\n }\n });\n } else {\n traceLog.push('Student did not make any selections in the dropdowns.');\n }\n\n const partialScoringEnabled = partialScoring.enabled(model, env);\n traceLog.push(\n `Scoring method: ${\n partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring'\n }.`\n );\n\n const score = getScore(model, session);\n traceLog.push(`Final score: ${score}.`);\n\n return traceLog;\n}\n\n/**\n *\n * The score is partial by default for checkbox mode, allOrNothing for radio mode.\n * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =\n * false. the value in `env` will override the value in `model`.\n * @param {Object} model - the main model\n * @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)\n * @param {*} session\n * @param {Object} env\n * @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides\n * `model.partialScoring`.\n */\nexport function outcome(model, session, env = {}) {\n return new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n traceLog: ['Student did not make any selections in the dropdowns. Score is 0.'] \n });\n } else {\n const traceLog = getLogTrace(model, session, env);\n const score = getScore(model, session);\n const partialScoringEnabled = partialScoring.enabled(model, env);\n\n resolve({\n score: partialScoringEnabled ? score : Math.floor(score),\n empty: false,\n traceLog\n });\n }\n });\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { choices } = question;\n const value = {};\n\n if (choices) {\n Object.keys(choices).forEach((key, i) => {\n const correctChoices = choices[key] && choices[key].filter((c) => c.correct);\n\n value[i] = correctChoices && correctChoices[0].value;\n });\n }\n\n resolve({\n id: '1',\n value,\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { markup, choices } = model;\n const { maxResponseAreas, maxResponseAreaChoices } = config;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const nbOfResponseAreas = ((markup || '').match(/\\{\\{(\\d+)\\}\\}/g) || []).length;\n\n if (nbOfResponseAreas > maxResponseAreas) {\n errors.responseAreasError = `No more than ${maxResponseAreas} response areas should be defined.`;\n } else if (nbOfResponseAreas < 1) {\n errors.responseAreasError = 'There should be defined at least 1 response area.';\n }\n\n (Object.keys(choices) || []).forEach((choiceKey) => {\n if (choices[choiceKey] && choices[choiceKey].length > maxResponseAreaChoices) {\n errors.responseAreaChoicesError = `No more than ${maxResponseAreaChoices} choices per response area should be defined.`;\n }\n });\n\n return errors;\n};\n"],"mappings":";;AACA,IAAI,IAAI,OAAO,gBAAgB,KAAK,GAAG,MAAM;CAC5C,IAAI,IAAI,CAAC;CACT,KAAK,IAAI,KAAK,GAAG,EAAE,GAAG,GAAG;EACxB,KAAK,EAAE;EACP,YAAY,CAAC;CACd,CAAC;CACD,OAAO,KAAK,EAAE,GAAG,OAAO,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qBAAqB,uDAG7B,OAAO,KAAK,CAAO,KAAK,CAAC,EAAA,CAAG,SAAS,MAAc;EAClD,AAAI,EAAQ,MAAc,EAAQ,EAAU,CAAC,SAAS,MACpD,EAAO,2BAA2B,gBAAgB,EAAuB;CAE7E,CAAC,GAEM;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as e } from "../rolldown-runtime-CWhphoD1.js";
|
|
2
|
-
import { It as t, L as n, Rt as r, S as i, a, d as o, dt as s, f as c, i as l, j as u, k as d, m as f, n as p, o as m, p as h, pt as g, t as _, ut as v, v as y, w as b } from "../Close-
|
|
2
|
+
import { It as t, L as n, Rt as r, S as i, a, d as o, dt as s, f as c, i as l, j as u, k as d, m as f, n as p, o as m, p as h, pt as g, t as _, ut as v, v as y, w as b } from "../Close-BVNoz0Wj.js";
|
|
3
3
|
import { _ as x, o as S } from "../dist-BJd6t-uW.js";
|
|
4
4
|
import C, { useRef as w } from "react";
|
|
5
5
|
import { createRoot as T } from "react-dom/client";
|
|
@@ -92,10 +92,16 @@ function te(e) {
|
|
|
92
92
|
function ne(e = {}) {
|
|
93
93
|
let t = e.useSingleDollar ?? !1;
|
|
94
94
|
return async (n) => {
|
|
95
|
-
if (typeof window > "u"
|
|
96
|
-
|
|
97
|
-
let r =
|
|
98
|
-
|
|
95
|
+
if (typeof window > "u") return;
|
|
96
|
+
T(n);
|
|
97
|
+
let r = te(e);
|
|
98
|
+
if (!E(n, t)) {
|
|
99
|
+
r.catch(() => {});
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
await r;
|
|
103
|
+
let i = C();
|
|
104
|
+
await i?.startup?.promise, typeof i?.typesetPromise == "function" && await i.typesetPromise([n]);
|
|
99
105
|
};
|
|
100
106
|
}
|
|
101
107
|
var A = "@pie-lib/math-rendering", j = "@pie-lib/math-rendering@2", M = null;
|
|
@@ -9002,4 +9008,4 @@ var Np = (e, t) => {
|
|
|
9002
9008
|
//#endregion
|
|
9003
9009
|
export { dl as $, cd as A, On as At, vu as B, of as C, mi as Ct, kd as D, Yr as Dt, Nd as E, H as Et, Au as F, le as Ft, $l as G, su as H, ku as I, ce as It, Fl as J, ql as K, Ou as L, ae as Lt, Pu as M, nn as Mt, Mu as N, rn as Nt, fd as O, Lr as Ot, ju as P, ue as Pt, hl as Q, $ as R, P as Rt, mf as S, Ri as St, Gd as T, ei as Tt, ou as U, cu as V, nu as W, bl as X, Pl as Y, gl as Z, Mf as _, Ao as _t, Sp as a, tl as at, yf as b, ya as bt, op as c, Qc as ct, Qf as d, os as dt, ll as et, Xf as f, Bo as ft, Lf as g, jo as gt, Bf as h, Mo as ht, Cp as i, nl as it, Gu as j, yn as jt, dd as k, An as kt, np as l, Zc as lt, Gf as m, No as mt, Ip as n, il as nt, xp as o, el as ot, Kf as p, J as pt, Kl as q, jp as r, rl as rt, bp as s, $c as st, Lp as t, ul as tt, tp as u, Hs as ut, Af as v, ko as vt, rf as w, U as wt, vf as x, Ki as xt, bf as y, Sa as yt, Su as z };
|
|
9004
9010
|
|
|
9005
|
-
//# sourceMappingURL=Close-
|
|
9011
|
+
//# sourceMappingURL=Close-DAVMI303.js.map
|