@pie-element/charting 5.0.10 → 5.0.11-next.173

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.
@@ -197,7 +197,7 @@ var ChartingConfig = /*#__PURE__*/function (_React$Component) {
197
197
  addCategoryEnabled: true,
198
198
  categoryDefaultLabel: model.categoryDefaultLabel,
199
199
  labelsPlaceholders: labelsPlaceholders,
200
- titlePlaceholder: titlePlaceholder
200
+ titlePlaceholder: titlePlaceholder === null || titlePlaceholder === void 0 ? void 0 : titlePlaceholder.label
201
201
  }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Checkbox["default"], {
202
202
  checked: model.addCategoryEnabled,
203
203
  onChange: function onChange(e) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/charting-config.jsx"],"names":["styles","theme","container","marginTop","spacing","unit","marginBottom","display","flex","column","restoreCorrectAnswer","correctAnswer","data","correctResponseDefinition","forEach","category","currentIndex","editable","interactive","label","value","ChartingConfig","props","open","callback","setState","dialog","onChange","model","title","text","onConfirm","handleAlertDialog","addCategoryEnabled","onClose","type","state","classes","charts","labelsPlaceholders","titlePlaceholder","showPixelGuides","chartType","graph","domain","range","map","index","changeData","changeTitle","changeLabel","categoryDefaultLabel","e","changeAddRemoveEnabled","target","checked","React","Component","PropTypes","object","isRequired","func","array"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,SAAS,EAAE;AACTC,MAAAA,SAAS,EAAEF,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB,CADvB;AAETC,MAAAA,YAAY,EAAEL,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB,CAF1B;AAGTE,MAAAA,OAAO,EAAE,MAHA;AAITC,MAAAA,IAAI,EAAE;AAJG,K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AAA,MAAM,EAAEoB,sBAAUI;AAJD,C;;eAgIN,wBAAW9D,MAAX,EAAmBqB,cAAnB,C","sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Chart } from '@pie-lib/charting';\nimport { AlertDialog } from '@pie-lib/config-ui';\nimport Checkbox from '@material-ui/core/Checkbox';\n\nimport Typography from '@material-ui/core/Typography';\n\nconst styles = (theme) => ({\n container: {\n marginTop: theme.spacing.unit * 3,\n marginBottom: theme.spacing.unit * 3,\n display: 'flex',\n flex: 1,\n },\n column: {\n flex: 1,\n },\n});\n\nconst restoreCorrectAnswer = (correctAnswer, data) => {\n if (!correctAnswer) {\n return data;\n }\n\n let correctResponseDefinition = [];\n\n (data || []).forEach((category, currentIndex) => {\n const { editable, interactive } = category;\n\n const label =\n editable && correctAnswer[currentIndex]?.label\n ? correctAnswer[currentIndex].label\n : category.label;\n\n const value =\n interactive && correctAnswer[currentIndex]?.value\n ? correctAnswer[currentIndex].value\n : category.value;\n\n correctResponseDefinition[currentIndex] = {\n label: label,\n value: value,\n editable: category.editable,\n interactive: category.interactive,\n };\n });\n\n return correctResponseDefinition;\n};\n\nexport class ChartingConfig extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n charts: PropTypes.array,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n dialog: {\n open: false,\n },\n };\n }\n\n handleAlertDialog = (open, callback) =>\n this.setState(\n {\n dialog: { open },\n },\n callback\n );\n\n changeData = (data) => this.props.onChange({ ...this.props.model, data });\n\n changeAddRemoveEnabled = (value) => {\n const { model } = this.props\n const correctAnswer = restoreCorrectAnswer(\n model.correctAnswer.data,\n model.data\n );\n\n if (!value) {\n this.setState({\n dialog: {\n open: true,\n title: 'Warning',\n text: `This change will remove any correct answer categories that are not part of the initial item configuration.`,\n onConfirm: () =>\n this.handleAlertDialog(\n false,\n this.props.onChange({\n ...this.props.model,\n addCategoryEnabled: value,\n correctAnswer: { data: correctAnswer },\n })\n ),\n onClose: () => this.handleAlertDialog(false),\n },\n });\n } else {\n this.props.onChange({ ...this.props.model, addCategoryEnabled: value });\n }\n };\n\n changeTitle = title => this.props.onChange({ ...this.props.model, title });\n\n changeLabel = (type, label) => this.props.onChange({\n ...this.props.model,\n [type]: {\n ...this.props.model[type],\n label\n },\n })\n\n render() {\n const { classes, model, charts, labelsPlaceholders, titlePlaceholder, showPixelGuides } = this.props;\n const { dialog } = this.state;\n\n return (\n <div>\n Define Initial Chart Attributes\n <div className={classes.container}>\n <div className={classes.column} key=\"graph\">\n <Typography component=\"div\" type=\"body1\">\n <span>\n Use the tools below to set up the chart as it will initially\n appear to students.\n </span>\n </Typography>\n\n <Chart\n defineChart={true}\n showPixelGuides={showPixelGuides}\n chartType={model.chartType}\n size={model.graph}\n domain={model.domain}\n range={model.range}\n charts={charts}\n // index is a property used for setting the correct answer data; it's needed in order to remove categories from other data sets from the same index it was removed from the initial data\n data={model.data.map((category, index) => ({\n ...category,\n index: index,\n }))}\n title={model.title}\n onDataChange={this.changeData}\n onChangeTitle={this.changeTitle}\n onChangeLabels={this.changeLabel}\n addCategoryEnabled={true}\n categoryDefaultLabel={model.categoryDefaultLabel}\n labelsPlaceholders={labelsPlaceholders}\n titlePlaceholder={titlePlaceholder}\n />\n <div>\n <Checkbox\n checked={model.addCategoryEnabled}\n onChange={(e) => {\n this.changeAddRemoveEnabled(e.target.checked);\n }}\n />\n Student can add categories\n </div>\n\n <AlertDialog\n open={dialog.open}\n title={dialog.title}\n text={dialog.text}\n onClose={dialog.onClose}\n onConfirm={dialog.onConfirm}\n />\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default withStyles(styles)(ChartingConfig);\n"],"file":"charting-config.js"}
1
+ {"version":3,"sources":["../src/charting-config.jsx"],"names":["styles","theme","container","marginTop","spacing","unit","marginBottom","display","flex","column","restoreCorrectAnswer","correctAnswer","data","correctResponseDefinition","forEach","category","currentIndex","editable","interactive","label","value","ChartingConfig","props","open","callback","setState","dialog","onChange","model","title","text","onConfirm","handleAlertDialog","addCategoryEnabled","onClose","type","state","classes","charts","labelsPlaceholders","titlePlaceholder","showPixelGuides","chartType","graph","domain","range","map","index","changeData","changeTitle","changeLabel","categoryDefaultLabel","e","changeAddRemoveEnabled","target","checked","React","Component","PropTypes","object","isRequired","func","array"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,SAAS,EAAE;AACTC,MAAAA,SAAS,EAAEF,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB,CADvB;AAETC,MAAAA,YAAY,EAAEL,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB,CAF1B;AAGTE,MAAAA,OAAO,EAAE,MAHA;AAITC,MAAAA,IAAI,EAAE;AAJG,KADc;AAOzBC,IAAAA,MAAM,EAAE;AACND,MAAAA,IAAI,EAAE;AADA;AAPiB,GAAZ;AAAA,CAAf;;AAYA,IAAME,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,aAAD,EAAgBC,IAAhB,EAAyB;AACpD,MAAI,CAACD,aAAL,EAAoB;AAClB,WAAOC,IAAP;AACD;;AAED,MAAIC,yBAAyB,GAAG,EAAhC;AAEA,GAACD,IAAI,IAAI,EAAT,EAAaE,OAAb,CAAqB,UAACC,QAAD,EAAWC,YAAX,EAA4B;AAAA;;AAC/C,QAAQC,QAAR,GAAkCF,QAAlC,CAAQE,QAAR;AAAA,QAAkBC,WAAlB,GAAkCH,QAAlC,CAAkBG,WAAlB;AAEA,QAAMC,KAAK,GACTF,QAAQ,6BAAIN,aAAa,CAACK,YAAD,CAAjB,kDAAI,sBAA6BG,KAAzC,GACIR,aAAa,CAACK,YAAD,CAAb,CAA4BG,KADhC,GAEIJ,Q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A,OAAO,EAAES,KAAK,CAACK,kBADjB;AAEE,QAAA,QAAQ,EAAE,kBAACmB,CAAD,EAAO;AACf,UAAA,MAAI,CAACC,sBAAL,CAA4BD,CAAC,CAACE,MAAF,CAASC,OAArC;AACD;AAJH,QADF,+BA9BF,eAwCE,oBAAC,qBAAD;AACE,QAAA,IAAI,EAAE7B,MAAM,CAACH,IADf;AAEE,QAAA,KAAK,EAAEG,MAAM,CAACG,KAFhB;AAGE,QAAA,IAAI,EAAEH,MAAM,CAACI,IAHf;AAIE,QAAA,OAAO,EAAEJ,MAAM,CAACQ,OAJlB;AAKE,QAAA,SAAS,EAAER,MAAM,CAACK;AALpB,QAxCF,CADF,CAFF,CADF;AAuDD;;;EA9HiCyB,KAAK,CAACC,S;;;iCAA7BpC,c,eACQ;AACjBgB,EAAAA,OAAO,EAAEqB,sBAAUC,MAAV,CAAiBC,UADT;AAEjBhC,EAAAA,KAAK,EAAE8B,sBAAUC,MAAV,CAAiBC,UAFP;AAGjBjC,EAAAA,QAAQ,EAAE+B,sBAAUG,IAAV,CAAeD,UAHR;AAIjBtB,EAAAA,MAAM,EAAEoB,sBAAUI;AAJD,C;;eAgIN,wBAAW9D,MAAX,EAAmBqB,cAAnB,C","sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Chart } from '@pie-lib/charting';\nimport { AlertDialog } from '@pie-lib/config-ui';\nimport Checkbox from '@material-ui/core/Checkbox';\n\nimport Typography from '@material-ui/core/Typography';\n\nconst styles = (theme) => ({\n container: {\n marginTop: theme.spacing.unit * 3,\n marginBottom: theme.spacing.unit * 3,\n display: 'flex',\n flex: 1,\n },\n column: {\n flex: 1,\n },\n});\n\nconst restoreCorrectAnswer = (correctAnswer, data) => {\n if (!correctAnswer) {\n return data;\n }\n\n let correctResponseDefinition = [];\n\n (data || []).forEach((category, currentIndex) => {\n const { editable, interactive } = category;\n\n const label =\n editable && correctAnswer[currentIndex]?.label\n ? correctAnswer[currentIndex].label\n : category.label;\n\n const value =\n interactive && correctAnswer[currentIndex]?.value\n ? correctAnswer[currentIndex].value\n : category.value;\n\n correctResponseDefinition[currentIndex] = {\n label: label,\n value: value,\n editable: category.editable,\n interactive: category.interactive,\n };\n });\n\n return correctResponseDefinition;\n};\n\nexport class ChartingConfig extends React.Component {\n static propTypes = {\n classes: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n charts: PropTypes.array,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n dialog: {\n open: false,\n },\n };\n }\n\n handleAlertDialog = (open, callback) =>\n this.setState(\n {\n dialog: { open },\n },\n callback\n );\n\n changeData = (data) => this.props.onChange({ ...this.props.model, data });\n\n changeAddRemoveEnabled = (value) => {\n const { model } = this.props\n const correctAnswer = restoreCorrectAnswer(\n model.correctAnswer.data,\n model.data\n );\n\n if (!value) {\n this.setState({\n dialog: {\n open: true,\n title: 'Warning',\n text: `This change will remove any correct answer categories that are not part of the initial item configuration.`,\n onConfirm: () =>\n this.handleAlertDialog(\n false,\n this.props.onChange({\n ...this.props.model,\n addCategoryEnabled: value,\n correctAnswer: { data: correctAnswer },\n })\n ),\n onClose: () => this.handleAlertDialog(false),\n },\n });\n } else {\n this.props.onChange({ ...this.props.model, addCategoryEnabled: value });\n }\n };\n\n changeTitle = title => this.props.onChange({ ...this.props.model, title });\n\n changeLabel = (type, label) => this.props.onChange({\n ...this.props.model,\n [type]: {\n ...this.props.model[type],\n label\n },\n })\n\n render() {\n const { classes, model, charts, labelsPlaceholders, titlePlaceholder, showPixelGuides } = this.props;\n const { dialog } = this.state;\n\n return (\n <div>\n Define Initial Chart Attributes\n <div className={classes.container}>\n <div className={classes.column} key=\"graph\">\n <Typography component=\"div\" type=\"body1\">\n <span>\n Use the tools below to set up the chart as it will initially\n appear to students.\n </span>\n </Typography>\n\n <Chart\n defineChart={true}\n showPixelGuides={showPixelGuides}\n chartType={model.chartType}\n size={model.graph}\n domain={model.domain}\n range={model.range}\n charts={charts}\n // index is a property used for setting the correct answer data; it's needed in order to remove categories from other data sets from the same index it was removed from the initial data\n data={model.data.map((category, index) => ({\n ...category,\n index: index,\n }))}\n title={model.title}\n onDataChange={this.changeData}\n onChangeTitle={this.changeTitle}\n onChangeLabels={this.changeLabel}\n addCategoryEnabled={true}\n categoryDefaultLabel={model.categoryDefaultLabel}\n labelsPlaceholders={labelsPlaceholders}\n titlePlaceholder={titlePlaceholder?.label}\n />\n <div>\n <Checkbox\n checked={model.addCategoryEnabled}\n onChange={(e) => {\n this.changeAddRemoveEnabled(e.target.checked);\n }}\n />\n Student can add categories\n </div>\n\n <AlertDialog\n open={dialog.open}\n title={dialog.title}\n text={dialog.text}\n onClose={dialog.onClose}\n onConfirm={dialog.onConfirm}\n />\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default withStyles(styles)(ChartingConfig);\n"],"file":"charting-config.js"}
@@ -189,13 +189,15 @@ var Configure = /*#__PURE__*/function (_React$Component) {
189
189
  _ref2$titlePlaceholde = _ref2.titlePlaceholder,
190
190
  titlePlaceholder = _ref2$titlePlaceholde === void 0 ? {} : _ref2$titlePlaceholde,
191
191
  _ref2$chartDimensions = _ref2.chartDimensions,
192
- chartDimensions = _ref2$chartDimensions === void 0 ? {} : _ref2$chartDimensions;
192
+ chartDimensions = _ref2$chartDimensions === void 0 ? {} : _ref2$chartDimensions,
193
+ withRubric = _ref2.withRubric;
193
194
 
194
195
  var _ref3 = model || {},
195
196
  teacherInstructionsEnabled = _ref3.teacherInstructionsEnabled,
196
197
  promptEnabled = _ref3.promptEnabled,
197
198
  rationaleEnabled = _ref3.rationaleEnabled,
198
- spellCheckEnabled = _ref3.spellCheckEnabled;
199
+ spellCheckEnabled = _ref3.spellCheckEnabled,
200
+ rubricEnabled = _ref3.rubricEnabled;
199
201
 
200
202
  var _this$state2 = this.state,
201
203
  gridValues = _this$state2.gridValues,
@@ -216,7 +218,8 @@ var Configure = /*#__PURE__*/function (_React$Component) {
216
218
  rationaleEnabled: rationale.settings && toggle(rationale.label),
217
219
  spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
218
220
  promptEnabled: prompt.settings && toggle(prompt.label),
219
- scoringType: scoringType.settings && radio(scoringType.label, ['all or nothing', 'partial scoring'])
221
+ scoringType: scoringType.settings && radio(scoringType.label, ['all or nothing', 'partial scoring']),
222
+ rubricEnabled: withRubric.settings && toggle(withRubric.label)
220
223
  }
221
224
  }
222
225
  })
@@ -237,7 +240,12 @@ var Configure = /*#__PURE__*/function (_React$Component) {
237
240
  spellCheck: spellCheckEnabled,
238
241
  maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
239
242
  maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
240
- uploadSoundSupport: uploadSoundSupport
243
+ uploadSoundSupport: uploadSoundSupport,
244
+ languageCharactersProps: [{
245
+ language: 'spanish'
246
+ }, {
247
+ language: 'special'
248
+ }]
241
249
  })), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
242
250
  label: prompt.label,
243
251
  className: classes.promptHolder
@@ -251,7 +259,12 @@ var Configure = /*#__PURE__*/function (_React$Component) {
251
259
  disableUnderline: true,
252
260
  maxImageWidth: defaultImageMaxWidth,
253
261
  maxImageHeight: defaultImageMaxHeight,
254
- uploadSoundSupport: uploadSoundSupport
262
+ uploadSoundSupport: uploadSoundSupport,
263
+ languageCharactersProps: [{
264
+ language: 'spanish'
265
+ }, {
266
+ language: 'special'
267
+ }]
255
268
  })), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
256
269
  label: rationale.label || 'Rationale',
257
270
  className: classes.promptHolder
@@ -263,7 +276,12 @@ var Configure = /*#__PURE__*/function (_React$Component) {
263
276
  spellCheck: spellCheckEnabled,
264
277
  maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
265
278
  maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight,
266
- uploadSoundSupport: uploadSoundSupport
279
+ uploadSoundSupport: uploadSoundSupport,
280
+ languageCharactersProps: [{
281
+ language: 'spanish'
282
+ }, {
283
+ language: 'special'
284
+ }]
267
285
  })), /*#__PURE__*/_react["default"].createElement(_charting.ConfigureChartPanel, {
268
286
  model: model,
269
287
  onChange: this.onConfigChange,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/configure.jsx"],"names":["log","Panel","settings","toggle","radio","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","charts","chartTypes","Bar","Histogram","LineDot","LineCross","DotPlot","LinePlot","Configure","props","rationale","onModelChanged","model","teacherInstructions","chartType","config","state","oldGridValues","gridValues","oldLabelValues","labelValues","updatedModel","graph","range","rangeConstraints","height","setState","step","classes","configuration","onConfigurationChanged","imageSupport","uploadSoundSupport","scoringType","studentInstructions","spellCheck","maxImageWidth","maxImageHeight","labelsPlaceholders","titlePlaceholder","chartDimensions","teacherInstructionsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","showPixeGuides","showInConfigPanel","defaultImageMaxWidth","defaultImageMaxHeight","Properties","label","studentInstructionsEnabled","onTeacherInstructionsChange","onPromptChange","onRationaleChange","onConfigChange","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AAGA,IAAMA,GAAG,GAAG,uBAAM,iCAAN,CAAZ;AACA,IAAQC,KAAR,GAAiCC,kBAAjC,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAAiCD,kBAAjC,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAAiCF,kBAAjC,CAAuBE,KAAvB;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,QA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,KADT;AAEE,QAAA,QAAQ,EAAED,cAFZ;AAGE,QAAA,MAAM,EAAEX,MAHV;AAIE,QAAA,kBAAkB,EAAEsC,kBAJtB;AAKE,QAAA,gBAAgB,EAAEC,gBALpB;AAME,QAAA,eAAe,EAAEM;AANnB,QAzEF,eAkFE,gCAAC,2BAAD;AACE,QAAA,MAAM,EAAEvB,KADV;AAEE,QAAA,KAAK,EAAEV,KAFT;AAGE,QAAA,QAAQ,EAAED,cAHZ;AAIE,QAAA,MAAM,EAAEX;AAJV,QAlFF,CA9BF,CADF;AA0HD;;;EApN4BwD,kBAAMC,S;;;iCAAxBjD,S,eACQ;AACjBG,EAAAA,cAAc,EAAE+C,sBAAUC,IADT;AAEjB7B,EAAAA,sBAAsB,EAAE4B,sBAAUC,IAFjB;AAGjB/B,EAAAA,OAAO,EAAE8B,sBAAUE,MAHF;AAIjB7B,EAAAA,YAAY,EAAE2B,sBAAUE,MAJP;AAKjB5B,EAAAA,kBAAkB,EAAE0B,sBAAUE,MALb;AAMjBhD,EAAAA,KAAK,EAAE8C,sBAAUE,MAAV,CAAiBC,UANP;AAOjBhC,EAAAA,aAAa,EAAE6B,sBAAUE,MAAV,CAAiBC;AAPf,C;iCADRrD,S,kBA0BW;AAAEoB,EAAAA,OAAO,EAAE;AAAX,C;;eA6LT,wBAAW3C,MAAX,EAAmBuB,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport { chartTypes, ConfigureChartPanel } from '@pie-lib/charting';\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';\n\nimport ChartingConfig from './charting-config';\nimport CorrectResponse from './correct-response';\nimport { applyConstraints, getGridValues, getLabelValues } from './utils';\n\n\nconst log = debug('@pie-element:graphing:configure');\nconst { Panel, toggle, radio } = settings;\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\nconst charts = [\n chartTypes.Bar(),\n chartTypes.Histogram(),\n chartTypes.LineDot(),\n chartTypes.LineCross(),\n chartTypes.DotPlot(),\n chartTypes.LinePlot(),\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 constructor(props) {\n super(props);\n const { range, graph } = props.model || {};\n\n const gridValues = {\n range: getGridValues(range, graph.height, true)\n };\n\n const labelValues = {\n range: getLabelValues(range.step || 1)\n };\n\n this.state = { gridValues, labelValues };\n };\n\n static defaultProps = { classes: {} };\n\n onRationaleChange = (rationale) =>\n this.props.onModelChanged({ ...this.props.model, rationale });\n\n onPromptChange = (prompt) =>\n this.props.onModelChanged({ ...this.props.model, prompt });\n\n onTeacherInstructionsChange = (teacherInstructions) =>\n this.props.onModelChanged({ ...this.props.model, teacherInstructions });\n\n onChartTypeChange = (chartType) =>\n this.props.onModelChanged({ ...this.props.model, chartType });\n\n onConfigChange = config => {\n const { model } = this.props;\n const { gridValues: oldGridValues, labelValues: oldLabelValues } = this.state;\n const updatedModel = { ...model, ...config };\n const { graph, range } = updatedModel;\n const gridValues = {};\n const labelValues = {};\n\n const rangeConstraints = applyConstraints(range, graph.height, oldGridValues.range, oldLabelValues.range);\n\n gridValues.range = rangeConstraints.gridValues;\n labelValues.range = rangeConstraints.labelValues;\n\n this.setState({ gridValues, labelValues });\n this.props.onModelChanged(updatedModel);\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n onModelChanged,\n imageSupport,\n uploadSoundSupport\n } = this.props;\n log('[render] model', model);\n const { graph } = model;\n const {\n rationale = {},\n scoringType = {},\n studentInstructions = {},\n teacherInstructions = {},\n prompt = {},\n spellCheck = {},\n maxImageWidth = {},\n maxImageHeight = {},\n labelsPlaceholders = {},\n titlePlaceholder = {},\n chartDimensions = {},\n } = configuration || {};\n const { teacherInstructionsEnabled, promptEnabled, rationaleEnabled, spellCheckEnabled } =\n model || {};\n const { gridValues, labelValues } = this.state;\n const showPixeGuides = chartDimensions.showInConfigPanel || true;\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\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 Properties: {\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n studentInstructionsEnabled:\n studentInstructions.settings &&\n toggle(studentInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n scoringType:\n scoringType.settings &&\n radio(scoringType.label, [\n 'all or nothing',\n 'partial scoring',\n ]),\n },\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This item type provides various types of interactive charts. Depending upon how an item is configured, students can change the heights of bars (or other similar chart elements) created by the author; relabel bars created by the author; and/or add new bars, label them, and set their heights.\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 spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\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 spellCheck={spellCheckEnabled}\n disableUnderline\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\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 spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n />\n </InputContainer>\n )}\n\n <ConfigureChartPanel\n model={model}\n onChange={this.onConfigChange}\n gridValues={gridValues}\n labelValues={labelValues}\n chartDimensions={chartDimensions}\n charts={charts}\n />\n\n <ChartingConfig\n model={model}\n onChange={onModelChanged}\n charts={charts}\n labelsPlaceholders={labelsPlaceholders}\n titlePlaceholder={titlePlaceholder}\n showPixelGuides={showPixeGuides}\n />\n\n <CorrectResponse\n config={graph}\n model={model}\n onChange={onModelChanged}\n charts={charts}\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":["log","Panel","settings","toggle","radio","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","charts","chartTypes","Bar","Histogram","LineDot","LineCross","DotPlot","LinePlot","Configure","props","rationale","onModelChanged","model","teacherInstructions","chartType","config","state","oldGridValues","gridValues","oldLabelValues","labelValues","updatedModel","graph","range","rangeConstraints","height","setState","step","classes","configuration","onConfigurationChanged","imageSupport","uploadSoundSupport","scoringType","studentInstructions","spellCheck","maxImageWidth","maxImageHeight","labelsPlaceholders","titlePlaceholder","chartDimensions","withRubric","teacherInstructionsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","rubricEnabled","showPixeGuides","showInConfigPanel","defaultImageMaxWidth","defaultImageMaxHeight","Properties","label","studentInstructionsEnabled","onTeacherInstructionsChange","language","onPromptChange","onRationaleChange","onConfigChange","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AAGA,IAAMA,GAAG,GAAG,uBAAM,iCAAN,CAAZ;AACA,IAAQC,KAAR,GAAiCC,kBAAjC,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAAiCD,kBAAjC,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAAiCF,kBAAjC,CAAuBE,KAAvB;;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;AACZ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AEE,QAAA,QAAQ,EAAE,KAAK8C,cAFjB;AAGE,QAAA,UAAU,EAAExC,UAHd;AAIE,QAAA,WAAW,EAAEE,WAJf;AAKE,QAAA,eAAe,EAAEoB,eALnB;AAME,QAAA,MAAM,EAAExC;AANV,QAnEF,eA4EE,gCAAC,0BAAD;AACE,QAAA,KAAK,EAAEY,KADT;AAEE,QAAA,QAAQ,EAAED,cAFZ;AAGE,QAAA,MAAM,EAAEX,MAHV;AAIE,QAAA,kBAAkB,EAAEsC,kBAJtB;AAKE,QAAA,gBAAgB,EAAEC,gBALpB;AAME,QAAA,eAAe,EAAEQ;AANnB,QA5EF,eAqFE,gCAAC,2BAAD;AACE,QAAA,MAAM,EAAEzB,KADV;AAEE,QAAA,KAAK,EAAEV,KAFT;AAGE,QAAA,QAAQ,EAAED,cAHZ;AAIE,QAAA,MAAM,EAAEX;AAJV,QArFF,CA/BF,CADF;AA8HD;;;EA9N4B2D,kBAAMC,S;;;iCAAxBpD,S,eACQ;AACjBG,EAAAA,cAAc,EAAEkD,sBAAUC,IADT;AAEjBhC,EAAAA,sBAAsB,EAAE+B,sBAAUC,IAFjB;AAGjBlC,EAAAA,OAAO,EAAEiC,sBAAUE,MAHF;AAIjBhC,EAAAA,YAAY,EAAE8B,sBAAUE,MAJP;AAKjB/B,EAAAA,kBAAkB,EAAE6B,sBAAUE,MALb;AAMjBnD,EAAAA,KAAK,EAAEiD,sBAAUE,MAAV,CAAiBC,UANP;AAOjBnC,EAAAA,aAAa,EAAEgC,sBAAUE,MAAV,CAAiBC;AAPf,C;iCADRxD,S,kBA0BW;AAAEoB,EAAAA,OAAO,EAAE;AAAX,C;;eAuMT,wBAAW3C,MAAX,EAAmBuB,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport { chartTypes, ConfigureChartPanel } from '@pie-lib/charting';\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';\n\nimport ChartingConfig from './charting-config';\nimport CorrectResponse from './correct-response';\nimport { applyConstraints, getGridValues, getLabelValues } from './utils';\n\n\nconst log = debug('@pie-element:graphing:configure');\nconst { Panel, toggle, radio } = settings;\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\nconst charts = [\n chartTypes.Bar(),\n chartTypes.Histogram(),\n chartTypes.LineDot(),\n chartTypes.LineCross(),\n chartTypes.DotPlot(),\n chartTypes.LinePlot(),\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 constructor(props) {\n super(props);\n const { range, graph } = props.model || {};\n\n const gridValues = {\n range: getGridValues(range, graph.height, true)\n };\n\n const labelValues = {\n range: getLabelValues(range.step || 1)\n };\n\n this.state = { gridValues, labelValues };\n };\n\n static defaultProps = { classes: {} };\n\n onRationaleChange = (rationale) =>\n this.props.onModelChanged({ ...this.props.model, rationale });\n\n onPromptChange = (prompt) =>\n this.props.onModelChanged({ ...this.props.model, prompt });\n\n onTeacherInstructionsChange = (teacherInstructions) =>\n this.props.onModelChanged({ ...this.props.model, teacherInstructions });\n\n onChartTypeChange = (chartType) =>\n this.props.onModelChanged({ ...this.props.model, chartType });\n\n onConfigChange = config => {\n const { model } = this.props;\n const { gridValues: oldGridValues, labelValues: oldLabelValues } = this.state;\n const updatedModel = { ...model, ...config };\n const { graph, range } = updatedModel;\n const gridValues = {};\n const labelValues = {};\n\n const rangeConstraints = applyConstraints(range, graph.height, oldGridValues.range, oldLabelValues.range);\n\n gridValues.range = rangeConstraints.gridValues;\n labelValues.range = rangeConstraints.labelValues;\n\n this.setState({ gridValues, labelValues });\n this.props.onModelChanged(updatedModel);\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n onModelChanged,\n imageSupport,\n uploadSoundSupport\n } = this.props;\n log('[render] model', model);\n const { graph } = model;\n const {\n rationale = {},\n scoringType = {},\n studentInstructions = {},\n teacherInstructions = {},\n prompt = {},\n spellCheck = {},\n maxImageWidth = {},\n maxImageHeight = {},\n labelsPlaceholders = {},\n titlePlaceholder = {},\n chartDimensions = {},\n withRubric,\n } = configuration || {};\n const {\n teacherInstructionsEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n rubricEnabled\n } = model || {};\n const { gridValues, labelValues } = this.state;\n const showPixeGuides = chartDimensions.showInConfigPanel || true;\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\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 Properties: {\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n studentInstructionsEnabled:\n studentInstructions.settings &&\n toggle(studentInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n scoringType:\n scoringType.settings &&\n radio(scoringType.label, [\n 'all or nothing',\n 'partial scoring',\n ]),\n rubricEnabled: withRubric.settings && toggle(withRubric.label)\n },\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This item type provides various types of interactive charts. Depending upon how an item is configured, students can change the heights of bars (or other similar chart elements) created by the author; relabel bars created by the author; and/or add new bars, label them, and set their heights.\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 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\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 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\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 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 <ConfigureChartPanel\n model={model}\n onChange={this.onConfigChange}\n gridValues={gridValues}\n labelValues={labelValues}\n chartDimensions={chartDimensions}\n charts={charts}\n />\n\n <ChartingConfig\n model={model}\n onChange={onModelChanged}\n charts={charts}\n labelsPlaceholders={labelsPlaceholders}\n titlePlaceholder={titlePlaceholder}\n showPixelGuides={showPixeGuides}\n />\n\n <CorrectResponse\n config={graph}\n model={model}\n onChange={onModelChanged}\n charts={charts}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
@@ -89,7 +89,10 @@ var _default = {
89
89
  settings: false,
90
90
  label: 'Chart Title'
91
91
  },
92
- titlePlaceholder: 'Click here to add a title',
92
+ titlePlaceholder: {
93
+ settings: false,
94
+ label: 'Click here to add a title'
95
+ },
93
96
  labelsPlaceholders: {
94
97
  left: 'Click here to add a label for this axis',
95
98
  right: '',
@@ -105,6 +108,10 @@ var _default = {
105
108
  teacherInstructions: 300,
106
109
  prompt: 300,
107
110
  rationale: 300
111
+ },
112
+ withRubric: {
113
+ settings: false,
114
+ label: 'Add Rubric'
108
115
  }
109
116
  }
110
117
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/defaults.js"],"names":["model","addCategoryEnabled","categoryDefaultLabel","chartType","correctAnswer","data","domain","label","graph","width","height","prompt","promptEnabled","rationale","range","max","min","scoringType","title","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","configuration","spellCheck","settings","enabled","chartDimensions","showInConfigPanel","step","studentInstructions","teacherInstructions","titlePlaceholder","labelsPlaceholders","left","right","top","bottom","maxImageWidth","maxImageHeight"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;eAEe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,kBAAkB,EAAE,IADf;AAELC,IAAAA,oBAAoB,EAAE,UAFjB;AAGLC,IAAAA,SAAS,EAAE,WAHN;AAILC,IAAAA,aAAa,EAAE,EAJV;AAKLC,IAAAA,IAAI,EAAE,EALD;AAMLC,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AAE;AACTW,MAAAA,QAAQ,EAAE,IADD;AAETjB,MAAAA,KAAK,EAAE;AAFE,KAzBE;AA6BbU,IAAAA,WAAW,EAAE;AACXO,MAAAA,QAAQ,EAAE,KADC;AAEXjB,MAAAA,KAAK,EAAE;AAFI,KA7BA;AAiCbsB,IAAAA,mBAAmB,EAAE;AACnBL,MAAAA,QAAQ,EAAE,KADS;AAEnBjB,MAAAA,KAAK,EAAE;AAFY,KAjCR;AAqCbuB,IAAAA,mBAAmB,EAAE;AACnBN,MAAAA,QAAQ,EAAE,IADS;AAEnBjB,MAAAA,KAAK,EAAE;AAFY,KArCR;AAyCbW,IAAAA,KAAK,EAAE;AACLM,MAAAA,QAAQ,EAAE,KADL;AAELjB,MAAAA,KAAK,EAAE;AAFF,KAzCM;AA6CbwB,IAAAA,gBAAgB,EAAE,2BA7CL;AA8CbC,IAAAA,kBAAkB,EAAE;AAClBC,MAAAA,IAAI,EAAE,yCADY;AAElBC,MAAAA,KAAK,EAAE,EAFW;AAGlBC,MAAAA,GAAG,EAAE,EAHa;AAIlBC,MAAAA,MAAM,EAAE;AAJU,KA9CP;AAoDbC,IAAAA,aAAa,EAAE;AACbP,MAAAA,mBAAmB,EAAE,GADR;AAEbnB,MAAAA,MAAM,EAAE,GAFK;AAGbE,MAAAA,SAAS,EAAE;AAHE,KApDF;AAyDbyB,IAAAA,cAAc,EAAE;AACdR,MAAAA,mBAAmB,EAAE,GADP;AAEdnB,MAAAA,MAAM,EAAE,GAFM;AAGdE,MAAAA,SAAS,EAAE;AAHG;AAzDH;AA5BF,C","sourcesContent":["/**\n * NOTE: There's no functionality described for graphTitle,\n * rationale, scoringType, studentInstructions, teacherInstructions\n * so there's no implementation (they are only added in model)\n */\n\n// const createCategory = (label, value) => ({\n// label,\n// value,\n// interactive: true,\n// editable: true\n// });\n\nexport default {\n model: {\n addCategoryEnabled: true,\n categoryDefaultLabel: 'Category',\n chartType: 'lineCross',\n correctAnswer: {},\n data: [],\n domain: {\n label: 'Fruits',\n },\n graph: {\n width: 480,\n height: 480,\n },\n prompt: 'Here goes item stem!',\n promptEnabled: true,\n rationale: 'Rationale goes here!',\n range: {\n label: 'Amount',\n max: 5.5,\n min: 0,\n },\n scoringType: 'all or nothing',\n title: 'This is a chart!',\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n },\n configuration: {\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n chartDimensions: {\n settings: false,\n label: 'Chart Dimensions',\n showInConfigPanel: true,\n width: {\n min: 50,\n max: 700,\n step: 20,\n },\n height: {\n min: 400,\n max: 700,\n step: 20,\n },\n },\n prompt: {\n settings: true,\n label: 'Item Stem',\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n },\n scoringType: {\n settings: false,\n label: 'Scoring Type',\n },\n studentInstructions: {\n settings: false,\n label: 'Student Instructions',\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n title: {\n settings: false,\n label: 'Chart Title',\n },\n titlePlaceholder: 'Click here to add a title',\n labelsPlaceholders: {\n left: 'Click here to add a label for this axis',\n right: '',\n top: '',\n bottom: 'Click here to add a label for this axis',\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n },\n};\n"],"file":"defaults.js"}
1
+ {"version":3,"sources":["../src/defaults.js"],"names":["model","addCategoryEnabled","categoryDefaultLabel","chartType","correctAnswer","data","domain","label","graph","width","height","prompt","promptEnabled","rationale","range","max","min","scoringType","title","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","configuration","spellCheck","settings","enabled","chartDimensions","showInConfigPanel","step","studentInstructions","teacherInstructions","titlePlaceholder","labelsPlaceholders","left","right","top","bottom","maxImageWidth","maxImageHeight","withRubric"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;eAEe;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B,IAAAA,UAAU,EAAE;AACVf,MAAAA,QAAQ,EAAE,KADA;AAEVjB,MAAAA,KAAK,EAAE;AAFG;AAjEC;AA5BF,C","sourcesContent":["/**\n * NOTE: There's no functionality described for graphTitle,\n * rationale, scoringType, studentInstructions, teacherInstructions\n * so there's no implementation (they are only added in model)\n */\n\n// const createCategory = (label, value) => ({\n// label,\n// value,\n// interactive: true,\n// editable: true\n// });\n\nexport default {\n model: {\n addCategoryEnabled: true,\n categoryDefaultLabel: 'Category',\n chartType: 'lineCross',\n correctAnswer: {},\n data: [],\n domain: {\n label: 'Fruits',\n },\n graph: {\n width: 480,\n height: 480,\n },\n prompt: 'Here goes item stem!',\n promptEnabled: true,\n rationale: 'Rationale goes here!',\n range: {\n label: 'Amount',\n max: 5.5,\n min: 0,\n },\n scoringType: 'all or nothing',\n title: 'This is a chart!',\n rationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n },\n configuration: {\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n chartDimensions: {\n settings: false,\n label: 'Chart Dimensions',\n showInConfigPanel: true,\n width: {\n min: 50,\n max: 700,\n step: 20,\n },\n height: {\n min: 400,\n max: 700,\n step: 20,\n },\n },\n prompt: {\n settings: true,\n label: 'Item Stem',\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n },\n scoringType: {\n settings: false,\n label: 'Scoring Type',\n },\n studentInstructions: {\n settings: false,\n label: 'Student Instructions',\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n title: {\n settings: false,\n label: 'Chart Title',\n },\n titlePlaceholder: {\n settings: false,\n label: 'Click here to add a title',\n },\n labelsPlaceholders: {\n left: 'Click here to add a label for this axis',\n right: '',\n top: '',\n bottom: 'Click here to add a label for this axis',\n },\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric'\n }\n },\n};\n"],"file":"defaults.js"}
@@ -9,8 +9,8 @@
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.2",
11
11
  "@pie-framework/pie-configure-events": "^1.3.0",
12
- "@pie-lib/charting": "^5.2.1",
13
- "@pie-lib/config-ui": "^11.0.19",
12
+ "@pie-lib/charting": "^5.3.0",
13
+ "@pie-lib/config-ui": "^11.0.20",
14
14
  "@pie-lib/editable-html": "^9.2.2",
15
15
  "@pie-lib/math-rendering": "^2.5.0",
16
16
  "classnames": "^2.2.5",
@@ -51,6 +51,63 @@
51
51
  }
52
52
  }
53
53
  },
54
+ "titlePlaceholder": {
55
+ "title": "ConfigureProp",
56
+ "type": "object",
57
+ "properties": {
58
+ "settings": {
59
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
60
+ "type": "boolean",
61
+ "title": "settings"
62
+ },
63
+ "label": {
64
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
65
+ "type": "string",
66
+ "title": "label"
67
+ }
68
+ }
69
+ },
70
+ "labelsPlaceholders": {
71
+ "title": "LabelsPlaceholderConfigProp",
72
+ "type": "object",
73
+ "properties": {
74
+ "top": {
75
+ "description": "This value is empty for charting. The property exist in order to be consistent with graphing configuration.",
76
+ "type": "string",
77
+ "title": "top"
78
+ },
79
+ "right": {
80
+ "description": "This value is empty for charting. The property exist in order to be consistent with graphing configuration.",
81
+ "type": "string",
82
+ "title": "right"
83
+ },
84
+ "bottom": {
85
+ "description": "Indicates the placeholder for the bottom label",
86
+ "type": "string",
87
+ "title": "bottom"
88
+ },
89
+ "left": {
90
+ "description": "Indicates the placeholder for the left label",
91
+ "type": "string",
92
+ "title": "left"
93
+ },
94
+ "settings": {
95
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
96
+ "type": "boolean",
97
+ "title": "settings"
98
+ },
99
+ "label": {
100
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
101
+ "type": "string",
102
+ "title": "label"
103
+ },
104
+ "enabled": {
105
+ "description": "Indicates the value of the item if it affects config-ui\n(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)",
106
+ "type": "boolean",
107
+ "title": "enabled"
108
+ }
109
+ }
110
+ },
54
111
  "scoringType": {
55
112
  "title": "ConfigureProp",
56
113
  "type": "object",
@@ -162,6 +219,22 @@
162
219
  }
163
220
  }
164
221
  },
222
+ "withRubric": {
223
+ "title": "ConfigureProp",
224
+ "type": "object",
225
+ "properties": {
226
+ "settings": {
227
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
228
+ "type": "boolean",
229
+ "title": "settings"
230
+ },
231
+ "label": {
232
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
233
+ "type": "string",
234
+ "title": "label"
235
+ }
236
+ }
237
+ },
165
238
  "showPrompt": {
166
239
  "description": "Determines whether prompt field will be displayed or not",
167
240
  "default": true,
@@ -198,6 +271,47 @@
198
271
  }
199
272
  }
200
273
  },
274
+ "LabelsPlaceholderConfigProp": {
275
+ "title": "LabelsPlaceholderConfigProp",
276
+ "type": "object",
277
+ "properties": {
278
+ "top": {
279
+ "description": "This value is empty for charting. The property exist in order to be consistent with graphing configuration.",
280
+ "type": "string",
281
+ "title": "top"
282
+ },
283
+ "right": {
284
+ "description": "This value is empty for charting. The property exist in order to be consistent with graphing configuration.",
285
+ "type": "string",
286
+ "title": "right"
287
+ },
288
+ "bottom": {
289
+ "description": "Indicates the placeholder for the bottom label",
290
+ "type": "string",
291
+ "title": "bottom"
292
+ },
293
+ "left": {
294
+ "description": "Indicates the placeholder for the left label",
295
+ "type": "string",
296
+ "title": "left"
297
+ },
298
+ "settings": {
299
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
300
+ "type": "boolean",
301
+ "title": "settings"
302
+ },
303
+ "label": {
304
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
305
+ "type": "string",
306
+ "title": "label"
307
+ },
308
+ "enabled": {
309
+ "description": "Indicates the value of the item if it affects config-ui\n(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)",
310
+ "type": "boolean",
311
+ "title": "enabled"
312
+ }
313
+ }
314
+ },
201
315
  "ConfigurePropWithEnabled": {
202
316
  "title": "ConfigurePropWithEnabled",
203
317
  "type": "object",
@@ -38,6 +38,51 @@ Indicates if the item has to be displayed in the Settings Panel
38
38
 
39
39
  Indicates the label for the item that has to be displayed in the Settings Panel
40
40
 
41
+ # `titlePlaceholder` (object)
42
+
43
+ Properties of the `titlePlaceholder` object:
44
+
45
+ ## `settings` (boolean)
46
+
47
+ Indicates if the item has to be displayed in the Settings Panel
48
+
49
+ ## `label` (string)
50
+
51
+ Indicates the label for the item that has to be displayed in the Settings Panel
52
+
53
+ # `labelsPlaceholders` (object)
54
+
55
+ Properties of the `labelsPlaceholders` object:
56
+
57
+ ## `top` (string)
58
+
59
+ This value is empty for charting. The property exist in order to be consistent with graphing configuration.
60
+
61
+ ## `right` (string)
62
+
63
+ This value is empty for charting. The property exist in order to be consistent with graphing configuration.
64
+
65
+ ## `bottom` (string)
66
+
67
+ Indicates the placeholder for the bottom label
68
+
69
+ ## `left` (string)
70
+
71
+ Indicates the placeholder for the left label
72
+
73
+ ## `settings` (boolean)
74
+
75
+ Indicates if the item has to be displayed in the Settings Panel
76
+
77
+ ## `label` (string)
78
+
79
+ Indicates the label for the item that has to be displayed in the Settings Panel
80
+
81
+ ## `enabled` (boolean)
82
+
83
+ Indicates the value of the item if it affects config-ui
84
+ (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
85
+
41
86
  # `scoringType` (object)
42
87
 
43
88
  Properties of the `scoringType` object:
@@ -123,6 +168,18 @@ Indicates the max dimension for images in prompt - this is also the default dime
123
168
 
124
169
  Indicates the max dimension for images in rationale
125
170
 
171
+ # `withRubric` (object)
172
+
173
+ Properties of the `withRubric` object:
174
+
175
+ ## `settings` (boolean)
176
+
177
+ Indicates if the item has to be displayed in the Settings Panel
178
+
179
+ ## `label` (string)
180
+
181
+ Indicates the label for the item that has to be displayed in the Settings Panel
182
+
126
183
  # `showPrompt` (boolean)
127
184
 
128
185
  Determines whether prompt field will be displayed or not
@@ -159,6 +216,39 @@ Indicates if the item has to be displayed in the Settings Panel
159
216
 
160
217
  Indicates the label for the item that has to be displayed in the Settings Panel
161
218
 
219
+ ## `LabelsPlaceholderConfigProp` (object)
220
+
221
+ Properties of the `LabelsPlaceholderConfigProp` object:
222
+
223
+ ### `top` (string)
224
+
225
+ This value is empty for charting. The property exist in order to be consistent with graphing configuration.
226
+
227
+ ### `right` (string)
228
+
229
+ This value is empty for charting. The property exist in order to be consistent with graphing configuration.
230
+
231
+ ### `bottom` (string)
232
+
233
+ Indicates the placeholder for the bottom label
234
+
235
+ ### `left` (string)
236
+
237
+ Indicates the placeholder for the left label
238
+
239
+ ### `settings` (boolean)
240
+
241
+ Indicates if the item has to be displayed in the Settings Panel
242
+
243
+ ### `label` (string)
244
+
245
+ Indicates the label for the item that has to be displayed in the Settings Panel
246
+
247
+ ### `enabled` (boolean)
248
+
249
+ Indicates the value of the item if it affects config-ui
250
+ (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
251
+
162
252
  ## `ConfigurePropWithEnabled` (object)
163
253
 
164
254
  Properties of the `ConfigurePropWithEnabled` object:
@@ -57,4 +57,5 @@ exports.model = (id, element) => ({
57
57
  labelStep: 1,
58
58
  },
59
59
  title: 'This is a chart!',
60
+ rubricEnabled: false
60
61
  });
@@ -503,6 +503,11 @@
503
503
  "type": "boolean",
504
504
  "title": "teacherInstructionsEnabled"
505
505
  },
506
+ "rubricEnabled": {
507
+ "description": "Indicates if Rubric is enabled",
508
+ "type": "boolean",
509
+ "title": "rubricEnabled"
510
+ },
506
511
  "id": {
507
512
  "description": "Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.",
508
513
  "type": "string",
@@ -526,6 +531,7 @@
526
531
  "id",
527
532
  "range",
528
533
  "rationaleEnabled",
534
+ "rubricEnabled",
529
535
  "spellCheckEnabled",
530
536
  "studentInstructionsEnabled",
531
537
  "teacherInstructionsEnabled"
@@ -547,6 +553,47 @@
547
553
  }
548
554
  }
549
555
  },
556
+ "LabelsPlaceholderConfigProp": {
557
+ "title": "LabelsPlaceholderConfigProp",
558
+ "type": "object",
559
+ "properties": {
560
+ "top": {
561
+ "description": "This value is empty for charting. The property exist in order to be consistent with graphing configuration.",
562
+ "type": "string",
563
+ "title": "top"
564
+ },
565
+ "right": {
566
+ "description": "This value is empty for charting. The property exist in order to be consistent with graphing configuration.",
567
+ "type": "string",
568
+ "title": "right"
569
+ },
570
+ "bottom": {
571
+ "description": "Indicates the placeholder for the bottom label",
572
+ "type": "string",
573
+ "title": "bottom"
574
+ },
575
+ "left": {
576
+ "description": "Indicates the placeholder for the left label",
577
+ "type": "string",
578
+ "title": "left"
579
+ },
580
+ "settings": {
581
+ "description": "Indicates if the item has to be displayed in the Settings Panel",
582
+ "type": "boolean",
583
+ "title": "settings"
584
+ },
585
+ "label": {
586
+ "description": "Indicates the label for the item that has to be displayed in the Settings Panel",
587
+ "type": "string",
588
+ "title": "label"
589
+ },
590
+ "enabled": {
591
+ "description": "Indicates the value of the item if it affects config-ui\n(eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)",
592
+ "type": "boolean",
593
+ "title": "enabled"
594
+ }
595
+ }
596
+ },
550
597
  "ConfigurePropWithEnabled": {
551
598
  "title": "ConfigurePropWithEnabled",
552
599
  "type": "object",
@@ -166,6 +166,10 @@ Indicates if Student Instructions are enabled
166
166
 
167
167
  Indicates if Teacher Instructions are enabled
168
168
 
169
+ # `rubricEnabled` (boolean, required)
170
+
171
+ Indicates if Rubric is enabled
172
+
169
173
  # `id` (string, required)
170
174
 
171
175
  Identifier to identify the Pie Element in html markup, Must be unique within a pie item config.
@@ -192,6 +196,39 @@ Indicates if the item has to be displayed in the Settings Panel
192
196
 
193
197
  Indicates the label for the item that has to be displayed in the Settings Panel
194
198
 
199
+ ## `LabelsPlaceholderConfigProp` (object)
200
+
201
+ Properties of the `LabelsPlaceholderConfigProp` object:
202
+
203
+ ### `top` (string)
204
+
205
+ This value is empty for charting. The property exist in order to be consistent with graphing configuration.
206
+
207
+ ### `right` (string)
208
+
209
+ This value is empty for charting. The property exist in order to be consistent with graphing configuration.
210
+
211
+ ### `bottom` (string)
212
+
213
+ Indicates the placeholder for the bottom label
214
+
215
+ ### `left` (string)
216
+
217
+ Indicates the placeholder for the left label
218
+
219
+ ### `settings` (boolean)
220
+
221
+ Indicates if the item has to be displayed in the Settings Panel
222
+
223
+ ### `label` (string)
224
+
225
+ Indicates the label for the item that has to be displayed in the Settings Panel
226
+
227
+ ### `enabled` (boolean)
228
+
229
+ Indicates the value of the item if it affects config-ui
230
+ (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)
231
+
195
232
  ## `ConfigurePropWithEnabled` (object)
196
233
 
197
234
  Properties of the `ConfigurePropWithEnabled` object:
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "5.0.10",
7
+ "version": "5.0.11-next.173+d434ce108",
8
8
  "description": "",
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@material-ui/core": "^3.9.2",
15
15
  "@pie-framework/pie-player-events": "^0.1.0",
16
- "@pie-lib/charting": "^5.2.1",
16
+ "@pie-lib/charting": "^5.3.0",
17
17
  "@pie-lib/correct-answer-toggle": "^2.3.46",
18
18
  "@pie-lib/math-rendering": "^2.5.0",
19
19
  "@pie-lib/render-ui": "^4.13.6",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "author": "",
27
27
  "license": "ISC",
28
- "gitHead": "f60d1edac928da4682a9789000e3c8cf464348c0",
28
+ "gitHead": "d434ce108dd12cb05f72f676a79bbfba67944cb3",
29
29
  "main": "lib/index.js",
30
30
  "module": "src/index.js"
31
31
  }