@pie-element/graphing 3.7.8 → 3.7.10-beta.1443

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","Configure","rationale","props","onModelChanged","model","teacherInstructions","arrows","left","right","up","down","classes","configuration","onConfigurationChanged","imageSupport","config","graph","padding","labels","scoringType","studentInstructions","coordinatesOnHover","authoring","teacherInstructionsEnabled","promptEnabled","rationaleEnabled","label","Properties","studentInstructionsEnabled","onTeacherInstructionsChange","onPromptChange","onRationaleChange","enabled","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA6CC,kBAA7C,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA6CD,kBAA7C,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAA6CF,kBAA7C,CAAuBE,KAAvB;AAAA,IAA8BC,UAA9B,GAA6CH,kBAA7C,CAA8BG,UAA9B;AACA,IAAMC,GAAG,GAAG,uBAAM,iCAAN,CAAZ;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,QAAQ,EAAE,QADL;AAELC,MAAAA,OAAO,EAAE,OAFJ;AAGLC,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAH3B;AAILC,MAAAA,YAAY,EAAEP,KAAK,CAACK,OAAN,CAAcC;AAJvB,KADgB;AAOvBE,IAAAA,OAAO,EAAE;AACPJ,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAc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EAlM4B8B,kBAAMC,S;;;iCAAxBlC,S,eACQ;AACjBG,EAAAA,cAAc,EAAEgC,sBAAUC,IADT;AAEjBvB,EAAAA,sBAAsB,EAAEsB,sBAAUC,IAFjB;AAGjBzB,EAAAA,OAAO,EAAEwB,sBAAUE,MAHF;AAIjBvB,EAAAA,YAAY,EAAEqB,sBAAUE,MAJP;AAKjBjC,EAAAA,KAAK,EAAE+B,sBAAUE,MAAV,CAAiBC,UALP;AAMjB1B,EAAAA,aAAa,EAAEuB,sBAAUE,MAAV,CAAiBC;AANf,C;iCADRtC,S,kBAUW;AAAEW,EAAAA,OAAO,EAAE;AAAX,C;;eA2LT,wBAAW1B,MAAX,EAAmBe,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport EditableHtml from '@pie-lib/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\n\nconst { Panel, toggle, radio, checkboxes } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = theme => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit\n },\n content: {\n marginTop: theme.spacing.unit * 2\n },\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n }\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n const { onModelChanged, model } = this.props;\n let { arrows } = model || {};\n\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = {\n left: true,\n right: true,\n up: true,\n down: true\n };\n } else {\n arrows = {\n left: false,\n right: false,\n up: false,\n down: false\n };\n }\n\n onModelChanged({ ...model, arrows });\n }\n }\n\n onRationaleChange = rationale => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = prompt => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = teacherInstructions => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n onModelChanged,\n imageSupport\n } = this.props;\n const config = model.graph;\n\n const {\n arrows = {},\n title = {},\n padding = {},\n labels = {},\n rationale = {},\n scoringType = {},\n studentInstructions = {},\n teacherInstructions = {},\n coordinatesOnHover = {},\n prompt = {},\n authoring = {}\n } = configuration || {};\n log('[render] model', model);\n const { teacherInstructionsEnabled, promptEnabled, rationaleEnabled } =\n model || {};\n\n return (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Item Type': {\n arrows: arrows.settings && checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down\n }),\n 'title.enabled': title.settings && toggle(title.label, true),\n padding: padding.settings && toggle(padding.label),\n labels: labels.settings && toggle(labels.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n },\n Properties: {\n 'authoring.enabled':\n authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n studentInstructionsEnabled:\n studentInstructions.settings &&\n toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n scoringType:\n scoringType.settings &&\n radio(scoringType.label, ['dichotomous', 'partial scoring'])\n }\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This interaction asks a student to draw a line that meets specific\n criteria. The student will draw the line by clicking on two points\n on the graph.\n </span>\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label || 'Rationale'}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n />\n </InputContainer>\n )}\n\n <GraphingConfig\n authoringEnabled={authoring && authoring.enabled}\n config={config}\n model={model}\n onChange={this.props.onModelChanged}\n />\n\n <CorrectResponse\n config={config}\n model={model}\n onChange={this.props.onModelChanged}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
1
+ {"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","Configure","rationale","props","onModelChanged","model","teacherInstructions","configuration","availableTools","arrows","left","right","up","down","toolbarTools","classes","onConfigurationChanged","imageSupport","uploadSoundSupport","authoring","coordinatesOnHover","gridConfigurations","graphDimensions","labels","padding","scoringType","settingsPanelDisabled","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","withRubric","errors","labelsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","titleEnabled","defaultImageMaxWidth","defaultImageMaxHeight","labelsPlaceholders","top","bottom","panelItemType","label","panelProperties","studentInstructionsEnabled","rubricEnabled","Properties","onTeacherInstructionsChange","language","onPromptChange","onRationaleChange","placeholder","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA6CC,kBAA7C,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA6CD,kBAA7C,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAA6CF,kBAA7C,CAAuBE,KAAvB;AAAA,IAA8BC,UAA9B,GAA6CH,kBAA7C,CAA8BG,UAA9B;AACA,IAAMC,GAAG,GAAG,uBAAM,iCAAN,CAAZ;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,QAAQ,EAAE,QADL;AAELC,MAAAA,OAAO,EAAE,OAFJ;AAGLC,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAH3B;AAILC,MAAAA,YAAY,EAAEP,KAAK,CAACK,OAAN,CAAcC;AAJvB,KADkB;AAOzBE,IAAAA,OAAO,EAAE;AACPJ,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB;AADzB,KAPgB;AAUzBG,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,MADK;AAEZC,MAAAA,aAAa,EAAEX,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAFxB;AAGZC,MAAAA,YAAY,EAAEP,KAAK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B,QA3DF,eAwEE,gCAAC,2BAAD;AACE,QAAA,cAAc,EAAEI,cADlB;AAEE,QAAA,MAAM,EAAEwB,MAFV;AAGE,QAAA,KAAK,EAAE3B,KAHT;AAIE,QAAA,QAAQ,EAAE,KAAKF,KAAL,CAAWC;AAJvB,QAxEF,CAfF,CADF;AAiGD;;;EA1N4BmD,kBAAMC,S;;;iCAAxBvD,S,eACQ;AACjBG,EAAAA,cAAc,EAAEqD,sBAAUC,IADT;AAEjB1C,EAAAA,sBAAsB,EAAEyC,sBAAUC,IAFjB;AAGjB3C,EAAAA,OAAO,EAAE0C,sBAAUE,MAHF;AAIjB1C,EAAAA,YAAY,EAAEwC,sBAAUE,MAJP;AAKjBzC,EAAAA,kBAAkB,EAAEuC,sBAAUE,MALb;AAMjBtD,EAAAA,KAAK,EAAEoD,sBAAUE,MAAV,CAAiBC,UANP;AAOjBrD,EAAAA,aAAa,EAAEkD,sBAAUE,MAAV,CAAiBC;AAPf,C;iCADR3D,S,kBAWW;AAAEc,EAAAA,OAAO,EAAE;AAAX,C;;eAkNT,wBAAW7B,MAAX,EAAmBe,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport EditableHtml from '@pie-lib/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\nimport intersection from 'lodash/intersection';\n\nconst { Panel, toggle, radio, checkboxes } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = (theme) => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit,\n },\n content: {\n marginTop: theme.spacing.unit * 2,\n },\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2,\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n },\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n const { configuration, onModelChanged, model } = this.props;\n const { availableTools } = configuration || {};\n let { arrows } = model || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = { left: true, right: true, up: true, down: true };\n } else {\n arrows = { left: false, right: false, up: false, down: false };\n }\n }\n\n const toolbarTools = intersection(availableTools || [], model.toolbarTools || []);\n\n onModelChanged && onModelChanged({ ...model, arrows, toolbarTools });\n }\n\n onRationaleChange = (rationale) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = (prompt) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = (teacherInstructions) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const { classes, model, configuration, onConfigurationChanged, onModelChanged, imageSupport, uploadSoundSupport } =\n this.props;\n const {\n arrows = {},\n authoring = {},\n availableTools = [],\n coordinatesOnHover = {},\n gridConfigurations = [],\n graphDimensions = {},\n labels = {},\n padding = {},\n prompt = {},\n rationale = {},\n scoringType = {},\n settingsPanelDisabled,\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n title = {},\n maxImageWidth = {},\n maxImageHeight = {},\n withRubric = {},\n } = configuration || {};\n const {\n errors = {},\n labelsEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n titleEnabled,\n } = model || {};\n\n log('[render] model', model);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n const labelsPlaceholders = {\n top: labels.top,\n right: labels.right,\n bottom: labels.bottom,\n left: labels.left,\n };\n\n const panelItemType = {\n arrows:\n arrows.settings &&\n checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down,\n }),\n titleEnabled: title.settings && toggle(title.label),\n padding: padding.settings && toggle(padding.label),\n labelsEnabled: labels.settings && toggle(labels.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n };\n const panelProperties = {\n 'authoring.enabled': authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring']),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Item Type': panelItemType,\n Properties: panelProperties,\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This interaction asks a student to draw a line that meets specific criteria. The student will draw the\n line by clicking on two points on the graph.\n </span>\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\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.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n disableUnderline\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 || 'Rationale'} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\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 <GraphingConfig\n authoring={authoring}\n availableTools={availableTools}\n gridConfigurations={gridConfigurations}\n graphDimensions={graphDimensions}\n labelsPlaceholders={labelsPlaceholders}\n model={model}\n showLabels={labelsEnabled}\n showTitle={titleEnabled}\n titlePlaceholder={title.placeholder}\n onChange={this.props.onModelChanged}\n />\n\n <CorrectResponse\n availableTools={availableTools}\n errors={errors}\n model={model}\n onChange={this.props.onModelChanged}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
@@ -7,7 +7,9 @@ var _typeof = require("@babel/runtime/helpers/typeof");
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
- exports["default"] = exports.CorrectResponse = exports.Tools = void 0;
10
+ exports["default"] = exports.Tools = exports.CorrectResponse = void 0;
11
+
12
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
13
 
12
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
15
 
@@ -35,37 +37,49 @@ var _styles = require("@material-ui/core/styles");
35
37
 
36
38
  var _graphing = require("@pie-lib/graphing");
37
39
 
40
+ var _configUi = require("@pie-lib/config-ui");
41
+
42
+ var _Delete = _interopRequireDefault(require("@material-ui/icons/Delete"));
43
+
38
44
  var _lodash = require("lodash");
39
45
 
46
+ var _core = require("@material-ui/core");
47
+
48
+ var _renderUi = require("@pie-lib/render-ui");
49
+
40
50
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
41
51
 
42
52
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
43
53
 
54
+ 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; }
55
+
56
+ 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; }
57
+
44
58
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
45
59
 
46
60
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
47
61
 
48
- var allTools = _graphing.tools.allTools;
49
-
50
62
  var styles = function styles(theme) {
51
63
  return {
52
64
  column: {
53
65
  flex: 1
54
66
  },
55
67
  graphingTools: {
56
- marginTop: theme.spacing.unit * 3,
57
68
  color: '#ababab'
58
69
  },
59
70
  availableTools: {
60
- marginTop: theme.spacing.unit * 3,
61
- marginBottom: theme.spacing.unit * 3,
71
+ marginTop: theme.spacing.unit,
62
72
  display: 'flex'
63
73
  },
64
74
  availableTool: {
65
75
  cursor: 'pointer',
66
76
  margin: theme.spacing.unit,
67
77
  padding: theme.spacing.unit,
68
- textTransform: 'capitalize'
78
+ border: '2px solid white',
79
+ textTransform: 'capitalize',
80
+ '&:hover': {
81
+ color: '#4d4d4d'
82
+ }
69
83
  },
70
84
  selectedTool: {
71
85
  background: '#d8d8d8',
@@ -74,39 +88,123 @@ var styles = function styles(theme) {
74
88
  container: {
75
89
  border: '2px solid #ababab',
76
90
  borderRadius: '4px',
77
- padding: "".concat(theme.spacing.unit * 2, "px ").concat(theme.spacing.unit * 4, "px"),
91
+ padding: "0 ".concat(theme.spacing.unit * 4, "px ").concat(theme.spacing.unit * 2, "px"),
78
92
  background: '#fafafa'
79
93
  },
80
94
  button: {
81
- marginTop: theme.spacing.unit * 3,
95
+ margin: "".concat(theme.spacing.unit * 3, "px 0"),
82
96
  cursor: 'pointer',
83
97
  background: '#eee',
84
- padding: theme.spacing.unit * 2,
98
+ padding: theme.spacing.unit * 1.5,
85
99
  width: 'fit-content',
86
- borderRadius: '4px'
100
+ borderRadius: '4px',
101
+ '&:hover': {
102
+ background: '#d8d8d8'
103
+ }
104
+ },
105
+ responseTitle: {
106
+ display: 'flex',
107
+ alignItems: 'center',
108
+ marginTop: '20px'
109
+ },
110
+ iconButton: {
111
+ marginLeft: '6px',
112
+ color: '#6d6d6d',
113
+ '&:hover': {
114
+ cursor: 'pointer',
115
+ color: '#000000'
116
+ }
117
+ },
118
+ name: {
119
+ margin: '5px 0'
120
+ },
121
+ subtitleText: {
122
+ marginTop: theme.spacing.unit * 1.5,
123
+ marginBottom: theme.spacing.unit
124
+ },
125
+ toolsHeader: {
126
+ display: 'flex',
127
+ alignItems: 'center',
128
+ justifyContent: 'space-between'
129
+ },
130
+ defaultTool: {
131
+ display: 'flex',
132
+ alignItems: 'center',
133
+ width: '300px'
134
+ },
135
+ defaultToolSelect: {
136
+ marginLeft: theme.spacing.unit,
137
+ textTransform: 'uppercase',
138
+ color: '#4d4d4d'
139
+ },
140
+ menuItem: {
141
+ textTransform: 'uppercase'
142
+ },
143
+ noDefaultTool: {
144
+ padding: theme.spacing.unit / 2
145
+ },
146
+ error: {
147
+ color: 'red'
148
+ },
149
+ errorMessage: {
150
+ fontSize: '14px',
151
+ color: 'red',
152
+ marginTop: theme.spacing.unit
153
+ },
154
+ graphError: {
155
+ border: '2px solid red'
87
156
  }
88
157
  };
89
158
  };
90
159
 
91
160
  var Tools = function Tools(_ref) {
92
161
  var classes = _ref.classes,
162
+ availableTools = _ref.availableTools,
163
+ defaultTool = _ref.defaultTool,
164
+ hasErrors = _ref.hasErrors,
93
165
  toolbarTools = _ref.toolbarTools,
94
- toggleToolBarTool = _ref.toggleToolBarTool;
95
- // label has to be placed at the end of the list
96
- var allToolsNoLabel = (allTools || []).filter(function (tool) {
166
+ toggleToolBarTool = _ref.toggleToolBarTool,
167
+ onDefaultToolChange = _ref.onDefaultToolChange;
168
+ var allTools = availableTools || [];
169
+ var isLabelAvailable = allTools.includes('label');
170
+ var toolbarToolsNoLabel = (toolbarTools || []).filter(function (tool) {
97
171
  return tool !== 'label';
98
172
  });
173
+
174
+ if (isLabelAvailable) {
175
+ // label has to be placed at the end of the list
176
+ var allToolsNoLabel = allTools.filter(function (tool) {
177
+ return tool !== 'label';
178
+ });
179
+ allTools = [].concat((0, _toConsumableArray2["default"])(allToolsNoLabel), ['label']);
180
+ }
181
+
99
182
  return /*#__PURE__*/React.createElement("div", {
100
183
  className: classes.graphingTools
101
- }, "GRAPHING TOOLS", /*#__PURE__*/React.createElement("div", {
184
+ }, /*#__PURE__*/React.createElement("div", {
185
+ className: classes.toolsHeader
186
+ }, /*#__PURE__*/React.createElement("span", null, "GRAPHING TOOLS"), toolbarToolsNoLabel.length > 0 && /*#__PURE__*/React.createElement("div", {
187
+ className: classes.defaultTool
188
+ }, /*#__PURE__*/React.createElement("span", null, "Default graphing tool:"), /*#__PURE__*/React.createElement(_core.Select, {
189
+ className: classes.defaultToolSelect,
190
+ onChange: onDefaultToolChange,
191
+ value: defaultTool,
192
+ disableUnderline: true
193
+ }, toolbarToolsNoLabel.map(function (tool, index) {
194
+ return /*#__PURE__*/React.createElement(_core.MenuItem, {
195
+ key: index,
196
+ className: classes.menuItem,
197
+ value: tool
198
+ }, tool);
199
+ })))), /*#__PURE__*/React.createElement("div", {
102
200
  className: classes.availableTools
103
- }, [].concat((0, _toConsumableArray2["default"])(allToolsNoLabel), ['label']).map(function (tool) {
201
+ }, allTools.map(function (tool) {
104
202
  var selected = toolbarTools.find(function (t) {
105
203
  return t === tool;
106
204
  });
107
205
  return /*#__PURE__*/React.createElement("div", {
108
206
  key: tool,
109
- className: (0, _classnames["default"])(classes.availableTool, selected && classes.selectedTool),
207
+ className: (0, _classnames["default"])(classes.availableTool, selected && classes.selectedTool, hasErrors && tool !== 'label' && classes.error),
110
208
  onClick: function onClick() {
111
209
  return toggleToolBarTool(tool);
112
210
  }
@@ -136,6 +234,18 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
136
234
  }
137
235
 
138
236
  _this = _super.call.apply(_super, [this].concat(args));
237
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
238
+ dialog: {
239
+ open: false
240
+ }
241
+ });
242
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleAlertDialog", function (open, callback) {
243
+ return _this.setState({
244
+ dialog: {
245
+ open: open
246
+ }
247
+ }, callback);
248
+ });
139
249
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeMarks", function (key, marks) {
140
250
  var _this$props = _this.props,
141
251
  model = _this$props.model,
@@ -143,6 +253,21 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
143
253
  (0, _lodash.set)(model, "answers.".concat(key, ".marks"), marks);
144
254
  onChange(model);
145
255
  });
256
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "filterMarks", function (tool) {
257
+ var answers = _this.props.model.answers;
258
+ return Object.entries(answers || {}).reduce(function (object, _ref2) {
259
+ var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
260
+ key = _ref3[0],
261
+ answer = _ref3[1];
262
+
263
+ object[key] = _objectSpread(_objectSpread({}, answer), {}, {
264
+ marks: (answer.marks || []).filter(function (mark) {
265
+ return mark.type !== tool;
266
+ })
267
+ });
268
+ return object;
269
+ }, {});
270
+ });
146
271
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeToolbarTools", function (toolbarTools) {
147
272
  var _this$props2 = _this.props,
148
273
  model = _this$props2.model,
@@ -150,28 +275,84 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
150
275
  model.toolbarTools = toolbarTools;
151
276
  onChange(model);
152
277
  });
278
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateModel", function (props) {
279
+ var _this$props3 = _this.props,
280
+ model = _this$props3.model,
281
+ onChange = _this$props3.onChange;
282
+ onChange(_objectSpread(_objectSpread({}, model), props));
283
+ });
153
284
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toggleToolBarTool", function (tool) {
154
- var toolbarTools = _this.props.model.toolbarTools;
285
+ var _this$props$model = _this.props.model,
286
+ defaultTool = _this$props$model.defaultTool,
287
+ toolbarTools = _this$props$model.toolbarTools,
288
+ _this$props$model$ans = _this$props$model.answers,
289
+ answers = _this$props$model$ans === void 0 ? {} : _this$props$model$ans;
290
+ var updatedToolbarTools = (0, _toConsumableArray2["default"])(toolbarTools);
291
+ var newDefaultTool = defaultTool;
155
292
  var index = toolbarTools.findIndex(function (t) {
156
293
  return tool === t;
157
294
  });
158
295
 
159
296
  if (index >= 0) {
160
- var update = (0, _toConsumableArray2["default"])(toolbarTools);
161
- update.splice(index, 1);
162
-
163
- _this.changeToolbarTools(update);
297
+ var updatedAnswers = _this.filterMarks(tool);
298
+
299
+ updatedToolbarTools.splice(index, 1);
300
+
301
+ if (tool === defaultTool) {
302
+ var toolbarToolsNoLabel = (updatedToolbarTools || []).filter(function (tool) {
303
+ return tool !== 'label';
304
+ });
305
+ newDefaultTool = toolbarToolsNoLabel.length && toolbarToolsNoLabel[0] || '';
306
+ }
307
+
308
+ if (!(0, _lodash.isEqual)(answers, updatedAnswers)) {
309
+ _this.setState({
310
+ dialog: {
311
+ open: true,
312
+ title: 'Warning',
313
+ text: "Correct answer includes one or more ".concat(tool, " objects and all of them will be deleted."),
314
+ onConfirm: function onConfirm() {
315
+ return _this.handleAlertDialog(false, _this.updateModel({
316
+ toolbarTools: updatedToolbarTools,
317
+ answers: updatedAnswers,
318
+ defaultTool: newDefaultTool
319
+ }));
320
+ },
321
+ onClose: function onClose() {
322
+ return _this.handleAlertDialog(false);
323
+ }
324
+ }
325
+ });
326
+
327
+ return;
328
+ }
164
329
  } else {
165
- _this.changeToolbarTools([].concat((0, _toConsumableArray2["default"])(toolbarTools), [tool]));
330
+ updatedToolbarTools.push(tool);
331
+
332
+ if (defaultTool === '' && tool !== 'label') {
333
+ newDefaultTool = tool;
334
+ }
166
335
  }
336
+
337
+ _this.updateModel({
338
+ toolbarTools: updatedToolbarTools,
339
+ defaultTool: newDefaultTool
340
+ });
341
+ });
342
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onDefaultToolChange", function (event) {
343
+ var value = event.target.value;
344
+
345
+ _this.updateModel({
346
+ defaultTool: value
347
+ });
167
348
  });
168
349
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "addAlternateResponse", function () {
169
- var _this$props3 = _this.props,
170
- model = _this$props3.model,
171
- onChange = _this$props3.onChange;
350
+ var _this$props4 = _this.props,
351
+ model = _this$props4.model,
352
+ onChange = _this$props4.onChange;
172
353
 
173
- var _ref2 = model || {},
174
- answers = _ref2.answers;
354
+ var _ref4 = model || {},
355
+ answers = _ref4.answers;
175
356
 
176
357
  var answersKeys = Object.keys(answers || {});
177
358
  (0, _lodash.set)(model, "answers.".concat("alternate".concat(answersKeys.length)), {
@@ -180,6 +361,44 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
180
361
  });
181
362
  onChange(model);
182
363
  });
364
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "deleteAlternateResponse", function (key, answer) {
365
+ var _this$props5 = _this.props,
366
+ model = _this$props5.model,
367
+ onChange = _this$props5.onChange;
368
+
369
+ var _ref5 = model || {},
370
+ answers = _ref5.answers;
371
+
372
+ var _ref6 = answer || {},
373
+ _ref6$marks = _ref6.marks,
374
+ marks = _ref6$marks === void 0 ? [] : _ref6$marks,
375
+ name = _ref6.name;
376
+
377
+ var deleteAnswer = function deleteAnswer() {
378
+ delete answers[key];
379
+ onChange(model);
380
+ };
381
+
382
+ if (marks.length) {
383
+ _this.setState({
384
+ dialog: {
385
+ open: true,
386
+ title: 'Warning',
387
+ text: "".concat(name, " includes one or more shapes and the entire response will be deleted."),
388
+ onConfirm: function onConfirm() {
389
+ return _this.handleAlertDialog(false, deleteAnswer);
390
+ },
391
+ onClose: function onClose() {
392
+ return _this.handleAlertDialog(false);
393
+ }
394
+ }
395
+ });
396
+
397
+ return;
398
+ }
399
+
400
+ deleteAnswer();
401
+ });
183
402
  return _this;
184
403
  }
185
404
 
@@ -188,63 +407,116 @@ var CorrectResponse = /*#__PURE__*/function (_React$Component) {
188
407
  value: function render() {
189
408
  var _this2 = this;
190
409
 
191
- var _this$props4 = this.props,
192
- classes = _this$props4.classes,
193
- model = _this$props4.model;
194
-
195
- var _ref3 = model || {},
196
- graph = _ref3.graph;
197
-
198
- var _ref4 = model || {},
199
- answers = _ref4.answers,
200
- arrows = _ref4.arrows,
201
- backgroundMarks = _ref4.backgroundMarks,
202
- coordinatesOnHover = _ref4.coordinatesOnHover,
203
- domain = _ref4.domain,
204
- labels = _ref4.labels,
205
- range = _ref4.range,
206
- title = _ref4.title,
207
- toolbarTools = _ref4.toolbarTools;
208
-
209
- graph = graph || {};
210
- var answersKeys = Object.keys(answers || {});
211
- return /*#__PURE__*/React.createElement("div", null, "Define Correct Response", /*#__PURE__*/React.createElement(Tools, {
410
+ var _this$props6 = this.props,
411
+ availableTools = _this$props6.availableTools,
412
+ classes = _this$props6.classes,
413
+ errors = _this$props6.errors,
414
+ model = _this$props6.model;
415
+ var dialog = this.state.dialog;
416
+
417
+ var _ref7 = model || {},
418
+ _ref7$answers = _ref7.answers,
419
+ answers = _ref7$answers === void 0 ? {} : _ref7$answers,
420
+ arrows = _ref7.arrows,
421
+ backgroundMarks = _ref7.backgroundMarks,
422
+ coordinatesOnHover = _ref7.coordinatesOnHover,
423
+ defaultTool = _ref7.defaultTool,
424
+ domain = _ref7.domain,
425
+ _ref7$graph = _ref7.graph,
426
+ graph = _ref7$graph === void 0 ? {} : _ref7$graph,
427
+ labels = _ref7.labels,
428
+ labelsEnabled = _ref7.labelsEnabled,
429
+ range = _ref7.range,
430
+ title = _ref7.title,
431
+ titleEnabled = _ref7.titleEnabled,
432
+ toolbarTools = _ref7.toolbarTools;
433
+
434
+ var _ref8 = errors || {},
435
+ _ref8$correctAnswerEr = _ref8.correctAnswerErrors,
436
+ correctAnswerErrors = _ref8$correctAnswerEr === void 0 ? {} : _ref8$correctAnswerEr,
437
+ toolbarToolsError = _ref8.toolbarToolsError;
438
+
439
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_core.Typography, {
440
+ component: "div",
441
+ variant: "subheading"
442
+ }, /*#__PURE__*/React.createElement("span", null, "Define Tool Set and Correct Response")), /*#__PURE__*/React.createElement(_core.Typography, {
443
+ component: "div",
444
+ variant: "body1",
445
+ className: classes.subtitleText
446
+ }, /*#__PURE__*/React.createElement("span", null, "Use this interface to choose which graphing tools students will be able to use, and to define the correct answer")), /*#__PURE__*/React.createElement(Tools, {
212
447
  classes: classes,
448
+ availableTools: availableTools,
449
+ defaultTool: defaultTool,
450
+ hasErrors: !!toolbarToolsError,
451
+ onDefaultToolChange: this.onDefaultToolChange,
213
452
  toggleToolBarTool: this.toggleToolBarTool,
214
453
  toolbarTools: toolbarTools
215
- }), /*#__PURE__*/React.createElement("div", {
216
- className: classes.container
217
- }, answersKeys.map(function (mark) {
218
- var _ref5 = answers[mark] || {},
219
- marks = _ref5.marks,
220
- name = _ref5.name;
454
+ }), toolbarToolsError && /*#__PURE__*/React.createElement("div", {
455
+ className: classes.errorMessage
456
+ }, toolbarToolsError), Object.entries(answers || {}).map(function (_ref9) {
457
+ var _ref10 = (0, _slicedToArray2["default"])(_ref9, 2),
458
+ key = _ref10[0],
459
+ answer = _ref10[1];
460
+
461
+ var _ref11 = answer || {},
462
+ _ref11$marks = _ref11.marks,
463
+ marks = _ref11$marks === void 0 ? [] : _ref11$marks,
464
+ name = _ref11.name;
221
465
 
222
466
  return /*#__PURE__*/React.createElement("div", {
223
467
  key: "correct-response-graph-".concat(name)
224
- }, /*#__PURE__*/React.createElement("p", null, name), /*#__PURE__*/React.createElement(_graphing.GraphContainer, {
468
+ }, /*#__PURE__*/React.createElement("div", {
469
+ className: classes.responseTitle
470
+ }, /*#__PURE__*/React.createElement("p", {
471
+ className: classes.name
472
+ }, name), key !== 'correctAnswer' && /*#__PURE__*/React.createElement(_Delete["default"], {
473
+ className: classes.iconButton,
474
+ onClick: function onClick() {
475
+ return _this2.deleteAlternateResponse(key, answer);
476
+ }
477
+ })), /*#__PURE__*/React.createElement(_graphing.GraphContainer, {
478
+ className: correctAnswerErrors[key] && classes.graphError,
225
479
  axesSettings: {
226
480
  includeArrows: arrows
227
481
  },
228
482
  backgroundMarks: backgroundMarks,
229
483
  coordinatesOnHover: coordinatesOnHover,
484
+ disabledLabels: true,
485
+ disabledTitle: true,
230
486
  domain: domain,
487
+ draggableTools: key === 'correctAnswer',
231
488
  labels: labels,
232
489
  marks: marks,
233
490
  onChangeMarks: function onChangeMarks(newMarks) {
234
- return _this2.changeMarks(mark, newMarks);
491
+ return _this2.changeMarks(key, newMarks);
235
492
  },
236
493
  range: range,
494
+ showLabels: labelsEnabled,
495
+ showTitle: titleEnabled,
237
496
  size: {
238
497
  width: graph.width,
239
498
  height: graph.height
240
499
  },
241
500
  title: title,
242
- toolbarTools: toolbarTools
243
- }));
501
+ toolbarTools: toolbarTools,
502
+ onChangeTools: function onChangeTools(toolbarTools) {
503
+ return _this2.updateModel({
504
+ toolbarTools: toolbarTools
505
+ });
506
+ }
507
+ }), correctAnswerErrors[key] && /*#__PURE__*/React.createElement("div", {
508
+ className: classes.errorMessage
509
+ }, correctAnswerErrors[key]));
244
510
  }), /*#__PURE__*/React.createElement("div", {
245
511
  className: classes.button,
246
512
  onClick: this.addAlternateResponse
247
- }, "ADD ALTERNATE")));
513
+ }, "ADD ALTERNATE"), /*#__PURE__*/React.createElement(_configUi.AlertDialog, {
514
+ open: dialog.open,
515
+ title: dialog.title,
516
+ text: dialog.text,
517
+ onClose: dialog.onClose,
518
+ onConfirm: dialog.onConfirm
519
+ }));
248
520
  }
249
521
  }]);
250
522
  return CorrectResponse;