@pie-element/inline-dropdown 4.7.1-beta.1 → 4.7.1-beta.4
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/configure/lib/defaults.js +78 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +137 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/inline-dropdown-toolbar.js +401 -0
- package/configure/lib/inline-dropdown-toolbar.js.map +1 -0
- package/configure/lib/main.js +636 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/lib/markupUtils.js +55 -0
- package/configure/lib/markupUtils.js.map +1 -0
- package/configure/lib/utils.js +15 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +3 -3
- package/controller/lib/defaults.js +11 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +292 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +33 -0
- package/controller/lib/utils.js.map +1 -0
- package/lib/index.js +87 -0
- package/lib/index.js.map +1 -0
- package/lib/inline-dropdown.js +182 -0
- package/lib/inline-dropdown.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_reactDom","_propTypes","_editableHtml","_interopRequireWildcard","_configUi","_mathRendering","_cloneDeep","_isEqual","_isUndefined","_isEmpty","_reduce","_max","_styles","_Tooltip","_Typography","_ExpansionPanel","_ExpansionPanelSummary","_ExpansionPanelDetails","_ExpandMore","_Info","_inlineDropdownToolbar","_utils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","_possibleConstructorReturn2","sham","Proxy","Boolean","valueOf","e","toggle","settings","Panel","styles","theme","promptHolder","width","paddingBottom","spacing","unit","marginBottom","prompt","paddingTop","markup","minHeight","design","choiceConfiguration","switchElement","justifyContent","margin","addButton","text","fontFamily","fontSize","typography","lineHeight","color","marginRight","rationaleLabel","display","whiteSpace","rationaleChoices","marginTop","panelDetails","flexContainer","alignItems","tooltip","maxWidth","errorText","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","prepareVal","html","tmp","value","textContent","innerText","Main","_React$Component","_inherits2","_super","_this","_classCallCheck2","_len","args","Array","_key","concat","_assertThisInitialized2","warning","open","newVal","props","onModelChanged","model","onModelChange","rationale","index","choice","indexOfChoice","choices","findIndex","elem","label","splice","teacherInstructions","slateMarkup","callback","setState","onClose","onConfirm","respAreaChoices","state","domMarkup","allRespAreas","querySelectorAll","allChoices","el","dataset","existingRespAreaChoices","reduce","isUndefined","newRespAreaChoices","shouldWarn","newChoices","find","c","correct","remove","cloneDeep","maxResponseAreaChoices","configuration","undefined","r","max","map","parseInt","val","isNaN","respIndex","selectedIndex","_createClass2","componentDidMount","UNSAFE_componentWillReceiveProps","nProps","newState","isEqual","isEmpty","componentDidUpdate","domNode","ReactDOM","findDOMNode","renderMath","render","_this2","_this$props","classes","onConfigurationChanged","imageSupport","uploadSoundSupport","_ref","_ref$choiceRationale","choiceRationale","_ref$lockChoiceOrder","lockChoiceOrder","maxResponseAreas","_ref$maxImageWidth","maxImageWidth","_ref$maxImageHeight","maxImageHeight","_ref$partialScoring","partialScoring","_ref$prompt","_ref$rationale","settingsPanelDisabled","_ref$spellCheck","spellCheck","_ref$teacherInstructi","_ref$withRubric","withRubric","_ref2","choiceRationaleEnabled","errors","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","_ref3","responseAreasError","responseAreaChoicesError","defaultImageMaxWidth","defaultImageMaxHeight","renderChoiceRationale","className","expandIcon","InputContainer","dangerouslySetInnerHTML","__html","onChange","onChoiceRationaleChanged","toolbarOpts","position","validationMessage","generateValidationMessage","panelSettings","panelProperties","rubricEnabled","layout","ConfigLayout","hideSettings","onChangeModel","onChangeConfiguration","groups","Settings","Properties","onTeacherInstructionsChanged","nonEmpty","languageCharactersProps","language","onPromptChanged","disableUnderline","onRationaleChanged","disableFocusListener","disableTouchListener","placement","title","activePlugins","ALL_PLUGINS","ref","window","editorRef","responseAreaProps","type","options","duplicates","respAreaToolbar","node","nodePath","editor","onToolbarDone","onAddChoice","onCheck","onRemoveChoice","data","onSelectChoice","disableImageAlignmentButtons","onBlur","disabled","highlightShape","error","AlertDialog","React","Component","exports","PropTypes","isRequired","disableSidePanel","bool","func","shape","add","Styled","withStyles","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\nimport { AlertDialog, InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport isUndefined from 'lodash/isUndefined';\nimport isEmpty from 'lodash/isEmpty';\nimport reduce from 'lodash/reduce';\nimport max from 'lodash/max';\nimport { withStyles } from '@material-ui/core/styles';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport ExpansionPanel from '@material-ui/core/ExpansionPanel';\nimport ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';\nimport ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Info from '@material-ui/icons/Info';\nimport InlineDropdownToolbar from './inline-dropdown-toolbar';\nimport { generateValidationMessage } from './utils';\n\nconst { toggle, Panel } = settings;\n\nconst styles = (theme) => ({\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n },\n markup: {\n minHeight: '100px',\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '100px',\n },\n },\n design: {\n paddingTop: theme.spacing.unit * 3,\n },\n choiceConfiguration: {\n paddingTop: theme.spacing.unit * 2,\n paddingBottom: theme.spacing.unit * 2,\n },\n switchElement: {\n justifyContent: 'space-between',\n margin: 0,\n },\n addButton: {\n float: 'right',\n },\n text: {\n fontFamily: 'Cerebri Sans',\n fontSize: theme.typography.fontSize + 2,\n lineHeight: '19px',\n color: '#495B8F',\n marginRight: theme.spacing.unit,\n },\n rationaleLabel: {\n display: 'flex',\n whiteSpace: 'break-spaces',\n },\n rationaleChoices: {\n marginTop: theme.spacing.unit * 2,\n },\n panelDetails: {\n display: 'block',\n },\n flexContainer: {\n display: 'flex',\n alignItems: 'center',\n marginBottom: theme.spacing.unit,\n },\n tooltip: {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: 'red',\n paddingTop: theme.spacing.unit,\n },\n});\n\nconst createElementFromHTML = (htmlString) => {\n const div = document.createElement('div');\n\n div.innerHTML = (htmlString || '').trim();\n\n return div;\n};\n\nconst prepareVal = (html) => {\n const tmp = document.createElement('DIV');\n\n tmp.innerHTML = html;\n\n const value = tmp.textContent || tmp.innerText || '';\n\n return value.trim();\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 classes: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n state = {\n warning: { open: false },\n };\n\n componentDidMount() {\n const {\n model: { choices },\n } = this.props;\n\n this.setState({ respAreaChoices: cloneDeep(choices) });\n }\n\n UNSAFE_componentWillReceiveProps(nProps) {\n const newState = {};\n\n if (\n !isEqual(nProps.model.choices, this.props.model.choices) ||\n !isEqual(nProps.model.choices, this.state.respAreaChoices)\n ) {\n newState.respAreaChoices = cloneDeep(nProps.model.choices);\n }\n\n if (!isEmpty(newState)) {\n this.setState(newState);\n }\n }\n\n componentDidUpdate() {\n //eslint-disable-next-line\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n onModelChange = (newVal) => {\n this.props.onModelChanged({ ...this.props.model, ...newVal });\n };\n\n onPromptChanged = (prompt) => {\n this.onModelChange({ prompt });\n };\n\n onRationaleChanged = (rationale) => {\n this.onModelChange({ rationale });\n };\n\n onChoiceRationaleChanged = (index, choice) => {\n const { model } = this.props;\n const indexOfChoice =\n model.choices &&\n model.choices[index] &&\n model.choices[index].findIndex((elem) => elem.label === choice.label && elem.value === choice.value);\n\n model.choices[index] && model.choices[index].splice(indexOfChoice, 1, choice);\n\n this.onModelChange(model);\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.onModelChange({ teacherInstructions });\n };\n\n onMarkupChanged = (slateMarkup) => {\n this.onModelChange({ slateMarkup });\n };\n\n onCheck = (callback) => {\n this.setState({\n warning: {\n open: true,\n text: 'Response areas with under 2 options or with no correct answers will be discarded.',\n onClose: () => {\n this.setState({ warning: { open: false } });\n },\n onConfirm: () => {\n this.setState({ warning: { open: false } }, callback);\n },\n },\n });\n };\n\n onChange = (markup) => {\n const { respAreaChoices } = this.state;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll('[data-type=\"inline_dropdown\"]');\n const allChoices = {};\n\n allRespAreas.forEach((el) => {\n allChoices[el.dataset.index] = el.dataset.value || '';\n });\n\n const existingRespAreaChoices = reduce(\n respAreaChoices,\n (obj, choices, key) => {\n if (!isUndefined(allChoices[key])) {\n obj[key] = respAreaChoices[key];\n }\n\n return obj;\n },\n {},\n );\n\n const newRespAreaChoices = {};\n let shouldWarn = false;\n\n allRespAreas.forEach((el, index) => {\n const newChoices = existingRespAreaChoices[el.dataset.index] || [];\n\n if (newChoices.length < 2 || !newChoices.find((c) => c.correct)) {\n el.remove();\n shouldWarn = true;\n } else {\n newRespAreaChoices[index] = existingRespAreaChoices[el.dataset.index] || [];\n el.dataset.index = index;\n }\n });\n\n if (shouldWarn) {\n this.setState({\n warning: {\n open: true,\n text: 'Response areas with under 2 options or with no correct answers will be discarded.',\n onClose: () => {\n this.setState({ warning: { open: false } });\n },\n onConfirm: () => {\n this.setState({ warning: { open: false } }, () =>\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML,\n }),\n );\n },\n },\n });\n } else {\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML,\n });\n }\n };\n\n onAddChoice = (index, label) => {\n const { respAreaChoices } = this.state;\n const { maxResponseAreaChoices } = this.props.configuration;\n\n if (respAreaChoices[index] && respAreaChoices[index].length >= maxResponseAreaChoices) {\n this.setState({\n warning: {\n open: true,\n text: `There are only ${maxResponseAreaChoices} answers allowed per choice.`,\n onClose: undefined,\n onConfirm: () => {\n this.setState({ warning: { open: false } });\n },\n },\n });\n\n return;\n }\n\n if (!respAreaChoices[index]) {\n respAreaChoices[index] = [];\n }\n\n if ((respAreaChoices[index] || []).find((r) => prepareVal(r.label) === prepareVal(label))) {\n this.setState({\n warning: {\n open: true,\n text: 'Duplicate answers are not allowed.',\n onClose: undefined,\n onConfirm: () => {\n this.setState({ warning: { open: false } });\n },\n },\n });\n\n return;\n }\n\n const value =\n (respAreaChoices[index] &&\n max(respAreaChoices[index].map((c) => parseInt(c.value)).filter((val) => !isNaN(val)))) ||\n 0;\n\n respAreaChoices[index].push({\n label,\n value: `${value + 1}`,\n correct: false,\n });\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onRemoveChoice = (respIndex, index) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex].splice(index, 1);\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onSelectChoice = (respIndex, selectedIndex) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex] = respAreaChoices[respIndex].map((choice, index) => ({\n ...choice,\n correct: index === selectedIndex,\n }));\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n render() {\n const { warning } = this.state;\n const { classes, model, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } = this.props;\n const {\n choiceRationale = {},\n lockChoiceOrder = {},\n maxResponseAreas,\n maxImageWidth = {},\n maxImageHeight = {},\n partialScoring = {},\n prompt = {},\n rationale = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n withRubric = {},\n } = configuration || {};\n const {\n choiceRationaleEnabled,\n choices,\n errors,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n const { responseAreasError, responseAreaChoicesError } = errors || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const renderChoiceRationale = () =>\n (Object.keys(choices) || []).map((key, index) => (\n <div key={key} className={classes.rationaleChoices}>\n <ExpansionPanel>\n <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>\n <Typography className={classes.text}>{`Rationale for response area #${index + 1}`}</Typography>\n </ExpansionPanelSummary>\n\n <ExpansionPanelDetails className={classes.panelDetails}>\n {(choices[key] || []).map((choice) => (\n <InputContainer\n key={choice.label}\n label={\n <span\n className={classes.rationaleLabel}\n dangerouslySetInnerHTML={{\n __html: `${rationale.label} for ${choice.label} (${choice.correct ? 'correct' : 'incorrect'})`,\n }}\n />\n }\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={choice.rationale || ''}\n spellCheck={spellCheckEnabled}\n onChange={(c) => this.onChoiceRationaleChanged(key, { ...choice, rationale: c })}\n imageSupport={imageSupport}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n />\n </InputContainer>\n ))}\n </ExpansionPanelDetails>\n </ExpansionPanel>\n </div>\n ));\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const validationMessage = generateValidationMessage(configuration);\n\n const panelSettings = {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n choiceRationaleEnabled: choiceRationale.settings && toggle(choiceRationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <div className={classes.design}>\n <layout.ConfigLayout\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 <div>\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\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 />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label={prompt.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer label={rationale.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\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 />\n </InputContainer>\n )}\n\n <div className={classes.flexContainer}>\n <Typography className={classes.text}>Define Template, Choices, and Correct Responses</Typography>\n <Tooltip\n classes={{ tooltip: classes.tooltip }}\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} />\n </Tooltip>\n </div>\n\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n toolbarOpts={{ position: 'top' }}\n ref={(ref) => {\n window.editorRef = ref;\n }}\n responseAreaProps={{\n type: 'inline-dropdown',\n options: {\n duplicates: true,\n },\n maxResponseAreas: maxResponseAreas,\n respAreaToolbar: (node, nodePath, editor, onToolbarDone) => {\n const { respAreaChoices } = this.state;\n\n return () => (\n <InlineDropdownToolbar\n onAddChoice={this.onAddChoice}\n onCheck={this.onCheck}\n onRemoveChoice={(index) => this.onRemoveChoice(node.data.index, index)}\n onSelectChoice={(index) => this.onSelectChoice(node.data.index, index)}\n editor={editor}\n node={node}\n nodePath={nodePath}\n onToolbarDone={onToolbarDone}\n choices={respAreaChoices[node.data.index]}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n />\n );\n },\n }}\n spellCheck={spellCheckEnabled}\n className={classes.markup}\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 />\n {responseAreasError && <div className={classes.errorText}>{responseAreasError}</div>}\n {responseAreaChoicesError && <div className={classes.errorText}>{responseAreaChoicesError}</div>}\n\n <br />\n {choiceRationaleEnabled && renderChoiceRationale()}\n\n <AlertDialog\n open={warning.open}\n title=\"Warning\"\n text={warning.text}\n onClose={warning.onClose}\n onConfirm={warning.onConfirm}\n />\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,aAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,I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,CAAC;IAC5BC,GAAG,EAAEN,qBAAS,CAACI,IAAI,CAACH,UAAU;IAC9B,UAAQD,qBAAS,CAACI,IAAI,CAACH;EACzB,CAAC,CAAC;EACFjG,kBAAkB,EAAEgG,qBAAS,CAACK,KAAK,CAAC;IAClCC,GAAG,EAAEN,qBAAS,CAACI,IAAI,CAACH,UAAU;IAC9B,UAAQD,qBAAS,CAACI,IAAI,CAACH;EACzB,CAAC;AACH,CAAC;AAycH,IAAMM,MAAM,GAAG,IAAAC,kBAAU,EAAC3O,MAAM,CAAC,CAACiD,IAAI,CAAC;AAAC,IAAA2L,QAAA,GAEzBF,MAAM;AAAAR,OAAA,cAAAU,QAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.removeUnwantedCharacters = exports.processMarkup = exports.createSlateMarkup = exports.createElementFromHTML = void 0;
|
|
8
|
+
var _escape = _interopRequireDefault(require("lodash/escape"));
|
|
9
|
+
// do not remove \t from \times, \triangle, \tan, \theta or \therefore
|
|
10
|
+
var tSymbols = 'imes|riangle|an|heta|herefore';
|
|
11
|
+
// do not remove \n from \nthroot, \nparallel, \ncong, \napprox, \neq, \ne or \nsim
|
|
12
|
+
var nSymbols = 'throot|parallel|cong|approx|eq|e|sim';
|
|
13
|
+
// match all \t and \n that are not part of math symbols that starts with \t or \n
|
|
14
|
+
var matchTabAndNewLine = new RegExp("(\\t(?!".concat(tSymbols, "))|(\\n(?!").concat(nSymbols, "))|(\\\\t(?!").concat(tSymbols, "))|(\\\\n(?!").concat(nSymbols, "))"), 'g');
|
|
15
|
+
var removeUnwantedCharacters = function removeUnwantedCharacters(markup) {
|
|
16
|
+
return markup.replace(matchTabAndNewLine, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
|
|
17
|
+
};
|
|
18
|
+
exports.removeUnwantedCharacters = removeUnwantedCharacters;
|
|
19
|
+
var createElementFromHTML = function createElementFromHTML(htmlString) {
|
|
20
|
+
var div = document.createElement('div');
|
|
21
|
+
div.innerHTML = htmlString.trim();
|
|
22
|
+
return div;
|
|
23
|
+
};
|
|
24
|
+
exports.createElementFromHTML = createElementFromHTML;
|
|
25
|
+
var processMarkup = function processMarkup(markup) {
|
|
26
|
+
var newMarkup = removeUnwantedCharacters(markup);
|
|
27
|
+
var slateMarkup = createElementFromHTML(newMarkup);
|
|
28
|
+
slateMarkup.querySelectorAll('[data-type="inline_dropdown"]').forEach(function (s) {
|
|
29
|
+
s.replaceWith("{{".concat(s.dataset.index, "}}"));
|
|
30
|
+
});
|
|
31
|
+
return slateMarkup.innerHTML;
|
|
32
|
+
};
|
|
33
|
+
exports.processMarkup = processMarkup;
|
|
34
|
+
var REGEX = /\{\{(\d+)\}\}/g;
|
|
35
|
+
var createSlateMarkup = function createSlateMarkup(markup, choices) {
|
|
36
|
+
var newMarkup = removeUnwantedCharacters(markup);
|
|
37
|
+
var createSelect = function createSelect(index) {
|
|
38
|
+
var correctChoice = choices[index] && choices[index].find(function (c) {
|
|
39
|
+
return c.correct;
|
|
40
|
+
});
|
|
41
|
+
if (!correctChoice || !correctChoice.value) {
|
|
42
|
+
correctChoice = {
|
|
43
|
+
id: '',
|
|
44
|
+
value: '',
|
|
45
|
+
label: ''
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return "<span data-type=\"inline_dropdown\" data-index=\"".concat(index, "\" data-value=\"").concat((0, _escape["default"])(correctChoice.label), "\"></span>");
|
|
49
|
+
};
|
|
50
|
+
return newMarkup.replace(REGEX, function (match, g) {
|
|
51
|
+
return createSelect(g);
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
exports.createSlateMarkup = createSlateMarkup;
|
|
55
|
+
//# sourceMappingURL=markupUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markupUtils.js","names":["_escape","_interopRequireDefault","require","tSymbols","nSymbols","matchTabAndNewLine","RegExp","concat","removeUnwantedCharacters","markup","replace","exports","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","processMarkup","newMarkup","slateMarkup","querySelectorAll","forEach","s","replaceWith","dataset","index","REGEX","createSlateMarkup","choices","createSelect","correctChoice","find","c","correct","value","id","label","escape","match","g"],"sources":["../src/markupUtils.js"],"sourcesContent":["import escape from 'lodash/escape';\n\n// do not remove \\t from \\times, \\triangle, \\tan, \\theta or \\therefore\nconst tSymbols = 'imes|riangle|an|heta|herefore';\n// do not remove \\n from \\nthroot, \\nparallel, \\ncong, \\napprox, \\neq, \\ne or \\nsim\nconst nSymbols = 'throot|parallel|cong|approx|eq|e|sim';\n// match all \\t and \\n that are not part of math symbols that starts with \\t or \\n\nconst matchTabAndNewLine = new RegExp(\n `(\\\\t(?!${tSymbols}))|(\\\\n(?!${nSymbols}))|(\\\\\\\\t(?!${tSymbols}))|(\\\\\\\\n(?!${nSymbols}))`,\n 'g',\n);\n\nexport const removeUnwantedCharacters = (markup) =>\n markup.replace(matchTabAndNewLine, '').replace(/\\\\\"/g, '\"').replace(/\\\\\\//g, '/');\n\nexport const createElementFromHTML = (htmlString) => {\n const div = document.createElement('div');\n\n div.innerHTML = htmlString.trim();\n\n return div;\n};\n\nexport const processMarkup = (markup) => {\n const newMarkup = removeUnwantedCharacters(markup);\n const slateMarkup = createElementFromHTML(newMarkup);\n\n slateMarkup.querySelectorAll('[data-type=\"inline_dropdown\"]').forEach((s) => {\n s.replaceWith(`{{${s.dataset.index}}}`);\n });\n\n return slateMarkup.innerHTML;\n};\n\nconst REGEX = /\\{\\{(\\d+)\\}\\}/g;\n\nexport const createSlateMarkup = (markup, choices) => {\n const newMarkup = removeUnwantedCharacters(markup);\n const createSelect = (index) => {\n let correctChoice = choices[index] && choices[index].find((c) => c.correct);\n\n if (!correctChoice || !correctChoice.value) {\n correctChoice = {\n id: '',\n value: '',\n label: '',\n };\n }\n\n return `<span data-type=\"inline_dropdown\" data-index=\"${index}\" data-value=\"${escape(\n correctChoice.label,\n )}\"></span>`;\n };\n\n return newMarkup.replace(REGEX, (match, g) => {\n return createSelect(g);\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA,IAAMC,QAAQ,GAAG,+BAA+B;AAChD;AACA,IAAMC,QAAQ,GAAG,sCAAsC;AACvD;AACA,IAAMC,kBAAkB,GAAG,IAAIC,MAAM,WAAAC,MAAA,CACzBJ,QAAQ,gBAAAI,MAAA,CAAaH,QAAQ,kBAAAG,MAAA,CAAeJ,QAAQ,kBAAAI,MAAA,CAAeH,QAAQ,SACrF,GACF,CAAC;AAEM,IAAMI,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAIC,MAAM;EAAA,OAC7CA,MAAM,CAACC,OAAO,CAACL,kBAAkB,EAAE,EAAE,CAAC,CAACK,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAACA,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;AAAA;AAACC,OAAA,CAAAH,wBAAA,GAAAA,wBAAA;AAE7E,IAAMI,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,UAAU,EAAK;EACnD,IAAMC,GAAG,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAEzCF,GAAG,CAACG,SAAS,GAAGJ,UAAU,CAACK,IAAI,CAAC,CAAC;EAEjC,OAAOJ,GAAG;AACZ,CAAC;AAACH,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAEK,IAAMO,aAAa,GAAG,SAAhBA,aAAaA,CAAIV,MAAM,EAAK;EACvC,IAAMW,SAAS,GAAGZ,wBAAwB,CAACC,MAAM,CAAC;EAClD,IAAMY,WAAW,GAAGT,qBAAqB,CAACQ,SAAS,CAAC;EAEpDC,WAAW,CAACC,gBAAgB,CAAC,+BAA+B,CAAC,CAACC,OAAO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age = void 0;
|
|
7
|
+
var generateValidationMessage = function generateValidationMessage(config) {
|
|
8
|
+
var maxResponseAreas = config.maxResponseAreas,
|
|
9
|
+
maxResponseAreaChoices = config.maxResponseAreaChoices;
|
|
10
|
+
var responseAreasMessage = '\nThere should be at least 1 ' + (maxResponseAreas ? "and at most ".concat(maxResponseAreas, " ") : '') + 'response area' + (maxResponseAreas ? 's' : '') + ' defined.' + (maxResponseAreaChoices ? "\nThere should be at most ".concat(maxResponseAreaChoices, " choices defined per response area.") : '');
|
|
11
|
+
var message = 'Validation requirements:' + responseAreasMessage;
|
|
12
|
+
return message;
|
|
13
|
+
};
|
|
14
|
+
exports.generateValidationMessage = generateValidationMessage;
|
|
15
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["generateValidationMessage","config","maxResponseAreas","maxResponseAreaChoices","responseAreasMessage","concat","message","exports"],"sources":["../src/utils.js"],"sourcesContent":["export const generateValidationMessage = (config) => {\n const { maxResponseAreas, maxResponseAreaChoices } = config;\n\n const responseAreasMessage =\n '\\nThere should be at least 1 ' +\n (maxResponseAreas ? `and at most ${maxResponseAreas} ` : '') +\n 'response area' +\n (maxResponseAreas ? 's' : '') +\n ' defined.' +\n (maxResponseAreaChoices\n ? `\\nThere should be at most ${maxResponseAreaChoices} choices defined per response area.`\n : '');\n\n const message = 'Validation requirements:' + responseAreasMessage;\n\n return message;\n};\n"],"mappings":";;;;;;AAAO,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAIC,MAAM,EAAK;EACnD,IAAQC,gBAAgB,GAA6BD,MAAM,CAAnDC,gBAAgB;IAAEC,sBAAsB,GAAKF,MAAM,CAAjCE,sBAAsB;EAEhD,IAAMC,oBAAoB,GACxB,+BAA+B,IAC9BF,gBAAgB,kBAAAG,MAAA,CAAkBH,gBAAgB,SAAM,EAAE,CAAC,GAC5D,eAAe,IACdA,gBAAgB,GAAG,GAAG,GAAG,EAAE,CAAC,GAC7B,WAAW,IACVC,sBAAsB,gCAAAE,MAAA,CACUF,sBAAsB,2CACnD,EAAE,CAAC;EAET,IAAMG,OAAO,GAAG,0BAA0B,GAAGF,oBAAoB;EAEjE,OAAOE,OAAO;AAChB,CAAC;AAACC,OAAA,CAAAP,yBAAA,GAAAA,yBAAA"}
|
package/configure/package.json
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"@material-ui/core": "^3.9.2",
|
|
9
9
|
"@material-ui/icons": "^3.0.1",
|
|
10
10
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
11
|
-
"@pie-lib/config-ui": "12.0.0-beta.
|
|
12
|
-
"@pie-lib/editable-html": "10.0.0-beta.
|
|
11
|
+
"@pie-lib/config-ui": "12.0.0-beta.5",
|
|
12
|
+
"@pie-lib/editable-html": "10.0.0-beta.7",
|
|
13
13
|
"@pie-lib/math-rendering": "^2.5.12",
|
|
14
14
|
"classnames": "^2.2.6",
|
|
15
15
|
"debug": "^3.1.0",
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"prop-types": "^15.6.2",
|
|
18
18
|
"react": "^16.8.1",
|
|
19
19
|
"react-dom": "^16.8.1",
|
|
20
|
-
"slate-react": "0.
|
|
20
|
+
"slate-react": "0.97.2"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["choices","exports","_default"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n choices: {},\n};\n"],"mappings":";;;;;;eAAe;EACbA,OAAO,EAAE,CAAC;AACZ,CAAC;AAAAC,OAAA,cAAAC,QAAA"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getScore = exports.createCorrectResponseSession = void 0;
|
|
8
|
+
exports.model = model;
|
|
9
|
+
exports.normalize = void 0;
|
|
10
|
+
exports.outcome = outcome;
|
|
11
|
+
exports.validate = void 0;
|
|
12
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
var _map = _interopRequireDefault(require("lodash/map"));
|
|
16
|
+
var _reduce = _interopRequireDefault(require("lodash/reduce"));
|
|
17
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
18
|
+
var _controllerUtils = require("@pie-lib/controller-utils");
|
|
19
|
+
var _utils = require("./utils");
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
+
var getFeedback = function getFeedback(correct) {
|
|
23
|
+
if (correct) {
|
|
24
|
+
return 'correct';
|
|
25
|
+
}
|
|
26
|
+
return 'incorrect';
|
|
27
|
+
};
|
|
28
|
+
var normalize = function normalize(question) {
|
|
29
|
+
return _objectSpread({
|
|
30
|
+
promptEnabled: true,
|
|
31
|
+
rationaleEnabled: true,
|
|
32
|
+
teacherInstructionsEnabled: true,
|
|
33
|
+
studentInstructionsEnabled: true,
|
|
34
|
+
choiceRationaleEnabled: true
|
|
35
|
+
}, question);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @param {*} question
|
|
41
|
+
* @param {*} session
|
|
42
|
+
* @param {*} env
|
|
43
|
+
* @param {*} updateSession - optional - a function that will set the properties passed into it on the session.
|
|
44
|
+
*/
|
|
45
|
+
exports.normalize = normalize;
|
|
46
|
+
function model(question, session, env, updateSession) {
|
|
47
|
+
return new Promise( /*#__PURE__*/function () {
|
|
48
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(resolve) {
|
|
49
|
+
var normalizedQuestion, _ref2, _ref2$value, value, choices, feedback, allCorrectResponses, respAreaLength, correctResponses, _loop, i, _ret, lockChoiceOrder, keys, _i, key, teacherInstructions, rationale, choicesWillNullRationales, out;
|
|
50
|
+
return _regenerator["default"].wrap(function _callee$(_context2) {
|
|
51
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
normalizedQuestion = normalize(question);
|
|
54
|
+
_ref2 = session || {}, _ref2$value = _ref2.value, value = _ref2$value === void 0 ? {} : _ref2$value;
|
|
55
|
+
choices = (0, _reduce["default"])(normalizedQuestion.choices, function (obj, area, key) {
|
|
56
|
+
obj[key] = (0, _map["default"])(area, function (choice) {
|
|
57
|
+
return choice;
|
|
58
|
+
});
|
|
59
|
+
return obj;
|
|
60
|
+
}, {});
|
|
61
|
+
feedback = {};
|
|
62
|
+
if (!(env.mode === 'evaluate')) {
|
|
63
|
+
_context2.next = 18;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
allCorrectResponses = (0, _utils.getAllCorrectResponses)(normalizedQuestion);
|
|
67
|
+
respAreaLength = Object.keys(allCorrectResponses).length;
|
|
68
|
+
correctResponses = 0;
|
|
69
|
+
_loop = /*#__PURE__*/_regenerator["default"].mark(function _loop(i) {
|
|
70
|
+
var result;
|
|
71
|
+
return _regenerator["default"].wrap(function _loop$(_context) {
|
|
72
|
+
while (1) switch (_context.prev = _context.next) {
|
|
73
|
+
case 0:
|
|
74
|
+
result = (0, _reduce["default"])(allCorrectResponses, function (obj, choices, key) {
|
|
75
|
+
var answer = value && value[key] || '';
|
|
76
|
+
var correctChoice = choices[i] || '';
|
|
77
|
+
var isCorrect = answer && correctChoice && correctChoice === answer;
|
|
78
|
+
obj.feedback[key] = getFeedback(isCorrect);
|
|
79
|
+
if (isCorrect) {
|
|
80
|
+
obj.correctResponses += 1;
|
|
81
|
+
}
|
|
82
|
+
return obj;
|
|
83
|
+
}, {
|
|
84
|
+
correctResponses: 0,
|
|
85
|
+
feedback: {}
|
|
86
|
+
});
|
|
87
|
+
if (result.correctResponses >= correctResponses) {
|
|
88
|
+
correctResponses = result.correctResponses;
|
|
89
|
+
feedback = result.feedback;
|
|
90
|
+
}
|
|
91
|
+
if (!(result.correctResponses === respAreaLength)) {
|
|
92
|
+
_context.next = 4;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
return _context.abrupt("return", "break");
|
|
96
|
+
case 4:
|
|
97
|
+
case "end":
|
|
98
|
+
return _context.stop();
|
|
99
|
+
}
|
|
100
|
+
}, _loop);
|
|
101
|
+
});
|
|
102
|
+
i = 0;
|
|
103
|
+
case 10:
|
|
104
|
+
if (!(i < respAreaLength)) {
|
|
105
|
+
_context2.next = 18;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
return _context2.delegateYield(_loop(i), "t0", 12);
|
|
109
|
+
case 12:
|
|
110
|
+
_ret = _context2.t0;
|
|
111
|
+
if (!(_ret === "break")) {
|
|
112
|
+
_context2.next = 15;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
return _context2.abrupt("break", 18);
|
|
116
|
+
case 15:
|
|
117
|
+
i++;
|
|
118
|
+
_context2.next = 10;
|
|
119
|
+
break;
|
|
120
|
+
case 18:
|
|
121
|
+
lockChoiceOrder = (0, _controllerUtils.lockChoices)(normalizedQuestion, session, env);
|
|
122
|
+
if (lockChoiceOrder) {
|
|
123
|
+
_context2.next = 30;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
keys = Object.keys(choices);
|
|
127
|
+
_i = 0;
|
|
128
|
+
case 22:
|
|
129
|
+
if (!(_i < keys.length)) {
|
|
130
|
+
_context2.next = 30;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
key = keys[_i];
|
|
134
|
+
_context2.next = 26;
|
|
135
|
+
return (0, _controllerUtils.getShuffledChoices)(choices[key], session, updateSession, 'value');
|
|
136
|
+
case 26:
|
|
137
|
+
choices[key] = _context2.sent;
|
|
138
|
+
case 27:
|
|
139
|
+
_i++;
|
|
140
|
+
_context2.next = 22;
|
|
141
|
+
break;
|
|
142
|
+
case 30:
|
|
143
|
+
teacherInstructions = null;
|
|
144
|
+
rationale = null;
|
|
145
|
+
choicesWillNullRationales = (Object.keys(choices) || []).reduce(function (acc, currentValue) {
|
|
146
|
+
acc[currentValue] = (choices[currentValue] || []).map(function (choice) {
|
|
147
|
+
return _objectSpread(_objectSpread({}, choice), {}, {
|
|
148
|
+
rationale: null
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
return acc;
|
|
152
|
+
}, {});
|
|
153
|
+
if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
|
|
154
|
+
rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;
|
|
155
|
+
teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;
|
|
156
|
+
choices = normalizedQuestion.choiceRationaleEnabled ? normalizedQuestion.choices : choicesWillNullRationales;
|
|
157
|
+
} else {
|
|
158
|
+
rationale = null;
|
|
159
|
+
teacherInstructions = null;
|
|
160
|
+
choices = choicesWillNullRationales;
|
|
161
|
+
}
|
|
162
|
+
out = {
|
|
163
|
+
disabled: env.mode !== 'gather',
|
|
164
|
+
mode: env.mode,
|
|
165
|
+
prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,
|
|
166
|
+
displayType: normalizedQuestion.displayType,
|
|
167
|
+
markup: normalizedQuestion.markup,
|
|
168
|
+
choices: choices,
|
|
169
|
+
feedback: feedback,
|
|
170
|
+
responseCorrect: env.mode === 'evaluate' ? getScore(normalizedQuestion, session) === 1 : undefined,
|
|
171
|
+
rationale: rationale,
|
|
172
|
+
teacherInstructions: teacherInstructions
|
|
173
|
+
};
|
|
174
|
+
resolve(out);
|
|
175
|
+
case 36:
|
|
176
|
+
case "end":
|
|
177
|
+
return _context2.stop();
|
|
178
|
+
}
|
|
179
|
+
}, _callee);
|
|
180
|
+
}));
|
|
181
|
+
return function (_x) {
|
|
182
|
+
return _ref.apply(this, arguments);
|
|
183
|
+
};
|
|
184
|
+
}());
|
|
185
|
+
}
|
|
186
|
+
var getScore = function getScore(config, session) {
|
|
187
|
+
var _ref3 = session || {},
|
|
188
|
+
_ref3$value = _ref3.value,
|
|
189
|
+
value = _ref3$value === void 0 ? {} : _ref3$value;
|
|
190
|
+
var maxScore = config && config.choices ? Object.keys(config.choices).length : 0;
|
|
191
|
+
var allCorrectResponses = (0, _utils.getAllCorrectResponses)(config);
|
|
192
|
+
var correctCount = 0;
|
|
193
|
+
var _loop2 = function _loop2(i) {
|
|
194
|
+
var result = (0, _reduce["default"])(allCorrectResponses, function (total, choices, key) {
|
|
195
|
+
var answer = value && value[key] || '';
|
|
196
|
+
var correctChoice = choices[i] || '';
|
|
197
|
+
if (correctChoice && answer && correctChoice === answer) {
|
|
198
|
+
return total;
|
|
199
|
+
}
|
|
200
|
+
return total - 1;
|
|
201
|
+
}, maxScore);
|
|
202
|
+
if (result > correctCount) {
|
|
203
|
+
correctCount = result;
|
|
204
|
+
}
|
|
205
|
+
if (result === maxScore) {
|
|
206
|
+
return "break";
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
for (var i = 0; i < maxScore; i++) {
|
|
210
|
+
var _ret2 = _loop2(i);
|
|
211
|
+
if (_ret2 === "break") break;
|
|
212
|
+
}
|
|
213
|
+
var str = (correctCount / maxScore).toFixed(2);
|
|
214
|
+
return parseFloat(str);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
*
|
|
219
|
+
* The score is partial by default for checkbox mode, allOrNothing for radio mode.
|
|
220
|
+
* To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =
|
|
221
|
+
* false. the value in `env` will override the value in `model`.
|
|
222
|
+
* @param {Object} model - the main model
|
|
223
|
+
* @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)
|
|
224
|
+
* @param {*} session
|
|
225
|
+
* @param {Object} env
|
|
226
|
+
* @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides
|
|
227
|
+
* `model.partialScoring`.
|
|
228
|
+
*/
|
|
229
|
+
exports.getScore = getScore;
|
|
230
|
+
function outcome(model, session) {
|
|
231
|
+
var env = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
232
|
+
return new Promise(function (resolve) {
|
|
233
|
+
if (!session || (0, _isEmpty["default"])(session)) {
|
|
234
|
+
resolve({
|
|
235
|
+
score: 0,
|
|
236
|
+
empty: true
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
var partialScoringEnabled = _controllerUtils.partialScoring.enabled(model, env);
|
|
240
|
+
var score = getScore(model, session);
|
|
241
|
+
resolve({
|
|
242
|
+
score: partialScoringEnabled ? score : Math.floor(score),
|
|
243
|
+
empty: false
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
var createCorrectResponseSession = function createCorrectResponseSession(question, env) {
|
|
248
|
+
return new Promise(function (resolve) {
|
|
249
|
+
if (env.mode !== 'evaluate' && env.role === 'instructor') {
|
|
250
|
+
var choices = question.choices;
|
|
251
|
+
var value = {};
|
|
252
|
+
if (choices) {
|
|
253
|
+
Object.keys(choices).forEach(function (key, i) {
|
|
254
|
+
var correctChoices = choices[key] && choices[key].filter(function (c) {
|
|
255
|
+
return c.correct;
|
|
256
|
+
});
|
|
257
|
+
value[i] = correctChoices && correctChoices[0].value;
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
resolve({
|
|
261
|
+
id: '1',
|
|
262
|
+
value: value
|
|
263
|
+
});
|
|
264
|
+
} else {
|
|
265
|
+
resolve(null);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
exports.createCorrectResponseSession = createCorrectResponseSession;
|
|
270
|
+
var validate = function validate() {
|
|
271
|
+
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
272
|
+
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
273
|
+
var markup = model.markup,
|
|
274
|
+
choices = model.choices;
|
|
275
|
+
var maxResponseAreas = config.maxResponseAreas,
|
|
276
|
+
maxResponseAreaChoices = config.maxResponseAreaChoices;
|
|
277
|
+
var errors = {};
|
|
278
|
+
var nbOfResponseAreas = ((markup || '').match(/\{\{(\d+)\}\}/g) || []).length;
|
|
279
|
+
if (nbOfResponseAreas > maxResponseAreas) {
|
|
280
|
+
errors.responseAreasError = "No more than ".concat(maxResponseAreas, " response areas should be defined.");
|
|
281
|
+
} else if (nbOfResponseAreas < 1) {
|
|
282
|
+
errors.responseAreasError = 'There should be defined at least 1 response area.';
|
|
283
|
+
}
|
|
284
|
+
(Object.keys(choices) || []).forEach(function (choiceKey) {
|
|
285
|
+
if (choices[choiceKey] && choices[choiceKey].length > maxResponseAreaChoices) {
|
|
286
|
+
errors.responseAreaChoicesError = "No more than ".concat(maxResponseAreaChoices, " choices per response area should be defined.");
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
return errors;
|
|
290
|
+
};
|
|
291
|
+
exports.validate = validate;
|
|
292
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_map","_interopRequireDefault","require","_reduce","_isEmpty","_controllerUtils","_utils","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getFeedback","correct","normalize","question","promptEnabled","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","choiceRationaleEnabled","exports","model","session","env","updateSession","Promise","_ref","_asyncToGenerator2","_regenerator","mark","_callee","resolve","normalizedQuestion","_ref2","_ref2$value","value","choices","feedback","allCorrectResponses","respAreaLength","correctResponses","_loop","_ret","lockChoiceOrder","_i","teacherInstructions","rationale","choicesWillNullRationales","out","wrap","_callee$","_context2","prev","next","reduce","obj","area","map","choice","mode","getAllCorrectResponses","result","_loop$","_context","answer","correctChoice","isCorrect","abrupt","stop","delegateYield","t0","lockChoices","getShuffledChoices","sent","acc","currentValue","role","disabled","prompt","displayType","markup","responseCorrect","getScore","undefined","_x","config","_ref3","_ref3$value","maxScore","correctCount","_loop2","total","_ret2","str","toFixed","parseFloat","outcome","isEmpty","score","empty","partialScoringEnabled","partialScoring","enabled","Math","floor","createCorrectResponseSession","correctChoices","c","id","validate","maxResponseAreas","maxResponseAreaChoices","errors","nbOfResponseAreas","match","responseAreasError","concat","choiceKey","responseAreaChoicesError"],"sources":["../src/index.js"],"sourcesContent":["import map from 'lodash/map';\nimport reduce from 'lodash/reduce';\nimport isEmpty from 'lodash/isEmpty';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-lib/controller-utils';\n\nimport { getAllCorrectResponses } from './utils';\n\nconst getFeedback = (correct) => {\n if (correct) {\n return 'correct';\n }\n\n return 'incorrect';\n};\n\nexport const normalize = (question) => ({\n promptEnabled: true,\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n choiceRationaleEnabled: true,\n ...question,\n});\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport function model(question, session, env, updateSession) {\n return new Promise(async (resolve) => {\n const normalizedQuestion = normalize(question);\n const { value = {} } = session || {};\n let choices = reduce(\n normalizedQuestion.choices,\n (obj, area, key) => {\n obj[key] = map(area, (choice) => choice);\n\n return obj;\n },\n {},\n );\n\n let feedback = {};\n\n if (env.mode === 'evaluate') {\n const allCorrectResponses = getAllCorrectResponses(normalizedQuestion);\n const respAreaLength = Object.keys(allCorrectResponses).length;\n let correctResponses = 0;\n\n for (let i = 0; i < respAreaLength; i++) {\n const result = reduce(\n allCorrectResponses,\n (obj, choices, key) => {\n const answer = (value && value[key]) || '';\n const correctChoice = choices[i] || '';\n const isCorrect = answer && correctChoice && correctChoice === answer;\n\n obj.feedback[key] = getFeedback(isCorrect);\n\n if (isCorrect) {\n obj.correctResponses += 1;\n }\n\n return obj;\n },\n { correctResponses: 0, feedback: {} },\n );\n\n if (result.correctResponses >= correctResponses) {\n correctResponses = result.correctResponses;\n feedback = result.feedback;\n }\n\n if (result.correctResponses === respAreaLength) {\n break;\n }\n }\n }\n\n const lockChoiceOrder = lockChoices(normalizedQuestion, session, env);\n\n if (!lockChoiceOrder) {\n const keys = Object.keys(choices);\n let i;\n\n for (i = 0; i < keys.length; i++) {\n const key = keys[i];\n\n choices[key] = await getShuffledChoices(choices[key], session, updateSession, 'value');\n }\n }\n\n let teacherInstructions = null;\n let rationale = null;\n\n const choicesWillNullRationales = (Object.keys(choices) || []).reduce((acc, currentValue) => {\n acc[currentValue] = (choices[currentValue] || []).map((choice) => ({\n ...choice,\n rationale: null,\n }));\n\n return acc;\n }, {});\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n\n choices = normalizedQuestion.choiceRationaleEnabled ? normalizedQuestion.choices : choicesWillNullRationales;\n } else {\n rationale = null;\n teacherInstructions = null;\n choices = choicesWillNullRationales;\n }\n\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n displayType: normalizedQuestion.displayType,\n markup: normalizedQuestion.markup,\n choices,\n feedback,\n\n responseCorrect: env.mode === 'evaluate' ? getScore(normalizedQuestion, session) === 1 : undefined,\n rationale,\n teacherInstructions,\n };\n\n resolve(out);\n });\n}\n\nexport const getScore = (config, session) => {\n const { value = {} } = session || {};\n const maxScore = config && config.choices ? Object.keys(config.choices).length : 0;\n const allCorrectResponses = getAllCorrectResponses(config);\n let correctCount = 0;\n\n for (let i = 0; i < maxScore; i++) {\n const result = reduce(\n allCorrectResponses,\n (total, choices, key) => {\n const answer = (value && value[key]) || '';\n const correctChoice = choices[i] || '';\n\n if (correctChoice && answer && correctChoice === answer) {\n return total;\n }\n\n return total - 1;\n },\n maxScore,\n );\n\n if (result > correctCount) {\n correctCount = result;\n }\n\n if (result === maxScore) {\n break;\n }\n }\n\n const str = (correctCount / maxScore).toFixed(2);\n\n return parseFloat(str);\n};\n\n/**\n *\n * The score is partial by default for checkbox mode, allOrNothing for radio mode.\n * To disable partial scoring for checkbox mode you either set model.partialScoring = false or env.partialScoring =\n * false. the value in `env` will override the value in `model`.\n * @param {Object} model - the main model\n * @param {boolean} model.partialScoring - is partial scoring enabled (if undefined set to to true)\n * @param {*} session\n * @param {Object} env\n * @param {boolean} env.partialScoring - is partial scoring enabled (if undefined default to true) This overrides\n * `model.partialScoring`.\n */\nexport function outcome(model, session, env = {}) {\n return new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true });\n }\n\n const partialScoringEnabled = partialScoring.enabled(model, env);\n const score = getScore(model, session);\n\n resolve({\n score: partialScoringEnabled ? score : Math.floor(score),\n empty: false,\n });\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 if (choices) {\n Object.keys(choices).forEach((key, i) => {\n const correctChoices = choices[key] && choices[key].filter((c) => c.correct);\n\n value[i] = correctChoices && correctChoices[0].value;\n });\n }\n\n resolve({\n id: '1',\n value,\n });\n } else {\n resolve(null);\n }\n });\n};\n\nexport const validate = (model = {}, config = {}) => {\n const { markup, choices } = model;\n const { maxResponseAreas, maxResponseAreaChoices } = config;\n const errors = {};\n\n const nbOfResponseAreas = ((markup || '').match(/\\{\\{(\\d+)\\}\\}/g) || []).length;\n\n if (nbOfResponseAreas > maxResponseAreas) {\n errors.responseAreasError = `No more than ${maxResponseAreas} response areas should be defined.`;\n } else if (nbOfResponseAreas < 1) {\n errors.responseAreasError = 'There should be defined at least 1 response area.';\n }\n\n (Object.keys(choices) || []).forEach((choiceKey) => {\n if (choices[choiceKey] && choices[choiceKey].length > maxResponseAreaChoices) {\n errors.responseAreaChoicesError = `No more than ${maxResponseAreaChoices} choices per response area should be defined.`;\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AAAiD,SAAAK,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAA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Kf,KAAK,CAAjBe,OAAO;EACvB,IAAQ0E,gBAAgB,GAA6BzB,MAAM,CAAnDyB,gBAAgB;IAAEC,sBAAsB,GAAK1B,MAAM,CAAjC0B,sBAAsB;EAChD,IAAMC,MAAM,GAAG,CAAC,CAAC;EAEjB,IAAMC,iBAAiB,GAAG,CAAC,CAACjC,MAAM,IAAI,EAAE,EAAEkC,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE/G,MAAM;EAE/E,IAAI8G,iBAAiB,GAAGH,gBAAgB,EAAE;IACxCE,MAAM,CAACG,kBAAkB,mBAAAC,MAAA,CAAmBN,gBAAgB,uCAAoC;EAClG,CAAC,MAAM,IAAIG,iBAAiB,GAAG,CAAC,EAAE;IAChCD,MAAM,CAACG,kBAAkB,GAAG,mDAAmD;EACjF;EAEA,CAAC7H,MAAM,CAACD,IAAI,CAAC+C,OAAO,CAAC,IAAI,EAAE,EAAE/B,OAAO,CAAC,UAACgH,SAAS,EAAK;IAClD,IAAIjF,OAAO,CAACiF,SAAS,CAAC,IAAIjF,OAAO,CAACiF,SAAS,CAAC,CAAClH,MAAM,GAAG4G,sBAAsB,EAAE;MAC5EC,MAAM,CAACM,wBAAwB,mBAAAF,MAAA,CAAmBL,sBAAsB,kDAA+C;IACzH;EACF,CAAC,CAAC;EAEF,OAAOC,MAAM;AACf,CAAC;AAAC5F,OAAA,CAAAyF,QAAA,GAAAA,QAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getAllCorrectResponses = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
10
|
+
var getAllCorrectResponses = function getAllCorrectResponses(_ref) {
|
|
11
|
+
var choices = _ref.choices,
|
|
12
|
+
alternateResponse = _ref.alternateResponse;
|
|
13
|
+
alternateResponse = alternateResponse || {};
|
|
14
|
+
var correctAnswers = {};
|
|
15
|
+
(0, _forEach["default"])(choices, function (respArea, key) {
|
|
16
|
+
if (!correctAnswers[key]) {
|
|
17
|
+
correctAnswers[key] = [];
|
|
18
|
+
}
|
|
19
|
+
if (respArea) {
|
|
20
|
+
respArea.forEach(function (choice) {
|
|
21
|
+
if (choice.correct) {
|
|
22
|
+
correctAnswers[key].push(choice.value);
|
|
23
|
+
if (alternateResponse[key]) {
|
|
24
|
+
correctAnswers[key] = [].concat((0, _toConsumableArray2["default"])(correctAnswers[key]), (0, _toConsumableArray2["default"])(alternateResponse[key]));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return correctAnswers;
|
|
31
|
+
};
|
|
32
|
+
exports.getAllCorrectResponses = getAllCorrectResponses;
|
|
33
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_forEach","_interopRequireDefault","require","getAllCorrectResponses","_ref","choices","alternateResponse","correctAnswers","forEach","respArea","key","choice","correct","push","value","concat","_toConsumableArray2","exports"],"sources":["../src/utils.js"],"sourcesContent":["import forEach from 'lodash/forEach';\n\nexport const getAllCorrectResponses = ({ choices, alternateResponse }) => {\n alternateResponse = alternateResponse || {};\n const correctAnswers = {};\n\n forEach(choices, (respArea, key) => {\n if (!correctAnswers[key]) {\n correctAnswers[key] = [];\n }\n\n if (respArea) {\n respArea.forEach((choice) => {\n if (choice.correct) {\n correctAnswers[key].push(choice.value);\n\n if (alternateResponse[key]) {\n correctAnswers[key] = [...correctAnswers[key], ...alternateResponse[key]];\n }\n }\n });\n }\n });\n\n return correctAnswers;\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEO,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAAC,IAAA,EAAuC;EAAA,IAAjCC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IAAEC,iBAAiB,GAAAF,IAAA,CAAjBE,iBAAiB;EACjEA,iBAAiB,GAAGA,iBAAiB,IAAI,CAAC,CAAC;EAC3C,IAAMC,cAAc,GAAG,CAAC,CAAC;EAEzB,IAAAC,mBAAO,EAACH,OAAO,EAAE,UAACI,QAAQ,EAAEC,GAAG,EAAK;IAClC,IAAI,CAACH,cAAc,CAACG,GAAG,CAAC,EAAE;MACxBH,cAAc,CAACG,GAAG,CAAC,GAAG,EAAE;IAC1B;IAEA,IAAID,QAAQ,EAAE;MACZA,QAAQ,CAACD,OAAO,CAAC,UAACG,MAAM,EAAK;QAC3B,IAAIA,MAAM,CAACC,OAAO,EAAE;UAClBL,cAAc,CAACG,GAAG,CAAC,CAACG,IAAI,CAACF,MAAM,CAACG,KAAK,CAAC;UAEtC,IAAIR,iBAAiB,CAACI,GAAG,CAAC,EAAE;YAC1BH,cAAc,CAACG,GAAG,CAAC,MAAAK,MAAA,KAAAC,mBAAA,aAAOT,cAAc,CAACG,GAAG,CAAC,OAAAM,mBAAA,aAAKV,iBAAiB,CAACI,GAAG,CAAC,EAAC;UAC3E;QACF;MACF,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;EAEF,OAAOH,cAAc;AACvB,CAAC;AAACU,OAAA,CAAAd,sBAAA,GAAAA,sBAAA"}
|