@pie-element/explicit-constructed-response 10.0.0-beta.0 → 10.0.0-next.42
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 +0 -11
- package/configure/CHANGELOG.md +0 -11
- package/configure/lib/alternateSection.js +8 -2
- package/configure/lib/alternateSection.js.map +1 -1
- package/configure/lib/ecr-toolbar.js +16 -18
- package/configure/lib/ecr-toolbar.js.map +1 -1
- package/configure/lib/main.js +12 -12
- package/configure/lib/main.js.map +1 -1
- package/configure/package.json +4 -4
- package/controller/CHANGELOG.md +0 -11
- package/controller/lib/index.js +3 -0
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +4 -4
- package/module/configure.js +1 -0
- package/module/controller.js +8320 -0
- package/module/demo.js +45 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +18 -0
- package/module/print-demo.js +83 -0
- package/module/print.html +18 -0
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_cloneDeep","_isEmpty","_pick","_throttle","_editableHtml","_interopRequireWildcard","_configUi","_styles","_Typography","_Info","_Tooltip","_ecrToolbar","_alternateResponses","_markupUtils","_utils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","toggle","Panel","dropdown","settings","PromptHolder","styled","InputContainer","theme","width","paddingTop","spacing","marginTop","marginBottom","MarkupContainer","EditableHtml","minHeight","StyledText","Typography","fontSize","typography","StyledTooltip","Tooltip","whiteSpace","maxWidth","ErrorText","color","palette","error","main","FlexContainer","display","alignItems","ResponseHeader","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","Main","React","Component","constructor","args","_defineProperty2","newVal","props","onModelChanged","model","prompt","rationale","teacherInstructions","slateMarkup","choices","maxLengthPerChoice","index","newValLength","decodeHTML","length","label","value","nbOfMissingChoices","Array","fill","splice","getAdjustedLength","markup","domMarkup","allRespAreas","querySelectorAll","allChoices","updatedMaxLengthPerChoice","forEach","el","newChoices","cloneDeep","dataset","callback","setState","cachedChoices","undefined","throttle","nodes","state","newCachedChoices","node","keyForNode","data","assign","pick","prototype","trailing","leading","componentDidMount","undefinedLengths","values","choice","labelLengthsArr","map","Math","max","render","configuration","onConfigurationChanged","imageSupport","uploadSoundSupport","baseInputConfiguration","contentDimensions","maxImageWidth","maxImageHeight","maxResponseAreas","partialScoring","playerSpellCheck","template","settingsPanelDisabled","spellCheck","editSource","withRubric","mathMlOptions","language","languageChoices","spanishButton","responseAreaInputConfiguration","errors","extraCSSRules","maxLengthPerChoiceEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","choicesErrors","promptError","rationaleError","responseAreas","responseAreasError","teacherInstructionsError","validationMessage","generateValidationMessage","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","enabled","options","panelProperties","playerSpellCheckEnabled","rubricEnabled","getPluginProps","layout","ConfigLayout","dimensions","hideSettings","onChangeModel","onModelChange","onChangeConfiguration","groups","Settings","Properties","className","onChange","onTeacherInstructionsChanged","nonEmpty","pluginProps","inputConfiguration","languageCharactersProps","autoWidthToolbar","onPromptChanged","disableUnderline","component","disableFocusListener","disableTouchListener","placement","title","style","marginLeft","activePlugins","ALL_PLUGINS","responseAreaProps","type","duplicates","respAreaToolbar","onToolbarDone","correctChoice","onChangeResponse","onHandleAreaChange","disableImageAlignmentButtons","onBlur","disabled","highlightShape","isEmpty","onResponsesChanged","onLengthChange","onLengthChanged","onRationaleChanged","exports","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","delete","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEmpty from 'lodash/isEmpty';\nimport pick from 'lodash/pick';\nimport throttle from 'lodash/throttle';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\nimport { InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport Info from '@mui/icons-material/Info';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport ECRToolbar from './ecr-toolbar';\nimport AlternateResponses from './alternateResponses';\nimport { decodeHTML, getAdjustedLength } from './markupUtils';\nimport { generateValidationMessage } from './utils';\n\nconst { toggle, Panel, dropdown } = settings;\n\nconst PromptHolder = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(1),\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst MarkupContainer = styled(EditableHtml)(({ theme }) => ({\n minHeight: '100px',\n paddingTop: theme.spacing(1),\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '100px',\n },\n}));\n\nconst StyledText = styled(Typography)(({ theme }) => ({\n fontSize: theme.typography.fontSize + 2,\n}));\n\nconst StyledTooltip = styled(Tooltip)(({ theme }) => ({\n '& .MuiTooltip-tooltip': {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\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 FlexContainer = styled('div')({\n display: 'flex',\n alignItems: 'center',\n});\n\nconst ResponseHeader = styled(Typography)(({ theme }) => ({\n fontSize: theme.typography.fontSize + 2,\n marginTop: theme.spacing(3),\n marginBottom: theme.spacing(1),\n}));\n\nconst createElementFromHTML = (htmlString) => {\n const div = document.createElement('div');\n div.innerHTML = htmlString.trim();\n\n return div;\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.object,\n };\n\n state = {};\n\n componentDidMount() {\n const {\n model: { slateMarkup, choices, maxLengthPerChoice = [] },\n onModelChanged,\n } = this.props;\n const undefinedLengths = !maxLengthPerChoice.length;\n\n this.setState({ markup: slateMarkup });\n\n // calculate maxLengthPerChoice array if it is not defined or defined incorrectly\n Object.values(choices).forEach((choice, index) => {\n const labelLengthsArr = choice.map((choice) => decodeHTML(choice.label || '').length);\n const length = Math.max(...labelLengthsArr);\n\n if (\n undefinedLengths ||\n !maxLengthPerChoice[index] ||\n maxLengthPerChoice[index] < length ||\n maxLengthPerChoice[index] > length + 10\n ) {\n maxLengthPerChoice[index] = getAdjustedLength(length);\n }\n });\n\n onModelChanged({ ...this.props.model, maxLengthPerChoice });\n }\n\n onModelChange = (newVal) => {\n this.props.onModelChanged({ ...this.props.model, ...newVal });\n };\n\n onPromptChanged = (prompt) => {\n this.props.onModelChanged({ ...this.props.model, prompt });\n };\n\n onRationaleChanged = (rationale) => {\n this.props.onModelChanged({ ...this.props.model, rationale });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n onMarkupChanged = (slateMarkup) => {\n this.props.onModelChanged({ ...this.props.model, slateMarkup });\n };\n\n onResponsesChanged = (choices) => {\n this.props.onModelChanged({ ...this.props.model, choices });\n };\n\n onLengthChanged = (maxLengthPerChoice) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, maxLengthPerChoice });\n };\n\n onChangeResponse = (index, newVal) => {\n const { model, onModelChanged } = this.props;\n const { choices } = model;\n let { maxLengthPerChoice } = model;\n const newValLength = decodeHTML(newVal || '').length;\n\n if (!choices[index]) {\n choices[index] = [{ label: newVal || '', value: '0' }];\n\n // add default values for missing choices up to the new index position\n const nbOfMissingChoices = index > maxLengthPerChoice.length ? index - maxLengthPerChoice.length : 0;\n\n maxLengthPerChoice = [...maxLengthPerChoice, ...Array(nbOfMissingChoices).fill(1)];\n\n maxLengthPerChoice.splice(index, 0, getAdjustedLength(newValLength));\n } else {\n choices[index][0].label = newVal || '';\n\n if (\n maxLengthPerChoice &&\n (maxLengthPerChoice[index] < newValLength || maxLengthPerChoice[index] > newValLength + 10)\n ) {\n maxLengthPerChoice[index] = getAdjustedLength(newValLength);\n }\n }\n\n onModelChanged({ ...model, choices, maxLengthPerChoice });\n };\n\n onChange = (markup) => {\n const {\n model: { choices, maxLengthPerChoice },\n onModelChanged,\n } = this.props;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll('[data-type=\"explicit_constructed_response\"]');\n\n const allChoices = {};\n const updatedMaxLengthPerChoice = [];\n\n allRespAreas.forEach((el, index) => {\n const newChoices = cloneDeep(choices[el.dataset.index]);\n\n if (newChoices) {\n newChoices[0] = {\n label: el.dataset.value || '',\n value: '0',\n };\n\n updatedMaxLengthPerChoice[index] = maxLengthPerChoice[el.dataset.index];\n }\n\n allChoices[index] = newChoices;\n el.dataset.index = index;\n });\n\n const callback = () =>\n onModelChanged({\n ...this.props.model,\n choices: allChoices,\n slateMarkup: domMarkup.innerHTML,\n maxLengthPerChoice: updatedMaxLengthPerChoice,\n });\n\n this.setState({ cachedChoices: undefined }, callback);\n };\n\n onHandleAreaChange = throttle(\n (nodes) => {\n const {\n model: { choices },\n onModelChanged,\n } = this.props;\n const { cachedChoices } = this.state;\n\n if (!nodes) {\n return;\n }\n\n const newChoices = choices ? cloneDeep(choices) : {};\n const newCachedChoices = cachedChoices ? cloneDeep(cachedChoices) : {};\n\n nodes.forEach((node) => {\n const keyForNode = node.data.get('index');\n\n if (!newChoices[keyForNode] && newCachedChoices[keyForNode]) {\n Object.assign(newChoices, pick(newCachedChoices, keyForNode));\n\n if (Object.prototype.hasOwnProperty.call(newCachedChoices, keyForNode)) {\n delete newCachedChoices[keyForNode];\n }\n } else {\n Object.assign(newCachedChoices, pick(newChoices, keyForNode));\n\n if (Object.prototype.hasOwnProperty.call(newChoices, keyForNode)) {\n delete newChoices[keyForNode];\n }\n }\n });\n\n const callback = () => onModelChanged({ ...this.props.model, choices: newChoices });\n\n this.setState({ cachedChoices: newCachedChoices }, callback);\n },\n 500,\n { trailing: false, leading: true },\n );\n\n render() {\n const { model, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } = this.props;\n\n const {\n baseInputConfiguration = {},\n contentDimensions = {},\n maxImageWidth = {},\n maxImageHeight = {},\n maxLengthPerChoice = {},\n maxResponseAreas,\n partialScoring = {},\n playerSpellCheck = {},\n prompt = {},\n rationale = {},\n template = {},\n settingsPanelDisabled,\n spellCheck = {},\n editSource = {},\n teacherInstructions = {},\n withRubric = {},\n mathMlOptions = {},\n language = {},\n languageChoices = {},\n spanishButton = {},\n responseAreaInputConfiguration = {},\n } = configuration || {};\n const {\n errors,\n extraCSSRules,\n maxLengthPerChoiceEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n\n const {\n choices: choicesErrors = {},\n prompt: promptError,\n rationale: rationaleError,\n responseAreas: responseAreasError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n const validationMessage = generateValidationMessage(configuration);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const panelSettings = {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n maxLengthPerChoiceEnabled: maxLengthPerChoice.settings && toggle(maxLengthPerChoice.label),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n 'responseAreaInputConfiguration.inputConfiguration.characters.disabled':\n spanishButton.settings && toggle(spanishButton.label, true),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n playerSpellCheckEnabled: playerSpellCheck.settings && toggle(playerSpellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n 'editSource.enabled': editSource?.settings && toggle(editSource.label, true),\n };\n\n const getPluginProps = (props = {}) => ({\n ...baseInputConfiguration,\n ...props,\n });\n return (\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => this.onModelChange(model)}\n onChangeConfiguration={(configuration) => onConfigurationChanged(configuration, true)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <PromptHolder label={teacherInstructions.label}>\n <EditableHtml\n className=\"prompt\"\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={teacherInstructionsError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n autoWidthToolbar\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </PromptHolder>\n )}\n\n {promptEnabled && (\n <PromptHolder label={prompt.label}>\n <EditableHtml\n className=\"prompt\"\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n error={promptError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n autoWidthToolbar\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </PromptHolder>\n )}\n\n <FlexContainer>\n <StyledText component=\"div\">\n Define Template, Choices, and Correct Responses\n </StyledText>\n <StyledTooltip\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} style={{ marginLeft: '8px' }} />\n </StyledTooltip>\n </FlexContainer>\n\n <MarkupContainer\n activePlugins={ALL_PLUGINS}\n toolbarOpts={{ position: 'top' }}\n spellCheck={spellCheckEnabled}\n pluginProps={getPluginProps(template?.inputConfiguration)}\n responseAreaProps={{\n type: 'explicit-constructed-response',\n options: {\n duplicates: true,\n },\n maxResponseAreas: maxResponseAreas,\n respAreaToolbar: (node, value, onToolbarDone) => {\n const { model } = this.props;\n const correctChoice = (model.choices[node.data.get('index')] || [])[0];\n return () => (\n <ECRToolbar\n onChangeResponse={(newVal) => this.onChangeResponse(node.data.get('index'), newVal)}\n node={node}\n value={value}\n onToolbarDone={onToolbarDone}\n correctChoice={correctChoice}\n maxLengthPerChoiceEnabled={maxLengthPerChoiceEnabled}\n pluginProps={getPluginProps(responseAreaInputConfiguration?.inputConfiguration)}\n />\n );\n },\n error: () => choicesErrors,\n onHandleAreaChange: this.onHandleAreaChange,\n }}\n markup={model.slateMarkup}\n onChange={this.onChange}\n imageSupport={imageSupport}\n disableImageAlignmentButtons={true}\n onBlur={this.onBlur}\n disabled={false}\n highlightShape={false}\n error={responseAreasError}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n autoWidthToolbar\n />\n {responseAreasError && <ErrorText>{responseAreasError}</ErrorText>}\n\n {!isEmpty(model.choices) && (\n <ResponseHeader>\n {`Define Alternates ${maxLengthPerChoiceEnabled ? 'and Character Limits' : ''}`}\n </ResponseHeader>\n )}\n <AlternateResponses\n model={model}\n onChange={this.onResponsesChanged}\n onLengthChange={this.onLengthChanged}\n maxLengthPerChoiceEnabled={maxLengthPerChoiceEnabled}\n spellCheck={spellCheckEnabled}\n choicesErrors={choicesErrors}\n pluginProps={getPluginProps(responseAreaInputConfiguration?.inputConfiguration)}\n />\n\n {rationaleEnabled && (\n <PromptHolder label={rationale.label}>\n <EditableHtml\n className=\"prompt\"\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n error={rationaleError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(rationale?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n autoWidthToolbar\n />\n {rationaleError && <ErrorText>{rationaleError}</ErrorText>}\n </PromptHolder>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,aAAA,GAAAC,uBAAA,CA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,kBAAkB,EAAEA,kBAAmB;MACvC6D,uBAAuB,EAAE,CAAC;QAAE/C,QAAQ,EAAE;MAAU,CAAC,EAAE;QAAEA,QAAQ,EAAE;MAAU,CAAC,CAAE;MAC5ED,aAAa,EAAEA,aAAc;MAC7BiD,gBAAgB;IAAA,CACjB,CAAC,EACDlC,cAAc,iBAAI5K,MAAA,CAAA6B,OAAA,CAAA8C,aAAA,CAACb,SAAS,QAAE8G,cAA0B,CAC7C,CAEG,CAAC;EAE1B;AACF;AAAC+D,OAAA,CAAA7J,IAAA,GAAAA,IAAA;AAAA,IAAAK,gBAAA,CAAAtD,OAAA,EApaYiD,IAAI,eACI;EACjB+D,aAAa,EAAE+F,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC1CvJ,KAAK,EAAEqJ,kBAAS,CAACC,MAAM,CAACC,UAAU;EAClCC,gBAAgB,EAAEH,kBAAS,CAACI,IAAI;EAChC1J,cAAc,EAAEsJ,kBAAS,CAACK,IAAI,CAACH,UAAU;EACzChG,sBAAsB,EAAE8F,kBAAS,CAACK,IAAI,CAACH,UAAU;EACjD/F,YAAY,EAAE6F,kBAAS,CAACM,KAAK,CAAC;IAC5BC,GAAG,EAAEP,kBAAS,CAACK,IAAI,CAACH,UAAU;IAC9BM,MAAM,EAAER,kBAAS,CAACK,IAAI,CAACH;EACzB,CAAC,CAAC;EACF9F,kBAAkB,EAAE4F,kBAAS,CAACC;AAChC,CAAC;AAAA,IAAAQ,QAAA,GAAAV,OAAA,CAAA9M,OAAA,GA0ZYiD,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_cloneDeep","_isEmpty","_pick","_throttle","_editableHtmlTipTap","_interopRequireWildcard","_configUi","_styles","_Typography","_Info","_Tooltip","_ecrToolbar","_alternateResponses","_markupUtils","_utils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","toggle","Panel","dropdown","settings","PromptHolder","styled","InputContainer","theme","width","paddingTop","spacing","marginTop","marginBottom","MarkupContainer","EditableHtml","minHeight","StyledText","Typography","fontSize","typography","StyledTooltip","Tooltip","whiteSpace","maxWidth","ErrorText","color","palette","error","main","FlexContainer","display","alignItems","ResponseHeader","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","Main","React","Component","constructor","args","_defineProperty2","newVal","props","onModelChanged","model","prompt","rationale","teacherInstructions","slateMarkup","choices","maxLengthPerChoice","index","newValLength","decodeHTML","length","label","value","nbOfMissingChoices","Array","fill","splice","getAdjustedLength","markup","domMarkup","allRespAreas","querySelectorAll","allChoices","updatedMaxLengthPerChoice","forEach","el","newChoices","cloneDeep","dataset","callback","setState","cachedChoices","undefined","throttle","nodes","state","newCachedChoices","node","keyForNode","assign","pick","prototype","trailing","leading","componentDidMount","undefinedLengths","values","choice","labelLengthsArr","map","Math","max","render","configuration","onConfigurationChanged","imageSupport","uploadSoundSupport","baseInputConfiguration","contentDimensions","maxImageWidth","maxImageHeight","maxResponseAreas","partialScoring","playerSpellCheck","template","settingsPanelDisabled","spellCheck","editSource","withRubric","mathMlOptions","language","languageChoices","spanishButton","responseAreaInputConfiguration","errors","extraCSSRules","maxLengthPerChoiceEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","choicesErrors","promptError","rationaleError","responseAreas","responseAreasError","teacherInstructionsError","validationMessage","generateValidationMessage","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","enabled","options","panelProperties","playerSpellCheckEnabled","rubricEnabled","getPluginProps","layout","ConfigLayout","dimensions","hideSettings","onChangeModel","onModelChange","onChangeConfiguration","groups","Settings","Properties","className","onChange","onTeacherInstructionsChanged","nonEmpty","pluginProps","inputConfiguration","languageCharactersProps","autoWidthToolbar","onPromptChanged","disableUnderline","component","disableFocusListener","disableTouchListener","placement","title","style","marginLeft","activePlugins","ALL_PLUGINS","responseAreaProps","type","duplicates","respAreaToolbar","editor","onToolbarDone","correctChoice","attrs","onChangeResponse","onHandleAreaChange","disableImageAlignmentButtons","onBlur","disabled","highlightShape","isEmpty","onResponsesChanged","onLengthChange","onLengthChanged","onRationaleChanged","exports","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","delete","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEmpty from 'lodash/isEmpty';\nimport pick from 'lodash/pick';\nimport throttle from 'lodash/throttle';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html-tip-tap';\nimport { InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport { styled } from '@mui/material/styles';\nimport Typography from '@mui/material/Typography';\nimport Info from '@mui/icons-material/Info';\nimport Tooltip from '@mui/material/Tooltip';\n\nimport ECRToolbar from './ecr-toolbar';\nimport AlternateResponses from './alternateResponses';\nimport { decodeHTML, getAdjustedLength } from './markupUtils';\nimport { generateValidationMessage } from './utils';\n\nconst { toggle, Panel, dropdown } = settings;\n\nconst PromptHolder = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(1),\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst MarkupContainer = styled(EditableHtml)(({ theme }) => ({\n minHeight: '100px',\n paddingTop: theme.spacing(1),\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '100px',\n },\n}));\n\nconst StyledText = styled(Typography)(({ theme }) => ({\n fontSize: theme.typography.fontSize + 2,\n}));\n\nconst StyledTooltip = styled(Tooltip)(({ theme }) => ({\n '& .MuiTooltip-tooltip': {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\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 FlexContainer = styled('div')({\n display: 'flex',\n alignItems: 'center',\n});\n\nconst ResponseHeader = styled(Typography)(({ theme }) => ({\n fontSize: theme.typography.fontSize + 2,\n marginTop: theme.spacing(3),\n marginBottom: theme.spacing(1),\n}));\n\nconst createElementFromHTML = (htmlString) => {\n const div = document.createElement('div');\n div.innerHTML = htmlString.trim();\n\n return div;\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.object,\n };\n\n state = {};\n\n componentDidMount() {\n const {\n model: { slateMarkup, choices, maxLengthPerChoice = [] },\n onModelChanged,\n } = this.props;\n const undefinedLengths = !maxLengthPerChoice.length;\n\n this.setState({ markup: slateMarkup });\n\n // calculate maxLengthPerChoice array if it is not defined or defined incorrectly\n Object.values(choices).forEach((choice, index) => {\n const labelLengthsArr = choice.map((choice) => decodeHTML(choice.label || '').length);\n const length = Math.max(...labelLengthsArr);\n\n if (\n undefinedLengths ||\n !maxLengthPerChoice[index] ||\n maxLengthPerChoice[index] < length ||\n maxLengthPerChoice[index] > length + 10\n ) {\n maxLengthPerChoice[index] = getAdjustedLength(length);\n }\n });\n\n onModelChanged({ ...this.props.model, maxLengthPerChoice });\n }\n\n onModelChange = (newVal) => {\n this.props.onModelChanged({ ...this.props.model, ...newVal });\n };\n\n onPromptChanged = (prompt) => {\n this.props.onModelChanged({ ...this.props.model, prompt });\n };\n\n onRationaleChanged = (rationale) => {\n this.props.onModelChanged({ ...this.props.model, rationale });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n onMarkupChanged = (slateMarkup) => {\n this.props.onModelChanged({ ...this.props.model, slateMarkup });\n };\n\n onResponsesChanged = (choices) => {\n this.props.onModelChanged({ ...this.props.model, choices });\n };\n\n onLengthChanged = (maxLengthPerChoice) => {\n const { model, onModelChanged } = this.props;\n\n onModelChanged({ ...model, maxLengthPerChoice });\n };\n\n onChangeResponse = (index, newVal) => {\n const { model, onModelChanged } = this.props;\n const { choices } = model;\n let { maxLengthPerChoice } = model;\n const newValLength = decodeHTML(newVal || '').length;\n\n if (!choices[index] || !choices[index].length) {\n choices[index] = [{ label: newVal || '', value: '0' }];\n\n // add default values for missing choices up to the new index position\n const nbOfMissingChoices = index > maxLengthPerChoice.length ? index - maxLengthPerChoice.length : 0;\n\n maxLengthPerChoice = [...maxLengthPerChoice, ...Array(nbOfMissingChoices).fill(1)];\n\n maxLengthPerChoice.splice(index, 0, getAdjustedLength(newValLength));\n } else {\n choices[index][0].label = newVal || '';\n\n if (\n maxLengthPerChoice &&\n (maxLengthPerChoice[index] < newValLength || maxLengthPerChoice[index] > newValLength + 10)\n ) {\n maxLengthPerChoice[index] = getAdjustedLength(newValLength);\n }\n }\n\n onModelChanged({ ...model, choices, maxLengthPerChoice });\n };\n\n onChange = (markup) => {\n const {\n model: { choices, maxLengthPerChoice },\n onModelChanged,\n } = this.props;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll('[data-type=\"explicit_constructed_response\"]');\n\n const allChoices = {};\n const updatedMaxLengthPerChoice = [];\n\n allRespAreas.forEach((el, index) => {\n const newChoices = cloneDeep(choices[el.dataset.index]);\n\n if (newChoices) {\n newChoices[0] = {\n label: el.dataset.value || '',\n value: '0',\n };\n\n updatedMaxLengthPerChoice[index] = maxLengthPerChoice[el.dataset.index];\n }\n\n allChoices[index] = newChoices;\n el.dataset.index = index;\n });\n\n const callback = () =>\n onModelChanged({\n ...this.props.model,\n choices: allChoices,\n slateMarkup: domMarkup.innerHTML,\n maxLengthPerChoice: updatedMaxLengthPerChoice,\n });\n\n this.setState({ cachedChoices: undefined }, callback);\n };\n\n onHandleAreaChange = throttle(\n (nodes) => {\n const {\n model: { choices },\n onModelChanged,\n } = this.props;\n const { cachedChoices } = this.state;\n\n if (!nodes) {\n return;\n }\n\n const newChoices = choices ? cloneDeep(choices) : {};\n const newCachedChoices = cachedChoices ? cloneDeep(cachedChoices) : {};\n\n nodes.forEach((node) => {\n const keyForNode = node.index;\n\n if (!newChoices[keyForNode] && newCachedChoices[keyForNode]) {\n Object.assign(newChoices, pick(newCachedChoices, keyForNode));\n\n if (Object.prototype.hasOwnProperty.call(newCachedChoices, keyForNode)) {\n delete newCachedChoices[keyForNode];\n }\n } else {\n Object.assign(newCachedChoices, pick(newChoices, keyForNode));\n\n if (Object.prototype.hasOwnProperty.call(newChoices, keyForNode)) {\n delete newChoices[keyForNode];\n }\n }\n });\n\n const callback = () => onModelChanged({ ...this.props.model, choices: newChoices });\n\n this.setState({ cachedChoices: newCachedChoices }, callback);\n },\n 500,\n { trailing: false, leading: true },\n );\n\n render() {\n const { model, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } = this.props;\n\n const {\n baseInputConfiguration = {},\n contentDimensions = {},\n maxImageWidth = {},\n maxImageHeight = {},\n maxLengthPerChoice = {},\n maxResponseAreas,\n partialScoring = {},\n playerSpellCheck = {},\n prompt = {},\n rationale = {},\n template = {},\n settingsPanelDisabled,\n spellCheck = {},\n editSource = {},\n teacherInstructions = {},\n withRubric = {},\n mathMlOptions = {},\n language = {},\n languageChoices = {},\n spanishButton = {},\n responseAreaInputConfiguration = {},\n } = configuration || {};\n const {\n errors,\n extraCSSRules,\n maxLengthPerChoiceEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n\n const {\n choices: choicesErrors = {},\n prompt: promptError,\n rationale: rationaleError,\n responseAreas: responseAreasError,\n teacherInstructions: teacherInstructionsError,\n } = errors || {};\n const validationMessage = generateValidationMessage(configuration);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const panelSettings = {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n maxLengthPerChoiceEnabled: maxLengthPerChoice.settings && toggle(maxLengthPerChoice.label),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n 'responseAreaInputConfiguration.inputConfiguration.characters.disabled':\n spanishButton.settings && toggle(spanishButton.label, true),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n playerSpellCheckEnabled: playerSpellCheck.settings && toggle(playerSpellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n 'editSource.enabled': editSource?.settings && toggle(editSource.label, true),\n };\n\n const getPluginProps = (props = {}) => ({\n ...baseInputConfiguration,\n ...props,\n });\n return (\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => this.onModelChange(model)}\n onChangeConfiguration={(configuration) => onConfigurationChanged(configuration, true)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <PromptHolder label={teacherInstructions.label}>\n <EditableHtml\n className=\"prompt\"\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={teacherInstructionsError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n autoWidthToolbar\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </PromptHolder>\n )}\n\n {promptEnabled && (\n <PromptHolder label={prompt.label}>\n <EditableHtml\n className=\"prompt\"\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n error={promptError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n autoWidthToolbar\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </PromptHolder>\n )}\n\n <FlexContainer>\n <StyledText component=\"div\">\n Define Template, Choices, and Correct Responses\n </StyledText>\n <StyledTooltip\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} style={{ marginLeft: '8px' }} />\n </StyledTooltip>\n </FlexContainer>\n\n <MarkupContainer\n activePlugins={ALL_PLUGINS}\n toolbarOpts={{ position: 'top' }}\n spellCheck={spellCheckEnabled}\n pluginProps={getPluginProps(template?.inputConfiguration)}\n responseAreaProps={{\n type: 'explicit-constructed-response',\n options: {\n duplicates: true,\n },\n maxResponseAreas: maxResponseAreas,\n respAreaToolbar: (node, editor, onToolbarDone) => {\n const { model } = this.props;\n const correctChoice = (model.choices[node.attrs.index] || [])[0];\n return () => (\n <ECRToolbar\n onChangeResponse={(newVal) => this.onChangeResponse(node.attrs.index, newVal)}\n node={node}\n editor={editor}\n onToolbarDone={onToolbarDone}\n correctChoice={correctChoice}\n maxLengthPerChoiceEnabled={maxLengthPerChoiceEnabled}\n pluginProps={getPluginProps(responseAreaInputConfiguration?.inputConfiguration)}\n />\n );\n },\n error: () => choicesErrors,\n onHandleAreaChange: this.onHandleAreaChange,\n }}\n markup={model.slateMarkup}\n onChange={this.onChange}\n imageSupport={imageSupport}\n disableImageAlignmentButtons={true}\n onBlur={this.onBlur}\n disabled={false}\n highlightShape={false}\n error={responseAreasError}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n autoWidthToolbar\n />\n {responseAreasError && <ErrorText>{responseAreasError}</ErrorText>}\n\n {!isEmpty(model.choices) && (\n <ResponseHeader>\n {`Define Alternates ${maxLengthPerChoiceEnabled ? 'and Character Limits' : ''}`}\n </ResponseHeader>\n )}\n <AlternateResponses\n model={model}\n onChange={this.onResponsesChanged}\n onLengthChange={this.onLengthChanged}\n maxLengthPerChoiceEnabled={maxLengthPerChoiceEnabled}\n spellCheck={spellCheckEnabled}\n choicesErrors={choicesErrors}\n pluginProps={getPluginProps(responseAreaInputConfiguration?.inputConfiguration)}\n />\n\n {rationaleEnabled && (\n <PromptHolder label={rationale.label}>\n <EditableHtml\n className=\"prompt\"\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n error={rationaleError}\n toolbarOpts={toolbarOpts}\n pluginProps={getPluginProps(rationale?.inputConfiguration)}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n autoWidthToolbar\n />\n {rationaleError && <ErrorText>{rationaleError}</ErrorText>}\n </PromptHolder>\n )}\n </layout.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;AAAA,IAAAQ,QAAA,GAAAV,OAAA,CAAA/M,OAAA,GA0ZYiD,IAAI","ignoreList":[]}
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/explicit-constructed-response-configure",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"modue": "src/index.js",
|
|
@@ -10,10 +10,10 @@
|
|
|
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": "
|
|
14
|
-
"@pie-lib/editable-html": "
|
|
13
|
+
"@pie-lib/config-ui": "12.1.1-next.0",
|
|
14
|
+
"@pie-lib/editable-html-tip-tap": "1.1.1-next.0",
|
|
15
15
|
"classnames": "^2.2.6",
|
|
16
|
-
"debug": "^
|
|
16
|
+
"debug": "^4.1.1",
|
|
17
17
|
"lodash": "^4.17.15",
|
|
18
18
|
"prop-types": "^15.6.2",
|
|
19
19
|
"react": "18.2.0",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,17 +3,6 @@
|
|
|
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.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@6.3.2...@pie-element/explicit-constructed-response-controller@6.3.3) (2025-11-27)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* bump libs PD-5274, PD-5211, PD-5248 ([7610b25](https://github.com/pie-framework/pie-elements/commit/7610b25423956b6492f33322513b3430051fca77))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
6
|
## [6.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/explicit-constructed-response-controller@6.3.1...@pie-element/explicit-constructed-response-controller@6.3.2) (2025-10-22)
|
|
18
7
|
|
|
19
8
|
|
package/controller/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_debug","_interopRequireDefault","require","_map","_reduce","_find","_isEmpty","_he","_controllerUtils","_translator","_defaults","translator","Translator","log","debug","prepareChoice","mode","defaultFeedback","choice","out","label","value","correct","feedbackType","feedback","type","exports","getFeedback","getAdjustedLength","length","decodeHtmlEntities","str","replace","normalize","question","defaults","model","session","env","choices","Object","keys","forEach","key","map","item","index","normalizedQuestion","assign","incorrect","prepareChoiceFn","reduce","obj","area","respArea","chosenValue","val","isEmpty","find","c","prepareVal","showNote","values","some","note","t","lng","language","maxLengthPerChoice","maxLengthPerChoiceEnabled","undefinedLengths","labelLengthsArr","Math","max","disabled","displayType","role","markup","playerSpellCheckEnabled","prompt","promptEnabled","rationale","responseCorrect","getScore","undefined","teacherInstructions","responseAreaInputConfiguration","extraCSSRules","rationaleEnabled","teacherInstructionsEnabled","html","decodeHTML","getInnerText","trim","config","responseAreas","match","maxScore","correctCount","total","toFixed","parseFloat","outcome","Promise","resolve","partialScoringEnabled","partialScoring","enabled","score","empty","createCorrectResponseSession","i","id","replaceAll","decode","getContent","validate","maxResponseAreas","allChoicesErrors","errors","field","required","entries","reversedChoices","reverse","choicesErrors","identicalAnswer","slice","nbOfResponseAreas"],"sources":["../src/index.js"],"sourcesContent":["import debug from 'debug';\nimport map from 'lodash/map';\nimport reduce from 'lodash/reduce';\nimport find from 'lodash/find';\nimport isEmpty from 'lodash/isEmpty';\nimport { decode } from 'he';\nimport { partialScoring } from '@pie-lib/controller-utils';\nimport Translator from '@pie-lib/translator';\nimport defaults from './defaults';\n\nconst { translator } = Translator;\n\nconst log = debug('explicit-constructed-response:controller');\n\nexport const prepareChoice = (mode, defaultFeedback) => (choice) => {\n const out = {\n label: choice.label,\n value: choice.value,\n };\n\n if (mode === 'evaluate') {\n out.correct = true;\n\n const feedbackType = (choice.feedback && choice.feedback.type) || 'none';\n\n if (feedbackType === 'default') {\n out.feedback = defaultFeedback['correct'];\n } else if (feedbackType === 'custom') {\n out.feedback = choice.feedback.value;\n }\n }\n\n return out;\n};\n\nconst getFeedback = (value) => {\n if (value) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\n// also used in configure/src/markupUtils.js\nconst getAdjustedLength = (length) => {\n if (length <= 2) {\n return length + 2;\n }\n\n if (length <= 4) {\n return length + 3;\n }\n\n if (length <= 6) {\n return length + 4;\n }\n\n return length + 5;\n};\n\n// we can't use the dom parser here because it is not available in the node environment\nconst decodeHtmlEntities = (str) => {\n if (!str) return '';\n return str\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/"/g, '\"')\n .replace(/'|'/g, '\\'')\n .replace(/&/g, '&');\n};\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n // this was added to treat an exception, when the model has choices without\n // the \"value\" property like: { label: 'test' }\n if (question.choices) {\n Object.keys(question.choices).forEach((key) => {\n question.choices[key] = (question.choices[key] || []).map((item, index) => {\n if (!item.value) {\n log('Choice does not contain \"value\" property, which is required.', item);\n return { value: `${index}`, ...item };\n }\n\n return item;\n });\n });\n }\n\n const normalizedQuestion = normalize(question);\n const defaultFeedback = Object.assign(\n { correct: 'Correct', incorrect: 'Incorrect' },\n normalizedQuestion.defaultFeedback,\n );\n const prepareChoiceFn = prepareChoice(env.mode, defaultFeedback);\n const choices = reduce(\n normalizedQuestion.choices,\n (obj, area, key) => {\n obj[key] = map(area, prepareChoiceFn);\n\n return obj;\n },\n {},\n );\n\n const { value = {} } = session || {};\n const feedback =\n env.mode === 'evaluate'\n ? reduce(\n normalizedQuestion.choices,\n (obj, respArea, key) => {\n const chosenValue = value && value[key];\n const val =\n !isEmpty(chosenValue) && find(respArea, (c) => prepareVal(c.label) === prepareVal(chosenValue));\n\n obj[key] = getFeedback(val);\n\n return obj;\n },\n {},\n )\n : {};\n\n // check if at least one choice has an alternate\n const showNote = Object.values(choices).some((choice) => choice?.length > 1);\n const note =\n normalizedQuestion.note ||\n translator.t('common:commonCorrectAnswerWithAlternates', { lng: normalizedQuestion.language });\n\n const { maxLengthPerChoice = [], maxLengthPerChoiceEnabled } = normalizedQuestion;\n const undefinedLengths = !maxLengthPerChoice.length;\n\n // calculate maxLengthPerChoice array if it is not defined or defined incorrectly\n Object.values(choices).forEach((choice, index) => {\n const labelLengthsArr = (choice || []).map((choice) => decodeHtmlEntities(choice.label || '').length);\n const length = Math.max(...labelLengthsArr);\n\n if (\n undefinedLengths ||\n !maxLengthPerChoice[index] ||\n maxLengthPerChoice[index] < length ||\n maxLengthPerChoice[index] > length + 10\n ) {\n maxLengthPerChoice[index] = getAdjustedLength(length);\n }\n });\n\n const out = {\n choices,\n disabled: env.mode !== 'gather',\n displayType: normalizedQuestion.displayType,\n mode: env.mode,\n role: env.role,\n feedback,\n language: normalizedQuestion.language,\n markup: normalizedQuestion.markup,\n maxLengthPerChoice,\n maxLengthPerChoiceEnabled,\n note,\n playerSpellCheckEnabled: normalizedQuestion.playerSpellCheckEnabled,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : defaults.prompt,\n rationale: defaults.rationale,\n responseCorrect: env.mode === 'evaluate' ? getScore(normalizedQuestion, session) === 1 : undefined,\n showNote,\n teacherInstructions: defaults.teacherInstructions,\n responseAreaInputConfiguration: normalizedQuestion.responseAreaInputConfiguration,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : defaults.rationale;\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : defaults.teacherInstructions;\n }\n\n return out;\n}\n\nexport const prepareVal = (html) => {\n return decodeHTML(getInnerText(html).trim());\n};\n\nexport const getScore = (config, session) => {\n const { value } = session || {};\n\n if (!session || isEmpty(session) || !value) {\n return 0;\n }\n\n const responseAreas = config.markup && config.markup.match(/\\{\\{(.+?)\\}\\}/g);\n const maxScore = responseAreas ? responseAreas.length : 0;\n const correctCount = reduce(\n config.choices,\n (total, respArea, key) => {\n const chosenValue = value && value[key];\n\n if (isEmpty(chosenValue) || !find(respArea, (c) => prepareVal(c.label) === prepareVal(chosenValue))) {\n return total;\n }\n\n return total + 1;\n },\n 0,\n );\n\n const str = maxScore ? (correctCount / maxScore).toFixed(2) : 0;\n\n return parseFloat(str);\n};\n\n/**\n * The score is partial by default for checkbox mode, allOrNothing for radio mode.\n * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =\n * false. the value in `env` will override the value in `model`.\n * @param {Object} model - the main model\n * @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)\n * @param {*} session\n * @param {Object} env\n * @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides\n * `model.partialScoring`.\n */\nexport function outcome(model, session, env = {}) {\n return new Promise((resolve) => {\n const partialScoringEnabled = partialScoring.enabled(model, env);\n const score = getScore(model, session);\n\n resolve({ score: partialScoringEnabled ? score : score === 1 ? 1 : 0, empty: isEmpty(session) });\n });\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { choices } = question;\n const value = {};\n\n Object.keys(choices).forEach((key, i) => {\n value[i] = choices[key][0].label;\n });\n\n resolve({ id: '1', value });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\n// const getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\nconst getInnerText = (html) => {\n if (typeof html !== 'string') {\n return '';\n }\n if (typeof html.replaceAll === 'function') {\n return html.replaceAll(/<[^>]*>/g, '');\n } else {\n // Polyfill for replaceAll using replace and a global regex\n return html.replace(/<[^>]*>/g, '');\n }\n};\n\nconst decodeHTML = (html) => decode(html);\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { choices, markup } = model;\n const { maxResponseAreas } = config;\n const allChoicesErrors = {};\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(choices || {}).forEach(([key, values]) => {\n const reversedChoices = [...(values || [])].reverse();\n const choicesErrors = {};\n\n reversedChoices.forEach((choice, index) => {\n const { value, label } = choice;\n\n if (label === '' || label === '<div></div>') {\n choicesErrors[value] = 'Content should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);\n\n if (identicalAnswer) {\n choicesErrors[value] = 'Content should be unique.';\n }\n }\n });\n\n if (!isEmpty(choicesErrors)) {\n allChoicesErrors[key] = choicesErrors;\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(allChoicesErrors)) {\n errors.choices = allChoicesErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,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QAAEzB,KAAK;QAAED;MAAM,CAAC,GAAGF,MAAM;MAE/B,IAAIE,KAAK,KAAK,EAAE,IAAIA,KAAK,KAAK,aAAa,EAAE;QAC3CyG,aAAa,CAACxG,KAAK,CAAC,GAAG,8BAA8B;MACvD,CAAC,MAAM;QACL,MAAMyG,eAAe,GAAGH,eAAe,CAACI,KAAK,CAACjF,KAAK,GAAG,CAAC,CAAC,CAACiB,IAAI,CAAEJ,CAAC,IAAKA,CAAC,CAACvC,KAAK,KAAKA,KAAK,CAAC;QAEvF,IAAI0G,eAAe,EAAE;UACnBD,aAAa,CAACxG,KAAK,CAAC,GAAG,2BAA2B;QACpD;MACF;IACF,CAAC,CAAC;IAEF,IAAI,CAAC,IAAAoC,gBAAO,EAACoE,aAAa,CAAC,EAAE;MAC3BP,gBAAgB,CAAC3E,GAAG,CAAC,GAAGkF,aAAa;IACvC;EACF,CAAC,CAAC;EAEF,MAAMG,iBAAiB,GAAG,CAACnD,MAAM,CAACmB,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAEnE,MAAM;EAEvE,IAAImG,iBAAiB,GAAGX,gBAAgB,EAAE;IACxCE,MAAM,CAACxB,aAAa,GAAG,gBAAgBsB,gBAAgB,oCAAoC;EAC7F,CAAC,MAAM,IAAIW,iBAAiB,GAAG,CAAC,EAAE;IAChCT,MAAM,CAACxB,aAAa,GAAG,mDAAmD;EAC5E;EAEA,IAAI,CAAC,IAAAtC,gBAAO,EAAC6D,gBAAgB,CAAC,EAAE;IAC9BC,MAAM,CAAChF,OAAO,GAAG+E,gBAAgB;EACnC;EAEA,OAAOC,MAAM;AACf,CAAC;AAAC7F,OAAA,CAAA0F,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_debug","_interopRequireDefault","require","_map","_reduce","_find","_isEmpty","_he","_controllerUtils","_translator","_defaults","translator","Translator","log","debug","prepareChoice","mode","defaultFeedback","choice","out","label","value","correct","feedbackType","feedback","type","exports","getFeedback","getAdjustedLength","length","Math","abs","Infinity","decodeHtmlEntities","str","replace","normalize","question","defaults","model","session","env","choices","Object","keys","forEach","key","map","item","index","normalizedQuestion","assign","incorrect","prepareChoiceFn","reduce","obj","area","respArea","chosenValue","val","isEmpty","find","c","prepareVal","showNote","values","some","note","t","lng","language","maxLengthPerChoice","maxLengthPerChoiceEnabled","undefinedLengths","labelLengthsArr","max","disabled","displayType","role","markup","playerSpellCheckEnabled","prompt","promptEnabled","rationale","responseCorrect","getScore","undefined","teacherInstructions","responseAreaInputConfiguration","extraCSSRules","rationaleEnabled","teacherInstructionsEnabled","html","decodeHTML","getInnerText","trim","config","responseAreas","match","maxScore","correctCount","total","toFixed","parseFloat","outcome","Promise","resolve","partialScoringEnabled","partialScoring","enabled","score","empty","createCorrectResponseSession","i","id","replaceAll","decode","getContent","validate","maxResponseAreas","allChoicesErrors","errors","field","required","entries","reversedChoices","reverse","choicesErrors","identicalAnswer","slice","nbOfResponseAreas"],"sources":["../src/index.js"],"sourcesContent":["import debug from 'debug';\nimport map from 'lodash/map';\nimport reduce from 'lodash/reduce';\nimport find from 'lodash/find';\nimport isEmpty from 'lodash/isEmpty';\nimport { decode } from 'he';\nimport { partialScoring } from '@pie-lib/controller-utils';\nimport Translator from '@pie-lib/translator';\nimport defaults from './defaults';\n\nconst { translator } = Translator;\n\nconst log = debug('explicit-constructed-response:controller');\n\nexport const prepareChoice = (mode, defaultFeedback) => (choice) => {\n const out = {\n label: choice.label,\n value: choice.value,\n };\n\n if (mode === 'evaluate') {\n out.correct = true;\n\n const feedbackType = (choice.feedback && choice.feedback.type) || 'none';\n\n if (feedbackType === 'default') {\n out.feedback = defaultFeedback['correct'];\n } else if (feedbackType === 'custom') {\n out.feedback = choice.feedback.value;\n }\n }\n\n return out;\n};\n\nconst getFeedback = (value) => {\n if (value) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\n// also used in configure/src/markupUtils.js\nconst getAdjustedLength = (length) => {\n if (Math.abs(length) === Infinity) {\n return 2;\n }\n\n if (length <= 2) {\n return length + 2;\n }\n\n if (length <= 4) {\n return length + 3;\n }\n\n if (length <= 6) {\n return length + 4;\n }\n\n return length + 5;\n};\n\n// we can't use the dom parser here because it is not available in the node environment\nconst decodeHtmlEntities = (str) => {\n if (!str) return '';\n return str\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/"/g, '\"')\n .replace(/'|'/g, '\\'')\n .replace(/&/g, '&');\n};\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n // this was added to treat an exception, when the model has choices without\n // the \"value\" property like: { label: 'test' }\n if (question.choices) {\n Object.keys(question.choices).forEach((key) => {\n question.choices[key] = (question.choices[key] || []).map((item, index) => {\n if (!item.value) {\n log('Choice does not contain \"value\" property, which is required.', item);\n return { value: `${index}`, ...item };\n }\n\n return item;\n });\n });\n }\n\n const normalizedQuestion = normalize(question);\n const defaultFeedback = Object.assign(\n { correct: 'Correct', incorrect: 'Incorrect' },\n normalizedQuestion.defaultFeedback,\n );\n const prepareChoiceFn = prepareChoice(env.mode, defaultFeedback);\n const choices = reduce(\n normalizedQuestion.choices,\n (obj, area, key) => {\n obj[key] = map(area, prepareChoiceFn);\n\n return obj;\n },\n {},\n );\n\n const { value = {} } = session || {};\n const feedback =\n env.mode === 'evaluate'\n ? reduce(\n normalizedQuestion.choices,\n (obj, respArea, key) => {\n const chosenValue = value && value[key];\n const val =\n !isEmpty(chosenValue) && find(respArea, (c) => prepareVal(c.label) === prepareVal(chosenValue));\n\n obj[key] = getFeedback(val);\n\n return obj;\n },\n {},\n )\n : {};\n\n // check if at least one choice has an alternate\n const showNote = Object.values(choices).some((choice) => choice?.length > 1);\n const note =\n normalizedQuestion.note ||\n translator.t('common:commonCorrectAnswerWithAlternates', { lng: normalizedQuestion.language });\n\n const { maxLengthPerChoice = [], maxLengthPerChoiceEnabled } = normalizedQuestion;\n const undefinedLengths = !maxLengthPerChoice.length;\n\n // calculate maxLengthPerChoice array if it is not defined or defined incorrectly\n Object.values(choices).forEach((choice, index) => {\n const labelLengthsArr = (choice || []).map((choice) => decodeHtmlEntities(choice.label || '').length);\n const length = Math.max(...labelLengthsArr);\n\n if (\n undefinedLengths ||\n !maxLengthPerChoice[index] ||\n maxLengthPerChoice[index] < length ||\n maxLengthPerChoice[index] > length + 10\n ) {\n maxLengthPerChoice[index] = getAdjustedLength(length);\n }\n });\n\n const out = {\n choices,\n disabled: env.mode !== 'gather',\n displayType: normalizedQuestion.displayType,\n mode: env.mode,\n role: env.role,\n feedback,\n language: normalizedQuestion.language,\n markup: normalizedQuestion.markup,\n maxLengthPerChoice,\n maxLengthPerChoiceEnabled,\n note,\n playerSpellCheckEnabled: normalizedQuestion.playerSpellCheckEnabled,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : defaults.prompt,\n rationale: defaults.rationale,\n responseCorrect: env.mode === 'evaluate' ? getScore(normalizedQuestion, session) === 1 : undefined,\n showNote,\n teacherInstructions: defaults.teacherInstructions,\n responseAreaInputConfiguration: normalizedQuestion.responseAreaInputConfiguration,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : defaults.rationale;\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : defaults.teacherInstructions;\n }\n\n return out;\n}\n\nexport const prepareVal = (html) => {\n return decodeHTML(getInnerText(html).trim());\n};\n\nexport const getScore = (config, session) => {\n const { value } = session || {};\n\n if (!session || isEmpty(session) || !value) {\n return 0;\n }\n\n const responseAreas = config.markup && config.markup.match(/\\{\\{(.+?)\\}\\}/g);\n const maxScore = responseAreas ? responseAreas.length : 0;\n const correctCount = reduce(\n config.choices,\n (total, respArea, key) => {\n const chosenValue = value && value[key];\n\n if (isEmpty(chosenValue) || !find(respArea, (c) => prepareVal(c.label) === prepareVal(chosenValue))) {\n return total;\n }\n\n return total + 1;\n },\n 0,\n );\n\n const str = maxScore ? (correctCount / maxScore).toFixed(2) : 0;\n\n return parseFloat(str);\n};\n\n/**\n * The score is partial by default for checkbox mode, allOrNothing for radio mode.\n * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =\n * false. the value in `env` will override the value in `model`.\n * @param {Object} model - the main model\n * @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)\n * @param {*} session\n * @param {Object} env\n * @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides\n * `model.partialScoring`.\n */\nexport function outcome(model, session, env = {}) {\n return new Promise((resolve) => {\n const partialScoringEnabled = partialScoring.enabled(model, env);\n const score = getScore(model, session);\n\n resolve({ score: partialScoringEnabled ? score : score === 1 ? 1 : 0, empty: isEmpty(session) });\n });\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { choices } = question;\n const value = {};\n\n Object.keys(choices).forEach((key, i) => {\n value[i] = choices[key][0].label;\n });\n\n resolve({ id: '1', value });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\n// const getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\nconst getInnerText = (html) => {\n if (typeof html !== 'string') {\n return '';\n }\n if (typeof html.replaceAll === 'function') {\n return html.replaceAll(/<[^>]*>/g, '');\n } else {\n // Polyfill for replaceAll using replace and a global regex\n return html.replace(/<[^>]*>/g, '');\n }\n};\n\nconst decodeHTML = (html) => decode(html);\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { choices, markup } = model;\n const { maxResponseAreas } = config;\n const allChoicesErrors = {};\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(choices || {}).forEach(([key, values]) => {\n const reversedChoices = [...(values || [])].reverse();\n const choicesErrors = {};\n\n reversedChoices.forEach((choice, index) => {\n const { value, label } = choice;\n\n if (label === '' || label === '<div></div>') {\n choicesErrors[value] = 'Content should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);\n\n if (identicalAnswer) {\n choicesErrors[value] = 'Content should be unique.';\n }\n }\n });\n\n if (!isEmpty(choicesErrors)) {\n allChoicesErrors[key] = choicesErrors;\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(allChoicesErrors)) {\n errors.choices = allChoicesErrors;\n }\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,GAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,SAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,MAAM;EAAES;AAAW,CAAC,GAAGC,mBAAU;AAEjC,MAAMC,GAAG,GAAG,IAAAC,cAAK,EAAC,0CAA0C,CAAC;AAEtD,MAAMC,aAAa,GAAGA,CAACC,IAAI,EAAEC,eAAe,KAAMC,MAAM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e,CAACI,KAAK,CAAChF,KAAK,GAAG,CAAC,CAAC,CAACiB,IAAI,CAAEJ,CAAC,IAAKA,CAAC,CAAC1C,KAAK,KAAKA,KAAK,CAAC;QAEvF,IAAI4G,eAAe,EAAE;UACnBD,aAAa,CAAC1G,KAAK,CAAC,GAAG,2BAA2B;QACpD;MACF;IACF,CAAC,CAAC;IAEF,IAAI,CAAC,IAAAuC,gBAAO,EAACmE,aAAa,CAAC,EAAE;MAC3BP,gBAAgB,CAAC1E,GAAG,CAAC,GAAGiF,aAAa;IACvC;EACF,CAAC,CAAC;EAEF,MAAMG,iBAAiB,GAAG,CAACnD,MAAM,CAACmB,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAErE,MAAM;EAEvE,IAAIqG,iBAAiB,GAAGX,gBAAgB,EAAE;IACxCE,MAAM,CAACxB,aAAa,GAAG,gBAAgBsB,gBAAgB,oCAAoC;EAC7F,CAAC,MAAM,IAAIW,iBAAiB,GAAG,CAAC,EAAE;IAChCT,MAAM,CAACxB,aAAa,GAAG,mDAAmD;EAC5E;EAEA,IAAI,CAAC,IAAArC,gBAAO,EAAC4D,gBAAgB,CAAC,EAAE;IAC9BC,MAAM,CAAC/E,OAAO,GAAG8E,gBAAgB;EACnC;EAEA,OAAOC,MAAM;AACf,CAAC;AAAC/F,OAAA,CAAA4F,QAAA,GAAAA,QAAA","ignoreList":[]}
|
package/controller/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/explicit-constructed-response-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "7.0.0-beta.
|
|
4
|
+
"version": "7.0.0-beta.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"author": "",
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@pie-lib/controller-utils": "
|
|
12
|
-
"@pie-lib/translator": "
|
|
13
|
-
"debug": "^
|
|
11
|
+
"@pie-lib/controller-utils": "1.1.1-next.0",
|
|
12
|
+
"@pie-lib/translator": "3.1.1-next.0",
|
|
13
|
+
"debug": "^4.1.1",
|
|
14
14
|
"he": "^1.2.0",
|
|
15
15
|
"lodash": "^4.17.15",
|
|
16
16
|
"type-of": "^2.0.1"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_dll_lodash as e,_dll_react as t,_dll_prop_types as a,_dll_mui__material_styles as o,_dll_mui__material as n,_dll_mui__icons_material as s,_dll_debug as l,_dll_react_dom as i}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as r}from"../../../@pie-lib/editable-html-module@^6.0.5/module/index.js";import{_dll_pie_lib__config_ui as d}from"../../../@pie-lib/config-module@^3.0.0/module/index.js";function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c,p={},h={exports:{}};(c=h).exports=function(e){return e&&e.__esModule?e:{default:e}},c.exports.__esModule=!0,c.exports.default=c.exports,u(h.exports);var g={exports:{}},f={exports:{}},m={exports:{}};!function(e){function t(a){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(a)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(m),u(m.exports);var b={exports:{}};!function(e){var t=m.exports.default;e.exports=function(e,a){if("object"!=t(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,a||"default");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===a?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(b),u(b.exports),function(e){var t=m.exports.default,a=b.exports;e.exports=function(e){var o=a(e,"string");return"symbol"==t(o)?o:o+""},e.exports.__esModule=!0,e.exports.default=e.exports}(f),u(f.exports),function(e){var t=f.exports;e.exports=function(e,a,o){return(a=t(a))in e?Object.defineProperty(e,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[a]=o,e},e.exports.__esModule=!0,e.exports.default=e.exports}(g),u(g.exports);var C={};Object.defineProperty(C,"__esModule",{value:!0});class x extends CustomEvent{constructor(e,t=!1){super(x.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}x.TYPE="model.updated",C.ModelUpdatedEvent=x;class v extends CustomEvent{constructor(e,t){super(v.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}v.TYPE="delete.image",C.DeleteImageEvent=v;class y extends CustomEvent{constructor(e){super(y.TYPE,{bubbles:!0,detail:e}),this.handler=e}}y.TYPE="insert.image",C.InsertImageEvent=y;class _ extends CustomEvent{constructor(e,t){super(_.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}_.TYPE="delete.sound",C.DeleteSoundEvent=_;class E extends CustomEvent{constructor(e){super(E.TYPE,{bubbles:!0,detail:e}),this.handler=e}}E.TYPE="insert.sound",C.InsertSoundEvent=E;var S={},M={},P={exports:{}};!function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)({}).hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(P),u(P.exports);var k={};const{escape:L}=e;var A=h.exports;Object.defineProperty(k,"__esModule",{value:!0}),k.stripHtmlTags=k.removeUnwantedCharacters=k.processMarkup=k.getAdjustedLength=k.decodeHTML=k.createSlateMarkup=void 0;var I=A(L);const T="imes|riangle|an|heta|herefore",R="throot|parallel|cong|approx|eq|e|sim",j=new RegExp(`(\\t(?!${T}))|(\\n(?!${R}))|(\\\\t(?!${T}))|(\\\\n(?!${R}))`,"g"),w=e=>e.replace(j,"").replace(/\\"/g,'"').replace(/\\\//g,"/");k.removeUnwantedCharacters=w,k.processMarkup=e=>{const t=((e="")=>{const t=document.createElement("div");return t.innerHTML=e.trim(),t})(w(e||"")||"");let a=0;return t.querySelectorAll('[data-type="explicit_constructed_response"]').forEach(e=>{e.replaceWith(`{{${a++}}}`)}),t.innerHTML};const O=/\{\{(\d+)\}\}/g;k.createSlateMarkup=(e,t)=>e?w(e).replace(O,(e,a)=>{const o=t[a][0].label||"";return`<span data-type="explicit_constructed_response" data-index="${a}" data-value="${(0,I.default)(o)}"></span>`}):"",k.getAdjustedLength=e=>e<=2?e+2:e<=4?e+3:e<=6?e+4:e+5,k.stripHtmlTags=e=>"string"!=typeof e?"":e.replace(/<\/?[^>]+(>|$)/g,""),k.decodeHTML=e=>(new DOMParser).parseFromString(e,"text/html").body.textContent||"";const D=t,q=a,H=o,W=r;function B(e){let t,a=e[0],o=1;for(;o<e.length;){const n=e[o],s=e[o+1];if(o+=2,("optionalAccess"===n||"optionalCall"===n)&&null==a)return;"access"===n||"optionalAccess"===n?(t=a,a=s(a)):"call"!==n&&"optionalCall"!==n||(a=s((...e)=>a.call(t,...e)),t=void 0)}return a}var N=h.exports;Object.defineProperty(M,"__esModule",{value:!0}),M.default=M.ECRToolbar=void 0;var U=N(P.exports),z=N(g.exports),$=N(D),Y=N(q),F=H,K=N(W),V=k;const G=(0,F.styled)(K.default)(({theme:e})=>({backgroundColor:e.palette.common.white,outline:"none",lineHeight:"15px"}));class J extends $.default.Component{constructor(...e){super(...e),(0,z.default)(this,"state",{markup:"",toolbarStyle:{}}),(0,z.default)(this,"onDone",e=>{const{node:t,editor:a,onToolbarDone:o,onChangeResponse:n}=this.props,s=(0,V.stripHtmlTags)(e);this.setState({markup:s}),a.commands.updateAttributes("explicit_constructed_response",{value:s}),o(!0),n(s)}),(0,z.default)(this,"onRespAreaChange",e=>{this.setState({respAreaMarkup:e})}),(0,z.default)(this,"onKeyDown",e=>{if("Enter"===e.key)return!0}),(0,z.default)(this,"onBlur",()=>{this.clickedInside&&(this.clickedInside=!1)})}componentDidMount(){const{correctChoice:e,node:t,editor:a}=this.props,o=e||{},n=a.view.nodeDOM(a.state.selection.from);if(1===B([n,"optionalAccess",e=>e.nodeType])){const e=n.getBoundingClientRect(),t=n.closest(".tiptap").getBoundingClientRect();e.top,t.top,e.left,t.left,this.setState({markup:o.label,toolbarStyle:{position:"absolute",top:0,left:0,width:e.width-4+"px"}})}}render(){const{maxLengthPerChoiceEnabled:e,pluginProps:t,spellCheck:a}=this.props,{markup:o,toolbarStyle:n}=this.state,s=e?{}:{maxLength:25};return $.default.createElement("div",{style:n},$.default.createElement(G,(0,U.default)({autoFocus:!0,disableUnderline:!0,onChange:e=>{this.preventDone||this.onRespAreaChange(e)},onDone:e=>{this.preventDone||this.onDone(e)},onBlur:e=>{this.preventDone=e.relatedTarget&&e.relatedTarget.closest(".insert-character-dialog"),this.onBlur(e)},onKeyDown:this.onKeyDown,markup:o||"",activePlugins:["languageCharacters"],pluginProps:t,languageCharactersProps:[{language:"spanish"}],minHeight:"15px",maxHeight:"15px",spellCheck:a,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",isHidden:!!B([t,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])}},s)))}}M.ECRToolbar=J,(0,z.default)(J,"propTypes",{correctChoice:Y.default.object,node:Y.default.object,onDone:Y.default.func,onChangeResponse:Y.default.func.isRequired,onToolbarDone:Y.default.func.isRequired,value:Y.default.shape({change:Y.default.func.isRequired,document:Y.default.shape({getNextText:Y.default.func.isRequired})}),editor:Y.default.object,maxLengthPerChoiceEnabled:Y.default.bool,pluginProps:Y.default.object,spellCheck:Y.default.bool}),M.default=J;var Q={},X={};const Z=t,ee=a,{debounce:te}=e,{isEqual:ae}=e,{max:oe}=e,{Button:ne}=n,{IconButton:se}=n,{MenuItem:le}=n,{Select:ie}=n,{TextField:re}=n,{Delete:de}=s,ue=o,ce=r;function pe(e){let t,a=e[0],o=1;for(;o<e.length;){const n=e[o],s=e[o+1];if(o+=2,("optionalAccess"===n||"optionalCall"===n)&&null==a)return;"access"===n||"optionalAccess"===n?(t=a,a=s(a)):"call"!==n&&"optionalCall"!==n||(a=s((...e)=>a.call(t,...e)),t=void 0)}return a}var he=h.exports;Object.defineProperty(X,"__esModule",{value:!0}),X.default=X.Choice=X.AlternateSection=void 0;var ge=he(P.exports),fe=he(g.exports),me=he(Z),be=he(ee),Ce=he(te),xe=he(ae),ve=he(ne),ye=he(de),_e=he(se),Ee=he(le),Se=he(ie),Me=he(re),Pe=ue,ke=he(oe),Le=he(ce),Ae=k;const Ie=(0,Pe.styled)("div")(({theme:e})=>({marginBottom:e.spacing(.5)})),Te=(0,Pe.styled)("div")(({theme:e})=>({alignItems:"flex-start",flexDirection:"column",display:"flex",paddingTop:e.spacing(2.5),"& > *":{marginBottom:e.spacing(2.5),width:"100%"}})),Re=(0,Pe.styled)(Le.default)(({theme:e,hasError:t})=>({flex:"1",marginRight:e.spacing(2.5),...t&&{border:`2px solid ${e.palette.error.main}`,borderRadius:"6px"}})),je=(0,Pe.styled)(_e.default)(({theme:e})=>({"& svg":{fill:e.palette.grey[600]}})),we=(0,Pe.styled)("div")({alignItems:"flex-end",display:"flex",justifyContent:"space-between",width:"100%"}),Oe=(0,Pe.styled)("div")({alignItems:"center",display:"flex"}),De=(0,Pe.styled)(Me.default)(({theme:e})=>({width:"230px",marginRight:e.spacing(2.5),"& .MuiInput-underline:before":{borderBottomColor:e.palette.divider},"& .MuiInput-underline:hover:not(.Mui-disabled):before":{borderBottomColor:e.palette.text.primary},"& .MuiInput-underline:after":{borderBottomColor:e.palette.primary.main}})),qe=(0,Pe.styled)("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(.5)})),He=(0,Pe.styled)("div")({alignItems:"center",display:"flex",justifyContent:"space-between"});class We extends me.default.Component{constructor(...e){super(...e),(0,fe.default)(this,"state",{value:this.props.markup}),(0,fe.default)(this,"updateText",(0,Ce.default)(this.props.onChange,300)),(0,fe.default)(this,"onChange",e=>{const t=(0,Ae.stripHtmlTags)(e);this.setState({value:t}),this.updateText(t)}),(0,fe.default)(this,"onKeyDown",e=>{if("Enter"===e.key)return!0})}UNSAFE_componentWillReceiveProps(e){e.markup&&this.setState({value:e.markup})}render(){const{value:e}=this.state,{onDelete:t,spellCheck:a,error:o,showMaxLength:n,pluginProps:s}=this.props,l=n?{}:{maxLength:25};return me.default.createElement(me.default.Fragment,null,me.default.createElement(He,null,me.default.createElement(Re,(0,ge.default)({hasError:!!o,disableUnderline:!0,onChange:this.onChange,onKeyDown:this.onKeyDown,markup:e||"",activePlugins:["languageCharacters"],pluginProps:s,languageCharactersProps:[{language:"spanish"}],spellCheck:a,autoWidthToolbar:!0,toolbarOpts:{minWidth:"auto",isHidden:!!pe([s,"optionalAccess",e=>e.characters,"optionalAccess",e=>e.disabled])}},l)),me.default.createElement(je,{"aria-label":"delete",onClick:t,size:"large"},me.default.createElement(ye.default,null))),o&&me.default.createElement(qe,null,o))}}X.Choice=We,(0,fe.default)(We,"propTypes",{error:be.default.string,markup:be.default.string,onChange:be.default.func.isRequired,onDelete:be.default.func.isRequired,value:be.default.string,spellCheck:be.default.bool,showMaxLength:be.default.bool,pluginProps:be.default.object});class Be extends me.default.Component{constructor(...e){super(...e),(0,fe.default)(this,"state",{}),(0,fe.default)(this,"updateChoicesIfNeeded",e=>{this.state.choices&&(0,xe.default)(e.choices,this.state.choices)&&(0,xe.default)(e.choices,this.props.choices)||this.setState({choices:e.choices})}),(0,fe.default)(this,"handleSelect",e=>{const{onSelect:t,selectChoices:a}=this.props,{value:o}=e.target;t(a.find(e=>e.value===o))}),(0,fe.default)(this,"onAddChoice",()=>{const{choices:e}=this.state;if(e.length&&""!==e[e.length-1].label){const t=(0,ke.default)(e.map(e=>parseInt(e.value)).filter(e=>!isNaN(e)))||0;this.setState({choices:[...e,{value:`${t+1}`,label:""}]})}}),(0,fe.default)(this,"onChoiceChanged",(e,t,a)=>{const{choiceChanged:o,lengthChanged:n,maxLength:s,choices:l}=this.props,i=l.map(e=>(0,Ae.decodeHTML)(e.label||"").length);i[a]=(0,Ae.decodeHTML)(t).length;const r=Math.max(...i);o({...e,label:t}),(r>s||r+10<=s)&&n((0,Ae.getAdjustedLength)(r))}),(0,fe.default)(this,"onRemoveChoice",e=>{const{choiceRemoved:t}=this.props;t(e.value)}),(0,fe.default)(this,"getChoicesMaxLength",()=>{const{choices:e}=this.state;if(!e)return 1;const t=e.map(e=>(0,Ae.decodeHTML)(e.label||"").length);return Math.max(...t)}),(0,fe.default)(this,"changeLength",e=>{const{lengthChanged:t}=this.props,a=parseInt(e.target.value,10),o=this.getChoicesMaxLength();a&&a>=o&&a<=o+10&&t(a)})}UNSAFE_componentWillReceiveProps(e){this.updateChoicesIfNeeded(e)}componentDidMount(){this.updateChoicesIfNeeded(this.props)}render(){const{selectChoices:e,maxLength:t,showMaxLength:a,value:o,spellCheck:n,errors:s,pluginProps:l}=this.props,{choices:i}=this.state,r=this.getChoicesMaxLength();return me.default.createElement(Ie,null,me.default.createElement(we,null,me.default.createElement(Se.default,{variant:"standard",displayEmpty:!0,onChange:this.handleSelect,value:o||"",readOnly:a,MenuProps:{transitionDuration:{enter:225,exit:195}}},me.default.createElement(Ee.default,{value:""},me.default.createElement("em",null,o?"Remove selection":"Select a response")),e.map((e,t)=>me.default.createElement(Ee.default,{key:t,value:pe([e,"optionalAccess",e=>e.value])},(0,Ae.decodeHTML)(pe([e,"optionalAccess",e=>e.label]))))),i&&i.length>0&&me.default.createElement(Oe,null,t&&a&&me.default.createElement(De,{variant:"standard",label:"Maximum length (characters)",type:"number",inputProps:{min:r,max:r+10},value:t,onChange:this.changeLength}),me.default.createElement(ve.default,{variant:"contained",color:"primary",onClick:this.onAddChoice},"Add"))),s&&s[0]&&me.default.createElement(qe,null,s[0]),me.default.createElement(Te,null,i&&i.map((e,t)=>t>0&&me.default.createElement(We,{key:t,markup:e.label,onChange:a=>this.onChoiceChanged(e,a,t),onDelete:()=>this.onRemoveChoice(e),spellCheck:n,error:s&&s[t],showMaxLength:a,pluginProps:l}))))}}X.AlternateSection=Be,(0,fe.default)(Be,"propTypes",{choices:be.default.array,selectChoices:be.default.array.isRequired,errors:be.default.object,onSelect:be.default.func.isRequired,choiceChanged:be.default.func.isRequired,lengthChanged:be.default.func,choiceRemoved:be.default.func.isRequired,value:be.default.string,maxLength:be.default.number,showMaxLength:be.default.bool,spellCheck:be.default.bool,pluginProps:be.default.object}),X.default=Be;const Ne=t,Ue=a,{isEqual:ze}=e,{map:$e}=e,{reduce:Ye}=e,{cloneDeep:Fe}=e;var Ke=h.exports;Object.defineProperty(Q,"__esModule",{value:!0}),Q.default=Q.AlternateResponses=void 0;var Ve=Ke(g.exports),Ge=Ke(Ne),Je=Ke(Ue),Qe=Ke(ze),Xe=Ke($e),Ze=Ke(Ye),et=Ke(Fe),tt=Ke(X);class at extends Ge.default.Component{constructor(...e){super(...e),(0,Ve.default)(this,"state",{maxLengthPerChoice:(0,et.default)(this.props.model.maxLengthPerChoice)}),(0,Ve.default)(this,"updateChoicesIfNeeded",e=>{if(!this.state.choices||!(0,Qe.default)(this.state.choices,e.model.choices)||!(0,Qe.default)(e.model.choices,this.props.model.choices)||this.state.values&&Object.keys(this.state.values).length!==Object.keys(this.props.model.choices).length||e.maxLengthPerChoiceEnabled!==this.props.maxLengthPerChoiceEnabled){const{choices:t,maxLengthPerChoice:a}=e.model,o=(0,Ze.default)(t,(t,a,o)=>(a&&(e.maxLengthPerChoiceEnabled||a.length>1)&&(t[o]=a[0]),t),{});this.setState({choices:e.model.choices,values:o,maxLengthPerChoice:(0,et.default)(a)})}}),(0,Ve.default)(this,"getRemainingChoices",e=>{const{choices:t}=this.state;return(0,Ze.default)(t,(t,a,o)=>(a&&1===a.length&&!e&&t.push({label:a[0].label,value:o}),t),[])}),(0,Ve.default)(this,"onChoiceChanged",(e,t)=>{const{onChange:a}=this.props,{choices:o}=this.state,n=o[t]||[],s=!n.find(t=>t.value===e.value),l=n.reduce((t,a)=>{const o=a.value===e.value?e:a;return t.push(o),t},[]);s&&l.push(e),a({...o,[t]:l})}),(0,Ve.default)(this,"onChoiceRemoved",(e,t)=>{const{onChange:a}=this.props,{choices:o}=this.state,n=(o[t]||[]).reduce((t,a)=>(a.value===e||t.push(a),t),[]);a({...o,[t]:n})}),(0,Ve.default)(this,"onSectionSelect",(e,t)=>{const{onChange:a}=this.props,{choices:o,values:n}=this.state;o[t]&&o[t].length>1?e||a({...o,[t]:[o[t][0]]}):this.setState({choices:{...o,[t]:[...o[t],{label:"",value:"1"}]},values:{...n,[t]:o[t][0]}})}),(0,Ve.default)(this,"onLengthChanged",(e,t)=>{const{model:a,onLengthChange:o}=this.props,{maxLengthPerChoice:n}=a;n[t]=e,o(n)})}UNSAFE_componentWillReceiveProps(e){this.updateChoicesIfNeeded(e)}componentDidMount(){this.updateChoicesIfNeeded(this.props)}render(){const{choices:e}=this.state,{model:{maxLengthPerChoice:t,maxLengthPerChoiceEnabled:a},spellCheck:o,choicesErrors:n,pluginProps:s}=this.props;return Ge.default.createElement("div",null,(0,Xe.default)(e,(e,l)=>{if(e&&(a||e.length>1)){const i=this.state.values[l];return Ge.default.createElement(tt.default,{key:l,value:i&&i.value,errors:n&&n[l],onSelect:e=>this.onSectionSelect(e,l),choiceChanged:e=>this.onChoiceChanged(e,l),choiceRemoved:e=>this.onChoiceRemoved(e,l),lengthChanged:e=>this.onLengthChanged(e,l),selectChoices:[i],choices:e,maxLength:t[l],showMaxLength:a,spellCheck:o,pluginProps:s})}}),e&&Object.keys(this.state.values).length!==Object.keys(e).length&&Ge.default.createElement(tt.default,{value:"",onSelect:e=>this.onSectionSelect(e,e.value),choiceChanged:e=>this.onChoiceChanged(e),choiceRemoved:e=>this.onChoiceRemoved(e),selectChoices:this.getRemainingChoices(),spellCheck:o,pluginProps:s}))}}Q.AlternateResponses=at,(0,Ve.default)(at,"propTypes",{choicesErrors:Je.default.object,model:Je.default.object.isRequired,onChange:Je.default.func.isRequired,onLengthChange:Je.default.func.isRequired,maxLengthPerChoiceEnabled:Je.default.bool.isRequired,spellCheck:Je.default.bool,pluginProps:Je.default.object}),Q.default=at;var ot={};Object.defineProperty(ot,"__esModule",{value:!0}),ot.generateValidationMessage=void 0,ot.generateValidationMessage=e=>{const{maxResponseAreas:t}=e;return"Validation requirements:\nCorrect answers should not be blank.\nEach answer defined for a response area should be unique.\nThere should be at least 1 "+(t?`and at most ${t} `:"")+"response area"+(t?"s":"")+" defined."};const nt=t,st=a,{cloneDeep:lt}=e,{isEmpty:it}=e,{pick:rt}=e,{throttle:dt}=e,ut=o,{Typography:ct}=n,{Tooltip:pt}=n,{Info:ht}=s,gt=r,ft=d;function mt(e){let t,a=e[0],o=1;for(;o<e.length;){const n=e[o],s=e[o+1];if(o+=2,("optionalAccess"===n||"optionalCall"===n)&&null==a)return;"access"===n||"optionalAccess"===n?(t=a,a=s(a)):"call"!==n&&"optionalCall"!==n||(a=s((...e)=>a.call(t,...e)),t=void 0)}return a}var bt=h.exports;Object.defineProperty(S,"__esModule",{value:!0}),S.default=S.Main=void 0;var Ct=bt(g.exports),xt=bt(nt),vt=bt(st),yt=bt(lt),_t=bt(it),Et=bt(rt),St=bt(dt),Mt=function(e){if("function"==typeof WeakMap){var t=new WeakMap;new WeakMap}return function(e){if(e&&e.__esModule)return e;var a,o,n={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return n;if(a=t){if(a.has(e))return a.get(e);a.set(e,n)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((o=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(o.get||o.set)?a(n,t,o):n[t]=e[t]);return n}(e)}(gt),Pt=ft,kt=ut,Lt=bt(ct),At=bt(ht),It=bt(pt),Tt=bt(M),Rt=bt(Q),jt=k,wt=ot;const{toggle:Ot,Panel:Dt,dropdown:qt}=Pt.settings,Ht=(0,kt.styled)(Pt.InputContainer)(({theme:e})=>({width:"100%",paddingTop:e.spacing(1),marginTop:e.spacing(2),marginBottom:e.spacing(2)})),Wt=(0,kt.styled)(Mt.default)(({theme:e})=>({minHeight:"100px",paddingTop:e.spacing(1),width:"100%",'& [data-slate-editor="true"]':{minHeight:"100px"}})),Bt=(0,kt.styled)(Lt.default)(({theme:e})=>({fontSize:e.typography.fontSize+2})),Nt=(0,kt.styled)(It.default)(({theme:e})=>({"& .MuiTooltip-tooltip":{fontSize:e.typography.fontSize-2,whiteSpace:"pre",maxWidth:"500px"}})),Ut=(0,kt.styled)("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)})),zt=(0,kt.styled)("div")({display:"flex",alignItems:"center"}),$t=(0,kt.styled)(Lt.default)(({theme:e})=>({fontSize:e.typography.fontSize+2,marginTop:e.spacing(3),marginBottom:e.spacing(1)}));class Yt extends xt.default.Component{constructor(...e){super(...e),(0,Ct.default)(this,"state",{}),(0,Ct.default)(this,"onModelChange",e=>{this.props.onModelChanged({...this.props.model,...e})}),(0,Ct.default)(this,"onPromptChanged",e=>{this.props.onModelChanged({...this.props.model,prompt:e})}),(0,Ct.default)(this,"onRationaleChanged",e=>{this.props.onModelChanged({...this.props.model,rationale:e})}),(0,Ct.default)(this,"onTeacherInstructionsChanged",e=>{const{model:t,onModelChanged:a}=this.props;a({...t,teacherInstructions:e})}),(0,Ct.default)(this,"onMarkupChanged",e=>{this.props.onModelChanged({...this.props.model,slateMarkup:e})}),(0,Ct.default)(this,"onResponsesChanged",e=>{this.props.onModelChanged({...this.props.model,choices:e})}),(0,Ct.default)(this,"onLengthChanged",e=>{const{model:t,onModelChanged:a}=this.props;a({...t,maxLengthPerChoice:e})}),(0,Ct.default)(this,"onChangeResponse",(e,t)=>{const{model:a,onModelChanged:o}=this.props,{choices:n}=a;let{maxLengthPerChoice:s}=a;const l=(0,jt.decodeHTML)(t||"").length;if(n[e]&&n[e].length)n[e][0].label=t||"",s&&(s[e]<l||s[e]>l+10)&&(s[e]=(0,jt.getAdjustedLength)(l));else{n[e]=[{label:t||"",value:"0"}];const a=e>s.length?e-s.length:0;s=[...s,...Array(a).fill(1)],s.splice(e,0,(0,jt.getAdjustedLength)(l))}o({...a,choices:n,maxLengthPerChoice:s})}),(0,Ct.default)(this,"onChange",e=>{const{model:{choices:t,maxLengthPerChoice:a},onModelChanged:o}=this.props,n=(e=>{const t=document.createElement("div");return t.innerHTML=e.trim(),t})(e),s=n.querySelectorAll('[data-type="explicit_constructed_response"]'),l={},i=[];s.forEach((e,o)=>{const n=(0,yt.default)(t[e.dataset.index]);n&&(n[0]={label:e.dataset.value||"",value:"0"},i[o]=a[e.dataset.index]),l[o]=n,e.dataset.index=o}),this.setState({cachedChoices:void 0},()=>o({...this.props.model,choices:l,slateMarkup:n.innerHTML,maxLengthPerChoice:i}))}),(0,Ct.default)(this,"onHandleAreaChange",(0,St.default)(e=>{const{model:{choices:t},onModelChanged:a}=this.props,{cachedChoices:o}=this.state;if(!e)return;const n=t?(0,yt.default)(t):{},s=o?(0,yt.default)(o):{};e.forEach(e=>{const t=e.index;!n[t]&&s[t]?(Object.assign(n,(0,Et.default)(s,t)),Object.prototype.hasOwnProperty.call(s,t)&&delete s[t]):(Object.assign(s,(0,Et.default)(n,t)),Object.prototype.hasOwnProperty.call(n,t)&&delete n[t])}),this.setState({cachedChoices:s},()=>a({...this.props.model,choices:n}))},500,{trailing:!1,leading:!0}))}componentDidMount(){const{model:{slateMarkup:e,choices:t,maxLengthPerChoice:a=[]},onModelChanged:o}=this.props,n=!a.length;this.setState({markup:e}),Object.values(t).forEach((e,t)=>{const o=e.map(e=>(0,jt.decodeHTML)(e.label||"").length),s=Math.max(...o);(n||!a[t]||a[t]<s||a[t]>s+10)&&(a[t]=(0,jt.getAdjustedLength)(s))}),o({...this.props.model,maxLengthPerChoice:a})}render(){const{model:e,configuration:t,onConfigurationChanged:a,imageSupport:o,uploadSoundSupport:n}=this.props,{baseInputConfiguration:s={},contentDimensions:l={},maxImageWidth:i={},maxImageHeight:r={},maxLengthPerChoice:d={},maxResponseAreas:u,partialScoring:c={},playerSpellCheck:p={},prompt:h={},rationale:g={},template:f={},settingsPanelDisabled:m,spellCheck:b={},editSource:C={},teacherInstructions:x={},withRubric:v={},mathMlOptions:y={},language:_={},languageChoices:E={},spanishButton:S={},responseAreaInputConfiguration:M={}}=t||{},{errors:P,extraCSSRules:k,maxLengthPerChoiceEnabled:L,promptEnabled:A,rationaleEnabled:I,spellCheckEnabled:T,teacherInstructionsEnabled:R,toolbarEditorPosition:j}=e||{},{choices:w={},prompt:O,rationale:D,responseAreas:q,teacherInstructions:H}=P||{},W=(0,wt.generateValidationMessage)(t),B=i&&i.prompt,N=r&&r.prompt,U={position:"top"===j?"top":"bottom"},z={partialScoring:c.settings&&Ot(c.label),maxLengthPerChoiceEnabled:d.settings&&Ot(d.label),"language.enabled":_.settings&&Ot(_.label,!0),language:_.settings&&_.enabled&&qt(E.label,E.options),"responseAreaInputConfiguration.inputConfiguration.characters.disabled":S.settings&&Ot(S.label,!0)},$={teacherInstructionsEnabled:x.settings&&Ot(x.label),rationaleEnabled:g.settings&&Ot(g.label),promptEnabled:h.settings&&Ot(h.label),spellCheckEnabled:b.settings&&Ot(b.label),playerSpellCheckEnabled:p.settings&&Ot(p.label),rubricEnabled:mt([v,"optionalAccess",e=>e.settings])&&Ot(mt([v,"optionalAccess",e=>e.label])),"editSource.enabled":mt([C,"optionalAccess",e=>e.settings])&&Ot(C.label,!0)},Y=(e={})=>({...s,...e});return xt.default.createElement(Pt.layout.ConfigLayout,{extraCSSRules:k,dimensions:l,hideSettings:m,settings:xt.default.createElement(Dt,{model:e,configuration:t,onChangeModel:e=>this.onModelChange(e),onChangeConfiguration:e=>a(e,!0),groups:{Settings:z,Properties:$}})},R&&xt.default.createElement(Ht,{label:x.label},xt.default.createElement(Mt.default,{className:"prompt",markup:e.teacherInstructions||"",onChange:this.onTeacherInstructionsChanged,imageSupport:o,nonEmpty:!1,error:H,toolbarOpts:U,pluginProps:Y(mt([x,"optionalAccess",e=>e.inputConfiguration])),spellCheck:T,maxImageWidth:i&&i.teacherInstructions||B,maxImageHeight:r&&r.teacherInstructions||N,uploadSoundSupport:n,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:y,autoWidthToolbar:!0}),H&&xt.default.createElement(Ut,null,H)),A&&xt.default.createElement(Ht,{label:h.label},xt.default.createElement(Mt.default,{className:"prompt",markup:e.prompt,onChange:this.onPromptChanged,imageSupport:o,nonEmpty:!1,disableUnderline:!0,error:O,toolbarOpts:U,pluginProps:Y(mt([h,"optionalAccess",e=>e.inputConfiguration])),spellCheck:T,maxImageWidth:B,maxImageHeight:N,uploadSoundSupport:n,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:y,autoWidthToolbar:!0}),O&&xt.default.createElement(Ut,null,O)),xt.default.createElement(zt,null,xt.default.createElement(Bt,{component:"div"},"Define Template, Choices, and Correct Responses"),xt.default.createElement(Nt,{disableFocusListener:!0,disableTouchListener:!0,placement:"right",title:W},xt.default.createElement(At.default,{fontSize:"small",color:"primary",style:{marginLeft:"8px"}}))),xt.default.createElement(Wt,{activePlugins:Mt.ALL_PLUGINS,toolbarOpts:{position:"top"},spellCheck:T,pluginProps:Y(mt([f,"optionalAccess",e=>e.inputConfiguration])),responseAreaProps:{type:"explicit-constructed-response",options:{duplicates:!0},maxResponseAreas:u,respAreaToolbar:(e,t,a)=>{const{model:o}=this.props,n=(o.choices[e.attrs.index]||[])[0];return()=>xt.default.createElement(Tt.default,{onChangeResponse:t=>this.onChangeResponse(e.attrs.index,t),node:e,editor:t,onToolbarDone:a,correctChoice:n,maxLengthPerChoiceEnabled:L,pluginProps:Y(mt([M,"optionalAccess",e=>e.inputConfiguration]))})},error:()=>w,onHandleAreaChange:this.onHandleAreaChange},markup:e.slateMarkup,onChange:this.onChange,imageSupport:o,disableImageAlignmentButtons:!0,onBlur:this.onBlur,disabled:!1,highlightShape:!1,error:q,uploadSoundSupport:n,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:y,autoWidthToolbar:!0}),q&&xt.default.createElement(Ut,null,q),!(0,_t.default)(e.choices)&&xt.default.createElement($t,null,"Define Alternates "+(L?"and Character Limits":"")),xt.default.createElement(Rt.default,{model:e,onChange:this.onResponsesChanged,onLengthChange:this.onLengthChanged,maxLengthPerChoiceEnabled:L,spellCheck:T,choicesErrors:w,pluginProps:Y(mt([M,"optionalAccess",e=>e.inputConfiguration]))}),I&&xt.default.createElement(Ht,{label:g.label},xt.default.createElement(Mt.default,{className:"prompt",markup:e.rationale||"",onChange:this.onRationaleChanged,imageSupport:o,error:D,toolbarOpts:U,pluginProps:Y(mt([g,"optionalAccess",e=>e.inputConfiguration])),spellCheck:T,maxImageWidth:i&&i.rationale||B,maxImageHeight:r&&r.rationale||N,uploadSoundSupport:n,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:y,autoWidthToolbar:!0}),D&&xt.default.createElement(Ut,null,D)))}}S.Main=Yt,(0,Ct.default)(Yt,"propTypes",{configuration:vt.default.object.isRequired,model:vt.default.object.isRequired,disableSidePanel:vt.default.bool,onModelChanged:vt.default.func.isRequired,onConfigurationChanged:vt.default.func.isRequired,imageSupport:vt.default.shape({add:vt.default.func.isRequired,delete:vt.default.func.isRequired}),uploadSoundSupport:vt.default.object}),S.default=Yt;var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.default=void 0,Ft.default={model:{choices:{},displayType:"block",markup:"",maxLengthPerChoiceEnabled:!0,playerSpellCheckEnabled:!0,prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,spellCheckEnabled:!0,studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom",responseAreaInputConfiguration:{}},configuration:{baseInputConfiguration:{html:{disabled:!0},audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},partialScoring:{settings:!1,label:"Allow Partial Scoring"},rationale:{settings:!0,label:"Rationale",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},settingsPanelDisabled:!1,spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},editSource:{label:"Edit Source",settings:!1,enabled:!1},playerSpellCheck:{label:"Student Spellcheck",settings:!0,enabled:!0},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},template:{inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!0},blockquote:{disabled:!0}}},maxLengthPerChoice:{settings:!0,label:"Maximum Length Per Choice"},maxResponseAreas:10,maxImageWidth:{teacherInstructions:300,prompt:300,rationale:300},maxImageHeight:{teacherInstructions:300,prompt:300,rationale: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:[]},responseAreaInputConfiguration:{inputConfiguration:{characters:{disabled:!0}}},spanishButton:{settings:!0,label:"Disable Spanish Characters"}}};const Kt=t,{client:Vt}=i,Gt=l,{defaults:Jt}=e,{isArray:Qt}=e;function Xt(e){let t,a=e[0],o=1;for(;o<e.length;){const n=e[o],s=e[o+1];if(o+=2,("optionalAccess"===n||"optionalCall"===n)&&null==a)return;"access"===n||"optionalAccess"===n?(t=a,a=s(a)):"call"!==n&&"optionalCall"!==n||(a=s((...e)=>a.call(t,...e)),t=void 0)}return a}var Zt=h.exports;Object.defineProperty(p,"__esModule",{value:!0});var ea=p.default=void 0,ta=Zt(g.exports),aa=Zt(Kt),oa=Vt,na=Zt(Gt),sa=Zt(Jt),la=Zt(Qt),ia=C,ra=Zt(S),da=Zt(Ft),ua=k;const ca=(0,na.default)("explicit-constructed-response:configure");class pa extends HTMLElement{constructor(){super(),this._root=null,this._model=pa.prepareModel(),this._configuration=da.default.configuration,this.onModelChanged=this.onModelChanged.bind(this),this.onConfigurationChanged=this.onConfigurationChanged.bind(this)}set model(e){this._model=pa.prepareModel(e),this._model.responseAreaInputConfiguration&&(this._model.responseAreaInputConfiguration=Xt([this,"access",e=>e._configuration,"access",e=>e.responseAreaInputConfiguration,"optionalAccess",e=>e.inputConfiguration])),this._render()}set configuration(e){this._configuration=(0,sa.default)(e,da.default.configuration),Xt([e,"access",e=>e.language,"optionalAccess",e=>e.enabled])?Xt([e,"access",e=>e.languageChoices,"optionalAccess",e=>e.options,"optionalAccess",e=>e.length])&&(this._model.language=e.languageChoices.options[0].value):e.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 ia.ModelUpdatedEvent(this._model,t))}onModelChanged(e,t){this._model=pa.prepareModel(e),this._render(),this.dispatchModelUpdated(t)}onConfigurationChanged(e){this._configuration=e;const t=Xt([this,"access",e=>e._configuration,"optionalAccess",e=>e.responseAreaInputConfiguration,"optionalAccess",e=>e.inputConfiguration]);this._model={...this._model,responseAreaInputConfiguration:t},this.onModelChanged(this._model)}insertImage(e){this.dispatchEvent(new ia.InsertImageEvent(e))}onDeleteImage(e,t){this.dispatchEvent(new ia.DeleteImageEvent(e,t))}insertSound(e){this.dispatchEvent(new ia.InsertSoundEvent(e))}onDeleteSound(e,t){this.dispatchEvent(new ia.DeleteSoundEvent(e,t))}_render(){ca("_render");let e=aa.default.createElement(ra.default,{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||(this._root=(0,oa.createRoot)(this)),this._root.render(e)}disconnectedCallback(){this._root&&this._root.unmount()}}ea=p.default=pa,(0,ta.default)(pa,"prepareModel",(e={})=>{const t={...da.default.model,...e},a=t.slateMarkup||(0,ua.createSlateMarkup)(t.markup,t.choices),o=(0,ua.processMarkup)(a);return t.choices&&Object.keys(t.choices).forEach(e=>{(0,la.default)(t.choices[e])&&(t.choices[e]=(t.choices[e]||[]).map((e,t)=>e.value?e:(ca('Choice does not contain "value" property, which is required.',e),{value:`${t}`,...e})))}),{...t,slateMarkup:a,markup:o}});export{ea as default};
|