@pie-element/multiple-choice 13.2.2 → 13.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/configure/CHANGELOG.md +12 -0
- package/configure/package.json +4 -4
- package/lib/choice-input.js +15 -9
- package/lib/choice-input.js.map +1 -1
- package/module/configure.js +1 -1
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +3 -3
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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
|
+
## [13.3.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.3.0...@pie-element/multiple-choice@13.3.1) (2026-06-17)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump shared modules and libs PIE-661 PIE-664 PIE-683 PIE-666 PIE-656 PIE-657 PIE-658 PIE-659 PIE-670 ([ebd6be4](https://github.com/pie-framework/pie-elements/commit/ebd6be4fd48fca41ad4c4908f606b25334731aed))
|
|
11
|
+
|
|
12
|
+
# [13.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.2.2...@pie-element/multiple-choice@13.3.0) (2026-06-12)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
17
|
+
- surpress ripple anim that generated visible background PIE-104 ([5c653ca](https://github.com/pie-framework/pie-elements/commit/5c653ca9a2967b1283b59e7b8fdb387ac76b6fa2))
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
- **multiple-choice:** hover styles for checkboxes and radios PIE-558 ([c5c38e8](https://github.com/pie-framework/pie-elements/commit/c5c38e8377e6ec919d100c5457531233ca119fbd))
|
|
22
|
+
|
|
6
23
|
## [13.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice@13.2.1...@pie-element/multiple-choice@13.2.2) (2026-06-04)
|
|
7
24
|
|
|
8
25
|
### Bug Fixes
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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
|
+
## [10.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.3...@pie-element/multiple-choice-configure@10.1.4) (2026-06-17)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump shared modules and libs PIE-661 PIE-664 PIE-683 PIE-666 PIE-656 PIE-657 PIE-658 PIE-659 PIE-670 ([ebd6be4](https://github.com/pie-framework/pie-elements/commit/ebd6be4fd48fca41ad4c4908f606b25334731aed))
|
|
11
|
+
|
|
12
|
+
## [10.1.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.2...@pie-element/multiple-choice-configure@10.1.3) (2026-06-12)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- bump shared modules and libsPIE-603, PIE-604, PIE-663, PIE-662, PIE-678 ([e61c7a7](https://github.com/pie-framework/pie-elements/commit/e61c7a7d23744586337dfbb17a18ebfc656c202f))
|
|
17
|
+
|
|
6
18
|
## [10.1.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/multiple-choice-configure@10.1.1...@pie-element/multiple-choice-configure@10.1.2) (2026-06-04)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multiple-choice-configure",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.4",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"@mui/icons-material": "^7.3.4",
|
|
11
11
|
"@mui/material": "^7.3.4",
|
|
12
12
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
13
|
-
"@pie-lib/config-ui": "13.0.
|
|
14
|
-
"@pie-lib/editable-html-tip-tap": "2.1.
|
|
15
|
-
"@pie-lib/render-ui": "6.1.
|
|
13
|
+
"@pie-lib/config-ui": "13.0.8",
|
|
14
|
+
"@pie-lib/editable-html-tip-tap": "2.1.6",
|
|
15
|
+
"@pie-lib/render-ui": "6.1.2",
|
|
16
16
|
"debug": "^4.1.1",
|
|
17
17
|
"lodash-es": "^4.17.23",
|
|
18
18
|
"prop-types": "^15.8.1",
|
package/lib/choice-input.js
CHANGED
|
@@ -79,11 +79,6 @@ const getInputStyles = correctness => {
|
|
|
79
79
|
return {
|
|
80
80
|
[key('root')]: {
|
|
81
81
|
...colorStyle('color', _renderUi.color.text()),
|
|
82
|
-
...(correctness ? {} : {
|
|
83
|
-
'&:hover': {
|
|
84
|
-
color: `${_renderUi.color.primaryLight()} !important`
|
|
85
|
-
}
|
|
86
|
-
}),
|
|
87
82
|
...(correctness === 'correct' ? colorStyle('correct-color', _renderUi.color.text()) : {}),
|
|
88
83
|
...(correctness === 'incorrect' ? colorStyle('incorrect-color', _renderUi.color.incorrect()) : {})
|
|
89
84
|
},
|
|
@@ -121,7 +116,11 @@ const StyledCheckboxBase = (0, _styles.styled)(_Checkbox.default, {
|
|
|
121
116
|
[`&.${CLASS_NAME}`]: {
|
|
122
117
|
...styles[key('root')],
|
|
123
118
|
'&.Mui-checked': styles[key('checked')],
|
|
124
|
-
'&.Mui-disabled': correctness ? {} : styles[key('disabled')]
|
|
119
|
+
'&.Mui-disabled': correctness ? {} : styles[key('disabled')],
|
|
120
|
+
'&:hover:not(.Mui-disabled) svg': {
|
|
121
|
+
boxShadow: `0px 0px 0px 2px ${_renderUi.color.keyBoardFocusIndicator()}`,
|
|
122
|
+
borderRadius: '4px'
|
|
123
|
+
}
|
|
125
124
|
},
|
|
126
125
|
'&.Mui-focusVisible': {
|
|
127
126
|
'&:not(.Mui-checked)': styles.focusVisibleUnchecked,
|
|
@@ -172,14 +171,21 @@ const StyledRadioBase = (0, _styles.styled)(_Radio.default, {
|
|
|
172
171
|
[`&.${CLASS_NAME}`]: {
|
|
173
172
|
...styles[key('root')],
|
|
174
173
|
'&.Mui-checked': styles[key('checked')],
|
|
175
|
-
'&.Mui-disabled': correctness ? {} : styles[key('disabled')]
|
|
174
|
+
'&.Mui-disabled': correctness ? {} : styles[key('disabled')],
|
|
175
|
+
'&.Mui-focusVisible:not(.Mui-checked)': styles.focusVisibleUnchecked,
|
|
176
|
+
'&.Mui-focusVisible.Mui-checked': styles.focusVisibleChecked,
|
|
177
|
+
'&:hover:not(.Mui-disabled) svg': {
|
|
178
|
+
boxShadow: `0px 0px 0px 2px ${_renderUi.color.keyBoardFocusIndicator()}`,
|
|
179
|
+
borderRadius: '50%'
|
|
180
|
+
}
|
|
176
181
|
},
|
|
177
182
|
'&.Mui-focusVisible': {
|
|
178
183
|
'& input': {
|
|
179
184
|
outline: 0
|
|
180
185
|
},
|
|
181
|
-
'
|
|
182
|
-
|
|
186
|
+
'& .MuiTouchRipple-root': {
|
|
187
|
+
display: 'none'
|
|
188
|
+
}
|
|
183
189
|
}
|
|
184
190
|
};
|
|
185
191
|
});
|
package/lib/choice-input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice-input.js","names":["_FormControlLabel","_interopRequireDefault","require","_react","_propTypes","_styles","_Box","_Checkbox","_renderUi","_Radio","_classnames","_feedbackTick","CLASS_NAME","Row","styled","Box","display","alignItems","backgroundColor","color","background","CheckboxHolder","flex","marginLeft","text","fontSize","padding","BelowSelectionComponent","theme","spacing","SrOnly","position","left","top","width","height","overflow","StyledFormControlLabel","exports","FormControlLabel","letterSpacing","cursor","colorStyle","varName","fallback","getInputStyles","correctness","key","k","primaryLight","incorrect","correct","primary","disabled","opacity","pointerEvents","focusVisibleUnchecked","outline","keyBoardFocusIndicator","focusVisibleChecked","StyledCheckboxBase","Checkbox","shouldForwardProp","prop","styles","StyledCheckbox","props","checked","onChange","value","id","onKeyDown","inputRef","miniProps","default","createElement","_extends2","slotProps","input","ref","disableRipple","className","StyledRadioBase","Radio","StyledRadio","tagName","name","ChoiceInput","React","Component","constructor","_defineProperty2","event","choiceMode","isArrowDown","isArrowUp","preventDefault","currentEl","document","getElementById","choiceId","fieldset","closest","groupCheckboxes","Array","from","querySelectorAll","currentIndex","findIndex","el","nextIndex","nextEl","focus","onToggleChoice","bind","generateChoiceId","descId","Math","random","toFixed","render","displayKey","feedback","label","rationale","hideTick","isEvaluateMode","choicesLayout","isSelectionButtonBelow","Tag","classSuffix","holderSx","margin","justifyContent","hasMathOrImage","includes","screenReaderLabel","choicelabel","Fragment","component","PreviewPrompt","prompt","tagProps","handleKeyDown","control","style","classNames","sx","htmlFor","labelPlacement","undefined","defaultClassName","Feedback","PropTypes","oneOf","string","bool","isRequired","func","_default"],"sources":["../src/choice-input.jsx"],"sourcesContent":["import FormControlLabel from '@mui/material/FormControlLabel';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\nimport Checkbox from '@mui/material/Checkbox';\nimport { Feedback, color, PreviewPrompt } from '@pie-lib/render-ui';\nimport Radio from '@mui/material/Radio';\nimport classNames from 'classnames';\n\nimport FeedbackTick from './feedback-tick';\n\nconst CLASS_NAME = 'multiple-choice-component';\n\nconst Row = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n backgroundColor: color.background(),\n});\n\nconst CheckboxHolder = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n backgroundColor: color.background(),\n flex: 1,\n '& .MuiFormControlLabel-root': {\n marginLeft: '-14px', // to be consistent to previous versions before MUI v5 upgrade\n },\n '& label': {\n color: color.text(),\n '& > span': {\n fontSize: 'inherit',\n },\n '& > .MuiButtonBase-root': {\n padding: '12px', // to be consistent to previous versions before MUI v5 upgrade\n },\n },\n});\n\nconst BelowSelectionComponent = styled('span')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n '& > span': {\n // visually reduce right padding, but maintain accessibility padding for checkbox indicators to be circles\n marginLeft: `-${theme.spacing(1)}`,\n },\n}));\n\nconst SrOnly = styled('span')({\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n});\n\nexport const StyledFormControlLabel = styled(FormControlLabel)({\n '& .MuiFormControlLabel-label': {\n color: `${color.text()} !important`,\n backgroundColor: color.background(),\n letterSpacing: 'normal',\n },\n '&.Mui-disabled *': {\n cursor: 'not-allowed !important',\n },\n});\n\nconst colorStyle = (varName, fallback) => ({\n [`&.${CLASS_NAME}`]: {\n color: `var(--choice-input-${varName}, ${fallback}) !important`,\n },\n});\n\nconst getInputStyles = (correctness) => {\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [key('root')]: {\n ...colorStyle('color', color.text()),\n ...(correctness ? {} : {\n '&:hover': { color: `${color.primaryLight()} !important` },\n }),\n ...(correctness === 'correct' ? colorStyle('correct-color', color.text()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-color', color.incorrect()) : {}),\n },\n [key('checked')]: {\n ...(correctness === 'correct' ? colorStyle('correct-selected-color', color.correct()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-checked', color.incorrect()) : {}),\n ...(!correctness ? colorStyle('selected-color', color.primary()) : {}),\n },\n [key('disabled')]: {\n ...colorStyle('disabled-color', color.text()),\n ...(correctness === 'correct' ? colorStyle('correct-disabled-color', color.disabled()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-disabled-color', color.disabled()) : {}),\n opacity: 0.6,\n cursor: 'not-allowed !important',\n pointerEvents: 'initial !important',\n },\n focusVisibleUnchecked: {\n outline: `2px solid ${color.keyBoardFocusIndicator()}`,\n backgroundColor: 'transparent',\n },\n focusVisibleChecked: {\n outline: `2px solid ${color.keyBoardFocusIndicator()}`,\n backgroundColor: 'transparent',\n },\n };\n};\n\nconst StyledCheckboxBase = styled(Checkbox, {\n shouldForwardProp: (prop) => prop !== 'correctness',\n})(({ correctness }) => {\n const styles = getInputStyles(correctness);\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [`&.${CLASS_NAME}`]: {\n ...styles[key('root')],\n '&.Mui-checked': styles[key('checked')],\n '&.Mui-disabled': correctness ? {} : styles[key('disabled')],\n },\n '&.Mui-focusVisible': {\n '&:not(.Mui-checked)': styles.focusVisibleUnchecked,\n '&.Mui-checked': styles.focusVisibleChecked,\n },\n };\n});\n\nexport const StyledCheckbox = (props) => {\n const { correctness, checked, onChange, disabled, value, id, onKeyDown, inputRef } = props;\n\n const miniProps = { checked, onChange, disabled, value };\n\n return (\n <StyledCheckboxBase\n id={id}\n slotProps={{ input: { ref: inputRef } }}\n onKeyDown={onKeyDown}\n disableRipple\n {...miniProps}\n correctness={correctness}\n className={CLASS_NAME}\n />\n );\n};\n\nconst StyledRadioBase = styled(Radio, {\n shouldForwardProp: (prop) => prop !== 'correctness',\n})(({ correctness }) => {\n const styles = getInputStyles(correctness);\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [`&.${CLASS_NAME}`]: {\n ...styles[key('root')],\n '&.Mui-checked': styles[key('checked')],\n '&.Mui-disabled': correctness ? {} : styles[key('disabled')],\n },\n '&.Mui-focusVisible': {\n '& input': { outline: 0 },\n '&:not(.Mui-checked)': styles.focusVisibleUnchecked,\n '&.Mui-checked': styles.focusVisibleChecked,\n },\n };\n});\n\nexport const StyledRadio = (props) => {\n const { correctness, checked, onChange, disabled, value, id, tagName, inputRef } = props;\n\n const miniProps = { checked, onChange, disabled, value };\n\n return (\n <StyledRadioBase\n id={id}\n slotProps={{ input: { ref: inputRef } }}\n disableRipple\n {...miniProps}\n correctness={correctness}\n className={CLASS_NAME}\n name={tagName}\n />\n );\n};\n\nexport class ChoiceInput extends React.Component {\n static propTypes = {\n choiceMode: PropTypes.oneOf(['radio', 'checkbox']),\n displayKey: PropTypes.string,\n checked: PropTypes.bool.isRequired,\n correctness: PropTypes.string,\n disabled: PropTypes.bool.isRequired,\n feedback: PropTypes.string,\n label: PropTypes.string.isRequired,\n rationale: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n value: PropTypes.string.isRequired,\n className: PropTypes.string,\n tagName: PropTypes.string,\n hideTick: PropTypes.bool,\n isEvaluateMode: PropTypes.bool,\n choicesLayout: PropTypes.oneOf(['vertical', 'grid', 'horizontal']),\n isSelectionButtonBelow: PropTypes.bool,\n };\n\n static defaultProps = {\n rationale: null,\n checked: false,\n isEvaluateMode: false,\n };\n\n constructor(props) {\n super(props);\n this.onToggleChoice = this.onToggleChoice.bind(this);\n this.choiceId = this.generateChoiceId();\n this.descId = `${this.choiceId}-desc`;\n }\n\n onToggleChoice(event) {\n this.props.onChange(event);\n }\n\n generateChoiceId() {\n return 'choice-' + (Math.random() * 10000).toFixed();\n }\n\n handleKeyDown = (event) => {\n const { choiceMode } = this.props;\n\n if (choiceMode !== 'checkbox') return;\n\n const isArrowDown = event.key === 'ArrowDown';\n const isArrowUp = event.key === 'ArrowUp';\n\n if (!isArrowDown && !isArrowUp) return;\n\n event.preventDefault();\n\n const currentEl = document.getElementById(this.choiceId);\n if (!currentEl) return;\n\n const fieldset = currentEl.closest('fieldset');\n if (!fieldset) return;\n\n const groupCheckboxes = Array.from(fieldset.querySelectorAll('input[type=\"checkbox\"]'));\n\n const currentIndex = groupCheckboxes.findIndex((el) => el === currentEl);\n if (currentIndex === -1) return;\n\n const nextIndex = isArrowDown ? currentIndex + 1 : currentIndex - 1;\n const nextEl = groupCheckboxes[nextIndex];\n\n if (nextEl) {\n nextEl.focus();\n }\n };\n\n render() {\n const {\n choiceMode,\n disabled,\n displayKey,\n feedback,\n label,\n correctness,\n className,\n rationale,\n hideTick,\n isEvaluateMode,\n choicesLayout,\n value,\n checked,\n tagName,\n isSelectionButtonBelow,\n } = this.props;\n\n const Tag = choiceMode === 'checkbox' ? StyledCheckbox : StyledRadio;\n const classSuffix = choiceMode === 'checkbox' ? 'checkbox' : 'radio-button';\n\n const holderSx = {\n ...(choicesLayout === 'horizontal' && {\n [`& .${CLASS_NAME}`]: {\n padding: '8px',\n margin: '4px 0 4px 4px',\n },\n }),\n ...(isSelectionButtonBelow && choicesLayout !== 'grid' && {\n '& > label': {\n alignItems: 'flex-start',\n },\n }),\n ...(isSelectionButtonBelow && choicesLayout === 'grid' && {\n justifyContent: 'center',\n '& > label': {\n alignItems: 'center',\n },\n }),\n };\n\n const hasMathOrImage =\n typeof label === 'string' &&\n (label.includes('<math') ||\n label.includes('\\\\(') ||\n label.includes('\\\\[') ||\n label.includes('<img') ||\n label.includes('data-latex') ||\n label.includes('data-raw') ||\n label.includes('<mjx-container'));\n\n const screenReaderLabel = displayKey ? (\n <SrOnly id={this.descId}>\n {hasMathOrImage ? `Pick the answer below, ${displayKey}` : displayKey}\n </SrOnly>\n ) : null;\n\n const choicelabel = (\n <>\n {displayKey && !isSelectionButtonBelow ? (\n <Row component=\"span\">\n <span aria-hidden=\"true\">{displayKey}.{'\\u00A0'}</span>\n <PreviewPrompt className=\"prompt-label\" prompt={label} tagName=\"span\" />\n </Row>\n ) : (\n <PreviewPrompt className=\"prompt-label\" prompt={label} tagName=\"span\" />\n )}\n </>\n );\n\n const tagProps = {\n disabled,\n checked,\n correctness,\n tagName,\n value,\n id: this.choiceId,\n onChange: this.onToggleChoice,\n onKeyDown: this.handleKeyDown,\n ...(screenReaderLabel ? { 'aria-describedby': this.descId } : {}),\n };\n\n const control = isSelectionButtonBelow ? (\n <BelowSelectionComponent>\n {screenReaderLabel}\n <Tag {...tagProps} style={{ padding: 0 }} />\n <span aria-hidden=\"true\">{displayKey ? `${displayKey}.` : ''}</span>\n </BelowSelectionComponent>\n ) : (\n <>\n {screenReaderLabel}\n <Tag {...tagProps} />\n </>\n );\n\n return (\n <div className={classNames(className, 'corespring-' + classSuffix, 'choice-input')}>\n <Row>\n {!hideTick && isEvaluateMode && <FeedbackTick correctness={correctness} />}\n <CheckboxHolder className=\"checkbox-holder\" sx={holderSx}>\n <StyledFormControlLabel\n label={choicelabel}\n value={value}\n htmlFor={this.choiceId}\n labelPlacement={isSelectionButtonBelow ? 'top' : undefined}\n control={control}\n />\n </CheckboxHolder>\n </Row>\n {rationale && <PreviewPrompt className=\"rationale\" defaultClassName=\"rationale\" prompt={rationale} />}\n <Feedback feedback={feedback} correctness={correctness} />\n </div>\n );\n }\n}\n\nexport default ChoiceInput;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,IAAAS,aAAA,GAAAV,sBAAA,CAAAC,OAAA;AAEA,MAAMU,UAAU,GAAG,2BAA2B;AAE9C,MAAMC,GAAG,GAAG,IAAAC,cAAM,EAACC,YAAG,CAAC,CAAC;EACtBC,OAAO,EAAE,MAAM;EACfC,UAAU,EAAE,QAAQ;EACpBC,eAAe,EAAEC,eAAK,CAACC,UAAU,CAAC;AACpC,CAAC,CAAC;AAEF,M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,MAAM;EAC3BtE,OAAO,EAAEoE,kBAAS,CAACE,MAAM;EACzB9B,QAAQ,EAAE4B,kBAAS,CAACG,IAAI;EACxB9B,cAAc,EAAE2B,kBAAS,CAACG,IAAI;EAC9B7B,aAAa,EAAE0B,kBAAS,CAACC,KAAK,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;EAClE1B,sBAAsB,EAAEyB,kBAAS,CAACG;AACpC,CAAC;AAAA,IAAAjE,gBAAA,CAAAjB,OAAA,EAlBUa,WAAW,kBAoBA;EACpBqC,SAAS,EAAE,IAAI;EACfzD,OAAO,EAAE,KAAK;EACd2D,cAAc,EAAE;AAClB,CAAC;AAAA,IAAAiC,QAAA,GAAAzH,OAAA,CAAAoC,OAAA,GAqKYa,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"choice-input.js","names":["_FormControlLabel","_interopRequireDefault","require","_react","_propTypes","_styles","_Box","_Checkbox","_renderUi","_Radio","_classnames","_feedbackTick","CLASS_NAME","Row","styled","Box","display","alignItems","backgroundColor","color","background","CheckboxHolder","flex","marginLeft","text","fontSize","padding","BelowSelectionComponent","theme","spacing","SrOnly","position","left","top","width","height","overflow","StyledFormControlLabel","exports","FormControlLabel","letterSpacing","cursor","colorStyle","varName","fallback","getInputStyles","correctness","key","k","incorrect","correct","primary","disabled","opacity","pointerEvents","focusVisibleUnchecked","outline","keyBoardFocusIndicator","focusVisibleChecked","StyledCheckboxBase","Checkbox","shouldForwardProp","prop","styles","boxShadow","borderRadius","StyledCheckbox","props","checked","onChange","value","id","onKeyDown","inputRef","miniProps","default","createElement","_extends2","slotProps","input","ref","disableRipple","className","StyledRadioBase","Radio","StyledRadio","tagName","name","ChoiceInput","React","Component","constructor","_defineProperty2","event","choiceMode","isArrowDown","isArrowUp","preventDefault","currentEl","document","getElementById","choiceId","fieldset","closest","groupCheckboxes","Array","from","querySelectorAll","currentIndex","findIndex","el","nextIndex","nextEl","focus","onToggleChoice","bind","generateChoiceId","descId","Math","random","toFixed","render","displayKey","feedback","label","rationale","hideTick","isEvaluateMode","choicesLayout","isSelectionButtonBelow","Tag","classSuffix","holderSx","margin","justifyContent","hasMathOrImage","includes","screenReaderLabel","choicelabel","Fragment","component","PreviewPrompt","prompt","tagProps","handleKeyDown","control","style","classNames","sx","htmlFor","labelPlacement","undefined","defaultClassName","Feedback","PropTypes","oneOf","string","bool","isRequired","func","_default"],"sources":["../src/choice-input.jsx"],"sourcesContent":["import FormControlLabel from '@mui/material/FormControlLabel';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport Box from '@mui/material/Box';\nimport Checkbox from '@mui/material/Checkbox';\nimport { Feedback, color, PreviewPrompt } from '@pie-lib/render-ui';\nimport Radio from '@mui/material/Radio';\nimport classNames from 'classnames';\n\nimport FeedbackTick from './feedback-tick';\n\nconst CLASS_NAME = 'multiple-choice-component';\n\nconst Row = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n backgroundColor: color.background(),\n});\n\nconst CheckboxHolder = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n backgroundColor: color.background(),\n flex: 1,\n '& .MuiFormControlLabel-root': {\n marginLeft: '-14px', // to be consistent to previous versions before MUI v5 upgrade\n },\n '& label': {\n color: color.text(),\n '& > span': {\n fontSize: 'inherit',\n },\n '& > .MuiButtonBase-root': {\n padding: '12px', // to be consistent to previous versions before MUI v5 upgrade\n },\n },\n});\n\nconst BelowSelectionComponent = styled('span')(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n '& > span': {\n // visually reduce right padding, but maintain accessibility padding for checkbox indicators to be circles\n marginLeft: `-${theme.spacing(1)}`,\n },\n}));\n\nconst SrOnly = styled('span')({\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n});\n\nexport const StyledFormControlLabel = styled(FormControlLabel)({\n '& .MuiFormControlLabel-label': {\n color: `${color.text()} !important`,\n backgroundColor: color.background(),\n letterSpacing: 'normal',\n },\n '&.Mui-disabled *': {\n cursor: 'not-allowed !important',\n },\n});\n\nconst colorStyle = (varName, fallback) => ({\n [`&.${CLASS_NAME}`]: {\n color: `var(--choice-input-${varName}, ${fallback}) !important`,\n },\n});\n\nconst getInputStyles = (correctness) => {\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [key('root')]: {\n ...colorStyle('color', color.text()),\n ...(correctness === 'correct' ? colorStyle('correct-color', color.text()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-color', color.incorrect()) : {}),\n },\n [key('checked')]: {\n ...(correctness === 'correct' ? colorStyle('correct-selected-color', color.correct()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-checked', color.incorrect()) : {}),\n ...(!correctness ? colorStyle('selected-color', color.primary()) : {}),\n },\n [key('disabled')]: {\n ...colorStyle('disabled-color', color.text()),\n ...(correctness === 'correct' ? colorStyle('correct-disabled-color', color.disabled()) : {}),\n ...(correctness === 'incorrect' ? colorStyle('incorrect-disabled-color', color.disabled()) : {}),\n opacity: 0.6,\n cursor: 'not-allowed !important',\n pointerEvents: 'initial !important',\n },\n focusVisibleUnchecked: {\n outline: `2px solid ${color.keyBoardFocusIndicator()}`,\n backgroundColor: 'transparent',\n },\n focusVisibleChecked: {\n outline: `2px solid ${color.keyBoardFocusIndicator()}`,\n backgroundColor: 'transparent',\n },\n };\n};\n\nconst StyledCheckboxBase = styled(Checkbox, {\n shouldForwardProp: (prop) => prop !== 'correctness',\n})(({ correctness }) => {\n const styles = getInputStyles(correctness);\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [`&.${CLASS_NAME}`]: {\n ...styles[key('root')],\n '&.Mui-checked': styles[key('checked')],\n '&.Mui-disabled': correctness ? {} : styles[key('disabled')],\n '&:hover:not(.Mui-disabled) svg': {\n boxShadow: `0px 0px 0px 2px ${color.keyBoardFocusIndicator()}`,\n borderRadius: '4px',\n },\n },\n '&.Mui-focusVisible': {\n '&:not(.Mui-checked)': styles.focusVisibleUnchecked,\n '&.Mui-checked': styles.focusVisibleChecked,\n },\n };\n});\n\nexport const StyledCheckbox = (props) => {\n const { correctness, checked, onChange, disabled, value, id, onKeyDown, inputRef } = props;\n\n const miniProps = { checked, onChange, disabled, value };\n\n return (\n <StyledCheckboxBase\n id={id}\n slotProps={{ input: { ref: inputRef } }}\n onKeyDown={onKeyDown}\n disableRipple\n {...miniProps}\n correctness={correctness}\n className={CLASS_NAME}\n />\n );\n};\n\nconst StyledRadioBase = styled(Radio, {\n shouldForwardProp: (prop) => prop !== 'correctness',\n})(({ correctness }) => {\n const styles = getInputStyles(correctness);\n const key = (k) => (correctness ? `${correctness}-${k}` : k);\n\n return {\n [`&.${CLASS_NAME}`]: {\n ...styles[key('root')],\n '&.Mui-checked': styles[key('checked')],\n '&.Mui-disabled': correctness ? {} : styles[key('disabled')],\n '&.Mui-focusVisible:not(.Mui-checked)': styles.focusVisibleUnchecked,\n '&.Mui-focusVisible.Mui-checked': styles.focusVisibleChecked,\n '&:hover:not(.Mui-disabled) svg': {\n boxShadow: `0px 0px 0px 2px ${color.keyBoardFocusIndicator()}`,\n borderRadius: '50%',\n },\n },\n '&.Mui-focusVisible': {\n '& input': { outline: 0 },\n '& .MuiTouchRipple-root': { display: 'none' },\n },\n };\n});\n\nexport const StyledRadio = (props) => {\n const { correctness, checked, onChange, disabled, value, id, tagName, inputRef } = props;\n\n const miniProps = { checked, onChange, disabled, value };\n\n return (\n <StyledRadioBase\n id={id}\n slotProps={{ input: { ref: inputRef } }}\n disableRipple\n {...miniProps}\n correctness={correctness}\n className={CLASS_NAME}\n name={tagName}\n />\n );\n};\n\nexport class ChoiceInput extends React.Component {\n static propTypes = {\n choiceMode: PropTypes.oneOf(['radio', 'checkbox']),\n displayKey: PropTypes.string,\n checked: PropTypes.bool.isRequired,\n correctness: PropTypes.string,\n disabled: PropTypes.bool.isRequired,\n feedback: PropTypes.string,\n label: PropTypes.string.isRequired,\n rationale: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n value: PropTypes.string.isRequired,\n className: PropTypes.string,\n tagName: PropTypes.string,\n hideTick: PropTypes.bool,\n isEvaluateMode: PropTypes.bool,\n choicesLayout: PropTypes.oneOf(['vertical', 'grid', 'horizontal']),\n isSelectionButtonBelow: PropTypes.bool,\n };\n\n static defaultProps = {\n rationale: null,\n checked: false,\n isEvaluateMode: false,\n };\n\n constructor(props) {\n super(props);\n this.onToggleChoice = this.onToggleChoice.bind(this);\n this.choiceId = this.generateChoiceId();\n this.descId = `${this.choiceId}-desc`;\n }\n\n onToggleChoice(event) {\n this.props.onChange(event);\n }\n\n generateChoiceId() {\n return 'choice-' + (Math.random() * 10000).toFixed();\n }\n\n handleKeyDown = (event) => {\n const { choiceMode } = this.props;\n\n if (choiceMode !== 'checkbox') return;\n\n const isArrowDown = event.key === 'ArrowDown';\n const isArrowUp = event.key === 'ArrowUp';\n\n if (!isArrowDown && !isArrowUp) return;\n\n event.preventDefault();\n\n const currentEl = document.getElementById(this.choiceId);\n if (!currentEl) return;\n\n const fieldset = currentEl.closest('fieldset');\n if (!fieldset) return;\n\n const groupCheckboxes = Array.from(fieldset.querySelectorAll('input[type=\"checkbox\"]'));\n\n const currentIndex = groupCheckboxes.findIndex((el) => el === currentEl);\n if (currentIndex === -1) return;\n\n const nextIndex = isArrowDown ? currentIndex + 1 : currentIndex - 1;\n const nextEl = groupCheckboxes[nextIndex];\n\n if (nextEl) {\n nextEl.focus();\n }\n };\n\n render() {\n const {\n choiceMode,\n disabled,\n displayKey,\n feedback,\n label,\n correctness,\n className,\n rationale,\n hideTick,\n isEvaluateMode,\n choicesLayout,\n value,\n checked,\n tagName,\n isSelectionButtonBelow,\n } = this.props;\n\n const Tag = choiceMode === 'checkbox' ? StyledCheckbox : StyledRadio;\n const classSuffix = choiceMode === 'checkbox' ? 'checkbox' : 'radio-button';\n\n const holderSx = {\n ...(choicesLayout === 'horizontal' && {\n [`& .${CLASS_NAME}`]: {\n padding: '8px',\n margin: '4px 0 4px 4px',\n },\n }),\n ...(isSelectionButtonBelow && choicesLayout !== 'grid' && {\n '& > label': {\n alignItems: 'flex-start',\n },\n }),\n ...(isSelectionButtonBelow && choicesLayout === 'grid' && {\n justifyContent: 'center',\n '& > label': {\n alignItems: 'center',\n },\n }),\n };\n\n const hasMathOrImage =\n typeof label === 'string' &&\n (label.includes('<math') ||\n label.includes('\\\\(') ||\n label.includes('\\\\[') ||\n label.includes('<img') ||\n label.includes('data-latex') ||\n label.includes('data-raw') ||\n label.includes('<mjx-container'));\n\n const screenReaderLabel = displayKey ? (\n <SrOnly id={this.descId}>\n {hasMathOrImage ? `Pick the answer below, ${displayKey}` : displayKey}\n </SrOnly>\n ) : null;\n\n const choicelabel = (\n <>\n {displayKey && !isSelectionButtonBelow ? (\n <Row component=\"span\">\n <span aria-hidden=\"true\">{displayKey}.{'\\u00A0'}</span>\n <PreviewPrompt className=\"prompt-label\" prompt={label} tagName=\"span\" />\n </Row>\n ) : (\n <PreviewPrompt className=\"prompt-label\" prompt={label} tagName=\"span\" />\n )}\n </>\n );\n\n const tagProps = {\n disabled,\n checked,\n correctness,\n tagName,\n value,\n id: this.choiceId,\n onChange: this.onToggleChoice,\n onKeyDown: this.handleKeyDown,\n ...(screenReaderLabel ? { 'aria-describedby': this.descId } : {}),\n };\n\n const control = isSelectionButtonBelow ? (\n <BelowSelectionComponent>\n {screenReaderLabel}\n <Tag {...tagProps} style={{ padding: 0 }} />\n <span aria-hidden=\"true\">{displayKey ? `${displayKey}.` : ''}</span>\n </BelowSelectionComponent>\n ) : (\n <>\n {screenReaderLabel}\n <Tag {...tagProps} />\n </>\n );\n\n return (\n <div className={classNames(className, 'corespring-' + classSuffix, 'choice-input')}>\n <Row>\n {!hideTick && isEvaluateMode && <FeedbackTick correctness={correctness} />}\n <CheckboxHolder className=\"checkbox-holder\" sx={holderSx}>\n <StyledFormControlLabel\n label={choicelabel}\n value={value}\n htmlFor={this.choiceId}\n labelPlacement={isSelectionButtonBelow ? 'top' : undefined}\n control={control}\n />\n </CheckboxHolder>\n </Row>\n {rationale && <PreviewPrompt className=\"rationale\" defaultClassName=\"rationale\" prompt={rationale} />}\n <Feedback feedback={feedback} correctness={correctness} />\n </div>\n );\n }\n}\n\nexport default ChoiceInput;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,WAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,IAAAS,aAAA,GAAAV,sBAAA,CAAAC,OAAA;AAEA,MAAMU,UAAU,GAAG,2BAA2B;AAE9C,MAAMC,GAAG,GAAG,IAAAC,cAAM,EAACC,YAAG,CAAC,CAAC;EACtBC,OAAO,EAAE,MAAM;EACfC,UAAU,EAAE,QAAQ;EACpBC,eAAe,EAAEC,eAAK,CAACC,UAAU,CAAC;AACpC,CAAC,CAAC;AAEF,MAAMC,cAAc,GAAG,IAAAP,cAAM,EAACC,YAAG,CAAC,CAAC;EACjCC,OAAO,EAAE,MAAM;EACfC,UAAU,EAAE,QAAQ;EACpBC,eAAe,EAAEC,eAAK,CAACC,UAAU,CAAC,CAAC;EACnCE,IAAI,EAAE,CAAC;EACP,6BAA6B,EAAE;IAC7BC,UAAU,EAAE,OAAO,CAAE;EACvB,CAAC;EACD,SAAS,EAAE;IACTJ,KAAK,EAAEA,eAAK,CAACK,IAAI,CAAC,CAAC;IACnB,UAAU,EAAE;MACVC,QAAQ,EAAE;IACZ,CAAC;IACD,yBAAyB,EAAE;MACzBC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Y,CAAC,CAAC;EAClE1B,sBAAsB,EAAEyB,kBAAS,CAACG;AACpC,CAAC;AAAA,IAAAjE,gBAAA,CAAAjB,OAAA,EAlBUa,WAAW,kBAoBA;EACpBqC,SAAS,EAAE,IAAI;EACfzD,OAAO,EAAE,KAAK;EACd2D,cAAc,EAAE;AAClB,CAAC;AAAA,IAAAiC,QAAA,GAAA1H,OAAA,CAAAqC,OAAA,GAqKYa,WAAW","ignoreList":[]}
|
package/module/configure.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_dll_react as e,_dll_prop_types as t,_dll_mui__material_styles as n,_dll_pie_lib__render_ui as o,_dll_mui__material as i,_dll_mui__icons_material as r,_dll_debug as a,_dll_react_dom_client as s}from"../../../@pie-lib/shared-module@^5.2.4/module/index.js";import{_dll_pie_lib__config_ui as l}from"../../../@pie-lib/config-module@^4.0.9/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as c}from"../../../@pie-lib/editable-html-module@^7.1.6/module/index.js";var u={};Object.defineProperty(u,"__esModule",{value:!0});class d extends CustomEvent{constructor(e,t=!1){super(d.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}d.TYPE="model.updated";var h=u.ModelUpdatedEvent=d;class p extends CustomEvent{constructor(e,t){super(p.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}p.TYPE="delete.image";var g=u.DeleteImageEvent=p;class f extends CustomEvent{constructor(e){super(f.TYPE,{bubbles:!0,detail:e}),this.handler=e}}f.TYPE="insert.image";var b=u.InsertImageEvent=f;class m extends CustomEvent{constructor(e,t){super(m.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}m.TYPE="delete.sound";var _=u.DeleteSoundEvent=m;class y extends CustomEvent{constructor(e){super(y.TYPE,{bubbles:!0,detail:e}),this.handler=e}}y.TYPE="insert.sound";var C=u.InsertSoundEvent=y,v="object"==typeof global&&global&&global.Object===Object&&global,E="object"==typeof self&&self&&self.Object===Object&&self,j=v||E||Function("return this")(),A=j.Symbol,S=Object.prototype,x=S.hasOwnProperty,w=S.toString,O=A?A.toStringTag:void 0,P=Object.prototype.toString,I=A?A.toStringTag:void 0;function k(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":I&&I in Object(e)?function(e){var t=x.call(e,O),n=e[O];try{e[O]=void 0;var o=!0}catch(e){}var i=w.call(e);return o&&(t?e[O]=n:delete e[O]),i}(e):function(e){return P.call(e)}(e)}function M(e){return null!=e&&"object"==typeof e}var T=Array.isArray;function z(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function R(e){return e}function L(e){if(!z(e))return!1;var t=k(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var D,q=j["__core-js_shared__"],F=(D=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",U=Function.prototype.toString,$=/^\[object .+?Constructor\]$/,B=Function.prototype,W=Object.prototype,Y=B.toString,H=W.hasOwnProperty,N=RegExp("^"+Y.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!z(e)||(t=e,F&&F in t))&&(L(e)?N:$).test(function(e){if(null!=e){try{return U.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}(n)?n:void 0}var V,J,K,Q=Object.create,X=function(){function e(){}return function(t){if(!z(t))return{};if(Q)return Q(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Z=Date.now,ee=function(){try{var e=G(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),te=ee,ne=te?function(e,t){return te(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:R,oe=(V=ne,J=0,K=0,function(){var e=Z(),t=16-(e-K);if(K=e,t>0){if(++J>=800)return arguments[0]}else J=0;return V.apply(void 0,arguments)}),ie=/^(?:0|[1-9]\d*)$/;function re(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ie.test(e))&&e>-1&&e%1==0&&e<t}function ae(e,t,n){"__proto__"==t&&te?te(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function se(e,t){return e===t||e!=e&&t!=t}var le=Object.prototype.hasOwnProperty;function ce(e,t,n){var o=e[t];le.call(e,t)&&se(o,n)&&(void 0!==n||t in e)||ae(e,t,n)}var ue=Math.max;function de(e,t){return oe(function(e,t,n){return t=ue(void 0===t?e.length-1:t,0),function(){for(var o=arguments,i=-1,r=ue(o.length-t,0),a=Array(r);++i<r;)a[i]=o[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=o[i];return s[t]=n(a),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,s)}}(e,t,R),e+"")}function he(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function pe(e){return null!=e&&he(e.length)&&!L(e)}function ge(e,t,n){if(!z(n))return!1;var o=typeof t;return!!("number"==o?pe(n)&&re(t,n.length):"string"==o&&t in n)&&se(n[t],e)}var fe=Object.prototype;function be(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||fe)}function me(e){return M(e)&&"[object Arguments]"==k(e)}var _e=Object.prototype,ye=_e.hasOwnProperty,Ce=_e.propertyIsEnumerable,ve=me(function(){return arguments}())?me:function(e){return M(e)&&ye.call(e,"callee")&&!Ce.call(e,"callee")},Ee="object"==typeof exports&&exports&&!exports.nodeType&&exports,je=Ee&&"object"==typeof module&&module&&!module.nodeType&&module,Ae=je&&je.exports===Ee?j.Buffer:void 0,Se=(Ae?Ae.isBuffer:void 0)||function(){return!1},xe={};xe["[object Float32Array]"]=xe["[object Float64Array]"]=xe["[object Int8Array]"]=xe["[object Int16Array]"]=xe["[object Int32Array]"]=xe["[object Uint8Array]"]=xe["[object Uint8ClampedArray]"]=xe["[object Uint16Array]"]=xe["[object Uint32Array]"]=!0,xe["[object Arguments]"]=xe["[object Array]"]=xe["[object ArrayBuffer]"]=xe["[object Boolean]"]=xe["[object DataView]"]=xe["[object Date]"]=xe["[object Error]"]=xe["[object Function]"]=xe["[object Map]"]=xe["[object Number]"]=xe["[object Object]"]=xe["[object RegExp]"]=xe["[object Set]"]=xe["[object String]"]=xe["[object WeakMap]"]=!1;var we="object"==typeof exports&&exports&&!exports.nodeType&&exports,Oe=we&&"object"==typeof module&&module&&!module.nodeType&&module,Pe=Oe&&Oe.exports===we&&v.process,Ie=function(){try{return Oe&&Oe.require&&Oe.require("util").types||Pe&&Pe.binding&&Pe.binding("util")}catch(e){}}(),ke=Ie&&Ie.isTypedArray,Me=ke?function(e){return function(t){return e(t)}}(ke):function(e){return M(e)&&he(e.length)&&!!xe[k(e)]},Te=Me,ze=Object.prototype.hasOwnProperty;var Re=Object.prototype.hasOwnProperty;function Le(e){return pe(e)?function(e,t){var n=T(e),o=!n&&ve(e),i=!n&&!o&&Se(e),r=!n&&!o&&!i&&Te(e),a=n||o||i||r,s=a?function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}(e.length,String):[],l=s.length;for(var c in e)!t&&!ze.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||re(c,l))||s.push(c);return s}(e,!0):function(e){if(!z(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=be(e),n=[];for(var o in e)("constructor"!=o||!t&&Re.call(e,o))&&n.push(o);return n}(e)}var De=G(Object,"create"),qe=Object.prototype.hasOwnProperty,Fe=Object.prototype.hasOwnProperty;function Ue(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function $e(e,t){for(var n=e.length;n--;)if(se(e[n][0],t))return n;return-1}Ue.prototype.clear=function(){this.__data__=De?De(null):{},this.size=0},Ue.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ue.prototype.get=function(e){var t=this.__data__;if(De){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return qe.call(t,e)?t[e]:void 0},Ue.prototype.has=function(e){var t=this.__data__;return De?void 0!==t[e]:Fe.call(t,e)},Ue.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=De&&void 0===t?"__lodash_hash_undefined__":t,this};var Be=Array.prototype.splice;function We(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}We.prototype.clear=function(){this.__data__=[],this.size=0},We.prototype.delete=function(e){var t=this.__data__,n=$e(t,e);return!(n<0||(n==t.length-1?t.pop():Be.call(t,n,1),--this.size,0))},We.prototype.get=function(e){var t=this.__data__,n=$e(t,e);return n<0?void 0:t[n][1]},We.prototype.has=function(e){return $e(this.__data__,e)>-1},We.prototype.set=function(e,t){var n=this.__data__,o=$e(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};var Ye=G(j,"Map");function He(e,t){var n,o,i=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Ne.prototype.clear=function(){this.size=0,this.__data__={hash:new Ue,map:new(Ye||We),string:new Ue}},Ne.prototype.delete=function(e){var t=He(this,e).delete(e);return this.size-=t?1:0,t},Ne.prototype.get=function(e){return He(this,e).get(e)},Ne.prototype.has=function(e){return He(this,e).has(e)},Ne.prototype.set=function(e,t){var n=He(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this};var Ge=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object),Ve=Ge,Je=Function.prototype,Ke=Object.prototype,Qe=Je.toString,Xe=Ke.hasOwnProperty,Ze=Qe.call(Object);function et(e){var t=this.__data__=new We(e);this.size=t.size}et.prototype.clear=function(){this.__data__=new We,this.size=0},et.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},et.prototype.get=function(e){return this.__data__.get(e)},et.prototype.has=function(e){return this.__data__.has(e)},et.prototype.set=function(e,t){var n=this.__data__;if(n instanceof We){var o=n.__data__;if(!Ye||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ne(o)}return n.set(e,t),this.size=n.size,this};var tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,nt=tt&&"object"==typeof module&&module&&!module.nodeType&&module,ot=nt&&nt.exports===tt?j.Buffer:void 0,it=(ot&&ot.allocUnsafe,j.Uint8Array);var rt=Object.prototype,at=rt.hasOwnProperty,st=de(function(e,t){e=Object(e);var n=-1,o=t.length,i=o>2?t[2]:void 0;for(i&&ge(t[0],t[1],i)&&(o=1);++n<o;)for(var r=t[n],a=Le(r),s=-1,l=a.length;++s<l;){var c=a[s],u=e[c];(void 0===u||se(u,rt[c])&&!at.call(e,c))&&(e[c]=r[c])}return e});function lt(e,t,n){(void 0!==n&&!se(e[t],n)||void 0===n&&!(t in e))&&ae(e,t,n)}function ct(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function ut(e,t,n,o,i,r,a){var s=ct(e,n),l=ct(t,n),c=a.get(l);if(c)lt(e,n,c);else{var u,d=r?r(s,l,n+"",e,t,a):void 0,h=void 0===d;if(h){var p=T(l),g=!p&&Se(l),f=!p&&!g&&Te(l);d=l,p||g||f?T(s)?d=s:M(u=s)&&pe(u)?d=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t}(s):g?(h=!1,d=function(e){return e.slice()}(l)):f?(h=!1,d=function(e,t){var n,o,i=t?(o=new(n=e.buffer).constructor(n.byteLength),new it(o).set(new it(n)),o):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}(l,!0)):d=[]:function(e){if(!M(e)||"[object Object]"!=k(e))return!1;var t=Ve(e);if(null===t)return!0;var n=Xe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Qe.call(n)==Ze}(l)||ve(l)?(d=s,ve(s)?d=function(e){return function(e,t,n){var o=!n;n||(n={});for(var i=-1,r=t.length;++i<r;){var a=t[i],s=void 0;void 0===s&&(s=e[a]),o?ae(n,a,s):ce(n,a,s)}return n}(e,Le(e))}(s):z(s)&&!L(s)||(d=function(e){return"function"!=typeof e.constructor||be(e)?{}:X(Ve(e))}(l))):h=!1}h&&(a.set(l,d),i(d,l,o,r,a),a.delete(l)),lt(e,n,d)}}function dt(e,t,n,o,i){e!==t&&function(e,t,n){for(var o=-1,i=Object(e),r=n(e),a=r.length;a--;){var s=r[++o];if(!1===t(i[s],s,i))break}}(t,function(r,a){if(i||(i=new et),z(r))ut(e,t,a,n,dt,o,i);else{var s=o?o(ct(e,a),r,a+"",e,t,i):void 0;void 0===s&&(s=r),lt(e,a,s)}},Le)}var ht,pt=(ht=function(e,t,n){dt(e,t,n)},de(function(e,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,r=o>2?t[2]:void 0;for(i=ht.length>3&&"function"==typeof i?(o--,i):void 0,r&&ge(t[0],t[1],r)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var a=t[n];a&&ht(e,a,n)}return e}));const gt=e,ft=t,{styled:bt}=n,{color:mt}=o,{Button:_t}=i,{Tooltip:yt}=i,{Typography:Ct}=i,{Box:vt}=i,{Info:Et}=r,jt=c,{AlertDialog:At}=l,{InputContainer:St}=l,{ChoiceConfiguration:xt}=l,{settings:wt}=l,{layout:Ot}=l,{choiceUtils:Pt}=l;function It(e){let t,n=e[0],o=1;for(;o<e.length;){const i=e[o],r=e[o+1];if(o+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=r(n)):"call"!==i&&"optionalCall"!==i||(n=r((...e)=>n.call(t,...e)),t=void 0)}return n}const{Panel:kt,toggle:Mt,radio:Tt,dropdown:zt}=wt,Rt=bt(St)(({theme:e})=>({width:"100%",paddingTop:e.spacing(2),marginBottom:e.spacing(2)})),Lt=bt(St)(({theme:e})=>({flex:1,marginTop:e.spacing(1.5),paddingTop:e.spacing(2),marginLeft:e.spacing(3.5)})),Dt=bt(St)(({theme:e})=>({display:"flex",flexDirection:"column",marginBottom:e.spacing(1),width:"100%"})),qt=bt(_t)(({theme:e})=>({marginTop:e.spacing(1),float:"right"})),Ft=bt(qt)({cursor:"not-allowed",pointerEvents:"all",backgroundColor:mt.disabled(),"&:hover":{backgroundColor:mt.disabled()},"&:focus":{backgroundColor:mt.disabled()}}),Ut=bt(vt)({display:"flex",alignItems:"center"}),$t=bt(Ct)(({theme:e})=>({fontSize:e.typography.fontSize+2,marginRight:e.spacing(1)})),Bt=bt(yt)(({theme:e})=>({"& .MuiTooltip-tooltip":{fontSize:e.typography.fontSize-2,whiteSpace:"pre",maxWidth:"500px"}})),Wt=bt("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)})),Yt=e=>{const{model:t,configuration:n,onPromptChanged:o,onChoiceChanged:i,onRemoveChoice:r,onAddChoice:a,imageSupport:s,uploadSoundSupport:l,onChangeModel:c,onConfigurationChanged:u,onTeacherInstructionsChanged:d}=e,{addChoiceButton:h={},contentDimensions:p={},feedback:g={},deleteChoice:f={},choiceMode:b={},choicePrefix:m={},partialScoring:_={},lockChoiceOrder:y={},teacherInstructions:C={},studentInstructions:v={},rationale:E={},scoringType:j={},sequentialChoiceLabels:A={},settingsPanelDisabled:S,choicesLayout:x,spellCheck:w={},gridColumns:O,maxImageWidth:P={},maxImageHeight:I={},prompt:k={},withRubric:M={},mathMlOptions:T={},language:z={},languageChoices:R={}}=n||{};let{maxAnswerChoices:L}=n||{};const{limitChoicesNumber:D,teacherInstructionsEnabled:q,rationaleEnabled:F,feedbackEnabled:U,promptEnabled:$,spellCheckEnabled:B,choices:W,errors:Y,toolbarEditorPosition:H,extraCSSRules:N}=t||{},{answerChoices:G,choices:V,correctResponse:J,prompt:K,rationale:Q,teacherInstructions:X}=Y||{},Z=It([W,"optionalAccess",e=>e.length])?Array.from({length:W.length},(e,t)=>`${t+1}`):[],{baseInputConfiguration:ee={}}=n,te={position:"top"===H?"top":"bottom"};D&&(L=9);const ne=(e={})=>({...ee,...e}),oe=(e=>{const{minAnswerChoices:t,maxAnswerChoices:n}=e;return`Validation requirements:\nThere should be at least ${t} `+(n?`and at most ${n} `:"")+"answer choices defined.\nEvery answer choice should be non-blank and unique.\nA correct answer must be defined."})(n),ie=P&&P.prompt,re=I&&I.prompt,ae=L&&It([W,"optionalAccess",e=>e.length])>=L?`Only ${L} allowed maximum`:"",se={choiceMode:b.settings&&Tt(b.label,["checkbox","radio"]),"sequentialChoiceLabels.enabled":A.settings&&Mt(A.label,!0),choicePrefix:m.settings&&Tt(m.label,["numbers","letters"]),partialScoring:_.settings&&Mt(_.label),lockChoiceOrder:y.settings&&Mt(y.label),feedbackEnabled:g.settings&&Mt(g.label),choicesLayout:x.settings&&zt(x.label,["vertical","grid","horizontal"]),gridColumns:x.settings&&"grid"===t.choicesLayout&&Z.length>0&&zt(O.label,Z),"language.enabled":z.settings&&Mt(z.label,!0),language:z.settings&&z.enabled&&zt(R.label,R.options)},le={teacherInstructionsEnabled:C.settings&&Mt(C.label),studentInstructionsEnabled:v.settings&&Mt(v.label),promptEnabled:k.settings&&Mt(k.label),rationaleEnabled:E.settings&&Mt(E.label),spellCheckEnabled:w.settings&&Mt(w.label),scoringType:j.settings&&Tt(j.label,["auto","rubric"]),rubricEnabled:It([M,"optionalAccess",e=>e.settings])&&Mt(It([M,"optionalAccess",e=>e.label]))};return gt.createElement(Ot.ConfigLayout,{dimensions:p,hideSettings:S,extraCSSRules:N,classes:{},settings:gt.createElement(kt,{model:t,onChangeModel:c,configuration:n,onChangeConfiguration:u,groups:{Settings:se,Properties:le}})},q&>.createElement(Rt,{label:C.label},gt.createElement(jt,{markup:t.teacherInstructions||"",onChange:d,imageSupport:s,nonEmpty:!1,disableUnderline:!0,error:X,toolbarOpts:te,pluginProps:ne(It([n,"optionalAccess",e=>e.teacherInstructions,"optionalAccess",e=>e.inputConfiguration])),spellCheck:B,maxImageWidth:P&&P.teacherInstructions||ie,maxImageHeight:I&&I.teacherInstructions||re,uploadSoundSupport:l,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:T}),X&>.createElement(Wt,null,X)),$&>.createElement(Rt,{label:k.label},gt.createElement(jt,{markup:t.prompt,onChange:o,imageSupport:s,nonEmpty:!1,disableUnderline:!0,error:K,toolbarOpts:te,pluginProps:ne(It([n,"optionalAccess",e=>e.prompt,"optionalAccess",e=>e.inputConfiguration])),spellCheck:B,maxImageWidth:P&&P.prompt,maxImageHeight:I&&I.prompt,uploadSoundSupport:l,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:T}),K&>.createElement(Wt,null,K)),gt.createElement(Ut,null,gt.createElement($t,{component:"div"},"Choices"),gt.createElement(Bt,{disableFocusListener:!0,disableTouchListener:!0,placement:"right",title:oe},gt.createElement(Et,{fontSize:"small",color:"primary"}))),W.map((e,o)=>gt.createElement(Dt,{key:`choice-${o}`},gt.createElement(xt,{key:o,index:o+1,useLetterOrdering:"letters"===t.choicePrefix,mode:t.choiceMode,data:e,defaultFeedback:{},imageSupport:s,disableImageAlignmentButtons:!0,onDelete:()=>r(o),onChange:e=>i(o,e),allowFeedBack:U,allowDelete:f.settings,noLabels:!0,pluginOpts:ne(It([n,"optionalAccess",e=>e.choices,"optionalAccess",e=>e.inputConfiguration])),toolbarOpts:te,spellCheck:B,error:It([V,"optionalAccess",t=>t[e.value]])||null,noCorrectAnswerError:J,maxImageWidth:P&&P.choices||ie,maxImageHeight:I&&I.choices||re,uploadSoundSupport:l,mathMlOptions:T}),F&>.createElement(Lt,{key:`rationale-${o}`,label:E.label},gt.createElement(jt,{markup:e.rationale||"",onChange:t=>i(o,{...e,rationale:t}),imageSupport:s,error:It([Q,"optionalAccess",t=>t[e.value]])||null,toolbarOpts:te,pluginProps:ne(It([n,"optionalAccess",e=>e.rationale,"optionalAccess",e=>e.inputConfiguration])),spellCheck:B,maxImageWidth:P&&P.rationale||ie,maxImageHeight:I&&I.rationale||re,uploadSoundSupport:l,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:T}),It([Q,"optionalAccess",t=>t[e.value]])&>.createElement(Wt,null,It([Q,"optionalAccess",t=>t[e.value]]))))),J&>.createElement(Wt,null,J),G&>.createElement(Wt,null,G),h.settings&>.createElement(Bt,{title:ae},L&&It([W,"optionalAccess",e=>e.length])>=L?gt.createElement(Ft,{variant:"contained",color:"primary",onClick:a,disabled:!0},h.label):gt.createElement(qt,{variant:"contained",color:"primary",onClick:a},h.label)))};class Ht extends gt.Component{constructor(...e){super(...e),Ht.prototype.__init.call(this),Ht.prototype.__init2.call(this),Ht.prototype.__init3.call(this),Ht.prototype.__init4.call(this),Ht.prototype.__init5.call(this),Ht.prototype.__init6.call(this),Ht.prototype.__init7.call(this)}static __initStatic(){this.propTypes={model:ft.object.isRequired,configuration:ft.object.isRequired,disableSidePanel:ft.bool,onModelChanged:ft.func.isRequired,onConfigurationChanged:ft.func.isRequired,imageSupport:ft.shape({add:ft.func.isRequired,delete:ft.func.isRequired})}}__init(){this.state={showWarning:!1}}__init2(){this.onRemoveChoice=e=>{const{model:t,configuration:n,onModelChanged:o}=this.props,{minAnswerChoices:i}=n||{};i&&t.choices.length===i?this.setState({showWarning:!0}):(t.choices.splice(e,1),o({choices:t.choices}))}}__init3(){this.onAddChoice=()=>{const{model:e,configuration:t,onModelChanged:n}=this.props;let{maxAnswerChoices:o}=t||{};const{limitChoicesNumber:i}=e||{};i&&(o=9),o&&e.choices.length>=o||(e.choices.push({label:"",value:Pt.firstAvailableIndex(e.choices.map(e=>e.value),0),feedback:{type:"none"}}),n({choices:e.choices}))}}__init4(){this.onChoiceChanged=(e,t)=>{const{model:n,onModelChanged:o}=this.props;t.correct&&"radio"===n.choiceMode&&(n.choices=n.choices.map(e=>pt({},e,{correct:!1}))),n.choices.splice(e,1,t),o({choices:n.choices})}}__init5(){this.onPromptChanged=e=>{this.props.onModelChanged({prompt:e})}}__init6(){this.onTeacherInstructionsChanged=e=>{this.props.onModelChanged({teacherInstructions:e})}}__init7(){this.onModelChanged=(e,t)=>{const{onModelChanged:n}=this.props;if("choiceMode"===t){if("radio"===e.choiceMode){let t=!1;e.choices=e.choices.map(e=>t?(e.correct=!1,e):(e.correct&&(t=!0),e))}n({choiceMode:e.choiceMode,choices:e.choices},!0)}else n(e)}}render(){const{configuration:{minAnswerChoices:e}={}}=this.props,{showWarning:t}=this.state;return gt.createElement(gt.Fragment,null,gt.createElement(At,{open:t,title:"Warning",text:`There can't be less than ${e||0} choices.`,onConfirm:()=>this.setState({showWarning:!1})}),gt.createElement(Yt,{...this.props,onChangeModel:this.onModelChanged,onRemoveChoice:this.onRemoveChoice,onChoiceChanged:this.onChoiceChanged,onAddChoice:this.onAddChoice,onPromptChanged:this.onPromptChanged,onTeacherInstructionsChanged:this.onTeacherInstructionsChanged}))}}Ht.__initStatic();var Nt={choiceMode:"checkbox",choicePrefix:"letters",choices:[],choicesLayout:"vertical",feedbackEnabled:!1,gridColumns:2,lockChoiceOrder:!0,partialScoring:!0,prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,scoringType:"auto",studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom",selectedAnswerBackgroundColor:"initial",keyboardEventsEnabled:!1},Gt={baseInputConfiguration:{h3:{disabled:!0},audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},choices:{inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}}},spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},choicesLayout:{settings:!1,label:"Choices Layout"},gridColumns:{label:"Grid columns"},answerChoiceCount:0,addChoiceButton:{settings:!0,label:"Add a Choice"},choiceMode:{settings:!0,label:"Response Type"},choicePrefix:{settings:!0,label:"Choice Labels"},deleteChoice:{settings:!0},feedback:{settings:!0,label:"Feedback"},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},lockChoiceOrder:{settings:!0,label:"Lock Choice Order"},partialScoring:{settings:!1,label:"Allow Partial Scoring"},rationale:{settings:!0,label:"Rationale",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!1}},required:!1},scoringType:{settings:!1,label:"Scoring Type"},studentInstructions:{settings:!1,label:"Student Instructions"},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},toolbarEditorPosition:{settings:!1,label:"Toolbar Editor Position"},minAnswerChoices:2,maxAnswerChoices:5,maxImageWidth:{teacherInstructions:300,prompt:300,rationale:636,choices:900},maxImageHeight:{teacherInstructions:300,prompt:300,rationale:300,choices:300},withRubric:{settings:!1,label:"Add Rubric"},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]}};const Vt=e,{createRoot:Jt}=s,Kt=a,{choiceUtils:Qt}=l;function Xt(e){let t,n=e[0],o=1;for(;o<e.length;){const i=e[o],r=e[o+1];if(o+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=r(n)):"call"!==i&&"optionalCall"!==i||(n=r((...e)=>n.call(t,...e)),t=void 0)}return n}const Zt=Kt("multiple-choice:configure"),en=(e,t=0)=>{if(!e||0===e.length){let e=[];for(let n=0;n<t;n++)e.push({value:`${n}`,label:"",feedback:{type:"none",value:""}});return e}return e},tn=(e,t)=>{const n=st(e,Gt);return{configuration:n,model:{...t,choices:en(t&&t.choices||[],n&&n.answerChoiceCount)}}};class nn extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>{const t=Qt.normalizeChoices({...Nt,...e,choices:en(e&&e.choices||[])});return t.choicesLayout=e.choicesLayout||!1===e.verticalMode&&"horizontal"||Nt.choicesLayout,t}}constructor(){super(),this._root=null,this._reactContainer=null,this._model=nn.createDefaultModel(),this._configuration=Gt,this.onModelChanged=this.onModelChanged.bind(this),this.onConfigurationChanged=this.onConfigurationChanged.bind(this)}set model(e){this._model=nn.createDefaultModel(e),this._render()}set configuration(e){const t=tn(e,this._model);this.onModelChanged(t.model);const n={...Gt,...t.configuration};this._configuration=n,Xt([n,"optionalAccess",e=>e.language,"optionalAccess",e=>e.enabled])?Xt([n,"optionalAccess",e=>e.languageChoices,"optionalAccess",e=>e.options,"optionalAccess",e=>e.length])&&(this._model.language=Xt([n,"optionalAccess",e=>e.languageChoices,"access",e=>e.options,"access",e=>e[0],"access",e=>e.value])):n.language.settings&&this._model.language?(this._configuration.language.enabled=!0,this._configuration.languageChoices.options&&this._configuration.languageChoices.options.length||(this._configuration.languageChoices.options=[]),this._configuration.languageChoices.options.find(e=>e.value===this._model.language)||this._configuration.languageChoices.options.push({value:this._model.language,label:this._model.language})):delete this._model.language,this._render()}set disableSidePanel(e){this._disableSidePanel=e,this._render()}dispatchModelUpdated(e){const t=!!e;this.dispatchEvent(new h(this._model,t))}onModelChanged(e,t){this._model={...this._model,...e},this._render(),this.dispatchModelUpdated(t)}onConfigurationChanged(e){this._configuration=tn(e,this._model).configuration,this._model&&this.onModelChanged(this._model),this._render()}insertImage(e){this.dispatchEvent(new b(e))}onDeleteImage(e,t){this.dispatchEvent(new g(e,t))}insertSound(e){this.dispatchEvent(new C(e))}onDeleteSound(e,t){this.dispatchEvent(new _(e,t))}_render(){Zt("_render - Starting render"),Zt("_render - Model:",this._model?"present":"missing"),Zt("_render - Configuration:",this._configuration?"present":"missing"),Zt("_render - Root exists:",!!this._root);try{let e=Vt.createElement(Ht,{model:this._model,configuration:this._configuration,onModelChanged:this.onModelChanged,onConfigurationChanged:this.onConfigurationChanged,disableSidePanel:this._disableSidePanel,imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(Zt("_render - Creating React container"),this._reactContainer=document.createElement("div"),this._reactContainer.className="pie-configure-wrapper",this.appendChild(this._reactContainer),Zt("_render - Creating new React root"),this._root=Jt(this._reactContainer),Zt("_render - React root created successfully")),Zt("_render - Calling root.render()"),this._root.render(e),Zt("_render - Render completed successfully")}catch(e){throw console.error("❌ [multiple-choice-configure] Render error:",e),console.error("Error stack:",e.stack),e}}connectedCallback(){Zt("connectedCallback - Component connected to DOM"),Zt("connectedCallback - Model:",this._model?"present":"missing"),Zt("connectedCallback - Configuration:",this._configuration?"present":"missing")}disconnectedCallback(){Zt("disconnectedCallback - Component disconnected from DOM"),this._root&&(Zt("disconnectedCallback - Unmounting React root"),this._root.unmount(),this._root=null),this._reactContainer&&(this._reactContainer=null)}}nn.__initStatic();export{nn as default};
|
|
1
|
+
import{_dll_react as e,_dll_prop_types as t,_dll_mui__material_styles as n,_dll_pie_lib__render_ui as o,_dll_mui__material as i,_dll_mui__icons_material as r,_dll_debug as a,_dll_react_dom_client as s}from"../../../@pie-lib/shared-module@^5.2.6/module/index.js";import{_dll_pie_lib__config_ui as l}from"../../../@pie-lib/config-module@^4.0.11/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as c}from"../../../@pie-lib/editable-html-module@^7.1.8/module/index.js";var u={};Object.defineProperty(u,"__esModule",{value:!0});class d extends CustomEvent{constructor(e,t=!1){super(d.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}d.TYPE="model.updated";var h=u.ModelUpdatedEvent=d;class p extends CustomEvent{constructor(e,t){super(p.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}p.TYPE="delete.image";var g=u.DeleteImageEvent=p;class f extends CustomEvent{constructor(e){super(f.TYPE,{bubbles:!0,detail:e}),this.handler=e}}f.TYPE="insert.image";var b=u.InsertImageEvent=f;class m extends CustomEvent{constructor(e,t){super(m.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}m.TYPE="delete.sound";var _=u.DeleteSoundEvent=m;class y extends CustomEvent{constructor(e){super(y.TYPE,{bubbles:!0,detail:e}),this.handler=e}}y.TYPE="insert.sound";var C=u.InsertSoundEvent=y,v="object"==typeof global&&global&&global.Object===Object&&global,E="object"==typeof self&&self&&self.Object===Object&&self,j=v||E||Function("return this")(),A=j.Symbol,S=Object.prototype,x=S.hasOwnProperty,w=S.toString,O=A?A.toStringTag:void 0,P=Object.prototype.toString,I=A?A.toStringTag:void 0;function k(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":I&&I in Object(e)?function(e){var t=x.call(e,O),n=e[O];try{e[O]=void 0;var o=!0}catch(e){}var i=w.call(e);return o&&(t?e[O]=n:delete e[O]),i}(e):function(e){return P.call(e)}(e)}function M(e){return null!=e&&"object"==typeof e}var T=Array.isArray;function z(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function R(e){return e}function L(e){if(!z(e))return!1;var t=k(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var D,q=j["__core-js_shared__"],F=(D=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+D:"",U=Function.prototype.toString,$=/^\[object .+?Constructor\]$/,B=Function.prototype,W=Object.prototype,Y=B.toString,H=W.hasOwnProperty,N=RegExp("^"+Y.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function G(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!z(e)||(t=e,F&&F in t))&&(L(e)?N:$).test(function(e){if(null!=e){try{return U.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}(n)?n:void 0}var V,J,K,Q=Object.create,X=function(){function e(){}return function(t){if(!z(t))return{};if(Q)return Q(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Z=Date.now,ee=function(){try{var e=G(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),te=ee,ne=te?function(e,t){return te(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:R,oe=(V=ne,J=0,K=0,function(){var e=Z(),t=16-(e-K);if(K=e,t>0){if(++J>=800)return arguments[0]}else J=0;return V.apply(void 0,arguments)}),ie=/^(?:0|[1-9]\d*)$/;function re(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ie.test(e))&&e>-1&&e%1==0&&e<t}function ae(e,t,n){"__proto__"==t&&te?te(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function se(e,t){return e===t||e!=e&&t!=t}var le=Object.prototype.hasOwnProperty;function ce(e,t,n){var o=e[t];le.call(e,t)&&se(o,n)&&(void 0!==n||t in e)||ae(e,t,n)}var ue=Math.max;function de(e,t){return oe(function(e,t,n){return t=ue(void 0===t?e.length-1:t,0),function(){for(var o=arguments,i=-1,r=ue(o.length-t,0),a=Array(r);++i<r;)a[i]=o[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=o[i];return s[t]=n(a),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,s)}}(e,t,R),e+"")}function he(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function pe(e){return null!=e&&he(e.length)&&!L(e)}function ge(e,t,n){if(!z(n))return!1;var o=typeof t;return!!("number"==o?pe(n)&&re(t,n.length):"string"==o&&t in n)&&se(n[t],e)}var fe=Object.prototype;function be(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||fe)}function me(e){return M(e)&&"[object Arguments]"==k(e)}var _e=Object.prototype,ye=_e.hasOwnProperty,Ce=_e.propertyIsEnumerable,ve=me(function(){return arguments}())?me:function(e){return M(e)&&ye.call(e,"callee")&&!Ce.call(e,"callee")},Ee="object"==typeof exports&&exports&&!exports.nodeType&&exports,je=Ee&&"object"==typeof module&&module&&!module.nodeType&&module,Ae=je&&je.exports===Ee?j.Buffer:void 0,Se=(Ae?Ae.isBuffer:void 0)||function(){return!1},xe={};xe["[object Float32Array]"]=xe["[object Float64Array]"]=xe["[object Int8Array]"]=xe["[object Int16Array]"]=xe["[object Int32Array]"]=xe["[object Uint8Array]"]=xe["[object Uint8ClampedArray]"]=xe["[object Uint16Array]"]=xe["[object Uint32Array]"]=!0,xe["[object Arguments]"]=xe["[object Array]"]=xe["[object ArrayBuffer]"]=xe["[object Boolean]"]=xe["[object DataView]"]=xe["[object Date]"]=xe["[object Error]"]=xe["[object Function]"]=xe["[object Map]"]=xe["[object Number]"]=xe["[object Object]"]=xe["[object RegExp]"]=xe["[object Set]"]=xe["[object String]"]=xe["[object WeakMap]"]=!1;var we="object"==typeof exports&&exports&&!exports.nodeType&&exports,Oe=we&&"object"==typeof module&&module&&!module.nodeType&&module,Pe=Oe&&Oe.exports===we&&v.process,Ie=function(){try{return Oe&&Oe.require&&Oe.require("util").types||Pe&&Pe.binding&&Pe.binding("util")}catch(e){}}(),ke=Ie&&Ie.isTypedArray,Me=ke?function(e){return function(t){return e(t)}}(ke):function(e){return M(e)&&he(e.length)&&!!xe[k(e)]},Te=Me,ze=Object.prototype.hasOwnProperty;var Re=Object.prototype.hasOwnProperty;function Le(e){return pe(e)?function(e,t){var n=T(e),o=!n&&ve(e),i=!n&&!o&&Se(e),r=!n&&!o&&!i&&Te(e),a=n||o||i||r,s=a?function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}(e.length,String):[],l=s.length;for(var c in e)!t&&!ze.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||re(c,l))||s.push(c);return s}(e,!0):function(e){if(!z(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=be(e),n=[];for(var o in e)("constructor"!=o||!t&&Re.call(e,o))&&n.push(o);return n}(e)}var De=G(Object,"create"),qe=Object.prototype.hasOwnProperty,Fe=Object.prototype.hasOwnProperty;function Ue(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function $e(e,t){for(var n=e.length;n--;)if(se(e[n][0],t))return n;return-1}Ue.prototype.clear=function(){this.__data__=De?De(null):{},this.size=0},Ue.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ue.prototype.get=function(e){var t=this.__data__;if(De){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return qe.call(t,e)?t[e]:void 0},Ue.prototype.has=function(e){var t=this.__data__;return De?void 0!==t[e]:Fe.call(t,e)},Ue.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=De&&void 0===t?"__lodash_hash_undefined__":t,this};var Be=Array.prototype.splice;function We(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}We.prototype.clear=function(){this.__data__=[],this.size=0},We.prototype.delete=function(e){var t=this.__data__,n=$e(t,e);return!(n<0||(n==t.length-1?t.pop():Be.call(t,n,1),--this.size,0))},We.prototype.get=function(e){var t=this.__data__,n=$e(t,e);return n<0?void 0:t[n][1]},We.prototype.has=function(e){return $e(this.__data__,e)>-1},We.prototype.set=function(e,t){var n=this.__data__,o=$e(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this};var Ye=G(j,"Map");function He(e,t){var n,o,i=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Ne.prototype.clear=function(){this.size=0,this.__data__={hash:new Ue,map:new(Ye||We),string:new Ue}},Ne.prototype.delete=function(e){var t=He(this,e).delete(e);return this.size-=t?1:0,t},Ne.prototype.get=function(e){return He(this,e).get(e)},Ne.prototype.has=function(e){return He(this,e).has(e)},Ne.prototype.set=function(e,t){var n=He(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this};var Ge=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object),Ve=Ge,Je=Function.prototype,Ke=Object.prototype,Qe=Je.toString,Xe=Ke.hasOwnProperty,Ze=Qe.call(Object);function et(e){var t=this.__data__=new We(e);this.size=t.size}et.prototype.clear=function(){this.__data__=new We,this.size=0},et.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},et.prototype.get=function(e){return this.__data__.get(e)},et.prototype.has=function(e){return this.__data__.has(e)},et.prototype.set=function(e,t){var n=this.__data__;if(n instanceof We){var o=n.__data__;if(!Ye||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ne(o)}return n.set(e,t),this.size=n.size,this};var tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,nt=tt&&"object"==typeof module&&module&&!module.nodeType&&module,ot=nt&&nt.exports===tt?j.Buffer:void 0,it=(ot&&ot.allocUnsafe,j.Uint8Array);var rt=Object.prototype,at=rt.hasOwnProperty,st=de(function(e,t){e=Object(e);var n=-1,o=t.length,i=o>2?t[2]:void 0;for(i&&ge(t[0],t[1],i)&&(o=1);++n<o;)for(var r=t[n],a=Le(r),s=-1,l=a.length;++s<l;){var c=a[s],u=e[c];(void 0===u||se(u,rt[c])&&!at.call(e,c))&&(e[c]=r[c])}return e});function lt(e,t,n){(void 0!==n&&!se(e[t],n)||void 0===n&&!(t in e))&&ae(e,t,n)}function ct(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function ut(e,t,n,o,i,r,a){var s=ct(e,n),l=ct(t,n),c=a.get(l);if(c)lt(e,n,c);else{var u,d=r?r(s,l,n+"",e,t,a):void 0,h=void 0===d;if(h){var p=T(l),g=!p&&Se(l),f=!p&&!g&&Te(l);d=l,p||g||f?T(s)?d=s:M(u=s)&&pe(u)?d=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t}(s):g?(h=!1,d=function(e){return e.slice()}(l)):f?(h=!1,d=function(e,t){var n,o,i=t?(o=new(n=e.buffer).constructor(n.byteLength),new it(o).set(new it(n)),o):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}(l,!0)):d=[]:function(e){if(!M(e)||"[object Object]"!=k(e))return!1;var t=Ve(e);if(null===t)return!0;var n=Xe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Qe.call(n)==Ze}(l)||ve(l)?(d=s,ve(s)?d=function(e){return function(e,t,n){var o=!n;n||(n={});for(var i=-1,r=t.length;++i<r;){var a=t[i],s=void 0;void 0===s&&(s=e[a]),o?ae(n,a,s):ce(n,a,s)}return n}(e,Le(e))}(s):z(s)&&!L(s)||(d=function(e){return"function"!=typeof e.constructor||be(e)?{}:X(Ve(e))}(l))):h=!1}h&&(a.set(l,d),i(d,l,o,r,a),a.delete(l)),lt(e,n,d)}}function dt(e,t,n,o,i){e!==t&&function(e,t,n){for(var o=-1,i=Object(e),r=n(e),a=r.length;a--;){var s=r[++o];if(!1===t(i[s],s,i))break}}(t,function(r,a){if(i||(i=new et),z(r))ut(e,t,a,n,dt,o,i);else{var s=o?o(ct(e,a),r,a+"",e,t,i):void 0;void 0===s&&(s=r),lt(e,a,s)}},Le)}var ht,pt=(ht=function(e,t,n){dt(e,t,n)},de(function(e,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,r=o>2?t[2]:void 0;for(i=ht.length>3&&"function"==typeof i?(o--,i):void 0,r&&ge(t[0],t[1],r)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var a=t[n];a&&ht(e,a,n)}return e}));const gt=e,ft=t,{styled:bt}=n,{color:mt}=o,{Button:_t}=i,{Tooltip:yt}=i,{Typography:Ct}=i,{Box:vt}=i,{Info:Et}=r,jt=c,{AlertDialog:At}=l,{InputContainer:St}=l,{ChoiceConfiguration:xt}=l,{settings:wt}=l,{layout:Ot}=l,{choiceUtils:Pt}=l;function It(e){let t,n=e[0],o=1;for(;o<e.length;){const i=e[o],r=e[o+1];if(o+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=r(n)):"call"!==i&&"optionalCall"!==i||(n=r((...e)=>n.call(t,...e)),t=void 0)}return n}const{Panel:kt,toggle:Mt,radio:Tt,dropdown:zt}=wt,Rt=bt(St)(({theme:e})=>({width:"100%",paddingTop:e.spacing(2),marginBottom:e.spacing(2)})),Lt=bt(St)(({theme:e})=>({flex:1,marginTop:e.spacing(1.5),paddingTop:e.spacing(2),marginLeft:e.spacing(3.5)})),Dt=bt(St)(({theme:e})=>({display:"flex",flexDirection:"column",marginBottom:e.spacing(1),width:"100%"})),qt=bt(_t)(({theme:e})=>({marginTop:e.spacing(1),float:"right"})),Ft=bt(qt)({cursor:"not-allowed",pointerEvents:"all",backgroundColor:mt.disabled(),"&:hover":{backgroundColor:mt.disabled()},"&:focus":{backgroundColor:mt.disabled()}}),Ut=bt(vt)({display:"flex",alignItems:"center"}),$t=bt(Ct)(({theme:e})=>({fontSize:e.typography.fontSize+2,marginRight:e.spacing(1)})),Bt=bt(yt)(({theme:e})=>({"& .MuiTooltip-tooltip":{fontSize:e.typography.fontSize-2,whiteSpace:"pre",maxWidth:"500px"}})),Wt=bt("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)})),Yt=e=>{const{model:t,configuration:n,onPromptChanged:o,onChoiceChanged:i,onRemoveChoice:r,onAddChoice:a,imageSupport:s,uploadSoundSupport:l,onChangeModel:c,onConfigurationChanged:u,onTeacherInstructionsChanged:d}=e,{addChoiceButton:h={},contentDimensions:p={},feedback:g={},deleteChoice:f={},choiceMode:b={},choicePrefix:m={},partialScoring:_={},lockChoiceOrder:y={},teacherInstructions:C={},studentInstructions:v={},rationale:E={},scoringType:j={},sequentialChoiceLabels:A={},settingsPanelDisabled:S,choicesLayout:x,spellCheck:w={},gridColumns:O,maxImageWidth:P={},maxImageHeight:I={},prompt:k={},withRubric:M={},mathMlOptions:T={},language:z={},languageChoices:R={}}=n||{};let{maxAnswerChoices:L}=n||{};const{limitChoicesNumber:D,teacherInstructionsEnabled:q,rationaleEnabled:F,feedbackEnabled:U,promptEnabled:$,spellCheckEnabled:B,choices:W,errors:Y,toolbarEditorPosition:H,extraCSSRules:N}=t||{},{answerChoices:G,choices:V,correctResponse:J,prompt:K,rationale:Q,teacherInstructions:X}=Y||{},Z=It([W,"optionalAccess",e=>e.length])?Array.from({length:W.length},(e,t)=>`${t+1}`):[],{baseInputConfiguration:ee={}}=n,te={position:"top"===H?"top":"bottom"};D&&(L=9);const ne=(e={})=>({...ee,...e}),oe=(e=>{const{minAnswerChoices:t,maxAnswerChoices:n}=e;return`Validation requirements:\nThere should be at least ${t} `+(n?`and at most ${n} `:"")+"answer choices defined.\nEvery answer choice should be non-blank and unique.\nA correct answer must be defined."})(n),ie=P&&P.prompt,re=I&&I.prompt,ae=L&&It([W,"optionalAccess",e=>e.length])>=L?`Only ${L} allowed maximum`:"",se={choiceMode:b.settings&&Tt(b.label,["checkbox","radio"]),"sequentialChoiceLabels.enabled":A.settings&&Mt(A.label,!0),choicePrefix:m.settings&&Tt(m.label,["numbers","letters"]),partialScoring:_.settings&&Mt(_.label),lockChoiceOrder:y.settings&&Mt(y.label),feedbackEnabled:g.settings&&Mt(g.label),choicesLayout:x.settings&&zt(x.label,["vertical","grid","horizontal"]),gridColumns:x.settings&&"grid"===t.choicesLayout&&Z.length>0&&zt(O.label,Z),"language.enabled":z.settings&&Mt(z.label,!0),language:z.settings&&z.enabled&&zt(R.label,R.options)},le={teacherInstructionsEnabled:C.settings&&Mt(C.label),studentInstructionsEnabled:v.settings&&Mt(v.label),promptEnabled:k.settings&&Mt(k.label),rationaleEnabled:E.settings&&Mt(E.label),spellCheckEnabled:w.settings&&Mt(w.label),scoringType:j.settings&&Tt(j.label,["auto","rubric"]),rubricEnabled:It([M,"optionalAccess",e=>e.settings])&&Mt(It([M,"optionalAccess",e=>e.label]))};return gt.createElement(Ot.ConfigLayout,{dimensions:p,hideSettings:S,extraCSSRules:N,classes:{},settings:gt.createElement(kt,{model:t,onChangeModel:c,configuration:n,onChangeConfiguration:u,groups:{Settings:se,Properties:le}})},q&>.createElement(Rt,{label:C.label},gt.createElement(jt,{markup:t.teacherInstructions||"",onChange:d,imageSupport:s,nonEmpty:!1,disableUnderline:!0,error:X,toolbarOpts:te,pluginProps:ne(It([n,"optionalAccess",e=>e.teacherInstructions,"optionalAccess",e=>e.inputConfiguration])),spellCheck:B,maxImageWidth:P&&P.teacherInstructions||ie,maxImageHeight:I&&I.teacherInstructions||re,uploadSoundSupport:l,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:T}),X&>.createElement(Wt,null,X)),$&>.createElement(Rt,{label:k.label},gt.createElement(jt,{markup:t.prompt,onChange:o,imageSupport:s,nonEmpty:!1,disableUnderline:!0,error:K,toolbarOpts:te,pluginProps:ne(It([n,"optionalAccess",e=>e.prompt,"optionalAccess",e=>e.inputConfiguration])),spellCheck:B,maxImageWidth:P&&P.prompt,maxImageHeight:I&&I.prompt,uploadSoundSupport:l,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:T}),K&>.createElement(Wt,null,K)),gt.createElement(Ut,null,gt.createElement($t,{component:"div"},"Choices"),gt.createElement(Bt,{disableFocusListener:!0,disableTouchListener:!0,placement:"right",title:oe},gt.createElement(Et,{fontSize:"small",color:"primary"}))),W.map((e,o)=>gt.createElement(Dt,{key:`choice-${o}`},gt.createElement(xt,{key:o,index:o+1,useLetterOrdering:"letters"===t.choicePrefix,mode:t.choiceMode,data:e,defaultFeedback:{},imageSupport:s,disableImageAlignmentButtons:!0,onDelete:()=>r(o),onChange:e=>i(o,e),allowFeedBack:U,allowDelete:f.settings,noLabels:!0,pluginOpts:ne(It([n,"optionalAccess",e=>e.choices,"optionalAccess",e=>e.inputConfiguration])),toolbarOpts:te,spellCheck:B,error:It([V,"optionalAccess",t=>t[e.value]])||null,noCorrectAnswerError:J,maxImageWidth:P&&P.choices||ie,maxImageHeight:I&&I.choices||re,uploadSoundSupport:l,mathMlOptions:T}),F&>.createElement(Lt,{key:`rationale-${o}`,label:E.label},gt.createElement(jt,{markup:e.rationale||"",onChange:t=>i(o,{...e,rationale:t}),imageSupport:s,error:It([Q,"optionalAccess",t=>t[e.value]])||null,toolbarOpts:te,pluginProps:ne(It([n,"optionalAccess",e=>e.rationale,"optionalAccess",e=>e.inputConfiguration])),spellCheck:B,maxImageWidth:P&&P.rationale||ie,maxImageHeight:I&&I.rationale||re,uploadSoundSupport:l,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:T}),It([Q,"optionalAccess",t=>t[e.value]])&>.createElement(Wt,null,It([Q,"optionalAccess",t=>t[e.value]]))))),J&>.createElement(Wt,null,J),G&>.createElement(Wt,null,G),h.settings&>.createElement(Bt,{title:ae},L&&It([W,"optionalAccess",e=>e.length])>=L?gt.createElement(Ft,{variant:"contained",color:"primary",onClick:a,disabled:!0},h.label):gt.createElement(qt,{variant:"contained",color:"primary",onClick:a},h.label)))};class Ht extends gt.Component{constructor(...e){super(...e),Ht.prototype.__init.call(this),Ht.prototype.__init2.call(this),Ht.prototype.__init3.call(this),Ht.prototype.__init4.call(this),Ht.prototype.__init5.call(this),Ht.prototype.__init6.call(this),Ht.prototype.__init7.call(this)}static __initStatic(){this.propTypes={model:ft.object.isRequired,configuration:ft.object.isRequired,disableSidePanel:ft.bool,onModelChanged:ft.func.isRequired,onConfigurationChanged:ft.func.isRequired,imageSupport:ft.shape({add:ft.func.isRequired,delete:ft.func.isRequired})}}__init(){this.state={showWarning:!1}}__init2(){this.onRemoveChoice=e=>{const{model:t,configuration:n,onModelChanged:o}=this.props,{minAnswerChoices:i}=n||{};i&&t.choices.length===i?this.setState({showWarning:!0}):(t.choices.splice(e,1),o({choices:t.choices}))}}__init3(){this.onAddChoice=()=>{const{model:e,configuration:t,onModelChanged:n}=this.props;let{maxAnswerChoices:o}=t||{};const{limitChoicesNumber:i}=e||{};i&&(o=9),o&&e.choices.length>=o||(e.choices.push({label:"",value:Pt.firstAvailableIndex(e.choices.map(e=>e.value),0),feedback:{type:"none"}}),n({choices:e.choices}))}}__init4(){this.onChoiceChanged=(e,t)=>{const{model:n,onModelChanged:o}=this.props;t.correct&&"radio"===n.choiceMode&&(n.choices=n.choices.map(e=>pt({},e,{correct:!1}))),n.choices.splice(e,1,t),o({choices:n.choices})}}__init5(){this.onPromptChanged=e=>{this.props.onModelChanged({prompt:e})}}__init6(){this.onTeacherInstructionsChanged=e=>{this.props.onModelChanged({teacherInstructions:e})}}__init7(){this.onModelChanged=(e,t)=>{const{onModelChanged:n}=this.props;if("choiceMode"===t){if("radio"===e.choiceMode){let t=!1;e.choices=e.choices.map(e=>t?(e.correct=!1,e):(e.correct&&(t=!0),e))}n({choiceMode:e.choiceMode,choices:e.choices},!0)}else n(e)}}render(){const{configuration:{minAnswerChoices:e}={}}=this.props,{showWarning:t}=this.state;return gt.createElement(gt.Fragment,null,gt.createElement(At,{open:t,title:"Warning",text:`There can't be less than ${e||0} choices.`,onConfirm:()=>this.setState({showWarning:!1})}),gt.createElement(Yt,{...this.props,onChangeModel:this.onModelChanged,onRemoveChoice:this.onRemoveChoice,onChoiceChanged:this.onChoiceChanged,onAddChoice:this.onAddChoice,onPromptChanged:this.onPromptChanged,onTeacherInstructionsChanged:this.onTeacherInstructionsChanged}))}}Ht.__initStatic();var Nt={choiceMode:"checkbox",choicePrefix:"letters",choices:[],choicesLayout:"vertical",feedbackEnabled:!1,gridColumns:2,lockChoiceOrder:!0,partialScoring:!0,prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,scoringType:"auto",studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom",selectedAnswerBackgroundColor:"initial",keyboardEventsEnabled:!1},Gt={baseInputConfiguration:{h3:{disabled:!0},audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},choices:{inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}}},spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},choicesLayout:{settings:!1,label:"Choices Layout"},gridColumns:{label:"Grid columns"},answerChoiceCount:0,addChoiceButton:{settings:!0,label:"Add a Choice"},choiceMode:{settings:!0,label:"Response Type"},choicePrefix:{settings:!0,label:"Choice Labels"},deleteChoice:{settings:!0},feedback:{settings:!0,label:"Feedback"},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},lockChoiceOrder:{settings:!0,label:"Lock Choice Order"},partialScoring:{settings:!1,label:"Allow Partial Scoring"},rationale:{settings:!0,label:"Rationale",inputConfiguration:{audio:{disabled:!0},video:{disabled:!0},image:{disabled:!1}},required:!1},scoringType:{settings:!1,label:"Scoring Type"},studentInstructions:{settings:!1,label:"Student Instructions"},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},toolbarEditorPosition:{settings:!1,label:"Toolbar Editor Position"},minAnswerChoices:2,maxAnswerChoices:5,maxImageWidth:{teacherInstructions:300,prompt:300,rationale:636,choices:900},maxImageHeight:{teacherInstructions:300,prompt:300,rationale:300,choices:300},withRubric:{settings:!1,label:"Add Rubric"},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]}};const Vt=e,{createRoot:Jt}=s,Kt=a,{choiceUtils:Qt}=l;function Xt(e){let t,n=e[0],o=1;for(;o<e.length;){const i=e[o],r=e[o+1];if(o+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=r(n)):"call"!==i&&"optionalCall"!==i||(n=r((...e)=>n.call(t,...e)),t=void 0)}return n}const Zt=Kt("multiple-choice:configure"),en=(e,t=0)=>{if(!e||0===e.length){let e=[];for(let n=0;n<t;n++)e.push({value:`${n}`,label:"",feedback:{type:"none",value:""}});return e}return e},tn=(e,t)=>{const n=st(e,Gt);return{configuration:n,model:{...t,choices:en(t&&t.choices||[],n&&n.answerChoiceCount)}}};class nn extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>{const t=Qt.normalizeChoices({...Nt,...e,choices:en(e&&e.choices||[])});return t.choicesLayout=e.choicesLayout||!1===e.verticalMode&&"horizontal"||Nt.choicesLayout,t}}constructor(){super(),this._root=null,this._reactContainer=null,this._model=nn.createDefaultModel(),this._configuration=Gt,this.onModelChanged=this.onModelChanged.bind(this),this.onConfigurationChanged=this.onConfigurationChanged.bind(this)}set model(e){this._model=nn.createDefaultModel(e),this._render()}set configuration(e){const t=tn(e,this._model);this.onModelChanged(t.model);const n={...Gt,...t.configuration};this._configuration=n,Xt([n,"optionalAccess",e=>e.language,"optionalAccess",e=>e.enabled])?Xt([n,"optionalAccess",e=>e.languageChoices,"optionalAccess",e=>e.options,"optionalAccess",e=>e.length])&&(this._model.language=Xt([n,"optionalAccess",e=>e.languageChoices,"access",e=>e.options,"access",e=>e[0],"access",e=>e.value])):n.language.settings&&this._model.language?(this._configuration.language.enabled=!0,this._configuration.languageChoices.options&&this._configuration.languageChoices.options.length||(this._configuration.languageChoices.options=[]),this._configuration.languageChoices.options.find(e=>e.value===this._model.language)||this._configuration.languageChoices.options.push({value:this._model.language,label:this._model.language})):delete this._model.language,this._render()}set disableSidePanel(e){this._disableSidePanel=e,this._render()}dispatchModelUpdated(e){const t=!!e;this.dispatchEvent(new h(this._model,t))}onModelChanged(e,t){this._model={...this._model,...e},this._render(),this.dispatchModelUpdated(t)}onConfigurationChanged(e){this._configuration=tn(e,this._model).configuration,this._model&&this.onModelChanged(this._model),this._render()}insertImage(e){this.dispatchEvent(new b(e))}onDeleteImage(e,t){this.dispatchEvent(new g(e,t))}insertSound(e){this.dispatchEvent(new C(e))}onDeleteSound(e,t){this.dispatchEvent(new _(e,t))}_render(){Zt("_render - Starting render"),Zt("_render - Model:",this._model?"present":"missing"),Zt("_render - Configuration:",this._configuration?"present":"missing"),Zt("_render - Root exists:",!!this._root);try{let e=Vt.createElement(Ht,{model:this._model,configuration:this._configuration,onModelChanged:this.onModelChanged,onConfigurationChanged:this.onConfigurationChanged,disableSidePanel:this._disableSidePanel,imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(Zt("_render - Creating React container"),this._reactContainer=document.createElement("div"),this._reactContainer.className="pie-configure-wrapper",this.appendChild(this._reactContainer),Zt("_render - Creating new React root"),this._root=Jt(this._reactContainer),Zt("_render - React root created successfully")),Zt("_render - Calling root.render()"),this._root.render(e),Zt("_render - Render completed successfully")}catch(e){throw console.error("❌ [multiple-choice-configure] Render error:",e),console.error("Error stack:",e.stack),e}}connectedCallback(){Zt("connectedCallback - Component connected to DOM"),Zt("connectedCallback - Model:",this._model?"present":"missing"),Zt("connectedCallback - Configuration:",this._configuration?"present":"missing")}disconnectedCallback(){Zt("disconnectedCallback - Component disconnected from DOM"),this._root&&(Zt("disconnectedCallback - Unmounting React root"),this._root.unmount(),this._root=null),this._reactContainer&&(this._reactContainer=null)}}nn.__initStatic();export{nn as default};
|