@pie-element/math-templated 7.2.2-beta.6 → 7.2.2-beta.8

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","names":["React","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_configUi","_mathToolbar","_Card","_CardContent","_Button","_FormControlLabel","_Typography","_InputLabel","_Checkbox","_Select","_MenuItem","_styles","_IconButton","_Delete","_renderUi","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ResponseContainer","styled","Card","theme","marginBottom","spacing","width","minWidth","border","palette","grey","display","flexDirection","justifyContent","StyledCardContent","CardContent","paddingBottom","StyledTitle","Typography","fontWeight","fontSize","flex","StyledSelectContainer","InputContainer","marginTop","InputContainerWrapper","TitleBar","alignItems","FlexContainer","AlternateButton","Button","color","text","RemoveAlternateButton","IconButton","marginLeft","ErrorText","typography","error","main","paddingTop","ResponseBox","background","padding","AlternateBar","CustomColorCheckbox","Checkbox","tertiary","document","styleId","getElementById","style","createElement","id","textContent","head","appendChild","Response","Component","constructor","props","_defineProperty2","name","evt","response","onResponseChange","responseKey","newResponse","target","value","checked","answer","alternateId","alternates","alternateIdCounter","state","setState","showKeypad","openCount","onResponseDone","alternatesLength","keys","length","render","mode","cAllowTrailingZeros","cIgnoreOrder","validation","ignoreOrder","allowTrailingZeros","hasAlternates","classNames","editor","mathToolbar","styles","minHeight","keyToDisplay","parseInt","component","label","onChange","MenuProps","transitionDuration","enter","exit","enabled","control","onLiteralOptionsChange","MathToolbar","keypadMode","controlledKeypad","latex","onAnswerChange","onFocus","onDone","map","altIdx","key","onAlternateAnswerChange","onAlternateFocus","onAlternateDone","onClick","onRemoveAlternate","size","type","onAddAlternate","exports","defaultResponse","PropTypes","bool","object","oneOfType","string","number","func","isRequired","_default"],"sources":["../src/response.jsx"],"sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { InputContainer } from '@pie-lib/config-ui';\nimport { MathToolbar } from '@pie-lib/math-toolbar';\nimport Card from '@mui/material/Card';\nimport CardContent from '@mui/material/CardContent';\nimport Button from '@mui/material/Button';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport Typography from '@mui/material/Typography';\nimport InputLabel from '@mui/material/InputLabel';\nimport Checkbox from '@mui/material/Checkbox';\nimport Select from '@mui/material/Select';\nimport MenuItem from '@mui/material/MenuItem';\nimport { styled } from '@mui/material/styles';\nimport IconButton from '@mui/material/IconButton';\nimport Delete from '@mui/icons-material/Delete';\nimport { color } from '@pie-lib/render-ui';\n\nconst ResponseContainer = styled(Card)(({ theme }) => ({\n marginBottom: theme.spacing(2.5),\n width: '100%',\n minWidth: '548px',\n border: `1px solid ${theme.palette.grey[700]}`,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'space-between',\n}));\n\nconst StyledCardContent = styled(CardContent)(({ theme }) => ({\n paddingBottom: `${theme.spacing(2)} !important`,\n}));\n\nconst StyledTitle = styled(Typography)({\n fontWeight: 700,\n fontSize: '1.2rem',\n flex: 3,\n});\n\nconst StyledSelectContainer = styled(InputContainer)(({ theme }) => ({\n flex: 2,\n '& > *:not(label)': {\n marginTop: theme.spacing(1),\n },\n}));\n\nconst InputContainerWrapper = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nconst TitleBar = styled('div')({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n});\n\nconst FlexContainer = styled('div')({\n display: 'flex',\n});\n\nconst AlternateButton = styled(Button)(({ theme }) => ({\n border: `1px solid ${theme.palette.grey['A400']}`,\n color: color.text(),\n}));\n\nconst RemoveAlternateButton = styled(IconButton)(({ theme }) => ({\n marginLeft: theme.spacing(1),\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nconst ResponseBox = styled('div')(({ theme }) => ({\n background: theme.palette.grey['A100'],\n color: theme.palette.grey['A700'],\n display: 'inline',\n minWidth: '50px',\n padding: '8px',\n border: '1px solid #C0C3CF',\n}));\n\nconst AlternateBar = styled('div')({\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n});\n\nconst CustomColorCheckbox = styled(Checkbox)({\n color: `${color.tertiary()} !important`,\n});\n\n// CSS for MathToolbar classNames (used as strings)\nif (typeof document !== 'undefined') {\n const styleId = 'math-templated-response-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n .response-editor {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-width: 500px;\n max-width: 900px;\n height: auto;\n min-height: 40px;\n }\n .math-toolbar {\n width: 100%;\n }\n `;\n document.head.appendChild(style);\n }\n}\n\nexport class Response extends React.Component {\n static propTypes = {\n defaultResponse: PropTypes.bool,\n error: PropTypes.object,\n mode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n onResponseChange: PropTypes.func.isRequired,\n onResponseDone: PropTypes.func.isRequired,\n response: PropTypes.object.isRequired,\n cIgnoreOrder: PropTypes.object.isRequired,\n cAllowTrailingZeros: PropTypes.object.isRequired,\n responseKey: PropTypes.number.isRequired,\n };\n\n static defaultProps = {\n defaultResponse: false,\n mode: '8',\n };\n\n constructor(props) {\n super(props);\n\n const { response: { alternates } = {} } = props || {};\n const alternatesLength = Object.keys(alternates || {}).length;\n\n this.state = {\n alternateIdCounter: alternatesLength + 1,\n showKeypad: {\n openCount: 0,\n main: false,\n },\n };\n }\n\n onChange = (name) => (evt) => {\n const { response, onResponseChange, responseKey } = this.props;\n const newResponse = { ...response };\n\n newResponse[name] = evt.target.value;\n\n onResponseChange(newResponse, responseKey);\n };\n\n onConfigChanged = (name) => (evt) => {\n const { response, onResponseChange, responseKey } = this.props;\n const newResponse = { ...response };\n\n newResponse[name] = evt.target.checked;\n\n onResponseChange(newResponse, responseKey);\n };\n\n onLiteralOptionsChange = (name) => () => {\n const { response, onResponseChange, responseKey } = this.props;\n const newResponse = { ...response };\n\n newResponse[name] = !response[name];\n\n onResponseChange(newResponse, responseKey);\n };\n\n onAnswerChange = (answer) => {\n const { response, onResponseChange, responseKey } = this.props;\n const newResponse = { ...response };\n\n newResponse.answer = answer;\n\n onResponseChange(newResponse, responseKey);\n };\n\n onAlternateAnswerChange = (alternateId) => (answer) => {\n const { response, onResponseChange, responseKey } = this.props;\n const newResponse = { ...response };\n\n newResponse.alternates[alternateId] = answer;\n\n onResponseChange(newResponse, responseKey);\n };\n\n onAddAlternate = () => {\n const { response, onResponseChange, responseKey } = this.props;\n const { alternateIdCounter } = this.state;\n const newResponse = { ...response };\n\n if (!newResponse.alternates) {\n newResponse.alternates = {};\n }\n\n newResponse.alternates[alternateIdCounter] = '';\n\n onResponseChange(newResponse, responseKey);\n\n this.setState({\n alternateIdCounter: alternateIdCounter + 1,\n });\n };\n\n onRemoveAlternate = (alternateId) => () => {\n const { response, onResponseChange, responseKey } = this.props;\n const newResponse = { ...response };\n\n delete newResponse.alternates[alternateId];\n\n onResponseChange(newResponse, responseKey);\n\n this.setState((state) => ({\n showKeypad: {\n ...state.showKeypad,\n openCount: !state.showKeypad[alternateId] ? state.showKeypad.openCount : state.showKeypad.openCount - 1,\n },\n }));\n };\n\n onDone = () => {\n const { onResponseDone } = this.props;\n this.setState((state) => ({\n showKeypad: {\n ...state.showKeypad,\n openCount: state.showKeypad.openCount - 1,\n main: false,\n },\n }));\n\n onResponseDone();\n };\n\n onFocus = () => {\n this.setState((state) => ({\n showKeypad: {\n ...state.showKeypad,\n openCount: !state.showKeypad.main ? state.showKeypad.openCount + 1 : state.showKeypad.openCount,\n main: true,\n },\n }));\n };\n\n onAlternateFocus = (alternateId) => () => {\n this.setState((state) => ({\n showKeypad: {\n ...state.showKeypad,\n openCount: !state.showKeypad[alternateId] ? state.showKeypad.openCount + 1 : state.showKeypad.openCount,\n [alternateId]: true,\n },\n }));\n };\n\n onAlternateDone = (alternateId) => () => {\n this.setState((state) => ({\n showKeypad: {\n ...state.showKeypad,\n openCount: state.showKeypad.openCount - 1,\n [alternateId]: false,\n },\n }));\n };\n\n render() {\n const { mode, responseKey, response, cAllowTrailingZeros, cIgnoreOrder, error } = this.props;\n const { showKeypad } = this.state;\n const { validation, answer, alternates, ignoreOrder, allowTrailingZeros } = response;\n const hasAlternates = Object.keys(alternates || {}).length > 0;\n const classNames = {\n editor: 'response-editor',\n mathToolbar: 'math-toolbar',\n };\n const styles = {\n minHeight: `${showKeypad.openCount > 0 ? 430 : 230}px`,\n };\n // add 1 to index to display R 1 instead of R 0\n const keyToDisplay = `R ${parseInt(responseKey) + 1}`;\n\n return (\n <ResponseContainer style={styles}>\n <StyledCardContent>\n <TitleBar>\n <StyledTitle component=\"div\">\n Response for <ResponseBox>{keyToDisplay}</ResponseBox>\n </StyledTitle>\n\n <StyledSelectContainer label=\"Validation\">\n <Select onChange={this.onChange('validation')} value={validation || 'literal'} MenuProps={{transitionDuration: { enter: 225, exit: 195 } }}>\n <MenuItem value=\"literal\">Literal Validation</MenuItem>\n <MenuItem value=\"symbolic\">Symbolic Validation</MenuItem>\n </Select>\n </StyledSelectContainer>\n </TitleBar>\n\n {validation === 'literal' && (\n <FlexContainer>\n {cAllowTrailingZeros.enabled && (\n <FormControlLabel\n label={cAllowTrailingZeros.label}\n control={\n <CustomColorCheckbox\n checked={allowTrailingZeros}\n onChange={this.onLiteralOptionsChange('allowTrailingZeros')}\n />\n }\n />\n )}\n\n {cIgnoreOrder.enabled && (\n <FormControlLabel\n label={cIgnoreOrder.label}\n control={\n <CustomColorCheckbox\n checked={ignoreOrder}\n onChange={this.onLiteralOptionsChange('ignoreOrder')}\n />\n }\n />\n )}\n </FlexContainer>\n )}\n\n <InputContainerWrapper>\n <InputLabel>Correct Answer</InputLabel>\n <MathToolbar\n keypadMode={mode}\n classNames={classNames}\n controlledKeypad\n showKeypad={showKeypad.main}\n latex={answer || ''}\n onChange={this.onAnswerChange}\n onFocus={this.onFocus}\n onDone={this.onDone}\n error={error && error.answer}\n />\n {error && error.answer ? <ErrorText>{error.answer}</ErrorText> : null}\n </InputContainerWrapper>\n\n {hasAlternates &&\n Object.keys(alternates).map((alternateId, altIdx) => (\n <InputContainerWrapper key={alternateId}>\n <InputLabel>\n Alternate\n {Object.keys(alternates).length > 1 ? ` ${altIdx + 1}` : ''}\n </InputLabel>\n <AlternateBar>\n <MathToolbar\n classNames={classNames}\n controlledKeypad\n keypadMode={mode}\n showKeypad={showKeypad[alternateId] || false}\n latex={alternates[alternateId] || ''}\n onChange={this.onAlternateAnswerChange(alternateId)}\n onFocus={this.onAlternateFocus(alternateId)}\n onDone={this.onAlternateDone(alternateId)}\n error={error && error[alternateId]}\n />\n <RemoveAlternateButton\n onClick={this.onRemoveAlternate(alternateId)}\n size=\"large\">\n <Delete />\n </RemoveAlternateButton>\n </AlternateBar>\n {error && error[alternateId] ? <ErrorText>{error[alternateId]}</ErrorText> : null}\n </InputContainerWrapper>\n ))}\n\n <AlternateButton type=\"primary\" onClick={this.onAddAlternate}>\n ADD ALTERNATE\n </AlternateButton>\n </StyledCardContent>\n </ResponseContainer>\n );\n }\n}\n\nexport default Response;\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,YAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,OAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,iBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,WAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,WAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,SAA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C,kBAAS,CAACG,SAAS,CAAC,CAACH,kBAAS,CAACI,MAAM,EAAEJ,kBAAS,CAACK,MAAM,CAAC,CAAC;EAC/DpE,gBAAgB,EAAE+D,kBAAS,CAACM,IAAI,CAACC,UAAU;EAC3CxD,cAAc,EAAEiD,kBAAS,CAACM,IAAI,CAACC,UAAU;EACzCvE,QAAQ,EAAEgE,kBAAS,CAACE,MAAM,CAACK,UAAU;EACrCjD,YAAY,EAAE0C,kBAAS,CAACE,MAAM,CAACK,UAAU;EACzClD,mBAAmB,EAAE2C,kBAAS,CAACE,MAAM,CAACK,UAAU;EAChDrE,WAAW,EAAE8D,kBAAS,CAACK,MAAM,CAACE;AAChC,CAAC;AAAA,IAAA1E,gBAAA,CAAAtE,OAAA,EAXUkE,QAAQ,kBAaG;EACpBsE,eAAe,EAAE,KAAK;EACtB3C,IAAI,EAAE;AACR,CAAC;AAAA,IAAAoD,QAAA,GAAAV,OAAA,CAAAvI,OAAA,GA4PYkE,QAAQ","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.generateValidationMessage = void 0;
7
+ const generateValidationMessage = config => {
8
+ const {
9
+ maxResponseAreas
10
+ } = config;
11
+ const responseAreasMessage = '\nCorrect answers should not be blank.' + '\nEach answer defined for a response area should be unique.' + '\nThere should be at least 1 ' + (maxResponseAreas ? `and at most ${maxResponseAreas} ` : '') + 'response area' + (maxResponseAreas ? 's' : '') + ' defined.';
12
+ return 'Validation requirements:' + responseAreasMessage;
13
+ };
14
+ exports.generateValidationMessage = generateValidationMessage;
15
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":["generateValidationMessage","config","maxResponseAreas","responseAreasMessage","exports"],"sources":["../src/utils.js"],"sourcesContent":["export const generateValidationMessage = (config) => {\n const { maxResponseAreas } = config;\n\n const responseAreasMessage =\n '\\nCorrect answers should not be blank.' +\n '\\nEach answer defined for a response area should be unique.' +\n '\\nThere should be at least 1 ' +\n (maxResponseAreas ? `and at most ${maxResponseAreas} ` : '') +\n 'response area' +\n (maxResponseAreas ? 's' : '') +\n ' defined.';\n\n return 'Validation requirements:' + responseAreasMessage;\n};\n"],"mappings":";;;;;;AAAO,MAAMA,yBAAyB,GAAIC,MAAM,IAAK;EACnD,MAAM;IAAEC;EAAiB,CAAC,GAAGD,MAAM;EAEnC,MAAME,oBAAoB,GACxB,wCAAwC,GACxC,6DAA6D,GAC7D,+BAA+B,IAC9BD,gBAAgB,GAAG,eAAeA,gBAAgB,GAAG,GAAG,EAAE,CAAC,GAC5D,eAAe,IACdA,gBAAgB,GAAG,GAAG,GAAG,EAAE,CAAC,GAC7B,WAAW;EAEb,OAAO,0BAA0B,GAAGC,oBAAoB;AAC1D,CAAC;AAACC,OAAA,CAAAJ,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/math-templated-configure",
3
3
  "private": true,
4
- "version": "5.4.0-beta.12",
4
+ "version": "5.4.0-beta.14",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -11,9 +11,9 @@
11
11
  "@mui/icons-material": "^7.3.4",
12
12
  "@mui/material": "^7.3.4",
13
13
  "@pie-framework/pie-configure-events": "^1.3.0",
14
- "@pie-lib/config-ui": "13.0.22-beta.1",
15
- "@pie-lib/editable-html-tip-tap": "2.1.20-beta.1",
16
- "@pie-lib/math-toolbar": "3.0.11-beta.1",
14
+ "@pie-lib/config-ui": "13.0.22-beta.3",
15
+ "@pie-lib/editable-html-tip-tap": "2.1.20-beta.3",
16
+ "@pie-lib/math-toolbar": "3.0.11-beta.3",
17
17
  "@pie-lib/render-ui": "6.1.3",
18
18
  "debug": "^4.1.1",
19
19
  "lodash-es": "^4.17.23",
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [6.4.0-beta.14](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-templated-controller@6.4.0-beta.13...@pie-element/math-templated-controller@6.4.0-beta.14) (2026-09-29)
7
+
8
+ **Note:** Version bump only for package @pie-element/math-templated-controller
9
+
10
+ # [6.4.0-beta.13](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-templated-controller@6.4.0-beta.12...@pie-element/math-templated-controller@6.4.0-beta.13) (2026-09-24)
11
+
12
+ **Note:** Version bump only for package @pie-element/math-templated-controller
13
+
6
14
  # [6.4.0-beta.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/math-templated-controller@6.4.0-beta.11...@pie-element/math-templated-controller@6.4.0-beta.12) (2026-09-24)
7
15
 
8
16
  **Note:** Version bump only for package @pie-element/math-templated-controller
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ // Should be exactly the same as configure/defaults.js
8
+ var _default = exports.default = {
9
+ model: {
10
+ allowTrailingZerosDefault: false,
11
+ equationEditor: '8',
12
+ ignoreOrderDefault: false,
13
+ markup: '',
14
+ playerSpellCheckEnabled: true,
15
+ prompt: '',
16
+ promptEnabled: true,
17
+ rationale: '',
18
+ rationaleEnabled: true,
19
+ responses: {},
20
+ spellCheckEnabled: true,
21
+ teacherInstructions: '',
22
+ teacherInstructionsEnabled: true,
23
+ toolbarEditorPosition: 'bottom',
24
+ validationDefault: 'literal'
25
+ },
26
+ configuration: {}
27
+ };
28
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","names":["_default","exports","default","model","allowTrailingZerosDefault","equationEditor","ignoreOrderDefault","markup","playerSpellCheckEnabled","prompt","promptEnabled","rationale","rationaleEnabled","responses","spellCheckEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition","validationDefault","configuration"],"sources":["../src/defaults.js"],"sourcesContent":["// Should be exactly the same as configure/defaults.js\nexport default {\n model: {\n allowTrailingZerosDefault: false,\n equationEditor: '8',\n ignoreOrderDefault: false,\n markup: '',\n playerSpellCheckEnabled: true,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n responses: {},\n spellCheckEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n validationDefault: 'literal',\n },\n configuration: {},\n};\n"],"mappings":";;;;;;AAAA;AAAA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACe;EACbC,KAAK,EAAE;IACLC,yBAAyB,EAAE,KAAK;IAChCC,cAAc,EAAE,GAAG;IACnBC,kBAAkB,EAAE,KAAK;IACzBC,MAAM,EAAE,EAAE;IACVC,uBAAuB,EAAE,IAAI;IAC7BC,MAAM,EAAE,EAAE;IACVC,aAAa,EAAE,IAAI;IACnBC,SAAS,EAAE,EAAE;IACbC,gBAAgB,EAAE,IAAI;IACtBC,SAAS,EAAE,CAAC,CAAC;IACbC,iBAAiB,EAAE,IAAI;IACvBC,mBAAmB,EAAE,EAAE;IACvBC,0BAA0B,EAAE,IAAI;IAChCC,qBAAqB,EAAE,QAAQ;IAC/BC,iBAAiB,EAAE;EACrB,CAAC;EACDC,aAAa,EAAE,CAAC;AAClB,CAAC","ignoreList":[]}
@@ -0,0 +1,360 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.validate = exports.prepareVal = exports.outcome = exports.normalizeSession = exports.model = exports.getPartialScore = exports.getLogTrace = exports.getCorrectness = exports.createDefaultModel = exports.createCorrectResponseSession = void 0;
8
+ var _debug = _interopRequireDefault(require("debug"));
9
+ var _lodashEs = require("lodash-es");
10
+ var _translator = _interopRequireDefault(require("@pie-lib/translator"));
11
+ var mv = _interopRequireWildcard(require("@pie-framework/math-validation"));
12
+ var _defaults = _interopRequireDefault(require("./defaults"));
13
+ var _controllerUtils = require("@pie-lib/controller-utils");
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
+ const {
16
+ translator
17
+ } = _translator.default;
18
+ const log = (0, _debug.default)('@pie-element:math-templated:controller');
19
+ const getFeedback = value => value ? 'correct' : 'incorrect';
20
+ const getContent = html => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
21
+ const getIsAnswerCorrect = (correctResponse, answerItem) => {
22
+ let answerCorrect = false;
23
+ const opts = {
24
+ mode: correctResponse.validation || _defaults.default.validationDefault,
25
+ ...(correctResponse.validation === 'literal' && {
26
+ literal: {
27
+ allowTrailingZeros: correctResponse.allowTrailingZeros || false,
28
+ ignoreOrder: correctResponse.ignoreOrder || false
29
+ }
30
+ })
31
+ };
32
+ if (!answerCorrect) {
33
+ const acceptedValues = [correctResponse.answer, ...Object.values(correctResponse.alternates || {})];
34
+ try {
35
+ for (const value of acceptedValues) {
36
+ answerCorrect = mv.latexEqual(answerItem.value, value, opts);
37
+ if (answerCorrect) break;
38
+ }
39
+ } catch (e) {
40
+ log('Parse failure when evaluating math', e, correctResponse, answerItem);
41
+ answerCorrect = false;
42
+ }
43
+ }
44
+ return answerCorrect;
45
+ };
46
+ const getResponseCorrectness = (question, sessionResponse) => {
47
+ const correctResponses = question.responses;
48
+ if (!sessionResponse) {
49
+ return {
50
+ correctness: 'unanswered',
51
+ score: 0,
52
+ correct: false
53
+ };
54
+ } else {
55
+ let correctAnswers = 0;
56
+ let score = 0;
57
+ const correctResponsesCount = Object.keys(correctResponses || {}).length;
58
+ Object.keys(correctResponses).forEach(responseId => {
59
+ const answerItem = sessionResponse['r' + responseId];
60
+ const correctResponse = correctResponses[responseId] || {};
61
+ const answerCorrect = getIsAnswerCorrect(correctResponse, answerItem);
62
+ if (answerCorrect) {
63
+ correctAnswers++;
64
+ }
65
+ });
66
+ const fullyCorrect = correctAnswers === correctResponsesCount;
67
+
68
+ // partial credit scoring: each correct answer is worth 1 / total answers point
69
+ // dichotomous scoring: for credit to be awarded, a correct answer must be entered for every response area
70
+ score = Number((correctAnswers / Object.keys(correctResponses).length).toFixed(2));
71
+ return {
72
+ correctness: getFeedback(fullyCorrect),
73
+ score: correctAnswers > 0 ? score : 0,
74
+ correct: fullyCorrect
75
+ };
76
+ }
77
+ };
78
+ const getCorrectness = (question, env, session) => {
79
+ if (env.mode === 'evaluate') {
80
+ return getResponseCorrectness(question, session && session.answers);
81
+ }
82
+ };
83
+ exports.getCorrectness = getCorrectness;
84
+ const getPartialScore = (question, session) => {
85
+ if (!session || (0, _lodashEs.isEmpty)(session)) {
86
+ return 0;
87
+ }
88
+ return 1;
89
+ };
90
+
91
+ /**
92
+ * Generates detailed trace log for math-templated scoring evaluation
93
+ * @param {Object} question
94
+ * @param {Object} session
95
+ * @param {Object} env
96
+ * @returns {Array<string>} traceLog
97
+ */
98
+ exports.getPartialScore = getPartialScore;
99
+ const getLogTrace = (question, session, env) => {
100
+ const traceLog = [];
101
+ if (!session || !session.answers || Object.keys(session.answers).length === 0) {
102
+ traceLog.push('Student did not enter a response.');
103
+ return traceLog;
104
+ }
105
+ const answers = session.answers;
106
+ const responseIds = Object.keys(question.responses || {});
107
+ const totalAreas = responseIds.length;
108
+ traceLog.push(`${totalAreas} response area(s) defined in this question.`);
109
+ let answeredCount = 0;
110
+ let correctCount = 0;
111
+ responseIds.forEach((responseId, index) => {
112
+ const answerItem = answers[`r${responseId}`];
113
+ const studentValue = answerItem?.value?.trim();
114
+ const correctResponse = question.responses[responseId] || {};
115
+ const cleanStudentAnswer = studentValue ? studentValue.replace(/\\/g, '') : '';
116
+ if (studentValue) {
117
+ answeredCount++;
118
+ traceLog.push(`Response area ${index + 1}: student entered ${cleanStudentAnswer}.`);
119
+ } else {
120
+ traceLog.push(`Response area ${index + 1}: no response entered.`);
121
+ }
122
+ const validation = correctResponse.validation || question.validationDefault;
123
+ traceLog.push(`Validation mode: ${validation}.`);
124
+ if (validation === 'literal') {
125
+ const allowTrailingZeros = correctResponse.allowTrailingZeros || false;
126
+ const ignoreOrder = correctResponse.ignoreOrder || false;
127
+ traceLog.push(`Allow trailing zeros: ${allowTrailingZeros ? 'enabled' : 'disabled'}.`);
128
+ traceLog.push(`Ignore order: ${ignoreOrder ? 'enabled' : 'disabled'}.`);
129
+ }
130
+ const acceptedValues = [correctResponse.answer].concat(Object.values(correctResponse.alternates || {}));
131
+ if (acceptedValues.length > 1) {
132
+ traceLog.push(`Accepted answers: ${acceptedValues.length} (including alternates).`);
133
+ }
134
+ if (studentValue) {
135
+ const isCorrect = getIsAnswerCorrect(correctResponse, answerItem);
136
+ if (isCorrect) {
137
+ correctCount++;
138
+ traceLog.push(`Response area ${index + 1} is correct.`);
139
+ } else {
140
+ traceLog.push(`Response area ${index + 1} is incorrect.`);
141
+ }
142
+ }
143
+ });
144
+ traceLog.push(`${correctCount} out of ${totalAreas} response area(s) are correct.`);
145
+ const partialScoringEnabled = _controllerUtils.partialScoring.enabled(question, env);
146
+ traceLog.push(`Scoring method: ${partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring'}.`);
147
+ if (partialScoringEnabled) {
148
+ traceLog.push('Each correct response area contributes to the score.');
149
+ } else {
150
+ traceLog.push('Student must answer all response areas correctly to receive full credit.');
151
+ }
152
+ const correctness = getCorrectness(question, env, session);
153
+ traceLog.push(`Overall correctness: ${correctness.correctness}.`);
154
+ traceLog.push(`Final score: ${correctness.score}.`);
155
+ return traceLog;
156
+ };
157
+ exports.getLogTrace = getLogTrace;
158
+ const outcome = (question, session, env) => new Promise(resolve => {
159
+ if (!session || (0, _lodashEs.isEmpty)(session)) {
160
+ resolve({
161
+ score: 0,
162
+ empty: true,
163
+ logTrace: ['Student did not enter a response.']
164
+ });
165
+ return;
166
+ }
167
+ const partialScoringEnabled = _controllerUtils.partialScoring.enabled(question, env);
168
+ session = normalizeSession(session);
169
+ if (env.mode !== 'evaluate') {
170
+ resolve({
171
+ score: undefined,
172
+ completed: undefined,
173
+ logTrace: []
174
+ });
175
+ } else {
176
+ const correctness = getCorrectness(question, env, session, true);
177
+ const score = correctness.score;
178
+ resolve({
179
+ score: partialScoringEnabled ? score : score === 1 ? 1 : 0,
180
+ logTrace: getLogTrace(question, session, env)
181
+ });
182
+ }
183
+ });
184
+ exports.outcome = outcome;
185
+ const createDefaultModel = (model = {}) => {
186
+ const {
187
+ validationDefault,
188
+ allowTrailingZerosDefault,
189
+ ignoreOrderDefault,
190
+ responses = {}
191
+ } = model;
192
+ const updatedResponses = Object.keys(responses).reduce((acc, responseId) => {
193
+ const correctResponse = responses[responseId];
194
+ acc[responseId] = {
195
+ ...correctResponse,
196
+ validation: correctResponse.validation || validationDefault,
197
+ allowTrailingZeros: correctResponse.allowTrailingZeros || allowTrailingZerosDefault,
198
+ ignoreOrder: correctResponse.ignoreOrder || ignoreOrderDefault
199
+ };
200
+ return acc;
201
+ }, {});
202
+ return {
203
+ ..._defaults.default.model,
204
+ ...model,
205
+ responses: updatedResponses
206
+ };
207
+ };
208
+ exports.createDefaultModel = createDefaultModel;
209
+ const normalizeSession = s => ({
210
+ ...s
211
+ });
212
+ exports.normalizeSession = normalizeSession;
213
+ const getTextFromHTML = html => (html || '').replace(/<\/?[^>]+(>|$)/g, '');
214
+ const prepareVal = html => getTextFromHTML(html).trim();
215
+ exports.prepareVal = prepareVal;
216
+ const model = (question, session, env) => {
217
+ return new Promise(resolve => {
218
+ session = session || {};
219
+ const normalizedQuestion = createDefaultModel(question);
220
+ const correctness = getCorrectness(normalizedQuestion, env, session);
221
+ const {
222
+ responses,
223
+ language
224
+ } = normalizedQuestion;
225
+ let {
226
+ note
227
+ } = normalizedQuestion;
228
+ let showNote = false;
229
+
230
+ // check if there is at least one alternate response or if the validation for at least one response is not literal
231
+ Object.keys(responses).forEach(responseId => {
232
+ const correctResponse = responses[responseId] || {};
233
+ if (correctResponse.alternates && Object.keys(correctResponse.alternates).length > 0) {
234
+ showNote = true;
235
+ } else if (correctResponse.validation !== 'literal') {
236
+ showNote = true;
237
+ }
238
+ });
239
+ if (!note) {
240
+ note = translator.t('mathInline.primaryCorrectWithAlternates', {
241
+ lng: language
242
+ });
243
+ }
244
+ const out = {
245
+ prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,
246
+ markup: normalizedQuestion.markup,
247
+ responses: env.mode === 'gather' ? null : normalizedQuestion.responses,
248
+ language: normalizedQuestion.language,
249
+ equationEditor: normalizedQuestion.equationEditor,
250
+ customKeys: normalizedQuestion.customKeys,
251
+ disabled: env.mode !== 'gather',
252
+ view: env.mode === 'view',
253
+ correctness,
254
+ env,
255
+ extraCSSRules: normalizedQuestion.extraCSSRules
256
+ };
257
+ const {
258
+ answers = {}
259
+ } = session || {};
260
+ let feedback = {};
261
+ if (env.mode === 'evaluate') {
262
+ Object.keys(responses).forEach(responseId => {
263
+ const answerItem = answers['r' + responseId];
264
+ const correctResponse = responses[responseId];
265
+ feedback[responseId] = getIsAnswerCorrect(correctResponse, answerItem);
266
+ });
267
+ }
268
+ if (env.mode === 'evaluate') {
269
+ out.correctResponse = {};
270
+ out.showNote = showNote;
271
+ out.note = note;
272
+ out.feedback = feedback;
273
+ } else {
274
+ out.responses = {};
275
+ out.showNote = false;
276
+ }
277
+ if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
278
+ out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;
279
+ out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;
280
+ } else {
281
+ out.rationale = null;
282
+ out.teacherInstructions = null;
283
+ }
284
+ log('out: ', out);
285
+ resolve(out);
286
+ });
287
+ };
288
+ exports.model = model;
289
+ const createCorrectResponseSession = (question, env) => new Promise(resolve => {
290
+ if (env.mode !== 'evaluate' && env.role === 'instructor') {
291
+ const correctResponse = Object.keys(question.responses).reduce((acc, responseId) => {
292
+ acc['r' + responseId] = {
293
+ value: question.responses[responseId].answer
294
+ };
295
+ return acc;
296
+ }, {});
297
+ resolve({
298
+ id: '1',
299
+ answers: correctResponse
300
+ });
301
+ } else {
302
+ resolve(null);
303
+ }
304
+ });
305
+ exports.createCorrectResponseSession = createCorrectResponseSession;
306
+ const validate = (model = {}, config = {}) => {
307
+ const {
308
+ responses,
309
+ markup
310
+ } = model;
311
+ const {
312
+ maxResponseAreas
313
+ } = config;
314
+ const responsesErrors = {};
315
+ const errors = {};
316
+ ['teacherInstructions', 'prompt', 'rationale'].forEach(field => {
317
+ if (config[field]?.required && !getContent(model[field])) {
318
+ errors[field] = 'This field is required.';
319
+ }
320
+ });
321
+ Object.entries(responses || {}).forEach(([key, response], index) => {
322
+ const {
323
+ answer
324
+ } = response;
325
+ const reversedAlternates = [...Object.entries(response.alternates || {})].reverse();
326
+ const alternatesErrors = {};
327
+ const responseError = {};
328
+ if (answer === '') {
329
+ responseError.answer = 'Content should not be empty.';
330
+ }
331
+ reversedAlternates.forEach(([key, value], index) => {
332
+ if (value === '') {
333
+ alternatesErrors[key] = 'Content should not be empty.';
334
+ } else {
335
+ const identicalAnswer = answer === value || reversedAlternates.slice(index + 1).some(([, val]) => val === value);
336
+ if (identicalAnswer) {
337
+ alternatesErrors[key] = 'Content should be unique.';
338
+ }
339
+ }
340
+ });
341
+ if (!(0, _lodashEs.isEmpty)(responseError) || !(0, _lodashEs.isEmpty)(alternatesErrors)) {
342
+ responsesErrors[index] = {
343
+ ...responseError,
344
+ ...alternatesErrors
345
+ };
346
+ }
347
+ });
348
+ const nbOfResponseAreas = (markup.match(/\{\{(\d+)\}\}/g) || []).length;
349
+ if (nbOfResponseAreas > maxResponseAreas) {
350
+ errors.responseAreas = `No more than ${maxResponseAreas} response areas should be defined.`;
351
+ } else if (nbOfResponseAreas < 1) {
352
+ errors.responseAreas = 'There should be at least 1 response area defined.';
353
+ }
354
+ if (!(0, _lodashEs.isEmpty)(responsesErrors)) {
355
+ errors.responses = responsesErrors;
356
+ }
357
+ return errors;
358
+ };
359
+ exports.validate = validate;
360
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_debug","_interopRequireDefault","require","_lodashEs","_translator","mv","_interopRequireWildcard","_defaults","_controllerUtils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","translator","Translator","log","debug","getFeedback","value","getContent","html","replace","getIsAnswerCorrect","correctResponse","answerItem","answerCorrect","opts","mode","validation","defaults","validationDefault","literal","allowTrailingZeros","ignoreOrder","acceptedValues","answer","values","alternates","latexEqual","getResponseCorrectness","question","sessionResponse","correctResponses","responses","correctness","score","correct","correctAnswers","correctResponsesCount","keys","length","forEach","responseId","fullyCorrect","Number","toFixed","getCorrectness","env","session","answers","exports","getPartialScore","isEmpty","getLogTrace","traceLog","push","responseIds","totalAreas","answeredCount","correctCount","index","studentValue","trim","cleanStudentAnswer","concat","isCorrect","partialScoringEnabled","partialScoring","enabled","outcome","Promise","resolve","empty","logTrace","normalizeSession","undefined","completed","createDefaultModel","model","allowTrailingZerosDefault","ignoreOrderDefault","updatedResponses","reduce","acc","s","getTextFromHTML","prepareVal","normalizedQuestion","language","note","showNote","lng","out","prompt","promptEnabled","markup","equationEditor","customKeys","disabled","view","extraCSSRules","feedback","role","rationale","rationaleEnabled","teacherInstructions","teacherInstructionsEnabled","createCorrectResponseSession","id","validate","config","maxResponseAreas","responsesErrors","errors","field","required","entries","key","response","reversedAlternates","reverse","alternatesErrors","responseError","identicalAnswer","slice","some","val","nbOfResponseAreas","match","responseAreas"],"sources":["../src/index.js"],"sourcesContent":["import debug from 'debug';\nimport { isEmpty } from 'lodash-es';\nimport Translator from '@pie-lib/translator';\nimport * as mv from '@pie-framework/math-validation';\n\nimport defaults from './defaults';\nimport { partialScoring } from '@pie-lib/controller-utils';\n\nconst { translator } = Translator;\nconst log = debug('@pie-element:math-templated:controller');\n\nconst getFeedback = (value) => (value ? 'correct' : 'incorrect');\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nconst getIsAnswerCorrect = (correctResponse, answerItem) => {\n let answerCorrect = false;\n\n const opts = {\n mode: correctResponse.validation || defaults.validationDefault,\n ...(correctResponse.validation === 'literal' && {\n literal: {\n allowTrailingZeros: correctResponse.allowTrailingZeros || false,\n ignoreOrder: correctResponse.ignoreOrder || false,\n },\n }),\n };\n\n if (!answerCorrect) {\n const acceptedValues = [correctResponse.answer, ...Object.values(correctResponse.alternates || {})];\n\n try {\n for (const value of acceptedValues) {\n answerCorrect = mv.latexEqual(answerItem.value, value, opts);\n if (answerCorrect) break;\n }\n } catch (e) {\n log('Parse failure when evaluating math', e, correctResponse, answerItem);\n answerCorrect = false;\n }\n }\n\n return answerCorrect;\n};\n\nconst getResponseCorrectness = (question, sessionResponse) => {\n const correctResponses = question.responses;\n\n if (!sessionResponse) {\n return {\n correctness: 'unanswered',\n score: 0,\n correct: false,\n };\n } else {\n let correctAnswers = 0;\n let score = 0;\n const correctResponsesCount = Object.keys(correctResponses || {}).length;\n\n Object.keys(correctResponses).forEach((responseId) => {\n const answerItem = sessionResponse['r' + responseId];\n const correctResponse = correctResponses[responseId] || {};\n\n const answerCorrect = getIsAnswerCorrect(correctResponse, answerItem);\n if (answerCorrect) {\n correctAnswers++;\n }\n });\n\n const fullyCorrect = correctAnswers === correctResponsesCount;\n\n // partial credit scoring: each correct answer is worth 1 / total answers point\n // dichotomous scoring: for credit to be awarded, a correct answer must be entered for every response area\n score = Number((correctAnswers / Object.keys(correctResponses).length).toFixed(2));\n\n return {\n correctness: getFeedback(fullyCorrect),\n score: correctAnswers > 0 ? score : 0,\n correct: fullyCorrect,\n };\n }\n};\n\nexport const getCorrectness = (question, env, session) => {\n if (env.mode === 'evaluate') {\n return getResponseCorrectness(question, session && session.answers);\n }\n};\n\nexport const getPartialScore = (question, session) => {\n if (!session || isEmpty(session)) {\n return 0;\n }\n\n return 1;\n};\n\n/**\n * Generates detailed trace log for math-templated scoring evaluation\n * @param {Object} question\n * @param {Object} session\n * @param {Object} env\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n if (!session || !session.answers || Object.keys(session.answers).length === 0) {\n traceLog.push('Student did not enter a response.');\n return traceLog;\n }\n\n const answers = session.answers;\n const responseIds = Object.keys(question.responses || {});\n const totalAreas = responseIds.length;\n\n traceLog.push(`${totalAreas} response area(s) defined in this question.`);\n\n let answeredCount = 0;\n let correctCount = 0;\n\n responseIds.forEach((responseId, index) => {\n const answerItem = answers[`r${responseId}`];\n const studentValue = answerItem?.value?.trim();\n const correctResponse = question.responses[responseId] || {};\n\n const cleanStudentAnswer = studentValue ? studentValue.replace(/\\\\/g, '') : '';\n\n if (studentValue) {\n answeredCount++;\n traceLog.push(`Response area ${index + 1}: student entered ${cleanStudentAnswer}.`);\n } else {\n traceLog.push(`Response area ${index + 1}: no response entered.`);\n }\n\n const validation = correctResponse.validation || question.validationDefault;\n traceLog.push(`Validation mode: ${validation}.`);\n \n if (validation === 'literal') {\n const allowTrailingZeros = correctResponse.allowTrailingZeros || false;\n const ignoreOrder = correctResponse.ignoreOrder || false;\n \n traceLog.push(`Allow trailing zeros: ${allowTrailingZeros ? 'enabled' : 'disabled'}.`);\n traceLog.push(`Ignore order: ${ignoreOrder ? 'enabled' : 'disabled'}.`);\n }\n \n const acceptedValues = [correctResponse.answer].concat(\n Object.values(correctResponse.alternates || {})\n );\n \n if (acceptedValues.length > 1) {\n traceLog.push(`Accepted answers: ${acceptedValues.length} (including alternates).`);\n }\n\n if (studentValue) {\n const isCorrect = getIsAnswerCorrect(correctResponse, answerItem);\n if (isCorrect) {\n correctCount++;\n traceLog.push(`Response area ${index + 1} is correct.`);\n } else {\n traceLog.push(`Response area ${index + 1} is incorrect.`);\n }\n }\n });\n\n traceLog.push(`${correctCount} out of ${totalAreas} response area(s) are correct.`);\n\n const partialScoringEnabled = partialScoring.enabled(question, env);\n traceLog.push(\n `Scoring method: ${partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring'}.`\n );\n\n if (partialScoringEnabled) {\n traceLog.push('Each correct response area contributes to the score.');\n } else {\n traceLog.push('Student must answer all response areas correctly to receive full credit.');\n }\n\n const correctness = getCorrectness(question, env, session);\n traceLog.push(`Overall correctness: ${correctness.correctness}.`);\n traceLog.push(`Final score: ${correctness.score}.`);\n\n return traceLog;\n};\n\nexport const outcome = (question, session, env) =>\n new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ \n score: 0, \n empty: true, \n logTrace: ['Student did not enter a response.'] \n });\n return;\n }\n \n const partialScoringEnabled = partialScoring.enabled(question, env);\n session = normalizeSession(session);\n\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined, logTrace: [] });\n } else {\n const correctness = getCorrectness(question, env, session, true);\n const score = correctness.score;\n\n resolve({ \n score: partialScoringEnabled ? score : score === 1 ? 1 : 0,\n logTrace: getLogTrace(question, session, env)\n });\n }\n });\n\nexport const createDefaultModel = (model = {}) => {\n const { validationDefault, allowTrailingZerosDefault, ignoreOrderDefault, responses = {} } = model;\n\n const updatedResponses = Object.keys(responses).reduce((acc, responseId) => {\n const correctResponse = responses[responseId];\n\n acc[responseId] = {\n ...correctResponse,\n validation: correctResponse.validation || validationDefault,\n allowTrailingZeros: correctResponse.allowTrailingZeros || allowTrailingZerosDefault,\n ignoreOrder: correctResponse.ignoreOrder || ignoreOrderDefault,\n };\n\n return acc;\n }, {});\n\n return {\n ...defaults.model,\n ...model,\n responses: updatedResponses,\n };\n};\n\nexport const normalizeSession = (s) => ({ ...s });\n\nconst getTextFromHTML = (html) => (html || '').replace(/<\\/?[^>]+(>|$)/g, '');\n\nexport const prepareVal = (html) => getTextFromHTML(html).trim();\n\nexport const model = (question, session, env) => {\n return new Promise((resolve) => {\n session = session || {};\n const normalizedQuestion = createDefaultModel(question);\n const correctness = getCorrectness(normalizedQuestion, env, session);\n const { responses, language } = normalizedQuestion;\n let { note } = normalizedQuestion;\n let showNote = false;\n\n // check if there is at least one alternate response or if the validation for at least one response is not literal\n Object.keys(responses).forEach((responseId) => {\n const correctResponse = responses[responseId] || {};\n if (correctResponse.alternates && Object.keys(correctResponse.alternates).length > 0) {\n showNote = true;\n } else if (correctResponse.validation !== 'literal') {\n showNote = true;\n }\n });\n\n if (!note) {\n note = translator.t('mathInline.primaryCorrectWithAlternates', { lng: language });\n }\n\n const out = {\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n markup: normalizedQuestion.markup,\n responses: env.mode === 'gather' ? null : normalizedQuestion.responses,\n language: normalizedQuestion.language,\n equationEditor: normalizedQuestion.equationEditor,\n customKeys: normalizedQuestion.customKeys,\n disabled: env.mode !== 'gather',\n view: env.mode === 'view',\n correctness,\n env,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n };\n\n const { answers = {} } = session || {};\n let feedback = {};\n\n if (env.mode === 'evaluate') {\n Object.keys(responses).forEach((responseId) => {\n const answerItem = answers['r' + responseId];\n const correctResponse = responses[responseId];\n feedback[responseId] = getIsAnswerCorrect(correctResponse, answerItem);\n });\n }\n\n if (env.mode === 'evaluate') {\n out.correctResponse = {};\n out.showNote = showNote;\n out.note = note;\n out.feedback = feedback;\n } else {\n out.responses = {};\n out.showNote = false;\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 log('out: ', out);\n resolve(out);\n });\n};\n\nexport const createCorrectResponseSession = (question, env) =>\n new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const correctResponse = Object.keys(question.responses).reduce((acc, responseId) => {\n acc['r' + responseId] = { value: question.responses[responseId].answer };\n return acc;\n }, {});\n\n resolve({ id: '1', answers: correctResponse });\n } else {\n resolve(null);\n }\n });\n\nexport const validate = (model = {}, config = {}) => {\n const { responses, markup } = model;\n const { maxResponseAreas } = config;\n const responsesErrors = {};\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 Object.entries(responses || {}).forEach(([key, response], index) => {\n const { answer } = response;\n const reversedAlternates = [...Object.entries(response.alternates || {})].reverse();\n const alternatesErrors = {};\n const responseError = {};\n\n if (answer === '') {\n responseError.answer = 'Content should not be empty.';\n }\n\n reversedAlternates.forEach(([key, value], index) => {\n if (value === '') {\n alternatesErrors[key] = 'Content should not be empty.';\n } else {\n const identicalAnswer =\n answer === value || reversedAlternates.slice(index + 1).some(([, val]) => val === value);\n\n if (identicalAnswer) {\n alternatesErrors[key] = 'Content should be unique.';\n }\n }\n });\n\n if (!isEmpty(responseError) || !isEmpty(alternatesErrors)) {\n responsesErrors[index] = { ...responseError, ...alternatesErrors };\n }\n });\n\n const nbOfResponseAreas = (markup.match(/\\{\\{(\\d+)\\}\\}/g) || []).length;\n\n if (nbOfResponseAreas > maxResponseAreas) {\n errors.responseAreas = `No more than ${maxResponseAreas} response areas should be defined.`;\n } else if (nbOfResponseAreas < 1) {\n errors.responseAreas = 'There should be at least 1 response area defined.';\n }\n\n if (!isEmpty(responsesErrors)) {\n errors.responses = responsesErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,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B,GAAG,CAAChC,MAAM,CAACiC,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAExF,MAAM;EAEvE,IAAIuF,iBAAiB,GAAGhB,gBAAgB,EAAE;IACxCE,MAAM,CAACgB,aAAa,GAAG,gBAAgBlB,gBAAgB,oCAAoC;EAC7F,CAAC,MAAM,IAAIgB,iBAAiB,GAAG,CAAC,EAAE;IAChCd,MAAM,CAACgB,aAAa,GAAG,mDAAmD;EAC5E;EAEA,IAAI,CAAC,IAAA7E,iBAAO,EAAC4D,eAAe,CAAC,EAAE;IAC7BC,MAAM,CAAChF,SAAS,GAAG+E,eAAe;EACpC;EAEA,OAAOC,MAAM;AACf,CAAC;AAAC/D,OAAA,CAAA2D,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/math-templated-controller",
3
3
  "private": true,
4
- "version": "6.4.0-beta.12",
4
+ "version": "6.4.0-beta.14",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",