@pie-element/math-inline 13.0.4-next.20261011174919 → 13.0.4

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.
@@ -37654,14 +37654,14 @@ function j_(e, t) {
37654
37654
  allowTrailingZeros: e.allowTrailingZeros || !1,
37655
37655
  ignoreOrder: e.ignoreOrder || !1
37656
37656
  });
37657
- let i = [e.answer].concat(Object.keys(e.alternates || {}).map((t) => e.alternates[t]));
37658
- for (let e = 0; e < i.length; e++) try {
37659
- if (D_.latexEqual(t, i[e], r)) {
37657
+ let i = e.alternates || {}, a = [e.answer].concat(Object.keys(i).map((e) => i[e]));
37658
+ for (let e = 0; e < a.length; e++) try {
37659
+ if (D_.latexEqual(t, a[e], r)) {
37660
37660
  n = !0;
37661
37661
  break;
37662
37662
  }
37663
37663
  } catch (n) {
37664
- k_("Parse failure when evaluating math", i[e], t, n);
37664
+ k_("Parse failure when evaluating math", a[e], t, n);
37665
37665
  continue;
37666
37666
  }
37667
37667
  }), n;
@@ -37690,8 +37690,8 @@ var P_ = (e, t, n) => {
37690
37690
  let e = t.allowTrailingZeros || !1, n = t.ignoreOrder || !1;
37691
37691
  r.push(`Allow trailing zeros: ${e ? "enabled" : "disabled"}.`), r.push(`Ignore order: ${n ? "enabled" : "disabled"}.`);
37692
37692
  }
37693
- let a = [t.answer].concat(Object.keys(t.alternates || {}).map((e) => t.alternates[e]));
37694
- a.length > 1 && r.push(`Accepted answers: ${a.length} (including alternates).`);
37693
+ let a = t.alternates || {}, o = [t.answer].concat(Object.keys(a).map((e) => a[e]));
37694
+ o.length > 1 && r.push(`Accepted answers: ${o.length} (including alternates).`);
37695
37695
  });
37696
37696
  let c = M_(e, n, t, !0);
37697
37697
  return c.correctness === "correct" ? r.push("Student answer matches one of the accepted responses.") : c.correctness === "incorrect" ? r.push("Student answer does not match any of the accepted responses.") : r.push("Student answer could not be evaluated."), r.push(`Response evaluated as ${c.correctness}.`), r.push(`Final score: ${c.score}.`), r;
@@ -37717,17 +37717,17 @@ var P_ = (e, t, n) => {
37717
37717
  ...h,
37718
37718
  ...e
37719
37719
  }), L_ = (e, t, n) => new Promise((r) => {
37720
- let i = I_(e), a = M_(i, n, t), { extraCSSRules: o, responses: s, language: c, ...l } = i;
37721
- l.responses = l.responseType === m.simple ? s.slice(0, 1) : s;
37722
- let u = {
37720
+ let i = I_(e), a = M_(i, n, t), { extraCSSRules: o, responses: s, language: c, ...l } = i, u = l;
37721
+ u.responses = u.responseType === m.simple ? s.slice(0, 1) : s;
37722
+ let d = {
37723
37723
  extraCSSRules: o,
37724
- config: l,
37724
+ config: u,
37725
37725
  correctness: a,
37726
37726
  feedback: n.mode === "evaluate" && i.feedbackEnabled ? f(a?.correctness, i.feedback) : void 0,
37727
37727
  disabled: n.mode !== "gather",
37728
37728
  view: n.mode === "view"
37729
- }, d = i.note || O_.t("mathInline.primaryCorrectWithAlternates", { lng: c }), p = l?.responses?.length > 1 || (l?.responses || []).some((e) => e.validation === "symbolic" || Object.keys(e.alternates || {}).length > 0);
37730
- n.mode === "evaluate" ? (u.correctResponse = {}, u.config.showNote = p, u.config.note = d) : (u.config.responses = [], u.config.showNote = !1), n.role === "instructor" && (n.mode === "view" || n.mode === "evaluate") ? (u.rationale = i.rationaleEnabled ? i.rationale : null, u.teacherInstructions = i.teacherInstructionsEnabled ? i.teacherInstructions : null) : (u.rationale = null, u.teacherInstructions = null, u.config.rationale = null, u.config.teacherInstructions = null), u.config.env = n, u.config.prompt = i.promptEnabled ? i.prompt : null, u.language = c, k_("out: ", u), r(u);
37729
+ }, p = i.note || O_.t("mathInline.primaryCorrectWithAlternates", { lng: c }), h = (u?.responses?.length ?? 0) > 1 || (u?.responses || []).some((e) => e.validation === "symbolic" || Object.keys(e.alternates || {}).length > 0);
37730
+ n.mode === "evaluate" ? (d.correctResponse = {}, d.config.showNote = h, d.config.note = p) : (d.config.responses = [], d.config.showNote = !1), n.role === "instructor" && (n.mode === "view" || n.mode === "evaluate") ? (d.rationale = i.rationaleEnabled ? i.rationale : null, d.teacherInstructions = i.teacherInstructionsEnabled ? i.teacherInstructions : null) : (d.rationale = null, d.teacherInstructions = null, d.config.rationale = null, d.config.teacherInstructions = null), d.config.env = n, d.config.prompt = i.promptEnabled ? i.prompt : null, d.language = c, k_("out: ", d), r(d);
37731
37731
  }), R_ = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), z_ = (e) => new Promise((t) => {
37732
37732
  let { responses: n, id: r } = e, { answer: i } = n && n.length ? n[0] : {};
37733
37733
  t({
@@ -37770,7 +37770,7 @@ var P_ = (e, t, n) => {
37770
37770
  completeAnswer: i
37771
37771
  }), console.error(e.toString());
37772
37772
  }
37773
- }), H_ = (e, t) => t.mode === "evaluate" || t.role !== "instructor" ? (console.error("can not create correct response session if mode is evaluate or role is not instructor"), Promise.resolve(null)) : (e.responseType || "").toLowerCase() === "simple" ? z_(e, t) : V_(e, t), U_ = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), W_ = (e = {}, t = {}) => {
37773
+ }), H_ = (e, t) => t.mode === "evaluate" || t.role !== "instructor" ? (console.error("can not create correct response session if mode is evaluate or role is not instructor"), Promise.resolve(null)) : (e.responseType || "").toLowerCase() === "simple" ? z_(e) : V_(e), U_ = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), W_ = (e = {}, t = {}) => {
37774
37774
  let { expression: n = "", responses: r, responseType: i } = e, { maxResponseAreas: a } = t, o = {}, c = {};
37775
37775
  if ([
37776
37776
  "teacherInstructions",