@pie-element/drag-in-the-blank 10.2.0-next.19 → 10.2.0-next.21

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.
@@ -41,7 +41,7 @@ async function d(e, t, n, r = "value") {
41
41
  let a = l(e);
42
42
  if (n && typeof n == "function") try {
43
43
  let e = c(a.map((e) => e[r]));
44
- u(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(a)}, key: ${r}`) : t.id && t.element && await n(t.id, t.element, { shuffledValues: e });
44
+ u(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 });
45
45
  } catch (e) {
46
46
  console.warn("Unable to save shuffled order for choices"), console.error(e);
47
47
  }
@@ -49,7 +49,7 @@ async function d(e, t, n, r = "value") {
49
49
  return a;
50
50
  }
51
51
  function f(e, t, n) {
52
- return !!(e.lockChoiceOrder || n["@pie-element"]?.lockChoiceOrder || (n.role ?? "student") === "instructor");
52
+ return !!(e.lockChoiceOrder || n?.["@pie-element"]?.lockChoiceOrder);
53
53
  }
54
54
  var p = /* @__PURE__ */ s({ enabled: () => m });
55
55
  function m(e, t, n) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/controller/utils.ts","../../../../../../shared/controller-utils/dist/index.js","../../../../src/controller/defaults.ts","../../../../src/controller/index.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/drag-in-the-blank/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 { cloneDeep, reduce } from '@pie-element/shared-lodash';\n\nconst replaceHtmlRegex = /<(?!img)[^>]*>?/gm;\n\nexport const getAllCorrectResponses = ({ correctResponse, alternateResponses }) => {\n return reduce(\n correctResponse || {},\n (obj, val, key) => {\n obj.possibleResponses[key] = [val];\n\n if (alternateResponses && alternateResponses[key]) {\n obj.possibleResponses[key] = [...obj.possibleResponses[key], ...cloneDeep(alternateResponses[key])];\n }\n\n if (\n obj.numberOfPossibleResponses === undefined ||\n obj.numberOfPossibleResponses > obj.possibleResponses[key].length\n ) {\n obj.numberOfPossibleResponses = obj.possibleResponses[key].length;\n }\n\n return obj;\n },\n {\n possibleResponses: {},\n numberOfPossibleResponses: undefined,\n },\n );\n};\n\nexport const choiceIsEmpty = (choice) => {\n if (choice) {\n const { value = '' } = choice;\n const withoutEmptyTags = value.replace(replaceHtmlRegex, '') || '';\n\n return withoutEmptyTags.trim() === '';\n }\n\n return false;\n};\n","//#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/drag-in-the-blank/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 choices: [],\n choicesPosition: 'below',\n correctResponse: {},\n disabled: false,\n duplicates: true,\n markup: '',\n mode: 'gather',\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/drag-in-the-blank/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 } from '@pie-element/shared-lodash';\nimport { getAllCorrectResponses, choiceIsEmpty } from './utils.js';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-element/shared-controller-utils';\nimport defaults from './defaults.js';\n\nexport const normalize = (question) => ({\n ...defaults,\n ...question,\n});\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 let feedback = {};\n\n if (env.mode === 'evaluate') {\n const responses = getAllCorrectResponses(normalizedQuestion) || {};\n const allCorrectResponses = responses.possibleResponses;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n let correctResponses = undefined;\n const { value } = session || {};\n\n for (let i = 0; i < numberOfPossibleResponses; i++) {\n const result = Object.keys(allCorrectResponses).reduce(\n (obj, key) => {\n const choices = allCorrectResponses[key];\n const answer = (value && value[key]) || '';\n\n obj.feedback[key] = choices[i] === answer;\n\n if (obj.feedback[key]) {\n obj.correctResponses += 1;\n }\n\n return obj;\n },\n { correctResponses: 0, feedback: {} },\n );\n\n if (correctResponses === undefined || result.correctResponses > correctResponses) {\n correctResponses = result.correctResponses;\n feedback = result.feedback;\n }\n }\n }\n\n let choices = normalizedQuestion.choices && normalizedQuestion.choices.filter((choice) => !choiceIsEmpty(choice));\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n choices = await getShuffledChoices(choices, session, updateSession, 'id');\n }\n\n // we don't need to check for fewer areas to be filled in the alternateResponses\n // because the alternates are an option in the default correct response (for scoring)\n const responseAreasToBeFilled = Object.values(normalizedQuestion.correctResponse || {}).filter(\n (value) => !!value,\n ).length;\n\n const shouldIncludeCorrectResponse = env.mode === 'evaluate';\n\n const out = {\n ...normalizedQuestion,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n choices,\n feedback,\n mode: env.mode,\n disabled: env.mode !== 'gather',\n responseCorrect: shouldIncludeCorrectResponse ? getScore(normalizedQuestion, session) === 1 : undefined,\n correctResponse: shouldIncludeCorrectResponse ? normalizedQuestion.correctResponse : undefined,\n responseAreasToBeFilled,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n return out;\n}\n\nexport const getScore = (config, session) => {\n const responses = getAllCorrectResponses(config);\n const allCorrectResponses = responses.possibleResponses;\n const maxScore = Object.keys(config.correctResponse).length;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n let correctCount = 0;\n const { value } = session || {};\n\n for (let i = 0; i < numberOfPossibleResponses; i++) {\n const result = Object.keys(allCorrectResponses).reduce((total, key) => {\n const choices = allCorrectResponses[key];\n const answer = (value && value[key]) || '';\n\n if (choices[i] === answer) {\n return total;\n }\n\n return total - 1;\n }, maxScore);\n\n if (result > correctCount) {\n correctCount = result;\n }\n\n if (result === maxScore) {\n break;\n }\n }\n\n const str = maxScore ? (correctCount / maxScore).toFixed(2) : 0;\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 \n const responseAreas = Object.keys(model.correctResponse || {});\n const totalAreas = responseAreas.length;\n traceLog.push(`${totalAreas} response area(s) defined in this question.`);\n \n if (value && Object.keys(value).length > 0) {\n const filledAreas = Object.entries(value).filter(([key, val]) => val && val.trim()).length;\n traceLog.push(`Student added choices to ${filledAreas} out of ${totalAreas} response area(s).`);\n \n responseAreas.forEach((areaKey) => {\n const studentAnswer = (value && value[areaKey]) || '';\n const correctAnswer = model.correctResponse[areaKey] || '';\n \n if (studentAnswer.trim()) {\n traceLog.push(`Response area ${areaKey}: student placed '${studentAnswer}' (correct answer: '${correctAnswer}').`);\n } else {\n traceLog.push(`Response area ${areaKey}: left empty (correct answer: '${correctAnswer}').`);\n }\n });\n } else {\n traceLog.push('Student did not add any choices to response areas.');\n }\n\n const responses = getAllCorrectResponses(model);\n const allCorrectResponses = responses.possibleResponses;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n \n if (numberOfPossibleResponses > 1) {\n traceLog.push(`${numberOfPossibleResponses} alternate response combinations are accepted for this question.`);\n }\n\n const partialScoringEnabled = partialScoring.enabled(model, env);\n const scoringMethod = partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring';\n traceLog.push(`Score calculated using ${scoringMethod}.`);\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 add any choices to response areas. 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 : score === 1 ? 1 : 0,\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 resolve({\n value: question.correctResponse,\n id: '1',\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 { choices, correctResponse, markup } = model;\n const { minChoices = 2, maxChoices, maxResponseAreas } = 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 const nbOfChoices = (choices || []).length;\n const emptyResponseAreas = Object.values(correctResponse)?.filter((response) => !response);\n\n if (emptyResponseAreas.length) {\n errors.correctResponseError = 'There should be a choice defined for each response area.';\n }\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 at least 1 response area defined.';\n }\n\n if (nbOfChoices < minChoices) {\n errors.choicesError = `There should be at least ${minChoices} tokens defined.`;\n } else if (nbOfChoices > maxChoices) {\n errors.choicesError = `No more than ${maxChoices} tokens should be defined.`;\n }\n\n return errors;\n};\n"],"mappings":";;AAYA,IAAM,IAAmB,qBAEZ,KAA0B,EAAE,oBAAiB,4BACjD,EACL,KAAmB,CAAC,IACnB,GAAK,GAAK,OACT,EAAI,kBAAkB,KAAO,CAAC,CAAG,GAE7B,KAAsB,EAAmB,OAC3C,EAAI,kBAAkB,KAAO,CAAC,GAAG,EAAI,kBAAkB,IAAM,GAAG,EAAU,EAAmB,EAAI,CAAC,KAIlG,EAAI,8BAA8B,KAAA,KAClC,EAAI,4BAA4B,EAAI,kBAAkB,EAAI,CAAC,YAE3D,EAAI,4BAA4B,EAAI,kBAAkB,EAAI,CAAC,SAGtD,IAET;CACE,mBAAmB,CAAC;CACpB,2BAA2B,KAAA;AAC7B,CACF,GAGW,KAAiB,MAAW;CACvC,IAAI,GAAQ;EACV,IAAM,EAAE,WAAQ,OAAO;EAGvB,QAFyB,EAAM,QAAQ,GAAkB,EAAE,KAAK,GAAA,CAExC,KAAK,MAAM;CACrC;CAEA,OAAO;AACT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ACnE,KAAe,KAAW,CAAC,EAAA,CAAG;CAmBpC,QAlB2B,OAAO,OAAO,CAAe,CAAC,EAAE,QAAQ,MAAa,CAAC,CAAQ,EAAA,CAElE,WACrB,EAAO,uBAAuB,6DAG5B,IAAoB,IACtB,EAAO,qBAAqB,gBAAgB,EAAiB,sCACpD,IAAoB,MAC7B,EAAO,qBAAqB,sDAG1B,IAAc,IAChB,EAAO,eAAe,4BAA4B,EAAW,oBACpD,IAAc,MACvB,EAAO,eAAe,gBAAgB,EAAW,8BAG5C;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/controller/utils.ts","../../../../../../shared/controller-utils/dist/index.js","../../../../src/controller/defaults.ts","../../../../src/controller/index.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/drag-in-the-blank/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 { cloneDeep, reduce } from '@pie-element/shared-lodash';\n\nconst replaceHtmlRegex = /<(?!img)[^>]*>?/gm;\n\nexport const getAllCorrectResponses = ({ correctResponse, alternateResponses }) => {\n return reduce(\n correctResponse || {},\n (obj, val, key) => {\n obj.possibleResponses[key] = [val];\n\n if (alternateResponses && alternateResponses[key]) {\n obj.possibleResponses[key] = [...obj.possibleResponses[key], ...cloneDeep(alternateResponses[key])];\n }\n\n if (\n obj.numberOfPossibleResponses === undefined ||\n obj.numberOfPossibleResponses > obj.possibleResponses[key].length\n ) {\n obj.numberOfPossibleResponses = obj.possibleResponses[key].length;\n }\n\n return obj;\n },\n {\n possibleResponses: {},\n numberOfPossibleResponses: undefined,\n },\n );\n};\n\nexport const choiceIsEmpty = (choice) => {\n if (choice) {\n const { value = '' } = choice;\n const withoutEmptyTags = value.replace(replaceHtmlRegex, '') || '';\n\n return withoutEmptyTags.trim() === '';\n }\n\n return false;\n};\n","//#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/drag-in-the-blank/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 choices: [],\n choicesPosition: 'below',\n correctResponse: {},\n disabled: false,\n duplicates: true,\n markup: '',\n mode: 'gather',\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/drag-in-the-blank/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 } from '@pie-element/shared-lodash';\nimport { getAllCorrectResponses, choiceIsEmpty } from './utils.js';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-element/shared-controller-utils';\nimport defaults from './defaults.js';\n\nexport const normalize = (question) => ({\n ...defaults,\n ...question,\n});\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 let feedback = {};\n\n if (env.mode === 'evaluate') {\n const responses = getAllCorrectResponses(normalizedQuestion) || {};\n const allCorrectResponses = responses.possibleResponses;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n let correctResponses = undefined;\n const { value } = session || {};\n\n for (let i = 0; i < numberOfPossibleResponses; i++) {\n const result = Object.keys(allCorrectResponses).reduce(\n (obj, key) => {\n const choices = allCorrectResponses[key];\n const answer = (value && value[key]) || '';\n\n obj.feedback[key] = choices[i] === answer;\n\n if (obj.feedback[key]) {\n obj.correctResponses += 1;\n }\n\n return obj;\n },\n { correctResponses: 0, feedback: {} },\n );\n\n if (correctResponses === undefined || result.correctResponses > correctResponses) {\n correctResponses = result.correctResponses;\n feedback = result.feedback;\n }\n }\n }\n\n let choices = normalizedQuestion.choices && normalizedQuestion.choices.filter((choice) => !choiceIsEmpty(choice));\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n choices = await getShuffledChoices(choices, session, updateSession, 'id');\n }\n\n // we don't need to check for fewer areas to be filled in the alternateResponses\n // because the alternates are an option in the default correct response (for scoring)\n const responseAreasToBeFilled = Object.values(normalizedQuestion.correctResponse || {}).filter(\n (value) => !!value,\n ).length;\n\n const shouldIncludeCorrectResponse = env.mode === 'evaluate';\n\n const out = {\n ...normalizedQuestion,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n choices,\n feedback,\n mode: env.mode,\n disabled: env.mode !== 'gather',\n responseCorrect: shouldIncludeCorrectResponse ? getScore(normalizedQuestion, session) === 1 : undefined,\n correctResponse: shouldIncludeCorrectResponse ? normalizedQuestion.correctResponse : undefined,\n responseAreasToBeFilled,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n return out;\n}\n\nexport const getScore = (config, session) => {\n const responses = getAllCorrectResponses(config);\n const allCorrectResponses = responses.possibleResponses;\n const maxScore = Object.keys(config.correctResponse).length;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n let correctCount = 0;\n const { value } = session || {};\n\n for (let i = 0; i < numberOfPossibleResponses; i++) {\n const result = Object.keys(allCorrectResponses).reduce((total, key) => {\n const choices = allCorrectResponses[key];\n const answer = (value && value[key]) || '';\n\n if (choices[i] === answer) {\n return total;\n }\n\n return total - 1;\n }, maxScore);\n\n if (result > correctCount) {\n correctCount = result;\n }\n\n if (result === maxScore) {\n break;\n }\n }\n\n const str = maxScore ? (correctCount / maxScore).toFixed(2) : 0;\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 \n const responseAreas = Object.keys(model.correctResponse || {});\n const totalAreas = responseAreas.length;\n traceLog.push(`${totalAreas} response area(s) defined in this question.`);\n \n if (value && Object.keys(value).length > 0) {\n const filledAreas = Object.entries(value).filter(([key, val]) => val && val.trim()).length;\n traceLog.push(`Student added choices to ${filledAreas} out of ${totalAreas} response area(s).`);\n \n responseAreas.forEach((areaKey) => {\n const studentAnswer = (value && value[areaKey]) || '';\n const correctAnswer = model.correctResponse[areaKey] || '';\n \n if (studentAnswer.trim()) {\n traceLog.push(`Response area ${areaKey}: student placed '${studentAnswer}' (correct answer: '${correctAnswer}').`);\n } else {\n traceLog.push(`Response area ${areaKey}: left empty (correct answer: '${correctAnswer}').`);\n }\n });\n } else {\n traceLog.push('Student did not add any choices to response areas.');\n }\n\n const responses = getAllCorrectResponses(model);\n const allCorrectResponses = responses.possibleResponses;\n const numberOfPossibleResponses = responses.numberOfPossibleResponses || 0;\n \n if (numberOfPossibleResponses > 1) {\n traceLog.push(`${numberOfPossibleResponses} alternate response combinations are accepted for this question.`);\n }\n\n const partialScoringEnabled = partialScoring.enabled(model, env);\n const scoringMethod = partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring';\n traceLog.push(`Score calculated using ${scoringMethod}.`);\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 add any choices to response areas. 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 : score === 1 ? 1 : 0,\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 resolve({\n value: question.correctResponse,\n id: '1',\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 { choices, correctResponse, markup } = model;\n const { minChoices = 2, maxChoices, maxResponseAreas } = 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 const nbOfChoices = (choices || []).length;\n const emptyResponseAreas = Object.values(correctResponse)?.filter((response) => !response);\n\n if (emptyResponseAreas.length) {\n errors.correctResponseError = 'There should be a choice defined for each response area.';\n }\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 at least 1 response area defined.';\n }\n\n if (nbOfChoices < minChoices) {\n errors.choicesError = `There should be at least ${minChoices} tokens defined.`;\n } else if (nbOfChoices > maxChoices) {\n errors.choicesError = `No more than ${maxChoices} tokens should be defined.`;\n }\n\n return errors;\n};\n"],"mappings":";;AAYA,IAAM,IAAmB,qBAEZ,KAA0B,EAAE,oBAAiB,4BACjD,EACL,KAAmB,CAAC,IACnB,GAAK,GAAK,OACT,EAAI,kBAAkB,KAAO,CAAC,CAAG,GAE7B,KAAsB,EAAmB,OAC3C,EAAI,kBAAkB,KAAO,CAAC,GAAG,EAAI,kBAAkB,IAAM,GAAG,EAAU,EAAmB,EAAI,CAAC,KAIlG,EAAI,8BAA8B,KAAA,KAClC,EAAI,4BAA4B,EAAI,kBAAkB,EAAI,CAAC,YAE3D,EAAI,4BAA4B,EAAI,kBAAkB,EAAI,CAAC,SAGtD,IAET;CACE,mBAAmB,CAAC;CACpB,2BAA2B,KAAA;AAC7B,CACF,GAGW,KAAiB,MAAW;CACvC,IAAI,GAAQ;EACV,IAAM,EAAE,WAAQ,OAAO;EAGvB,QAFyB,EAAM,QAAQ,GAAkB,EAAE,KAAK,GAAA,CAExC,KAAK,MAAM;CACrC;CAEA,OAAO;AACT,GChDI,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,MAA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,CAGnD,IAAwB,IAAQ,QAAU;IACjD,OAAO;IACP;GACF,CAAC;EACH;CACF,CAAC;AACH;AAEA,IAAa,KAAgC,GAAU,MAC9C,IAAI,SAAS,MAAY;CAC9B,AAAI,EAAI,SAAS,cAAc,EAAI,SAAS,eAC1C,EAAQ;EACN,OAAO,EAAS;EAChB,IAAI;CACN,CAAC,IAED,EAAQ,IAAI;AAEhB,CAAC,GAOG,KAAc,OAAU,KAAQ,GAAA,CAAI,QAAQ,sCAAsC,EAAE,GAE7E,KAAY,IAAQ,CAAC,GAAG,IAAS,CAAC,MAAM;CACnD,IAAM,EAAE,YAAS,oBAAiB,cAAW,GACvC,EAAE,gBAAa,GAAG,eAAY,wBAAqB,GACnD,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,QACnE,KAAe,KAAW,CAAC,EAAA,CAAG;CAmBpC,QAlB2B,OAAO,OAAO,CAAe,CAAC,EAAE,QAAQ,MAAa,CAAC,CAAQ,EAAA,CAElE,WACrB,EAAO,uBAAuB,6DAG5B,IAAoB,IACtB,EAAO,qBAAqB,gBAAgB,EAAiB,sCACpD,IAAoB,MAC7B,EAAO,qBAAqB,sDAG1B,IAAc,IAChB,EAAO,eAAe,4BAA4B,EAAW,oBACpD,IAAc,MACvB,EAAO,eAAe,gBAAgB,EAAW,8BAG5C;AACT"}
@@ -1,12 +1,12 @@
1
1
  import { a as e } from "../rolldown-runtime-CHQKHQ89.js";
2
- import { A as t, B as n, Bt as r, Dt as i, Et as a, J as o, Lt as s, M as c, P as l, Rt as u, T as d, Tt as f, V as p, Y as m, _ as h, a as g, c as _, dt as v, et as y, g as b, h as x, ht as S, i as C, k as w, m as T, n as E, o as D, pt as O, r as k, s as ee, t as te, xt as ne, zt as A } from "../drag-provider-DQlukEyZ.js";
2
+ import { A as t, B as n, Dt as r, Et as i, J as a, Lt as o, M as s, P as c, Rt as l, T as u, Tt as d, V as f, Vt as p, Y as m, _ as h, a as g, c as _, dt as v, et as y, g as b, h as x, ht as S, i as C, k as w, m as T, n as E, o as D, pt as O, r as k, s as ee, t as te, xt as ne, zt as A } from "../drag-provider-UfwrFy4Z.js";
3
3
  import { h as j, m as M } from "../dist-CqufoV2m.js";
4
4
  import * as N from "react";
5
5
  import P, { useEffect as F, useRef as I, useState as re } from "react";
6
6
  import { createRoot as ie } from "react-dom/client";
7
7
  import { jsx as L, jsxs as R } from "react/jsx-runtime";
8
8
  //#region ../../lib-react/icons/dist/correct-response-icon.js
9
- var z = /* @__PURE__ */ e(s(), 1), ae = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ R("svg", {
9
+ var z = /* @__PURE__ */ e(o(), 1), ae = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ R("svg", {
10
10
  preserveAspectRatio: "xMinYMin meet",
11
11
  version: "1.1",
12
12
  viewBox: "-283 359 34 35",
@@ -1738,7 +1738,7 @@ var dt = ut(b, "Readable") || ut(mt.Readable, "Readable"), ft = _, pt = ft.defau
1738
1738
  minWidth: "140px",
1739
1739
  alignSelf: "center",
1740
1740
  verticalAlign: "middle",
1741
- color: `var(--correct-answer-toggle-label-color, ${u.text()})`,
1741
+ color: `var(--correct-answer-toggle-label-color, ${l.text()})`,
1742
1742
  fontWeight: "normal",
1743
1743
  ...gt
1744
1744
  })), bt = S("div")(() => ({
@@ -2092,7 +2092,7 @@ var Vt = /* @__PURE__ */ Y(((e, t) => {
2092
2092
  Vt();
2093
2093
  //#endregion
2094
2094
  //#region ../../lib-react/mask-markup/dist/serialization.js
2095
- var Ht = /* @__PURE__ */ e(l(), 1), Ut = Vt(), Wt = (0, Ht.default)("@pie-lib:mask-markup:serialization"), Gt = ["span"], Kt = [
2095
+ var Ht = /* @__PURE__ */ e(c(), 1), Ut = Vt(), Wt = (0, Ht.default)("@pie-lib:mask-markup:serialization"), Gt = ["span"], Kt = [
2096
2096
  "em",
2097
2097
  "strong",
2098
2098
  "u"
@@ -2286,7 +2286,7 @@ var Ht = /* @__PURE__ */ e(l(), 1), Ut = Vt(), Wt = (0, Ht.default)("@pie-lib:ma
2286
2286
  };
2287
2287
  componentDidMount() {
2288
2288
  let e = this.props.containerRef || this.internalContainerRef;
2289
- e.current && typeof r == "function" && r(e.current);
2289
+ e.current && typeof p == "function" && p(e.current);
2290
2290
  }
2291
2291
  handleChange = (e, t) => {
2292
2292
  let n = {
@@ -2341,39 +2341,39 @@ var Ht = /* @__PURE__ */ e(l(), 1), Ut = Vt(), Wt = (0, Ht.default)("@pie-lib:ma
2341
2341
  //#endregion
2342
2342
  //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Chip/chipClasses.js
2343
2343
  function bn(e) {
2344
- return a("MuiChip", e);
2344
+ return i("MuiChip", e);
2345
2345
  }
2346
- var X = f("MuiChip", /* @__PURE__ */ "root.sizeSmall.sizeMedium.colorDefault.colorError.colorInfo.colorPrimary.colorSecondary.colorSuccess.colorWarning.disabled.clickable.clickableColorPrimary.clickableColorSecondary.deletable.deletableColorPrimary.deletableColorSecondary.outlined.filled.outlinedPrimary.outlinedSecondary.filledPrimary.filledSecondary.avatar.avatarSmall.avatarMedium.avatarColorPrimary.avatarColorSecondary.icon.iconSmall.iconMedium.iconColorPrimary.iconColorSecondary.label.labelSmall.labelMedium.deleteIcon.deleteIconSmall.deleteIconMedium.deleteIconColorPrimary.deleteIconColorSecondary.deleteIconOutlinedColorPrimary.deleteIconOutlinedColorSecondary.deleteIconFilledColorPrimary.deleteIconFilledColorSecondary.focusVisible".split(".")), xn = (e) => {
2346
+ var X = d("MuiChip", /* @__PURE__ */ "root.sizeSmall.sizeMedium.colorDefault.colorError.colorInfo.colorPrimary.colorSecondary.colorSuccess.colorWarning.disabled.clickable.clickableColorPrimary.clickableColorSecondary.deletable.deletableColorPrimary.deletableColorSecondary.outlined.filled.outlinedPrimary.outlinedSecondary.filledPrimary.filledSecondary.avatar.avatarSmall.avatarMedium.avatarColorPrimary.avatarColorSecondary.icon.iconSmall.iconMedium.iconColorPrimary.iconColorSecondary.label.labelSmall.labelMedium.deleteIcon.deleteIconSmall.deleteIconMedium.deleteIconColorPrimary.deleteIconColorSecondary.deleteIconOutlinedColorPrimary.deleteIconOutlinedColorSecondary.deleteIconFilledColorPrimary.deleteIconFilledColorSecondary.focusVisible".split(".")), xn = (e) => {
2347
2347
  let { classes: t, disabled: n, size: r, color: i, iconColor: a, onDelete: o, clickable: s, variant: c } = e;
2348
2348
  return ne({
2349
2349
  root: [
2350
2350
  "root",
2351
2351
  c,
2352
2352
  n && "disabled",
2353
- `size${p(r)}`,
2354
- `color${p(i)}`,
2353
+ `size${f(r)}`,
2354
+ `color${f(i)}`,
2355
2355
  s && "clickable",
2356
- s && `clickableColor${p(i)}`,
2356
+ s && `clickableColor${f(i)}`,
2357
2357
  o && "deletable",
2358
- o && `deletableColor${p(i)}`,
2359
- `${c}${p(i)}`
2358
+ o && `deletableColor${f(i)}`,
2359
+ `${c}${f(i)}`
2360
2360
  ],
2361
- label: ["label", `label${p(r)}`],
2361
+ label: ["label", `label${f(r)}`],
2362
2362
  avatar: [
2363
2363
  "avatar",
2364
- `avatar${p(r)}`,
2365
- `avatarColor${p(i)}`
2364
+ `avatar${f(r)}`,
2365
+ `avatarColor${f(i)}`
2366
2366
  ],
2367
2367
  icon: [
2368
2368
  "icon",
2369
- `icon${p(r)}`,
2370
- `iconColor${p(a)}`
2369
+ `icon${f(r)}`,
2370
+ `iconColor${f(a)}`
2371
2371
  ],
2372
2372
  deleteIcon: [
2373
2373
  "deleteIcon",
2374
- `deleteIcon${p(r)}`,
2375
- `deleteIconColor${p(i)}`,
2376
- `deleteIcon${p(c)}Color${p(i)}`
2374
+ `deleteIcon${f(r)}`,
2375
+ `deleteIconColor${f(i)}`,
2376
+ `deleteIcon${f(c)}Color${f(i)}`
2377
2377
  ]
2378
2378
  }, bn, t);
2379
2379
  }, Sn = S("div", {
@@ -2383,24 +2383,24 @@ var X = f("MuiChip", /* @__PURE__ */ "root.sizeSmall.sizeMedium.colorDefault.col
2383
2383
  let { ownerState: n } = e, { color: r, iconColor: i, clickable: a, onDelete: o, size: s, variant: c } = n;
2384
2384
  return [
2385
2385
  { [`& .${X.avatar}`]: t.avatar },
2386
- { [`& .${X.avatar}`]: t[`avatar${p(s)}`] },
2387
- { [`& .${X.avatar}`]: t[`avatarColor${p(r)}`] },
2386
+ { [`& .${X.avatar}`]: t[`avatar${f(s)}`] },
2387
+ { [`& .${X.avatar}`]: t[`avatarColor${f(r)}`] },
2388
2388
  { [`& .${X.icon}`]: t.icon },
2389
- { [`& .${X.icon}`]: t[`icon${p(s)}`] },
2390
- { [`& .${X.icon}`]: t[`iconColor${p(i)}`] },
2389
+ { [`& .${X.icon}`]: t[`icon${f(s)}`] },
2390
+ { [`& .${X.icon}`]: t[`iconColor${f(i)}`] },
2391
2391
  { [`& .${X.deleteIcon}`]: t.deleteIcon },
2392
- { [`& .${X.deleteIcon}`]: t[`deleteIcon${p(s)}`] },
2393
- { [`& .${X.deleteIcon}`]: t[`deleteIconColor${p(r)}`] },
2394
- { [`& .${X.deleteIcon}`]: t[`deleteIcon${p(c)}Color${p(r)}`] },
2392
+ { [`& .${X.deleteIcon}`]: t[`deleteIcon${f(s)}`] },
2393
+ { [`& .${X.deleteIcon}`]: t[`deleteIconColor${f(r)}`] },
2394
+ { [`& .${X.deleteIcon}`]: t[`deleteIcon${f(c)}Color${f(r)}`] },
2395
2395
  t.root,
2396
- t[`size${p(s)}`],
2397
- t[`color${p(r)}`],
2396
+ t[`size${f(s)}`],
2397
+ t[`color${f(r)}`],
2398
2398
  a && t.clickable,
2399
- a && r !== "default" && t[`clickableColor${p(r)}`],
2399
+ a && r !== "default" && t[`clickableColor${f(r)}`],
2400
2400
  o && t.deletable,
2401
- o && r !== "default" && t[`deletableColor${p(r)}`],
2401
+ o && r !== "default" && t[`deletableColor${f(r)}`],
2402
2402
  t[c],
2403
- t[`${c}${p(r)}`]
2403
+ t[`${c}${f(r)}`]
2404
2404
  ];
2405
2405
  }
2406
2406
  })(m(({ theme: e }) => {
@@ -2568,7 +2568,7 @@ var X = f("MuiChip", /* @__PURE__ */ "root.sizeSmall.sizeMedium.colorDefault.col
2568
2568
  slot: "Label",
2569
2569
  overridesResolver: (e, t) => {
2570
2570
  let { ownerState: n } = e, { size: r } = n;
2571
- return [t.label, t[`label${p(r)}`]];
2571
+ return [t.label, t[`label${f(r)}`]];
2572
2572
  }
2573
2573
  })({
2574
2574
  overflow: "hidden",
@@ -2607,17 +2607,17 @@ function wn(e) {
2607
2607
  return e.key === "Backspace" || e.key === "Delete";
2608
2608
  }
2609
2609
  var Tn = /*#__PURE__*/ N.forwardRef(function(e, n) {
2610
- let r = v({
2610
+ let i = v({
2611
2611
  props: e,
2612
2612
  name: "MuiChip"
2613
- }), { avatar: a, className: s, clickable: c, color: l = "default", component: u, deleteIcon: d, disabled: f = !1, icon: p, label: m, onClick: h, onDelete: g, onKeyDown: _, onKeyUp: b, size: x = "medium", variant: S = "filled", tabIndex: C, skipFocusWhenDisabled: w = !1, slots: T = {}, slotProps: E = {}, ...D } = r, O = y(N.useRef(null), n), k = (e) => {
2613
+ }), { avatar: o, className: s, clickable: c, color: l = "default", component: u, deleteIcon: d, disabled: f = !1, icon: p, label: m, onClick: h, onDelete: g, onKeyDown: _, onKeyUp: b, size: x = "medium", variant: S = "filled", tabIndex: C, skipFocusWhenDisabled: w = !1, slots: T = {}, slotProps: E = {}, ...D } = i, O = y(N.useRef(null), n), k = (e) => {
2614
2614
  e.stopPropagation(), g(e);
2615
2615
  }, ee = (e) => {
2616
2616
  e.currentTarget === e.target && wn(e) && e.preventDefault(), _ && _(e);
2617
2617
  }, te = (e) => {
2618
2618
  e.currentTarget === e.target && g && wn(e) && g(e), b && b(e);
2619
2619
  }, ne = c !== !1 && h ? !0 : c, A = ne || g ? t : u || "div", j = {
2620
- ...r,
2620
+ ...i,
2621
2621
  component: A,
2622
2622
  disabled: f,
2623
2623
  size: x,
@@ -2632,20 +2632,20 @@ var Tn = /*#__PURE__*/ N.forwardRef(function(e, n) {
2632
2632
  ...g && { disableRipple: !0 }
2633
2633
  } : {}, F = null;
2634
2634
  g && (F = d && /*#__PURE__*/ N.isValidElement(d) ? /*#__PURE__*/ N.cloneElement(d, {
2635
- className: i(d.props.className, M.deleteIcon),
2635
+ className: r(d.props.className, M.deleteIcon),
2636
2636
  onClick: k
2637
2637
  }) : /*#__PURE__*/ L(yn, {
2638
2638
  className: M.deleteIcon,
2639
2639
  onClick: k
2640
2640
  }));
2641
2641
  let I = null;
2642
- a && /*#__PURE__*/ N.isValidElement(a) && (I = /*#__PURE__*/ N.cloneElement(a, { className: i(M.avatar, a.props.className) }));
2642
+ o && /*#__PURE__*/ N.isValidElement(o) && (I = /*#__PURE__*/ N.cloneElement(o, { className: r(M.avatar, o.props.className) }));
2643
2643
  let re = null;
2644
- p && /*#__PURE__*/ N.isValidElement(p) && (re = /*#__PURE__*/ N.cloneElement(p, { className: i(M.icon, p.props.className) }));
2644
+ p && /*#__PURE__*/ N.isValidElement(p) && (re = /*#__PURE__*/ N.cloneElement(p, { className: r(M.icon, p.props.className) }));
2645
2645
  let ie = {
2646
2646
  slots: T,
2647
2647
  slotProps: E
2648
- }, [z, ae] = o("root", {
2648
+ }, [z, ae] = a("root", {
2649
2649
  elementType: Sn,
2650
2650
  externalForwardedProps: {
2651
2651
  ...ie,
@@ -2654,7 +2654,7 @@ var Tn = /*#__PURE__*/ N.forwardRef(function(e, n) {
2654
2654
  ownerState: j,
2655
2655
  shouldForwardComponentProp: !0,
2656
2656
  ref: O,
2657
- className: i(M.root, s),
2657
+ className: r(M.root, s),
2658
2658
  additionalProps: {
2659
2659
  disabled: ne && f ? !0 : void 0,
2660
2660
  tabIndex: w && f ? -1 : C,
@@ -2672,7 +2672,7 @@ var Tn = /*#__PURE__*/ N.forwardRef(function(e, n) {
2672
2672
  e.onKeyUp?.(t), te(t);
2673
2673
  }
2674
2674
  })
2675
- }), [oe, se] = o("label", {
2675
+ }), [oe, se] = a("label", {
2676
2676
  elementType: Cn,
2677
2677
  externalForwardedProps: ie,
2678
2678
  ownerState: j,
@@ -2697,10 +2697,10 @@ var Tn = /*#__PURE__*/ N.forwardRef(function(e, n) {
2697
2697
  display: "inline-flex",
2698
2698
  ...t && {}
2699
2699
  })), On = S(Tn)(({ selected: e }) => ({
2700
- backgroundColor: u.white(),
2701
- border: e ? `solid 2px ${u.buttonFocusOutline()}` : `1px solid ${u.text()}`,
2700
+ backgroundColor: l.white(),
2701
+ border: e ? `solid 2px ${l.buttonFocusOutline()}` : `1px solid ${l.text()}`,
2702
2702
  opacity: e ? .7 : 1,
2703
- color: u.text(),
2703
+ color: l.text(),
2704
2704
  alignItems: "center",
2705
2705
  display: "inline-flex",
2706
2706
  height: "initial",
@@ -2722,8 +2722,8 @@ var Tn = /*#__PURE__*/ N.forwardRef(function(e, n) {
2722
2722
  "& mjx-frac": { fontSize: "120% !important" },
2723
2723
  "& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn": { fontSize: "120% !important" }
2724
2724
  }));
2725
- function An({ choice: e, disabled: t, instanceId: n, selectedItem: i, onSelectClick: a }) {
2726
- let o = I(null), { attributes: s, listeners: c, setNodeRef: l, isDragging: u } = D({
2725
+ function An({ choice: e, disabled: t, instanceId: n, selectedItem: r, onSelectClick: i }) {
2726
+ let a = I(null), { attributes: o, listeners: s, setNodeRef: c, isDragging: l } = D({
2727
2727
  id: `choice-${e.id}`,
2728
2728
  data: {
2729
2729
  choice: e,
@@ -2734,32 +2734,32 @@ function An({ choice: e, disabled: t, instanceId: n, selectedItem: i, onSelectCl
2734
2734
  disabled: t
2735
2735
  });
2736
2736
  F(() => {
2737
- r(o.current);
2737
+ p(a.current);
2738
2738
  }, [e.value]);
2739
- let d = !!i && i.fromChoice === !0 && i.choice.id === e.id;
2739
+ let u = !!r && r.fromChoice === !0 && r.choice.id === e.id;
2740
2740
  return /* @__PURE__ */ L(Dn, {
2741
- ref: l,
2742
- style: u ? {
2743
- width: o.current?.offsetWidth || 90,
2744
- height: o.current?.offsetHeight || 32
2741
+ ref: c,
2742
+ style: l ? {
2743
+ width: a.current?.offsetWidth || 90,
2744
+ height: a.current?.offsetHeight || 32
2745
2745
  } : {},
2746
2746
  disabled: t,
2747
- selected: d,
2747
+ selected: u,
2748
2748
  onClick: (r) => {
2749
- t || (r.stopPropagation(), a?.({
2749
+ t || (r.stopPropagation(), i?.({
2750
2750
  choice: e,
2751
2751
  instanceId: n,
2752
2752
  fromChoice: !0,
2753
2753
  type: "MaskBlank"
2754
2754
  }));
2755
2755
  },
2756
- ...c,
2757
2756
  ...s,
2757
+ ...o,
2758
2758
  children: /* @__PURE__ */ L(On, {
2759
2759
  clickable: !1,
2760
2760
  disabled: t,
2761
- selected: d,
2762
- ref: o,
2761
+ selected: u,
2762
+ ref: a,
2763
2763
  label: /* @__PURE__ */ L(kn, { dangerouslySetInnerHTML: { __html: e.value } })
2764
2764
  })
2765
2765
  });
@@ -2798,22 +2798,22 @@ var Nn = S("div")(({ theme: e }) => ({
2798
2798
  userSelect: "none",
2799
2799
  width: "100%",
2800
2800
  height: "100%",
2801
- background: u.white(),
2801
+ background: l.white(),
2802
2802
  transition: "background-color 200ms linear, border-color 200ms linear",
2803
2803
  boxSizing: "border-box",
2804
2804
  display: "grid",
2805
2805
  gridRowGap: e.spacing(1),
2806
2806
  gridColumnGap: e.spacing(1),
2807
2807
  padding: e.spacing(1),
2808
- border: `2px dashed ${u.black()}`
2808
+ border: `2px dashed ${l.black()}`
2809
2809
  },
2810
2810
  "&.placeholderDisabled": {
2811
2811
  boxShadow: "none",
2812
- background: u.white()
2812
+ background: l.white()
2813
2813
  },
2814
2814
  "&.over": {
2815
- border: `1px solid ${u.border()}`,
2816
- backgroundColor: u.backgroundDark()
2815
+ border: `1px solid ${l.border()}`,
2816
+ backgroundColor: l.backgroundDark()
2817
2817
  },
2818
2818
  "&.board": {
2819
2819
  padding: e.spacing(1),
@@ -2824,7 +2824,7 @@ var Nn = S("div")(({ theme: e }) => ({
2824
2824
  justifyContent: "center",
2825
2825
  overflow: "hidden",
2826
2826
  touchAction: "none",
2827
- backgroundColor: u.surface()
2827
+ backgroundColor: l.surface()
2828
2828
  },
2829
2829
  "&.categorizeBoard": {
2830
2830
  padding: e.spacing(.5),
@@ -2835,19 +2835,19 @@ var Nn = S("div")(({ theme: e }) => ({
2835
2835
  justifyContent: "center",
2836
2836
  overflow: "hidden",
2837
2837
  touchAction: "none",
2838
- backgroundColor: u.surface()
2838
+ backgroundColor: l.surface()
2839
2839
  },
2840
2840
  "&.verticalPool": {
2841
2841
  display: "flex",
2842
2842
  flexFlow: "column wrap"
2843
2843
  }
2844
2844
  })), Pn = (e) => {
2845
- let { children: t, className: n, isOver: r, type: i, grid: a, disabled: o, choiceBoard: s, isCategorize: c, isVerticalPool: l, minHeight: d, extraStyles: f } = e, p = Mn("placeholder", o && "placeholderDisabled", r && "over", i, n), m = {};
2845
+ let { children: t, className: n, isOver: r, type: i, grid: a, disabled: o, choiceBoard: s, isCategorize: c, isVerticalPool: u, minHeight: d, extraStyles: f } = e, p = Mn("placeholder", o && "placeholderDisabled", r && "over", i, n), m = {};
2846
2846
  if (a && a.columns && (m.gridTemplateColumns = `repeat(${a.columns}, 1fr)`), a && a.rows) {
2847
2847
  let e = a.rowsRepeatValue || "1fr";
2848
2848
  m.gridTemplateRows = `repeat(${a.rows}, ${e})`;
2849
2849
  }
2850
- i === "choice" && (m.border = `1px solid ${u.borderLight()}`, m.background = u.surface());
2850
+ i === "choice" && (m.border = `1px solid ${l.borderLight()}`, m.background = l.surface());
2851
2851
  let h = c ? "categorizeBoard" : "board";
2852
2852
  return /* @__PURE__ */ L(Nn, {
2853
2853
  style: {
@@ -2855,7 +2855,7 @@ var Nn = S("div")(({ theme: e }) => ({
2855
2855
  minHeight: d,
2856
2856
  ...f
2857
2857
  },
2858
- className: Mn(s ? h : p, l && "verticalPool"),
2858
+ className: Mn(s ? h : p, u && "verticalPool"),
2859
2859
  children: t
2860
2860
  });
2861
2861
  };
@@ -2984,7 +2984,7 @@ function zn() {
2984
2984
  //#region ../../lib-react/mask-markup/dist/components/blank.js
2985
2985
  (0, Ht.default)("pie-lib:mask-markup:blank");
2986
2986
  var Bn = S("span")(({ dragged: e, over: t, selected: n, showsPointerCursor: r }) => ({
2987
- border: `solid 0px ${u.primary()}`,
2987
+ border: `solid 0px ${l.primary()}`,
2988
2988
  minWidth: "200px",
2989
2989
  overflow: "hidden",
2990
2990
  whiteSpace: "nowrap",
@@ -3000,10 +3000,10 @@ var Bn = S("span")(({ dragged: e, over: t, selected: n, showsPointerCursor: r })
3000
3000
  display: "inline-flex",
3001
3001
  touchAction: "none"
3002
3002
  }), Hn = S(Tn)(() => ({
3003
- backgroundColor: u.background(),
3004
- border: `2px dashed ${u.text()}`,
3003
+ backgroundColor: l.background(),
3004
+ border: `2px dashed ${l.text()}`,
3005
3005
  touchAction: "none",
3006
- color: u.text(),
3006
+ color: l.text(),
3007
3007
  fontSize: "inherit",
3008
3008
  maxWidth: "374px",
3009
3009
  position: "relative",
@@ -3016,8 +3016,8 @@ var Bn = S("span")(({ dragged: e, over: t, selected: n, showsPointerCursor: r })
3016
3016
  border: `1px solid ${A[500]}`,
3017
3017
  backgroundColor: `${A[300]}`
3018
3018
  },
3019
- "&.correct": { border: `solid 1px ${u.correct()}` },
3020
- "&.incorrect": { border: `solid 1px ${u.incorrect()}` },
3019
+ "&.correct": { border: `solid 1px ${l.correct()}` },
3020
+ "&.incorrect": { border: `solid 1px ${l.incorrect()}` },
3021
3021
  "&.Mui-disabled": { opacity: 1 }
3022
3022
  })), Un = S("span")(() => ({
3023
3023
  whiteSpace: "normal",
@@ -3048,38 +3048,38 @@ var Bn = S("span")(({ dragged: e, over: t, selected: n, showsPointerCursor: r })
3048
3048
  transform: "translateY(-50%)"
3049
3049
  }
3050
3050
  }));
3051
- function Wn({ disabled: e, choice: t, isOver: n, isDragging: i, dragItem: a, correct: o, emptyResponseAreaWidth: s, emptyResponseAreaHeight: c }) {
3052
- let l = I(null), u = I(null), d = I(null), f = I(!1), [p, m] = re({
3051
+ function Wn({ disabled: e, choice: t, isOver: n, isDragging: r, dragItem: i, correct: a, emptyResponseAreaWidth: o, emptyResponseAreaHeight: s }) {
3052
+ let c = I(null), l = I(null), u = I(null), d = I(!1), [f, m] = re({
3053
3053
  height: 0,
3054
3054
  width: 0
3055
3055
  }), h = () => {
3056
3056
  v();
3057
3057
  }, g = () => {
3058
- let e = u.current?.querySelector("img");
3058
+ let e = l.current?.querySelector("img");
3059
3059
  e ? e.onload = h : setTimeout(() => {
3060
3060
  v();
3061
3061
  }, 300);
3062
3062
  }, _ = () => {
3063
- if (!u.current) return null;
3064
- if (u.current.querySelector("mjx-container") && u.current.parentElement) return u.current.parentElement;
3065
- let e = u.current.querySelector("img");
3066
- return e ? u.current.textContent.trim().length > 0 ? u.current : e : u.current;
3063
+ if (!l.current) return null;
3064
+ if (l.current.querySelector("mjx-container") && l.current.parentElement) return l.current.parentElement;
3065
+ let e = l.current.querySelector("img");
3066
+ return e ? l.current.textContent.trim().length > 0 ? l.current : e : l.current;
3067
3067
  }, v = () => {
3068
- if (u.current && l.current && !f.current) {
3069
- f.current = !0, l.current.style.width = "auto", l.current.style.height = "auto", l.current.offsetHeight;
3070
- let e = _() || u.current, t = e.getBoundingClientRect(), n = e.offsetWidth || t.width || 0, r = Math.max(e.offsetHeight || 0, t.height || 0, e.scrollHeight || 0, u.current.scrollHeight || 0), i = n + 24 + 4 + 1, a = r + 24 + 4 + 1, o = parseFloat(s) || 0, d = parseFloat(c) || 0, p = i <= o ? o : i, h = a <= d ? d : a;
3068
+ if (l.current && c.current && !d.current) {
3069
+ d.current = !0, c.current.style.width = "auto", c.current.style.height = "auto", c.current.offsetHeight;
3070
+ let e = _() || l.current, t = e.getBoundingClientRect(), n = e.offsetWidth || t.width || 0, r = Math.max(e.offsetHeight || 0, t.height || 0, e.scrollHeight || 0, l.current.scrollHeight || 0), i = n + 24 + 4 + 1, a = r + 24 + 4 + 1, u = parseFloat(o) || 0, f = parseFloat(s) || 0, p = i <= u ? u : i, h = a <= f ? f : a;
3071
3071
  m((e) => ({
3072
- width: p > o ? p : e.width,
3073
- height: h > d ? h : e.height
3072
+ width: p > u ? p : e.width,
3073
+ height: h > f ? h : e.height
3074
3074
  }));
3075
3075
  let g = `${p}px`, v = `${h}px`;
3076
- l.current.style.width !== g && (l.current.style.width = g), l.current.style.height !== v && (l.current.style.height = v), f.current = !1;
3076
+ c.current.style.width !== g && (c.current.style.width = g), c.current.style.height !== v && (c.current.style.height = v), d.current = !1;
3077
3077
  }
3078
3078
  }, y = () => {
3079
- let e = isNaN(parseFloat(s)) ? 0 : parseFloat(s), t = isNaN(parseFloat(c)) ? 0 : parseFloat(c);
3079
+ let e = isNaN(parseFloat(o)) ? 0 : parseFloat(o), t = isNaN(parseFloat(s)) ? 0 : parseFloat(s);
3080
3080
  return {
3081
- height: p.height || t,
3082
- width: p.width || e,
3081
+ height: f.height || t,
3082
+ width: f.width || e,
3083
3083
  ...e ? {} : { minWidth: 90 },
3084
3084
  ...t ? {} : { minHeight: 32 }
3085
3085
  };
@@ -3087,17 +3087,17 @@ function Wn({ disabled: e, choice: t, isOver: n, isDragging: i, dragItem: a, cor
3087
3087
  F(() => {
3088
3088
  g();
3089
3089
  }, []), F(() => {
3090
- if (typeof IntersectionObserver > "u" || !l.current) return;
3090
+ if (typeof IntersectionObserver > "u" || !c.current) return;
3091
3091
  let e = new IntersectionObserver((e) => {
3092
3092
  e.some((e) => e.isIntersecting) && v();
3093
3093
  }, { threshold: 0 });
3094
- return e.observe(l.current), () => e.disconnect();
3094
+ return e.observe(c.current), () => e.disconnect();
3095
3095
  }, []), F(() => {
3096
- l.current && r(l.current);
3096
+ c.current && p(c.current);
3097
3097
  }, [
3098
- o,
3098
+ a,
3099
3099
  n,
3100
- a?.choice?.value
3100
+ i?.choice?.value
3101
3101
  ]), F(() => {
3102
3102
  if (!t) {
3103
3103
  m({
@@ -3108,26 +3108,26 @@ function Wn({ disabled: e, choice: t, isOver: n, isDragging: i, dragItem: a, cor
3108
3108
  }
3109
3109
  g();
3110
3110
  }, [t?.value]), F(() => {
3111
- !n && !i && (d.current = {
3112
- width: l.current.offsetWidth,
3113
- height: l.current.offsetHeight
3111
+ !n && !r && (u.current = {
3112
+ width: c.current.offsetWidth,
3113
+ height: c.current.offsetHeight
3114
3114
  });
3115
3115
  }, [
3116
3116
  t,
3117
3117
  n,
3118
- i
3118
+ r
3119
3119
  ]);
3120
- let b = a && n && a.choice && a.choice.value, x = t && t.value, S = n || i ? {
3121
- width: d.current?.width,
3122
- height: d.current?.height
3120
+ let b = i && n && i.choice && i.choice.value, x = t && t.value, S = n || r ? {
3121
+ width: u.current?.width,
3122
+ height: u.current?.height
3123
3123
  } : y();
3124
3124
  return /* @__PURE__ */ L(Hn, {
3125
3125
  clickable: !1,
3126
3126
  disabled: e,
3127
- ref: l,
3127
+ ref: c,
3128
3128
  component: "span",
3129
3129
  label: /* @__PURE__ */ R(P.Fragment, { children: [/* @__PURE__ */ L(Un, {
3130
- ref: u,
3130
+ ref: l,
3131
3131
  draggable: !0,
3132
3132
  className: zn({
3133
3133
  over: n,
@@ -3145,8 +3145,8 @@ function Wn({ disabled: e, choice: t, isOver: n, isDragging: i, dragItem: a, cor
3145
3145
  className: zn({
3146
3146
  over: n,
3147
3147
  parentOver: n,
3148
- correct: o !== void 0 && o,
3149
- incorrect: o !== void 0 && !o
3148
+ correct: a !== void 0 && a,
3149
+ incorrect: a !== void 0 && !a
3150
3150
  }),
3151
3151
  variant: e ? "outlined" : void 0,
3152
3152
  style: S
@@ -3502,10 +3502,10 @@ function Z(e) {
3502
3502
  function Q(e, t) {
3503
3503
  return !e || Z(e) ? e : Z(e.default) ? e.default : t && Z(e[t]) ? e[t] : t && Z(e[t]?.default) ? e[t].default : e;
3504
3504
  }
3505
- var Qn = Q(d, "UiLayout") || Q(rr.UiLayout, "UiLayout"), $n = Q(h, "PreviewPrompt") || Q(rr.PreviewPrompt, "PreviewPrompt"), er = Q(c, "Collapsible") || Q(rr.Collapsible, "Collapsible"), tr = _, nr = tr.default, rr = nr && typeof nr == "object" ? nr : tr, ir = S(Qn)({
3506
- color: u.text(),
3507
- backgroundColor: u.background(),
3508
- "& tr > td": { color: u.text() },
3505
+ var Qn = Q(u, "UiLayout") || Q(rr.UiLayout, "UiLayout"), $n = Q(h, "PreviewPrompt") || Q(rr.PreviewPrompt, "PreviewPrompt"), er = Q(s, "Collapsible") || Q(rr.Collapsible, "Collapsible"), tr = _, nr = tr.default, rr = nr && typeof nr == "object" ? nr : tr, ir = S(Qn)({
3506
+ color: l.text(),
3507
+ backgroundColor: l.background(),
3508
+ "& tr > td": { color: l.text() },
3509
3509
  position: "relative"
3510
3510
  }), ar = S(er)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), or = S(er)(({ theme: e }) => ({ marginTop: e.spacing(2) })), sr = class extends P.Component {
3511
3511
  static propTypes = {
@@ -3603,7 +3603,7 @@ var lr = cr("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMC
3603
3603
  value: this._session.value,
3604
3604
  onChange: this.changeSession
3605
3605
  });
3606
- this._root ||= ie(this), this._root.render(e), setTimeout(() => r(this), 0);
3606
+ this._root ||= ie(this), this._root.render(e), setTimeout(() => p(this), 0);
3607
3607
  }
3608
3608
  };
3609
3609
  dispatchChangedEvent = () => {