@pie-element/extended-text-entry 13.4.1-next.3 → 14.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -17
- package/configure/CHANGELOG.md +0 -11
- package/configure/lib/defaults.js +2 -3
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +97 -151
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +223 -298
- package/configure/lib/main.js.map +1 -1
- package/configure/package.json +9 -6
- package/controller/CHANGELOG.md +0 -11
- package/controller/lib/defaults.js +2 -3
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +73 -170
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +2 -2
- package/lib/annotation/annotation-editor.js +493 -566
- package/lib/annotation/annotation-editor.js.map +1 -1
- package/lib/annotation/annotation-menu.js +131 -190
- package/lib/annotation/annotation-menu.js.map +1 -1
- package/lib/annotation/annotation-utils.js +77 -121
- package/lib/annotation/annotation-utils.js.map +1 -1
- package/lib/annotation/freeform-editor.js +202 -227
- package/lib/annotation/freeform-editor.js.map +1 -1
- package/lib/index.js +77 -131
- package/lib/index.js.map +1 -1
- package/lib/main.js +179 -243
- package/lib/main.js.map +1 -1
- package/lib/print.js +45 -87
- package/lib/print.js.map +1 -1
- package/package.json +13 -19
- package/esm/configure.js +0 -9412
- package/esm/configure.js.map +0 -1
- package/esm/controller.js +0 -905
- package/esm/controller.js.map +0 -1
- package/esm/element.js +0 -21631
- package/esm/element.js.map +0 -1
- package/esm/package.json +0 -3
- package/esm/print.js +0 -21600
- package/esm/print.js.map +0 -1
- package/module/configure.js +0 -1
- package/module/controller.js +0 -139
- package/module/demo.js +0 -38
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -22
- package/module/print-demo.js +0 -76
- package/module/print.html +0 -18
- package/module/print.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","numberFields","dropdown","defaultFeedback","type","Main","props","markup","onModelChanged","model","prompt","feedback","update","teacherInstructions","state","setDimensions","classes","configuration","imageSupport","onConfigurationChanged","uploadSoundSupport","annotations","contentDimensions","dimensions","equationEditor","playerSpellCheck","settingsPanelDisabled","spanishInput","specialInput","spellCheck","studentInstructions","mathInput","maxImageWidth","maxImageHeight","multiple","withRubric","mathMlOptions","baseInputConfiguration","errors","extraCSSRules","feedbackEnabled","promptEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","promptError","teacherInstructionsError","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","enabled","width","suffix","min","max","height","annotationsEnabled","playerSpellCheckDisabled","panelProperties","studentInstructionsEnabled","rubricEnabled","getPluginProps","Object","assign","config","Settings","Properties","promptContainer","changeTeacherInstructions","language","inputConfiguration","errorText","ALL_PLUGINS","onPromptChange","header","changeFeedback","React","Component","PropTypes","func","isRequired","object","theme","paddingBottom","spacing","unit","paddingTop","marginBottom","fontSize","typography","color","palette","error","main"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAQA,KAAR,GAAkDC,kBAAlD,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAAkDD,kBAAlD,CAAeC,MAAf;AAAA,IAAuBC,YAAvB,GAAkDF,kBAAlD,CAAuBE,YAAvB;AAAA,IAAqCC,QAArC,GAAkDH,kBAAlD,CAAqCG,QAArC;AAEA,IAAMC,eAAe,GAAG;AACtBC,EAAAA,IAAI,EAAE,SADgB;AAEtB,aAAS;AAFa,CAAxB;;IAKaC,I;;;;;AAWX,gBAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,uGAKF,UAACC,MAAD,EAAY;AAC3B,wBAAkC,MAAKD,KAAvC;AAAA,UAAQE,cAAR,eAAQA,cAAR;AAAA,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AAqB,CADlB;AAEfE,MAAAA,YAAY,EAAEL,KAAK,CAACE,OAAN,CAAcC,IAAd,GAAqB,CAFpB;AAGflC,MAAAA,KAAK,EAAE;AAHQ,KAJmB;AASpCoB,IAAAA,SAAS,EAAE;AACTiB,MAAAA,QAAQ,EAAEN,KAAK,CAACO,UAAN,CAAiBD,QAAjB,GAA4B,CAD7B;AAETE,MAAAA,KAAK,EAAER,KAAK,CAACS,OAAN,CAAcC,KAAd,CAAoBC,IAFlB;AAGTP,MAAAA,UAAU,EAAEJ,KAAK,CAACE,OAAN,CAAcC;AAHjB;AATyB,GAAZ;AAAA,CAAX,EAcXnF,IAdW,C","sourcesContent":["import React from 'react';\nimport { FeedbackSelector, InputContainer, settings, layout } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport Typography from '@material-ui/core/Typography';\nimport { withStyles } from '@material-ui/core/styles';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\n\nconst { Panel, toggle, numberFields, dropdown } = settings;\n\nconst defaultFeedback = {\n type: 'default',\n default: 'Your answer has been submitted',\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n imageSupport: PropTypes.object.isRequired,\n uploadSoundSupport: PropTypes.object.isRequired,\n classes: PropTypes.object.isRequired,\n };\n\n constructor(props) {\n super(props);\n this.state = { setDimensions: true };\n }\n\n onPromptChange = (markup) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt: markup });\n };\n\n changeFeedback = (feedback) => {\n const { model, onModelChanged } = this.props;\n const update = { ...model, feedback };\n\n onModelChanged(update);\n };\n\n changeTeacherInstructions = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n const update = { ...model, teacherInstructions };\n\n onModelChanged(update);\n };\n\n render() {\n const { model, classes, configuration, imageSupport, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const {\n annotations = {},\n contentDimensions = {},\n dimensions = {},\n equationEditor = {},\n feedback = {},\n playerSpellCheck = {},\n prompt = {},\n settingsPanelDisabled,\n spanishInput = {},\n specialInput = {},\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n mathInput = {},\n maxImageWidth = {},\n maxImageHeight = {},\n multiple = {},\n withRubric = {},\n mathMlOptions = {},\n baseInputConfiguration = {},\n } = configuration || {};\n const {\n errors = {},\n extraCSSRules,\n feedbackEnabled,\n promptEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n const { prompt: promptError, teacherInstructions: teacherInstructionsError } = errors;\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 mathInput: mathInput.settings && toggle(mathInput.label),\n equationEditor:\n equationEditor.enabled &&\n model.mathInput &&\n dropdown(equationEditor.label, [\n 'non-negative-integers',\n 'integers',\n 'decimals',\n 'fractions',\n 'Grade 1 - 2',\n 'Grade 3 - 5',\n 'Grade 6 - 7',\n 'Grade 8 - HS',\n 'geometry',\n 'advanced-algebra',\n 'statistics',\n 'item-authoring',\n ]),\n spanishInput: spanishInput.settings && toggle(spanishInput.label),\n specialInput: specialInput.settings && toggle(specialInput.label),\n dimensions:\n dimensions.settings &&\n numberFields(dimensions.label, {\n width: { label: 'Width (px)', suffix: 'px', min: 100, max: 1200 },\n height: { label: 'Height (px)', suffix: 'px', min: 100, max: 500 },\n }),\n 'multiple.enabled': multiple.settings && toggle(multiple.label, true),\n promptEnabled: prompt.settings && toggle(prompt.label),\n feedbackEnabled: feedback.settings && toggle(feedback.label),\n annotationsEnabled: annotations.settings && toggle(annotations.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n playerSpellCheckDisabled: playerSpellCheck.settings && toggle(playerSpellCheck.label),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n const getPluginProps = (props) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\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) => onModelChanged(model)}\n onChangeConfiguration={(config) => onConfigurationChanged(config)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptContainer}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.changeTeacherInstructions}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={teacherInstructionsError}\n toolbarOpts={toolbarOpts}\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 pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n />\n {teacherInstructionsError && <div className={classes.errorText}>{teacherInstructionsError}</div>}\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label={prompt.label} className={classes.promptContainer}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n className={classes.prompt}\n markup={model.prompt || ''}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={promptError}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n />\n {promptError && <div className={classes.errorText}>{promptError}</div>}\n </InputContainer>\n )}\n\n {feedbackEnabled && (\n <React.Fragment>\n <Typography className={classes.header} variant=\"subheading\">\n Feedback\n </Typography>\n\n <FeedbackSelector\n label=\"When submitted, show\"\n feedback={model.feedback || defaultFeedback}\n onChange={this.changeFeedback}\n toolbarOpts={toolbarOpts}\n />\n </React.Fragment>\n )}\n </layout.ConfigLayout>\n );\n }\n}\nexport default withStyles((theme) => ({\n header: {\n paddingBottom: theme.spacing.unit,\n },\n promptContainer: {\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n width: '100%',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing.unit,\n },\n}))(Main);\n"],"file":"main.js"}
|
|
1
|
+
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_configUi","_propTypes","_Typography","_styles","_editableHtmlTipTap","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Panel","toggle","numberFields","dropdown","settings","defaultFeedback","type","StyledHeader","styled","Typography","theme","paddingBottom","spacing","PromptContainer","InputContainer","paddingTop","marginTop","marginBottom","width","ErrorText","fontSize","typography","color","palette","error","main","Main","React","Component","constructor","props","_defineProperty2","markup","onModelChanged","model","prompt","feedback","update","teacherInstructions","state","setDimensions","render","configuration","imageSupport","onConfigurationChanged","uploadSoundSupport","annotations","contentDimensions","dimensions","equationEditor","playerSpellCheck","settingsPanelDisabled","spanishInput","specialInput","spellCheck","studentInstructions","mathInput","maxImageWidth","maxImageHeight","multiple","withRubric","mathMlOptions","baseInputConfiguration","errors","extraCSSRules","feedbackEnabled","promptEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","promptError","teacherInstructionsError","defaultImageMaxWidth","defaultImageMaxHeight","toolbarOpts","position","panelSettings","label","enabled","suffix","min","max","height","annotationsEnabled","playerSpellCheckDisabled","panelProperties","studentInstructionsEnabled","rubricEnabled","getPluginProps","assign","createElement","layout","ConfigLayout","hideSettings","onChangeModel","onChangeConfiguration","config","groups","Settings","Properties","className","onChange","changeTeacherInstructions","nonEmpty","languageCharactersProps","language","pluginProps","inputConfiguration","activePlugins","ALL_PLUGINS","onPromptChange","Fragment","variant","FeedbackSelector","changeFeedback","exports","PropTypes","func","isRequired","object","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport { FeedbackSelector, InputContainer, settings, layout } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport Typography from '@mui/material/Typography';\nimport { styled } from '@mui/material/styles';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html-tip-tap';\n\nconst { Panel, toggle, numberFields, dropdown } = settings;\n\nconst defaultFeedback = {\n type: 'default',\n default: 'Your answer has been submitted',\n};\n\nconst StyledHeader = styled(Typography)(({ theme }) => ({\n paddingBottom: theme.spacing(1),\n}));\n\nconst PromptContainer = styled(InputContainer)(({ theme }) => ({\n paddingTop: theme.spacing(1),\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n width: '100%',\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\nexport class Main extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n imageSupport: PropTypes.object.isRequired,\n uploadSoundSupport: PropTypes.object.isRequired,\n };\n\n constructor(props) {\n super(props);\n this.state = { setDimensions: true };\n }\n\n onPromptChange = (markup) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt: markup });\n };\n\n changeFeedback = (feedback) => {\n const { model, onModelChanged } = this.props;\n const update = { ...model, feedback };\n\n onModelChanged(update);\n };\n\n changeTeacherInstructions = (teacherInstructions) => {\n const { model, onModelChanged } = this.props;\n const update = { ...model, teacherInstructions };\n\n onModelChanged(update);\n };\n\n render() {\n const { model, configuration, imageSupport, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const {\n annotations = {},\n contentDimensions = {},\n dimensions = {},\n equationEditor = {},\n feedback = {},\n playerSpellCheck = {},\n prompt = {},\n settingsPanelDisabled,\n spanishInput = {},\n specialInput = {},\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n mathInput = {},\n maxImageWidth = {},\n maxImageHeight = {},\n multiple = {},\n withRubric = {},\n mathMlOptions = {},\n baseInputConfiguration = {},\n } = configuration || {};\n const {\n errors = {},\n extraCSSRules,\n feedbackEnabled,\n promptEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n const { prompt: promptError, teacherInstructions: teacherInstructionsError } = errors;\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 mathInput: mathInput.settings && toggle(mathInput.label),\n equationEditor:\n equationEditor.enabled &&\n model.mathInput &&\n dropdown(equationEditor.label, [\n 'non-negative-integers',\n 'integers',\n 'decimals',\n 'fractions',\n 'Grade 1 - 2',\n 'Grade 3 - 5',\n 'Grade 6 - 7',\n 'Grade 8 - HS',\n 'geometry',\n 'advanced-algebra',\n 'statistics',\n 'item-authoring',\n ]),\n spanishInput: spanishInput.settings && toggle(spanishInput.label),\n specialInput: specialInput.settings && toggle(specialInput.label),\n dimensions:\n dimensions.settings &&\n numberFields(dimensions.label, {\n width: { label: 'Width (px)', suffix: 'px', min: 100, max: 1200 },\n height: { label: 'Height (px)', suffix: 'px', min: 100, max: 500 },\n }),\n 'multiple.enabled': multiple.settings && toggle(multiple.label, true),\n promptEnabled: prompt.settings && toggle(prompt.label),\n feedbackEnabled: feedback.settings && toggle(feedback.label),\n annotationsEnabled: annotations.settings && toggle(annotations.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n playerSpellCheckDisabled: playerSpellCheck.settings && toggle(playerSpellCheck.label),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n const getPluginProps = (props) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\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) => onModelChanged(model)}\n onChangeConfiguration={(config) => onConfigurationChanged(config)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <PromptContainer label={teacherInstructions.label}>\n <EditableHtml\n className=\"prompt\"\n markup={model.teacherInstructions || ''}\n onChange={this.changeTeacherInstructions}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={teacherInstructionsError}\n toolbarOpts={toolbarOpts}\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 pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </PromptContainer>\n )}\n\n {promptEnabled && (\n <PromptContainer label={prompt.label}>\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n className=\"prompt\"\n markup={model.prompt || ''}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={promptError}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n mathMlOptions={mathMlOptions}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </PromptContainer>\n )}\n\n {feedbackEnabled && (\n <React.Fragment>\n <StyledHeader variant=\"h6\">\n Feedback\n </StyledHeader>\n\n <FeedbackSelector\n label=\"When submitted, show\"\n feedback={model.feedback || defaultFeedback}\n onChange={this.changeFeedback}\n toolbarOpts={toolbarOpts}\n />\n </React.Fragment>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAC,uBAAA,CAAAN,OAAA;AAA2E,SAAAM,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA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AAA,GAAAA,IAAA;AAAA,IAAAK,gBAAA,CAAAxC,OAAA,EA/MYmC,IAAI,eACI;EACjBO,cAAc,EAAEmF,kBAAS,CAACC,IAAI,CAACC,UAAU;EACzC1E,sBAAsB,EAAEwE,kBAAS,CAACC,IAAI;EACtCnF,KAAK,EAAEkF,kBAAS,CAACG,MAAM,CAACD,UAAU;EAClC5E,aAAa,EAAE0E,kBAAS,CAACG,MAAM,CAACD,UAAU;EAC1C3E,YAAY,EAAEyE,kBAAS,CAACG,MAAM,CAACD,UAAU;EACzCzE,kBAAkB,EAAEuE,kBAAS,CAACG,MAAM,CAACD;AACvC,CAAC;AAAA,IAAAE,QAAA,GAAAL,OAAA,CAAA5H,OAAA,GAyMYmC,IAAI","ignoreList":[]}
|
package/configure/package.json
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/extended-text-entry-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "12.0.0-beta.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"author": "pie framework developers",
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@
|
|
11
|
+
"@emotion/react": "^11.14.0",
|
|
12
|
+
"@emotion/style": "^0.8.0",
|
|
13
|
+
"@mui/icons-material": "^7.3.4",
|
|
14
|
+
"@mui/material": "^7.3.4",
|
|
12
15
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
13
|
-
"@pie-lib/config-ui": "
|
|
14
|
-
"@pie-lib/editable-html": "
|
|
16
|
+
"@pie-lib/config-ui": "12.1.0-next.5",
|
|
17
|
+
"@pie-lib/editable-html-tip-tap": "1.1.0-next.5",
|
|
15
18
|
"lodash": "^4.17.15",
|
|
16
19
|
"prop-types": "^15.6.2",
|
|
17
|
-
"react": "
|
|
18
|
-
"react-dom": "
|
|
20
|
+
"react": "18.2.0",
|
|
21
|
+
"react-dom": "18.2.0"
|
|
19
22
|
}
|
|
20
23
|
}
|
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
|
-
## [7.3.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-controller@7.3.2...@pie-element/extended-text-entry-controller@7.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
|
## [7.3.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-controller@7.3.1...@pie-element/extended-text-entry-controller@7.3.2) (2025-10-22)
|
|
18
7
|
|
|
19
8
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
var _default = {
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = {
|
|
8
8
|
annotationsEnabled: false,
|
|
9
9
|
dimensions: {
|
|
10
10
|
height: 100,
|
|
@@ -88,5 +88,4 @@ var _default = {
|
|
|
88
88
|
teacherInstructionsEnabled: true,
|
|
89
89
|
toolbarEditorPosition: 'bottom'
|
|
90
90
|
};
|
|
91
|
-
exports["default"] = _default;
|
|
92
91
|
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["annotationsEnabled","dimensions","height","width","equationEditor","feedbackEnabled","mathInput","playerSpellCheckDisabled","predefinedAnnotations","label","text","type","prompt","promptEnabled","rationale","rationaleEnabled","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n annotationsEnabled: false,\n dimensions: { height: 100, width: 500 },\n equationEditor: 'Grade 8 - HS',\n feedbackEnabled: false,\n mathInput: false,\n playerSpellCheckDisabled: true,\n predefinedAnnotations: [\n { label: 'good', text: 'good', type: 'positive' },\n { label: '★', text: '★', type: 'positive' },\n { label: ':-)', text: ':-)', type: 'positive' },\n { label: 'creative', text: 'creative', type: 'positive' },\n { label: 'run-on', text: 'run-on', type: 'negative' },\n { label: 'frag', text: 'fragment', type: 'negative' },\n { label: 'tran', text: 'transition', type: 'negative' },\n { label: 'supp', text: 'support needed', type: 'negative' },\n { label: 'punc', text: 'punctuation', type: 'negative' },\n { label: 'agr', text: 'agreement wrong', type: 'negative' },\n { label: 'unclear', text: 'unclear', type: 'negative' },\n { label: 'cut', text: 'cut', type: 'negative' },\n { label: 'sp', text: 'spelling', type: 'negative' },\n { label: 'cap', text: 'capitalization', type: 'negative' },\n { label: 'inf', text: 'informal', type: 'negative' },\n { label: 'awk', text: 'awkward', type: 'negative' },\n ],\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n"],"mappings":";;;;;;iCAAe;EACbA,kBAAkB,EAAE,KAAK;EACzBC,UAAU,EAAE;IAAEC,MAAM,EAAE,GAAG;IAAEC,KAAK,EAAE;EAAI,CAAC;EACvCC,cAAc,EAAE,cAAc;EAC9BC,eAAe,EAAE,KAAK;EACtBC,SAAS,EAAE,KAAK;EAChBC,wBAAwB,EAAE,IAAI;EAC9BC,qBAAqB,EAAE,CACrB;IAAEC,KAAK,EAAE,MAAM;IAAEC,IAAI,EAAE,MAAM;IAAEC,IAAI,EAAE;EAAW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AI,EAAE;EAAW,CAAC,EACpD;IAAEF,KAAK,EAAE,KAAK;IAAEC,IAAI,EAAE,SAAS;IAAEC,IAAI,EAAE;EAAW,CAAC,CACpD;EACDC,MAAM,EAAE,EAAE;EACVC,aAAa,EAAE,IAAI;EACnBC,SAAS,EAAE,EAAE;EACbC,gBAAgB,EAAE,IAAI;EACtBC,0BAA0B,EAAE,IAAI;EAChCC,mBAAmB,EAAE,EAAE;EACvBC,0BAA0B,EAAE,IAAI;EAChCC,qBAAqB,EAAE;AACzB,CAAC","ignoreList":[]}
|
package/controller/lib/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -10,189 +9,93 @@ exports.model = model;
|
|
|
10
9
|
exports.normalize = void 0;
|
|
11
10
|
exports.outcome = outcome;
|
|
12
11
|
exports.validate = void 0;
|
|
13
|
-
|
|
14
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
|
-
|
|
16
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
-
|
|
18
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
19
|
-
|
|
20
12
|
var _debug = _interopRequireDefault(require("debug"));
|
|
21
|
-
|
|
22
13
|
var _feedback = require("@pie-lib/feedback");
|
|
23
|
-
|
|
24
14
|
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
function createDefaultModel() {
|
|
33
|
-
return _createDefaultModel.apply(this, arguments);
|
|
15
|
+
const log = (0, _debug.default)('@pie-element:extended-text-entry:controller');
|
|
16
|
+
async function createDefaultModel(model = {}) {
|
|
17
|
+
log('[createDefaultModel]', model);
|
|
18
|
+
return {
|
|
19
|
+
..._defaults.default,
|
|
20
|
+
...model
|
|
21
|
+
};
|
|
34
22
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
_args = arguments;
|
|
40
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
41
|
-
while (1) {
|
|
42
|
-
switch (_context.prev = _context.next) {
|
|
43
|
-
case 0:
|
|
44
|
-
model = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
45
|
-
log('[createDefaultModel]', model);
|
|
46
|
-
return _context.abrupt("return", _objectSpread(_objectSpread({}, _defaults["default"]), model));
|
|
47
|
-
|
|
48
|
-
case 3:
|
|
49
|
-
case "end":
|
|
50
|
-
return _context.stop();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}, _callee);
|
|
54
|
-
}));
|
|
55
|
-
return _createDefaultModel.apply(this, arguments);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
var normalize = function normalize(question) {
|
|
59
|
-
return _objectSpread(_objectSpread({}, _defaults["default"]), question);
|
|
60
|
-
};
|
|
61
|
-
|
|
23
|
+
const normalize = question => ({
|
|
24
|
+
..._defaults.default,
|
|
25
|
+
...question
|
|
26
|
+
});
|
|
62
27
|
exports.normalize = normalize;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
case 18:
|
|
111
|
-
annotatorMode = normalizedQuestion.annotationsEnabled && (env.role === 'instructor' || env.mode === 'evaluate');
|
|
112
|
-
return _context2.abrupt("return", fb.then(function (feedback) {
|
|
113
|
-
return {
|
|
114
|
-
prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,
|
|
115
|
-
dimensions: normalizedQuestion.dimensions,
|
|
116
|
-
customKeys: normalizedQuestion.customKeys || [],
|
|
117
|
-
id: normalizedQuestion.id,
|
|
118
|
-
disabled: env.mode !== 'gather',
|
|
119
|
-
feedback: feedback,
|
|
120
|
-
teacherInstructions: teacherInstructions,
|
|
121
|
-
language: normalizedQuestion.language,
|
|
122
|
-
mathInput: normalizedQuestion.mathInput,
|
|
123
|
-
spanishInput: normalizedQuestion.spanishInput,
|
|
124
|
-
specialInput: normalizedQuestion.specialInput,
|
|
125
|
-
equationEditor: equationEditor,
|
|
126
|
-
spellCheckEnabled: !normalizedQuestion.playerSpellCheckDisabled,
|
|
127
|
-
playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom',
|
|
128
|
-
annotatorMode: annotatorMode,
|
|
129
|
-
disabledAnnotator: normalizedQuestion.annotationsEnabled ? env.role !== 'instructor' : true,
|
|
130
|
-
predefinedAnnotations: normalizedQuestion.annotationsEnabled ? normalizedQuestion.predefinedAnnotations : [],
|
|
131
|
-
extraCSSRules: normalizedQuestion.extraCSSRules
|
|
132
|
-
};
|
|
133
|
-
}));
|
|
134
|
-
|
|
135
|
-
case 20:
|
|
136
|
-
case "end":
|
|
137
|
-
return _context2.stop();
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}, _callee2);
|
|
28
|
+
async function model(question, session, env) {
|
|
29
|
+
log('[question]', question);
|
|
30
|
+
const normalizedQuestion = normalize(question);
|
|
31
|
+
const fb = env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled ? (0, _feedback.getFeedback)(normalizedQuestion.feedback, 'Your answer has been submitted') : Promise.resolve(undefined);
|
|
32
|
+
let teacherInstructions = null;
|
|
33
|
+
if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
|
|
34
|
+
teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;
|
|
35
|
+
} else {
|
|
36
|
+
teacherInstructions = null;
|
|
37
|
+
}
|
|
38
|
+
let equationEditor = normalizedQuestion.equationEditor || 'miscellaneous';
|
|
39
|
+
switch (normalizedQuestion.equationEditor) {
|
|
40
|
+
case 'Grade 1 - 2':
|
|
41
|
+
equationEditor = 1;
|
|
42
|
+
break;
|
|
43
|
+
case 'Grade 3 - 5':
|
|
44
|
+
equationEditor = 3;
|
|
45
|
+
break;
|
|
46
|
+
case 'Grade 6 - 7':
|
|
47
|
+
equationEditor = 6;
|
|
48
|
+
break;
|
|
49
|
+
case 'Grade 8 - HS':
|
|
50
|
+
equationEditor = 8;
|
|
51
|
+
break;
|
|
52
|
+
default:
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
const annotatorMode = normalizedQuestion.annotationsEnabled && (env.role === 'instructor' || env.mode === 'evaluate');
|
|
56
|
+
return fb.then(feedback => ({
|
|
57
|
+
prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,
|
|
58
|
+
dimensions: normalizedQuestion.dimensions,
|
|
59
|
+
customKeys: normalizedQuestion.customKeys || [],
|
|
60
|
+
id: normalizedQuestion.id,
|
|
61
|
+
disabled: env.mode !== 'gather',
|
|
62
|
+
feedback,
|
|
63
|
+
teacherInstructions,
|
|
64
|
+
language: normalizedQuestion.language,
|
|
65
|
+
mathInput: normalizedQuestion.mathInput,
|
|
66
|
+
spanishInput: normalizedQuestion.spanishInput,
|
|
67
|
+
specialInput: normalizedQuestion.specialInput,
|
|
68
|
+
equationEditor,
|
|
69
|
+
spellCheckEnabled: !normalizedQuestion.playerSpellCheckDisabled,
|
|
70
|
+
playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom',
|
|
71
|
+
annotatorMode,
|
|
72
|
+
disabledAnnotator: normalizedQuestion.annotationsEnabled ? env.role !== 'instructor' : true,
|
|
73
|
+
predefinedAnnotations: normalizedQuestion.annotationsEnabled ? normalizedQuestion.predefinedAnnotations : [],
|
|
74
|
+
extraCSSRules: normalizedQuestion.extraCSSRules
|
|
141
75
|
}));
|
|
142
|
-
return _model.apply(this, arguments);
|
|
143
76
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
function _outcome() {
|
|
153
|
-
_outcome = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
154
|
-
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
155
|
-
while (1) {
|
|
156
|
-
switch (_context3.prev = _context3.next) {
|
|
157
|
-
case 0:
|
|
158
|
-
return _context3.abrupt("return", {
|
|
159
|
-
score: 0,
|
|
160
|
-
completed: 'n/a',
|
|
161
|
-
note: 'Requires manual scoring'
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
case 1:
|
|
165
|
-
case "end":
|
|
166
|
-
return _context3.stop();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}, _callee3);
|
|
170
|
-
}));
|
|
171
|
-
return _outcome.apply(this, arguments);
|
|
77
|
+
async function outcome(/*question, session, env*/
|
|
78
|
+
) {
|
|
79
|
+
return {
|
|
80
|
+
score: 0,
|
|
81
|
+
completed: 'n/a',
|
|
82
|
+
note: 'Requires manual scoring'
|
|
83
|
+
};
|
|
172
84
|
}
|
|
173
85
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}; // remove all html tags except img, iframe and source tag for audio
|
|
86
|
+
// remove all html tags
|
|
87
|
+
const getInnerText = html => (html || '').replaceAll(/<[^>]*>/g, '');
|
|
177
88
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
185
|
-
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
186
|
-
var errors = {};
|
|
187
|
-
['teacherInstructions', 'prompt'].forEach(function (field) {
|
|
188
|
-
var _config$field;
|
|
189
|
-
|
|
190
|
-
if ((_config$field = config[field]) !== null && _config$field !== void 0 && _config$field.required && !getContent(model[field])) {
|
|
89
|
+
// remove all html tags except img, iframe and source tag for audio
|
|
90
|
+
const getContent = html => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
|
|
91
|
+
const validate = (model = {}, config = {}) => {
|
|
92
|
+
const errors = {};
|
|
93
|
+
['teacherInstructions', 'prompt'].forEach(field => {
|
|
94
|
+
if (config[field]?.required && !getContent(model[field])) {
|
|
191
95
|
errors[field] = 'This field is required.';
|
|
192
96
|
}
|
|
193
97
|
});
|
|
194
98
|
return errors;
|
|
195
99
|
};
|
|
196
|
-
|
|
197
100
|
exports.validate = validate;
|
|
198
101
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_debug","_interopRequireDefault","require","_feedback","_defaults","log","debug","createDefaultModel","model","defaults","normalize","question","exports","session","env","normalizedQuestion","fb","mode","feedbackEnabled","getFeedback","feedback","Promise","resolve","undefined","teacherInstructions","role","teacherInstructionsEnabled","equationEditor","annotatorMode","annotationsEnabled","then","prompt","promptEnabled","dimensions","customKeys","id","disabled","language","mathInput","spanishInput","specialInput","spellCheckEnabled","playerSpellCheckDisabled","playersToolbarPosition","disabledAnnotator","predefinedAnnotations","extraCSSRules","outcome","score","completed","note","getInnerText","html","replaceAll","getContent","replace","validate","config","errors","forEach","field","required"],"sources":["../src/index.js"],"sourcesContent":["import debug from 'debug';\nimport { getFeedback } from '@pie-lib/feedback';\nimport defaults from './defaults';\n\nconst log = debug('@pie-element:extended-text-entry:controller');\n\nexport async function createDefaultModel(model = {}) {\n log('[createDefaultModel]', model);\n\n return { ...defaults, ...model };\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\nexport async function model(question, session, env) {\n log('[question]', question);\n const normalizedQuestion = normalize(question);\n\n const fb =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? getFeedback(normalizedQuestion.feedback, 'Your answer has been submitted')\n : Promise.resolve(undefined);\n\n let teacherInstructions = null;\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n } else {\n teacherInstructions = null;\n }\n\n let equationEditor = normalizedQuestion.equationEditor || 'miscellaneous';\n\n switch (normalizedQuestion.equationEditor) {\n case 'Grade 1 - 2':\n equationEditor = 1;\n break;\n case 'Grade 3 - 5':\n equationEditor = 3;\n break;\n case 'Grade 6 - 7':\n equationEditor = 6;\n break;\n case 'Grade 8 - HS':\n equationEditor = 8;\n break;\n default:\n break;\n }\n\n const annotatorMode = normalizedQuestion.annotationsEnabled && (env.role === 'instructor' || env.mode === 'evaluate');\n\n return fb.then((feedback) => ({\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n dimensions: normalizedQuestion.dimensions,\n customKeys: normalizedQuestion.customKeys || [],\n id: normalizedQuestion.id,\n disabled: env.mode !== 'gather',\n feedback,\n teacherInstructions,\n language: normalizedQuestion.language,\n mathInput: normalizedQuestion.mathInput,\n spanishInput: normalizedQuestion.spanishInput,\n specialInput: normalizedQuestion.specialInput,\n equationEditor,\n spellCheckEnabled: !normalizedQuestion.playerSpellCheckDisabled,\n playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom',\n annotatorMode,\n disabledAnnotator: normalizedQuestion.annotationsEnabled ? env.role !== 'instructor' : true,\n predefinedAnnotations: normalizedQuestion.annotationsEnabled ? normalizedQuestion.predefinedAnnotations : [],\n extraCSSRules: normalizedQuestion.extraCSSRules,\n }));\n}\n\nexport async function outcome(/*question, session, env*/) {\n return {\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\n };\n}\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n\n ['teacherInstructions', 'prompt'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,MAAMG,GAAG,GAAG,IAAAC,cAAK,EAAC,6CAA6C,CAAC;AAEzD,eAAeC,kBAAkBA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAE;EACnDH,GAAG,CAAC,sBAAsB,EAAEG,KAAK,CAAC;EAElC,OAAO;IAAE,GAAGC,iBAAQ;IAAE,GAAGD;EAAM,CAAC;AAClC;AAEO,MAAME,SAAS,GAAIC,QAAQ,KAAM;EAAE,GAAGF,iBAAQ;EAAE,GAAGE;AAAS,CAAC,CAAC;AAACC,OAAA,CAAAF,SAAA,GAAAA,SAAA;AAE/D,eAAeF,KAAKA,CAACG,QAAQ,EAAEE,OAAO,EAAEC,GAAG,EAAE;EAClDT,GAAG,CAAC,YAAY,EAAEM,QAAQ,CAAC;EAC3B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QAAQ,CAAC,CAACC,OAAO,CAAEC,KAAK,IAAK;IACnD,IAAIH,MAAM,CAACG,KAAK,CAAC,EAAEC,QAAQ,IAAI,CAACP,UAAU,CAAC9C,KAAK,CAACoD,KAAK,CAAC,CAAC,EAAE;MACxDF,MAAM,CAACE,KAAK,CAAC,GAAG,yBAAyB;IAC3C;EACF,CAAC,CAAC;EAEF,OAAOF,MAAM;AACf,CAAC;AAAC9C,OAAA,CAAA4C,QAAA,GAAAA,QAAA","ignoreList":[]}
|
package/controller/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/extended-text-entry-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "8.0.0-beta.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@pie-lib/feedback": "0.
|
|
9
|
+
"@pie-lib/feedback": "1.1.0-next.4"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"test": "echo \"Error: no test specified\" && exit 1"
|