@pie-element/multi-trait-rubric 3.16.3-next.0 → 3.16.3-next.2

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.
@@ -47,6 +47,8 @@ var _common = require("./common");
47
47
 
48
48
  var _modals = require("./modals");
49
49
 
50
+ var _debounce = _interopRequireDefault(require("lodash/debounce"));
51
+
50
52
  var _excluded = ["scorePointsDescriptors"],
51
53
  _excluded2 = ["scorePointsDescriptors"],
52
54
  _excluded3 = ["scorePointsDescriptors"],
@@ -124,6 +126,9 @@ var Main = /*#__PURE__*/function (_React$Component) {
124
126
  initialUpdateCompleted: false // flag to track the initial update of the div width
125
127
 
126
128
  });
129
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "updateDivWidthDebounced", (0, _debounce["default"])(function () {
130
+ return _this.updateDivWidth();
131
+ }, 50));
127
132
  (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onScaleAdded", function () {
128
133
  var _scales$;
129
134
 
@@ -402,7 +407,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
402
407
  (0, _createClass2["default"])(Main, [{
403
408
  key: "componentDidMount",
404
409
  value: function componentDidMount() {
405
- window.addEventListener('resize', this.updateDivWidth);
410
+ window.addEventListener('resize', this.updateDivWidthDebounced);
406
411
  window.addEventListener('load', this.updateDivWidth); // delay updateDivWidth to avoid having this.divRef.current = null at first load
407
412
 
408
413
  setTimeout(this.updateDivWidth, 0);
@@ -410,7 +415,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
410
415
  }, {
411
416
  key: "componentWillUnmount",
412
417
  value: function componentWillUnmount() {
413
- window.removeEventListener('resize', this.updateDivWidth);
418
+ window.removeEventListener('resize', this.updateDivWidthDebounced);
414
419
  window.removeEventListener('load', this.updateDivWidth);
415
420
  }
416
421
  }, {
@@ -428,9 +433,12 @@ var Main = /*#__PURE__*/function (_React$Component) {
428
433
  value: function updateDivWidth() {
429
434
  if (this.divRef && this.divRef.current) {
430
435
  var divWidth = this.divRef.current.offsetWidth;
431
- this.set({
432
- adjustedWidth: divWidth
433
- });
436
+
437
+ if (divWidth !== this.state.adjustedWidth) {
438
+ this.set({
439
+ adjustedWidth: divWidth
440
+ });
441
+ }
434
442
  }
435
443
  }
436
444
  }, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","MIN_WIDTH","styles","theme","design","fontFamily","fontSize","typography","ShowModal","showExcludeZeroDialog","excludeZero","changeExcludeZero","cancel","propTypes","PropTypes","bool","func","Main","props","showDecreaseMaxPointsDialog","showDeleteScaleDialog","showDeleteTraitDialog","showInfoDialog","infoDialogText","adjustedWidth","initialUpdateCompleted","model","onModelChanged","configuration","scales","maxNoOfScales","defaultTraitLabel","length","traitLabel","set","push","maxPoints","scorePointsLabels","traits","scaleIndex","params","Object","keys","forEach","key","minNoOfScales","slice","halfScoring","visibleToStudent","newState","setState","pointLabels","description","standards","excludeZeroType","newScales","reduce","acc","scale","excludeZeroTypes","remove0","map","scorePointsDescriptors","trait","add0","shiftLeft","shiftRight","hideToggleExcludeZeroModal","updatedModel","updatedProperty","showToggleExcludeZeroModal","divRef","React","createRef","updateDivWidth","bind","window","addEventListener","setTimeout","removeEventListener","state","current","divWidth","offsetWidth","onConfigurationChanged","uploadSoundSupport","imageSupport","addScale","baseInputConfiguration","dragAndDrop","contentDimensions","showDescription","showExcludeZero","showLevelTagInput","showStandards","showHalfScoring","showMaxPoint","showScorePointLabels","showVisibleToStudent","spellCheck","settingsPanelDisabled","maxNoOfTraits","minNoOfTraits","width","mathMlOptions","maxMaxPoints","expandedInput","labelInput","errors","spellCheckEnabled","maxPointsEnabled","addScaleEnabled","panelSettings","label","panelProperties","getPluginProps","assign","Settings","Properties","onScaleRemoved","onScaleChanged","enabled","inputConfiguration","onScaleAdded","Component","classes","object","shape","add","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;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0DE,gCAAC,kBAAD;AAAY,QAAA,IAAI,EAAErG,cAAlB;AAAkC,QAAA,IAAI,EAAEC,cAAxC;AAAwD,QAAA,OAAO,EAAE;AAAA,iBAAM,MAAI,CAACW,GAAL,CAAS;AAAEZ,YAAAA,cAAc,EAAE;AAAlB,WAAT,CAAN;AAAA;AAAjE,QA1DF,CADF;AA8DD;;;EArXuBkD,kBAAMoD,S;;;AAwXhC3G,IAAI,CAACJ,SAAL,GAAiB;AACfgH,EAAAA,OAAO,EAAE/G,sBAAUgH,MADJ;AAEfpG,EAAAA,KAAK,EAAEZ,sBAAUgH,MAFF;AAGfzC,EAAAA,kBAAkB,EAAEvE,sBAAUgH,MAHf;AAIflG,EAAAA,aAAa,EAAEd,sBAAUgH,MAJV;AAKfnG,EAAAA,cAAc,EAAEb,sBAAUE,IALX;AAMfoE,EAAAA,sBAAsB,EAAEtE,sBAAUE,IANnB;AAOfsE,EAAAA,YAAY,EAAExE,sBAAUiH,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAElH,sBAAUE,IAAV,CAAeiH,UADQ;AAE5B,cAAQnH,sBAAUE,IAAV,CAAeiH;AAFK,GAAhB;AAPC,CAAjB;;eAae,2BAAgB,wBAAW/H,MAAX,EAAmBe,IAAnB,CAAhB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEmpty from 'lodash/isEmpty';\n\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { withDragContext } from '@pie-lib/pie-toolbox/drag';\nimport { layout, settings } from '@pie-lib/pie-toolbox/config-ui';\n\nimport Scale from './scale';\nimport { MultiTraitButton } from './common';\nimport { ExcludeZeroDialog, excludeZeroTypes, IncludeZeroDialog, InfoDialog } from './modals';\n\nconst { Panel, toggle } = settings;\nconst MIN_WIDTH = '650px';\n\nconst styles = (theme) => ({\n design: {\n fontFamily: 'Cerebri Sans',\n fontSize: theme.typography.fontSize,\n },\n});\n\nconst ShowModal = ({ showExcludeZeroDialog, excludeZero, changeExcludeZero, cancel }) => {\n if (showExcludeZeroDialog && !excludeZero) {\n return (\n <ExcludeZeroDialog\n open={showExcludeZeroDialog && !excludeZero}\n changeExcludeZero={changeExcludeZero}\n cancel={cancel}\n />\n );\n } else if (showExcludeZeroDialog && excludeZero) {\n return (\n <IncludeZeroDialog\n open={showExcludeZeroDialog && excludeZero}\n changeExcludeZero={changeExcludeZero}\n cancel={cancel}\n />\n );\n } else {\n return null;\n }\n};\n\nShowModal.propTypes = {\n showExcludeZeroDialog: PropTypes.bool,\n excludeZero: PropTypes.bool,\n changeExcludeZero: PropTypes.func,\n cancel: PropTypes.func,\n};\n\nexport class Main extends React.Component {\n constructor(props) {\n super(props);\n this.divRef = React.createRef();\n this.updateDivWidth = this.updateDivWidth.bind(this);\n }\n\n state = {\n showDecreaseMaxPointsDialog: false,\n showDeleteScaleDialog: false,\n showDeleteTraitDialog: false,\n showExcludeZeroDialog: false,\n showInfoDialog: false,\n infoDialogText: '',\n adjustedWidth: MIN_WIDTH,\n initialUpdateCompleted: false, // flag to track the initial update of the div width\n };\n\n componentDidMount() {\n window.addEventListener('resize', this.updateDivWidth);\n window.addEventListener('load', this.updateDivWidth);\n\n // delay updateDivWidth to avoid having this.divRef.current = null at first load\n setTimeout(this.updateDivWidth, 0);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.updateDivWidth);\n window.removeEventListener('load', this.updateDivWidth);\n }\n\n componentDidUpdate() {\n if (!this.state.initialUpdateCompleted) {\n this.updateDivWidth();\n this.setState({ initialUpdateCompleted: true });\n }\n }\n\n updateDivWidth() {\n if (this.divRef && this.divRef.current) {\n const divWidth = this.divRef.current.offsetWidth;\n this.set({\n adjustedWidth: divWidth,\n });\n }\n }\n\n onScaleAdded = () => {\n const { model, onModelChanged, configuration } = this.props;\n let { scales, excludeZero } = model || {};\n const { maxNoOfScales } = configuration || {};\n let { defaultTraitLabel } = configuration || '';\n\n if (!scales.length) {\n scales = [];\n }\n\n // if no default trait label is defined, take the trait label of the first scale\n defaultTraitLabel = typeof defaultTraitLabel === 'string' ? defaultTraitLabel : scales[0]?.traitLabel || '';\n\n if (scales.length === maxNoOfScales) {\n this.set({\n infoDialogText: `There can't be more than ${maxNoOfScales} scales.`,\n showInfoDialog: true,\n });\n\n return false;\n }\n\n scales.push({\n maxPoints: 1,\n scorePointsLabels: excludeZero ? [''] : ['', ''],\n traitLabel: defaultTraitLabel,\n traits: [],\n });\n\n onModelChanged({ ...model, scales });\n };\n\n onScaleChanged = (scaleIndex, params) => {\n const { model, onModelChanged } = this.props;\n const scales = cloneDeep((model || {}).scales);\n\n if (scaleIndex < 0 || scaleIndex >= scales.length || isEmpty(params)) return false;\n\n Object.keys(params).forEach((key) => {\n scales[scaleIndex][key] = params[key];\n });\n\n onModelChanged({ ...model, scales });\n };\n\n onScaleRemoved = (scaleIndex) => {\n const { model, onModelChanged, configuration } = this.props;\n let { scales } = model || {};\n const { minNoOfScales } = configuration || {};\n\n if (scaleIndex < 0 || scaleIndex >= scales.length) return false;\n\n if (scales.length === minNoOfScales) {\n this.set({\n infoDialogText: `There can't be less than ${minNoOfScales} scales.`,\n showInfoDialog: true,\n });\n\n return false;\n }\n\n scales = [...scales.slice(0, scaleIndex), ...scales.slice(scaleIndex + 1)];\n\n onModelChanged({ ...model, scales });\n };\n\n onHalfScoringChanged = () => {\n const { model, onModelChanged } = this.props;\n let { halfScoring } = model || {};\n\n onModelChanged({ ...model, halfScoring: !halfScoring });\n };\n\n onVisibleToStudentChanged = () => {\n const { model, onModelChanged } = this.props;\n let { visibleToStudent } = model || {};\n\n onModelChanged({ ...model, visibleToStudent: !visibleToStudent });\n };\n\n set = (newState) => this.setState(newState);\n\n changeShowScorePointLabels = () => {\n const { model, onModelChanged } = this.props || {};\n let { pointLabels } = model || {};\n\n pointLabels = !pointLabels;\n\n onModelChanged({ ...model, pointLabels });\n };\n\n changeShowDescription = () => {\n const { model, onModelChanged } = this.props || {};\n let { description } = model || {};\n\n description = !description;\n\n onModelChanged({ ...model, description });\n };\n\n changeShowStandards = () => {\n const { model, onModelChanged } = this.props || {};\n let { standards } = model || {};\n\n standards = !standards;\n\n onModelChanged({ ...model, standards });\n };\n\n // Exclude Zero\n showToggleExcludeZeroModal = () => this.set({ showExcludeZeroDialog: true });\n\n hideToggleExcludeZeroModal = () => {\n this.set({ showExcludeZeroDialog: false });\n };\n\n onCloseInfoDialog = () => this.set({ showInfoDialog: false });\n\n changeExcludeZero = (excludeZeroType) => {\n const { model, onModelChanged } = this.props || {};\n const { scales } = model || {};\n let { excludeZero } = model || {};\n\n if (!scales || !scales.length) return;\n\n excludeZero = !excludeZero;\n\n const newScales = scales.reduce((acc, scale) => {\n let { scorePointsLabels, traits } = scale || {};\n\n if (scorePointsLabels.length < 1) return acc;\n\n switch (excludeZeroType) {\n case excludeZeroTypes.remove0: {\n // removes column 0\n scorePointsLabels = scorePointsLabels.slice(1);\n traits = traits.map(({ scorePointsDescriptors, ...trait }) => ({\n ...trait,\n scorePointsDescriptors: scorePointsDescriptors.slice(1),\n }));\n\n break;\n }\n\n case excludeZeroTypes.add0: {\n // adds empty column at start\n scorePointsLabels = ['', ...scorePointsLabels];\n traits = traits.map(({ scorePointsDescriptors, ...trait }) => ({\n ...trait,\n scorePointsDescriptors: ['', ...scorePointsDescriptors],\n }));\n\n break;\n }\n\n case excludeZeroTypes.shiftLeft: {\n // removes last column\n scorePointsLabels = scorePointsLabels.slice(0, -1);\n traits = traits.map(({ scorePointsDescriptors, ...trait }) => ({\n ...trait,\n scorePointsDescriptors: scorePointsDescriptors.slice(0, -1),\n }));\n\n break;\n }\n\n case excludeZeroTypes.shiftRight: {\n // adds empty column at end\n scorePointsLabels = [...scorePointsLabels, ''];\n traits = traits.map(({ scorePointsDescriptors, ...trait }) => ({\n ...trait,\n scorePointsDescriptors: [...scorePointsDescriptors, ''],\n }));\n\n break;\n }\n\n default:\n break;\n }\n\n acc.push({ ...scale, scorePointsLabels, traits });\n\n return acc;\n }, []);\n\n onModelChanged({ ...model, scales: newScales, excludeZero });\n\n this.hideToggleExcludeZeroModal();\n };\n\n onModelChanged = (updatedModel, updatedProperty) => {\n const { onModelChanged } = this.props || {};\n\n if (updatedProperty === 'excludeZero') {\n this.showToggleExcludeZeroModal();\n } else {\n onModelChanged(updatedModel);\n }\n };\n\n render() {\n const { model, configuration, onConfigurationChanged, uploadSoundSupport, imageSupport } = this.props || {};\n const {\n addScale,\n baseInputConfiguration = {},\n dragAndDrop,\n contentDimensions = {},\n showDescription,\n showExcludeZero,\n showLevelTagInput,\n showStandards,\n showHalfScoring,\n showMaxPoint,\n showScorePointLabels,\n showVisibleToStudent,\n spellCheck = {},\n settingsPanelDisabled,\n maxNoOfTraits,\n minNoOfTraits,\n width,\n mathMlOptions = {},\n maxMaxPoints,\n expandedInput = {},\n labelInput = {},\n } = configuration || {};\n const {\n errors,\n scales,\n excludeZero,\n description,\n pointLabels,\n standards,\n spellCheckEnabled,\n maxPointsEnabled,\n addScaleEnabled,\n } = model || {};\n const { showExcludeZeroDialog, showInfoDialog, infoDialogText, adjustedWidth } = this.state || {};\n\n const panelSettings = {\n standards: showStandards.settings && toggle(showStandards.label),\n 'showLevelTagInput.enabled': showLevelTagInput.settings && toggle(showLevelTagInput.label, true),\n visibleToStudent: showVisibleToStudent.settings && toggle(showVisibleToStudent.label),\n excludeZero: showExcludeZero.settings && toggle(showExcludeZero.label),\n halfScoring: showHalfScoring.settings && toggle(showHalfScoring.label),\n 'dragAndDrop.enabled': dragAndDrop.settings && toggle(dragAndDrop.label, true),\n };\n const panelProperties = {\n description: showDescription.settings && toggle(showDescription.label),\n pointLabels: showScorePointLabels.settings && toggle(showScorePointLabels.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),\n addScaleEnabled: addScale.settings && toggle(addScale.label),\n };\n\n const getPluginProps = (props) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={this.onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n modal={\n <ShowModal\n showExcludeZeroDialog={showExcludeZeroDialog}\n excludeZero={excludeZero}\n changeExcludeZero={this.changeExcludeZero}\n cancel={this.hideToggleExcludeZeroModal}\n ></ShowModal>\n }\n />\n }\n >\n <div style={{ width: '100%' }} ref={this.divRef} />\n <div style={{ width: width || adjustedWidth }}>\n {(scales || []).map((scale, scaleIndex) => (\n <Scale\n key={`scale-${scaleIndex}`}\n scale={scale}\n scaleIndex={scaleIndex}\n errors={errors}\n onScaleRemoved={this.onScaleRemoved}\n onScaleChanged={this.onScaleChanged}\n showStandards={standards}\n showScorePointLabels={pointLabels}\n showDescription={description}\n showLevelTagInput={showLevelTagInput.enabled}\n excludeZero={excludeZero}\n enableDragAndDrop={dragAndDrop.enabled}\n spellCheck={spellCheckEnabled}\n width={adjustedWidth}\n uploadSoundSupport={uploadSoundSupport}\n maxPointsEnabled={maxPointsEnabled}\n maxNoOfTraits={maxNoOfTraits}\n minNoOfTraits={minNoOfTraits}\n imageSupport={imageSupport}\n {...this.props}\n classes={{}}\n mathMlOptions={mathMlOptions}\n maxMaxPoints={maxMaxPoints}\n expandedPluginProps={getPluginProps(expandedInput?.inputConfiguration)}\n labelPluginProps={getPluginProps(labelInput?.inputConfiguration)}\n />\n ))}\n {addScaleEnabled && <MultiTraitButton onClick={this.onScaleAdded}>Add Scale</MultiTraitButton>}\n </div>\n\n <InfoDialog open={showInfoDialog} text={infoDialogText} onClose={() => this.set({ showInfoDialog: false })} />\n </layout.ConfigLayout>\n );\n }\n}\n\nMain.propTypes = {\n classes: PropTypes.object,\n model: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n configuration: PropTypes.object,\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n};\n\nexport default withDragContext(withStyles(styles)(Main));\n"],"file":"main.js"}
1
+ {"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","MIN_WIDTH","styles","theme","design","fontFamily","fontSize","typography","ShowModal","showExcludeZeroDialog","excludeZero","changeExcludeZero","cancel","propTypes","PropTypes","bool","func","Main","props","showDecreaseMaxPointsDialog","showDeleteScaleDialog","showDeleteTraitDialog","showInfoDialog","infoDialogText","adjustedWidth","initialUpdateCompleted","updateDivWidth","model","onModelChanged","configuration","scales","maxNoOfScales","defaultTraitLabel","length","traitLabel","set","push","maxPoints","scorePointsLabels","traits","scaleIndex","params","Object","keys","forEach","key","minNoOfScales","slice","halfScoring","visibleToStudent","newState","setState","pointLabels","description","standards","excludeZeroType","newScales","reduce","acc","scale","excludeZeroTypes","remove0","map","scorePointsDescriptors","trait","add0","shiftLeft","shiftRight","hideToggleExcludeZeroModal","updatedModel","updatedProperty","showToggleExcludeZeroModal","divRef","React","createRef","bind","window","addEventListener","updateDivWidthDebounced","setTimeout","removeEventListener","state","current","divWidth","offsetWidth","onConfigurationChanged","uploadSoundSupport","imageSupport","addScale","baseInputConfiguration","dragAndDrop","contentDimensions","showDescription","showExcludeZero","showLevelTagInput","showStandards","showHalfScoring","showMaxPoint","showScorePointLabels","showVisibleToStudent","spellCheck","settingsPanelDisabled","maxNoOfTraits","minNoOfTraits","width","mathMlOptions","maxMaxPoints","expandedInput","labelInput","errors","spellCheckEnabled","maxPointsEnabled","addScaleEnabled","panelSettings","label","panelProperties","getPluginProps","assign","Settings","Properties","onScaleRemoved","onScaleChanged","enabled","inputConfiguration","onScaleAdded","Component","classes","object","shape","add","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AAEA;;AACA;;AAEA;;AACA;;AACA;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B,CAxBvC;AAyBI,UAAA,gBAAgB,EAAEP,cAAc,CAACR,UAAD,aAACA,UAAD,uBAACA,UAAU,CAAEe,kBAAb;AAzBpC,WADgB;AAAA,OAAnB,CADL,EA8BKX,eAAe,iBAAI,gCAAC,wBAAD;AAAkB,QAAA,OAAO,EAAE,KAAKY;AAAhC,qBA9BxB,CAzBJ,eA0DI,gCAAC,kBAAD;AAAY,QAAA,IAAI,EAAEtG,cAAlB;AAAkC,QAAA,IAAI,EAAEC,cAAxC;AACY,QAAA,OAAO,EAAE;AAAA,iBAAM,MAAI,CAACY,GAAL,CAAS;AAACb,YAAAA,cAAc,EAAE;AAAjB,WAAT,CAAN;AAAA;AADrB,QA1DJ,CADJ;AA+DH;;;EA1XqBmD,kBAAMoD,S;;;AA6XhC5G,IAAI,CAACJ,SAAL,GAAiB;AACbiH,EAAAA,OAAO,EAAEhH,sBAAUiH,MADN;AAEbpG,EAAAA,KAAK,EAAEb,sBAAUiH,MAFJ;AAGbzC,EAAAA,kBAAkB,EAAExE,sBAAUiH,MAHjB;AAIblG,EAAAA,aAAa,EAAEf,sBAAUiH,MAJZ;AAKbnG,EAAAA,cAAc,EAAEd,sBAAUE,IALb;AAMbqE,EAAAA,sBAAsB,EAAEvE,sBAAUE,IANrB;AAObuE,EAAAA,YAAY,EAAEzE,sBAAUkH,KAAV,CAAgB;AAC1BC,IAAAA,GAAG,EAAEnH,sBAAUE,IAAV,CAAekH,UADM;AAE1B,cAAQpH,sBAAUE,IAAV,CAAekH;AAFG,GAAhB;AAPD,CAAjB;;eAae,2BAAgB,wBAAWhI,MAAX,EAAmBe,IAAnB,CAAhB,C","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEmpty from 'lodash/isEmpty';\n\nimport {withStyles} from '@material-ui/core/styles';\n\nimport {withDragContext} from '@pie-lib/pie-toolbox/drag';\nimport {layout, settings} from '@pie-lib/pie-toolbox/config-ui';\n\nimport Scale from './scale';\nimport {MultiTraitButton} from './common';\nimport {ExcludeZeroDialog, excludeZeroTypes, IncludeZeroDialog, InfoDialog} from './modals';\nimport debounce from 'lodash/debounce';\n\nconst {Panel, toggle} = settings;\nconst MIN_WIDTH = '650px';\n\nconst styles = (theme) => ({\n design: {\n fontFamily: 'Cerebri Sans',\n fontSize: theme.typography.fontSize,\n },\n});\n\nconst ShowModal = ({showExcludeZeroDialog, excludeZero, changeExcludeZero, cancel}) => {\n if (showExcludeZeroDialog && !excludeZero) {\n return (\n <ExcludeZeroDialog\n open={showExcludeZeroDialog && !excludeZero}\n changeExcludeZero={changeExcludeZero}\n cancel={cancel}\n />\n );\n } else if (showExcludeZeroDialog && excludeZero) {\n return (\n <IncludeZeroDialog\n open={showExcludeZeroDialog && excludeZero}\n changeExcludeZero={changeExcludeZero}\n cancel={cancel}\n />\n );\n } else {\n return null;\n }\n};\n\nShowModal.propTypes = {\n showExcludeZeroDialog: PropTypes.bool,\n excludeZero: PropTypes.bool,\n changeExcludeZero: PropTypes.func,\n cancel: PropTypes.func,\n};\n\nexport class Main extends React.Component {\n constructor(props) {\n super(props);\n this.divRef = React.createRef();\n this.updateDivWidth = this.updateDivWidth.bind(this);\n }\n\n state = {\n showDecreaseMaxPointsDialog: false,\n showDeleteScaleDialog: false,\n showDeleteTraitDialog: false,\n showExcludeZeroDialog: false,\n showInfoDialog: false,\n infoDialogText: '',\n adjustedWidth: MIN_WIDTH,\n initialUpdateCompleted: false, // flag to track the initial update of the div width\n };\n\n componentDidMount() {\n window.addEventListener('resize', this.updateDivWidthDebounced);\n window.addEventListener('load', this.updateDivWidth);\n\n // delay updateDivWidth to avoid having this.divRef.current = null at first load\n setTimeout(this.updateDivWidth, 0);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.updateDivWidthDebounced);\n window.removeEventListener('load', this.updateDivWidth);\n }\n\n componentDidUpdate() {\n if (!this.state.initialUpdateCompleted) {\n this.updateDivWidth();\n this.setState({initialUpdateCompleted: true});\n }\n }\n\n updateDivWidth() {\n if (this.divRef && this.divRef.current) {\n const divWidth = this.divRef.current.offsetWidth;\n if (divWidth !== this.state.adjustedWidth) {\n this.set({\n adjustedWidth: divWidth,\n });\n }\n }\n }\n\n updateDivWidthDebounced = debounce(() => this.updateDivWidth(), 50);\n\n onScaleAdded = () => {\n const {model, onModelChanged, configuration} = this.props;\n let {scales, excludeZero} = model || {};\n const {maxNoOfScales} = configuration || {};\n let {defaultTraitLabel} = configuration || '';\n\n if (!scales.length) {\n scales = [];\n }\n\n // if no default trait label is defined, take the trait label of the first scale\n defaultTraitLabel = typeof defaultTraitLabel === 'string' ? defaultTraitLabel : scales[0]?.traitLabel || '';\n\n if (scales.length === maxNoOfScales) {\n this.set({\n infoDialogText: `There can't be more than ${maxNoOfScales} scales.`,\n showInfoDialog: true,\n });\n\n return false;\n }\n\n scales.push({\n maxPoints: 1,\n scorePointsLabels: excludeZero ? [''] : ['', ''],\n traitLabel: defaultTraitLabel,\n traits: [],\n });\n\n onModelChanged({...model, scales});\n };\n\n onScaleChanged = (scaleIndex, params) => {\n const {model, onModelChanged} = this.props;\n const scales = cloneDeep((model || {}).scales);\n\n if (scaleIndex < 0 || scaleIndex >= scales.length || isEmpty(params)) return false;\n\n Object.keys(params).forEach((key) => {\n scales[scaleIndex][key] = params[key];\n });\n\n onModelChanged({...model, scales});\n };\n\n onScaleRemoved = (scaleIndex) => {\n const {model, onModelChanged, configuration} = this.props;\n let {scales} = model || {};\n const {minNoOfScales} = configuration || {};\n\n if (scaleIndex < 0 || scaleIndex >= scales.length) return false;\n\n if (scales.length === minNoOfScales) {\n this.set({\n infoDialogText: `There can't be less than ${minNoOfScales} scales.`,\n showInfoDialog: true,\n });\n\n return false;\n }\n\n scales = [...scales.slice(0, scaleIndex), ...scales.slice(scaleIndex + 1)];\n\n onModelChanged({...model, scales});\n };\n\n onHalfScoringChanged = () => {\n const {model, onModelChanged} = this.props;\n let {halfScoring} = model || {};\n\n onModelChanged({...model, halfScoring: !halfScoring});\n };\n\n onVisibleToStudentChanged = () => {\n const {model, onModelChanged} = this.props;\n let {visibleToStudent} = model || {};\n\n onModelChanged({...model, visibleToStudent: !visibleToStudent});\n };\n\n set = (newState) => this.setState(newState);\n\n changeShowScorePointLabels = () => {\n const {model, onModelChanged} = this.props || {};\n let {pointLabels} = model || {};\n\n pointLabels = !pointLabels;\n\n onModelChanged({...model, pointLabels});\n };\n\n changeShowDescription = () => {\n const {model, onModelChanged} = this.props || {};\n let {description} = model || {};\n\n description = !description;\n\n onModelChanged({...model, description});\n };\n\n changeShowStandards = () => {\n const {model, onModelChanged} = this.props || {};\n let {standards} = model || {};\n\n standards = !standards;\n\n onModelChanged({...model, standards});\n };\n\n // Exclude Zero\n showToggleExcludeZeroModal = () => this.set({showExcludeZeroDialog: true});\n\n hideToggleExcludeZeroModal = () => {\n this.set({showExcludeZeroDialog: false});\n };\n\n onCloseInfoDialog = () => this.set({showInfoDialog: false});\n\n changeExcludeZero = (excludeZeroType) => {\n const {model, onModelChanged} = this.props || {};\n const {scales} = model || {};\n let {excludeZero} = model || {};\n\n if (!scales || !scales.length) return;\n\n excludeZero = !excludeZero;\n\n const newScales = scales.reduce((acc, scale) => {\n let {scorePointsLabels, traits} = scale || {};\n\n if (scorePointsLabels.length < 1) return acc;\n\n switch (excludeZeroType) {\n case excludeZeroTypes.remove0: {\n // removes column 0\n scorePointsLabels = scorePointsLabels.slice(1);\n traits = traits.map(({scorePointsDescriptors, ...trait}) => ({\n ...trait,\n scorePointsDescriptors: scorePointsDescriptors.slice(1),\n }));\n\n break;\n }\n\n case excludeZeroTypes.add0: {\n // adds empty column at start\n scorePointsLabels = ['', ...scorePointsLabels];\n traits = traits.map(({scorePointsDescriptors, ...trait}) => ({\n ...trait,\n scorePointsDescriptors: ['', ...scorePointsDescriptors],\n }));\n\n break;\n }\n\n case excludeZeroTypes.shiftLeft: {\n // removes last column\n scorePointsLabels = scorePointsLabels.slice(0, -1);\n traits = traits.map(({scorePointsDescriptors, ...trait}) => ({\n ...trait,\n scorePointsDescriptors: scorePointsDescriptors.slice(0, -1),\n }));\n\n break;\n }\n\n case excludeZeroTypes.shiftRight: {\n // adds empty column at end\n scorePointsLabels = [...scorePointsLabels, ''];\n traits = traits.map(({scorePointsDescriptors, ...trait}) => ({\n ...trait,\n scorePointsDescriptors: [...scorePointsDescriptors, ''],\n }));\n\n break;\n }\n\n default:\n break;\n }\n\n acc.push({...scale, scorePointsLabels, traits});\n\n return acc;\n }, []);\n\n onModelChanged({...model, scales: newScales, excludeZero});\n\n this.hideToggleExcludeZeroModal();\n };\n\n onModelChanged = (updatedModel, updatedProperty) => {\n const {onModelChanged} = this.props || {};\n\n if (updatedProperty === 'excludeZero') {\n this.showToggleExcludeZeroModal();\n } else {\n onModelChanged(updatedModel);\n }\n };\n\n render() {\n const {model, configuration, onConfigurationChanged, uploadSoundSupport, imageSupport} = this.props || {};\n const {\n addScale,\n baseInputConfiguration = {},\n dragAndDrop,\n contentDimensions = {},\n showDescription,\n showExcludeZero,\n showLevelTagInput,\n showStandards,\n showHalfScoring,\n showMaxPoint,\n showScorePointLabels,\n showVisibleToStudent,\n spellCheck = {},\n settingsPanelDisabled,\n maxNoOfTraits,\n minNoOfTraits,\n width,\n mathMlOptions = {},\n maxMaxPoints,\n expandedInput = {},\n labelInput = {},\n } = configuration || {};\n const {\n errors,\n scales,\n excludeZero,\n description,\n pointLabels,\n standards,\n spellCheckEnabled,\n maxPointsEnabled,\n addScaleEnabled,\n } = model || {};\n const {showExcludeZeroDialog, showInfoDialog, infoDialogText, adjustedWidth} = this.state || {};\n\n const panelSettings = {\n standards: showStandards.settings && toggle(showStandards.label),\n 'showLevelTagInput.enabled': showLevelTagInput.settings && toggle(showLevelTagInput.label, true),\n visibleToStudent: showVisibleToStudent.settings && toggle(showVisibleToStudent.label),\n excludeZero: showExcludeZero.settings && toggle(showExcludeZero.label),\n halfScoring: showHalfScoring.settings && toggle(showHalfScoring.label),\n 'dragAndDrop.enabled': dragAndDrop.settings && toggle(dragAndDrop.label, true),\n };\n const panelProperties = {\n description: showDescription.settings && toggle(showDescription.label),\n pointLabels: showScorePointLabels.settings && toggle(showScorePointLabels.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n maxPointsEnabled: showMaxPoint.settings && toggle(showMaxPoint.label),\n addScaleEnabled: addScale.settings && toggle(addScale.label),\n };\n\n const getPluginProps = (props) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\n\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={this.onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n modal={\n <ShowModal\n showExcludeZeroDialog={showExcludeZeroDialog}\n excludeZero={excludeZero}\n changeExcludeZero={this.changeExcludeZero}\n cancel={this.hideToggleExcludeZeroModal}\n ></ShowModal>\n }\n />\n }\n >\n <div style={{width: '100%'}} ref={this.divRef}/>\n <div style={{width: width || adjustedWidth}}>\n {(scales || []).map((scale, scaleIndex) => (\n <Scale\n key={`scale-${scaleIndex}`}\n scale={scale}\n scaleIndex={scaleIndex}\n errors={errors}\n onScaleRemoved={this.onScaleRemoved}\n onScaleChanged={this.onScaleChanged}\n showStandards={standards}\n showScorePointLabels={pointLabels}\n showDescription={description}\n showLevelTagInput={showLevelTagInput.enabled}\n excludeZero={excludeZero}\n enableDragAndDrop={dragAndDrop.enabled}\n spellCheck={spellCheckEnabled}\n width={adjustedWidth}\n uploadSoundSupport={uploadSoundSupport}\n maxPointsEnabled={maxPointsEnabled}\n maxNoOfTraits={maxNoOfTraits}\n minNoOfTraits={minNoOfTraits}\n imageSupport={imageSupport}\n {...this.props}\n classes={{}}\n mathMlOptions={mathMlOptions}\n maxMaxPoints={maxMaxPoints}\n expandedPluginProps={getPluginProps(expandedInput?.inputConfiguration)}\n labelPluginProps={getPluginProps(labelInput?.inputConfiguration)}\n />\n ))}\n {addScaleEnabled && <MultiTraitButton onClick={this.onScaleAdded}>Add Scale</MultiTraitButton>}\n </div>\n\n <InfoDialog open={showInfoDialog} text={infoDialogText}\n onClose={() => this.set({showInfoDialog: false})}/>\n </layout.ConfigLayout>\n );\n }\n}\n\nMain.propTypes = {\n classes: PropTypes.object,\n model: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n configuration: PropTypes.object,\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n};\n\nexport default withDragContext(withStyles(styles)(Main));\n"],"file":"main.js"}
@@ -1,180 +1,117 @@
1
1
  exports.model = (id, element) => ({
2
- id,
3
- element,
4
- visibleToStudent: true,
5
- halfScoring: false,
6
- excludeZero: true,
7
- pointLabels: true,
8
- description: false,
9
- standards: false,
10
- maxPointsEnabled: true,
11
- addScaleEnabled: true,
12
- scales: [
2
+ "visibleToStudent": true,
3
+ "halfScoring": false,
4
+ "pointLabels": true,
5
+ "description": false,
6
+ "standards": false,
7
+ "scales": [
13
8
  {
14
- maxPoints: 4,
15
- scorePointsLabels: ['Non-Scorable', 'Developing', 'Progressing', 'Effective', 'Strong'],
16
- traitLabel: 'Trait',
17
- traits: [
9
+ "maxPoints": 4,
10
+ "scorePointsLabels": [
11
+ "<div>Non-Scorable</div>",
12
+ "<div>Developing</div>",
13
+ "<div>Progressing</div>",
14
+ "<div>Effective</div>"
15
+ ],
16
+ "traitLabel": "Trait",
17
+ "traits": [
18
18
  {
19
- name: 'Ideas',
20
- standards: [],
21
- description: 'the main message',
22
- scorePointsDescriptors: [
23
- 'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
24
- 'Topic undefined and/or difficult to follow\n' + '\n' + 'Details are unclear',
25
- 'Topic too broad\n' + '\n' + 'Details are limited',
26
- 'Writing stays on topic\n' + '\n' + 'Complete details given',
27
- 'Strong control of topic\n' + '\n' + 'Relevant, accurate, specific details that support topic',
28
- ],
19
+ "name": "<div>Ideas</div>",
20
+ "standards": [],
21
+ "description": "the main message",
22
+ "scorePointsDescriptors": [
23
+ "<div>Student’s response is blank, not in English, not legible, or does not respond to the prompt.</div>",
24
+ "<div>Topic undefined and/or difficult to followDetails are unclear</div>",
25
+ "<div>Topic too broadDetails are limited</div>",
26
+ "<div>Writing stays on topicComplete details given</div>"
27
+ ]
29
28
  },
30
29
  {
31
- name: 'Organization',
32
- standards: [],
33
- description: 'the internal structure of the piece',
34
- scorePointsDescriptors: [
35
- 'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
36
- 'Does not have a beginning, middle and/or end\n' +
37
- '\n' +
38
- 'Does not have a lead and/or conclusion\n' +
39
- '\n' +
40
- 'Transitions confusing and/or not present\n' +
41
- '\n' +
42
- 'Not written in logical order\n' +
43
- '\n' +
44
- 'No sign of paragraphing / incorrect paragraphing',
45
- 'Weak beginning, middle and end\n' +
46
- '\n' +
47
- 'Has evidence of a lead and/or conclusion but missing elements\n' +
48
- '\n' +
49
- 'Transitions are used sometimes\n' +
50
- '\n' +
51
- 'Some logical order\n' +
52
- '\n' +
53
- 'Most paragraphing incorrect',
54
- 'Has an acceptable beginning, middle and end\n' +
55
- '\n' +
56
- 'Includes a lead and conclusion\n' +
57
- '\n' +
58
- 'Transitions are used correctly\n' +
59
- '\n' +
60
- 'Mostly logical order\n' +
61
- '\n' +
62
- 'Mostly correct paragraphing',
63
- 'Has an effective beginning, middle and end\n' +
64
- '\n' +
65
- 'Powerful introduction / lead and conclusion\n' +
66
- '\n' +
67
- 'Effective transitions\n' +
68
- '\n' +
69
- 'Logical order / sequencing\n' +
70
- '\n' +
71
- 'Uses appropriate paragraphing',
72
- ],
30
+ "name": "<div>Organization</div>",
31
+ "standards": [],
32
+ "description": "the internal structure of the piece",
33
+ "scorePointsDescriptors": [
34
+ "<div>Student’s response is blank, not in English, not legible, or does not respond to the prompt.</div>",
35
+ "<div>Does not have a beginning, middle and/or endDoes not have a lead and/or conclusionTransitions confusing and/or not presentNot written in logical orderNo sign of paragraphing / incorrect paragraphing</div>",
36
+ "<div>Weak beginning, middle and endHas evidence of a lead and/or conclusion but missing elementsTransitions are used sometimesSome logical orderMost paragraphing incorrect</div>",
37
+ "<div>Has an acceptable beginning, middle and endIncludes a lead and conclusionTransitions are used correctlyMostly logical orderMostly correct paragraphing</div>"
38
+ ]
73
39
  },
74
40
  {
75
- name: 'Word Choice',
76
- standards: [],
77
- description: 'the vocabulary a writer chooses to convey meaning',
78
- scorePointsDescriptors: [
79
- 'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
80
- 'Vocabulary is limited/used incorrectly\n' + '\n' + 'No figurative language; words do not convey meaning',
81
- 'Generally correct words\n' +
82
- '\n' +
83
- 'Attempt at figurative language\n' +
84
- '\n' +
85
- 'and/or words convey general meaning',
86
- 'Some active verbs and precise nouns\n' +
87
- '\n' +
88
- 'Effective use of figurative language and/or words that enhance meaning',
89
- 'Powerful and engaging words\n' + '\n' + 'Artful use of figurative language and/or sensory detail',
90
- ],
41
+ "name": "<div>Word Choice</div>",
42
+ "standards": [],
43
+ "description": "the vocabulary a writer chooses to convey meaning",
44
+ "scorePointsDescriptors": [
45
+ "<div>Student’s response is blank, not in English, not legible, or does not respond to the prompt.</div>",
46
+ "<div>Vocabulary is limited/used incorrectlyNo figurative language; words do not convey meaning</div>",
47
+ "<div>Generally correct wordsAttempt at figurative languageand/or words convey general meaning</div>",
48
+ "<div>Some active verbs and precise nounsEffective use of figurative language and/or words that enhance meaning</div>"
49
+ ]
91
50
  },
92
51
  {
93
- name: 'Sentence Fluency',
94
- standards: [],
95
- description: 'the rhythm and flow of the language',
96
- scorePointsDescriptors: [
97
- 'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
98
- 'No sentences are clear\n' +
99
- '\n' +
100
- 'No variety in sentence structure\n' +
101
- '\n' +
102
- 'Frequent run-ons and/or fragments are present',
103
- 'Some sentences are clear\n' +
104
- '\n' +
105
- 'Sentence variety used rarely\n' +
106
- '\n' +
107
- 'Some run-ons and/or fragments are present',
108
- 'Most sentences are clear\n' +
109
- '\n' +
110
- 'Some sentence variety is used\n' +
111
- '\n' +
112
- 'Run-ons and/or fragments are rare',
113
- 'All Sentences are clear\n' +
114
- '\n' +
115
- 'Variety of sentence structure is used\n' +
116
- '\n' +
117
- 'Run-ons and/or fragments are not present',
118
- ],
52
+ "name": "<div>Sentence Fluency</div>",
53
+ "standards": [],
54
+ "description": "the rhythm and flow of the language",
55
+ "scorePointsDescriptors": [
56
+ "<div>Student’s response is blank, not in English, not legible, or does not respond to the prompt.</div>",
57
+ "<div>No sentences are clearNo variety in sentence structureFrequent run-ons and/or fragments are present</div>",
58
+ "<div>Some sentences are clearSentence variety used rarelySome run-ons and/or fragments are present</div>",
59
+ "<div>Most sentences are clearSome sentence variety is usedRun-ons and/or fragments are rare</div>"
60
+ ]
119
61
  },
120
62
  {
121
- name: 'Conventions',
122
- standards: [],
123
- description: 'the mechanical correctness',
124
- scorePointsDescriptors: [
125
- 'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
126
- 'Many distracting errors are present in grammar, punctuation, capitalization and/or spelling',
127
- 'Errors in grammar, punctuation, capitalization and/or spelling are present and some distract from meaning',
128
- 'Errors in grammar, punctuation, capitalization and/or spelling are present but don’t distract from meaning',
129
- 'Few errors in grammar, punctuation,\n' + '\n' + 'capitalization and/or spelling',
130
- ],
63
+ "name": "<div>Conventions</div>",
64
+ "standards": [],
65
+ "description": "the mechanical correctness",
66
+ "scorePointsDescriptors": [
67
+ "<div>Student’s response is blank, not in English, not legible, or does not respond to the prompt.</div>",
68
+ "<div>Many distracting errors are present in grammar, punctuation, capitalization and/or spelling</div>",
69
+ "<div>Errors in grammar, punctuation, capitalization and/or spelling are present and some distract from meaning</div>",
70
+ "<div>Errors in grammar, punctuation, capitalization and/or spelling are present but don’t distract from meaning</div>"
71
+ ]
131
72
  },
132
73
  {
133
- name: 'Voice',
134
- standards: [],
135
- description: 'the personal tone and flavor of the author\'s message',
136
- scorePointsDescriptors: [
137
- 'Student’s response is blank, not in English, not legible, or does not respond to the prompt.',
138
- 'Not concerned with audience or purpose\n' +
139
- '\n' +
140
- 'No viewpoint (perspective) used\n' +
141
- '\n' +
142
- 'Writing is mechanical and lifeless',
143
- 'Shows beginning awareness of audience/purpose\n' +
144
- '\n' +
145
- 'Some viewpoint (perspective) used throughout the piece\n' +
146
- '\n' +
147
- 'Writing is distant, too formal or informal',
148
- 'Awareness of audience; purpose is clear most of the time\n' +
149
- '\n' +
150
- 'Uses viewpoint (perspective) throughout most of the paper\n' +
151
- '\n' +
152
- 'Writing is pleasant, agreeable and satisfying',
153
- 'Powerful connection with audience; purpose is clearly communicated\n' +
154
- '\n' +
155
- 'Maintains strong viewpoint (perspective) throughout entire piece\n' +
156
- '\n' +
157
- 'Writing is expressive, engaging and has lots of energy',
158
- ],
159
- },
160
- ],
74
+ "name": "<div>Voice</div>",
75
+ "standards": [],
76
+ "description": "the personal tone and flavor of the author's message",
77
+ "scorePointsDescriptors": [
78
+ "<div>Student’s response is blank, not in English, not legible, or does not respond to the prompt.</div>",
79
+ "<div>Not concerned with audience or purposeNo viewpoint (perspective) usedWriting is mechanical and lifeless</div>",
80
+ "<div>Shows beginning awareness of audience/purposeSome viewpoint (perspective) used throughout the pieceWriting is distant, too formal or informal</div>",
81
+ "<div>Awareness of audience; purpose is clear most of the timeUses viewpoint (perspective) throughout most of the paperWriting is pleasant, agreeable and satisfying</div>"
82
+ ]
83
+ }
84
+ ]
161
85
  },
162
86
  {
163
- maxPoints: 5,
164
- scorePointsLabels: ['Non-Scorable', 'Unsatisfactory', 'Satisfactory'],
165
- traitLabel: 'Category',
166
- traits: [
167
- {
168
- name: 'Presentation',
169
- standards: [],
170
- description: '',
171
- scorePointsDescriptors: [
172
- 'Handwriting is unreadable, or response is blank, not in English, or too brief to evaluate. ',
173
- 'Handwriting poor\n' + '\n' + 'Overall appearance is distracting to unacceptable',
174
- 'Handwriting is generally legible\n' + '\n' + 'Overall appearance is acceptable or better',
175
- ],
176
- },
87
+ "maxPoints": 5,
88
+ "scorePointsLabels": [
89
+ "<div>Non-Scorable</div>",
90
+ "<div>Unsatisfactory</div>",
91
+ "<div>Satisfactory</div>",
92
+ "<div></div>",
93
+ "<div></div>"
177
94
  ],
178
- },
95
+ "traitLabel": "Category",
96
+ "traits": [
97
+ {
98
+ "name": "<div>Presentation</div>",
99
+ "standards": [],
100
+ "description": "",
101
+ "scorePointsDescriptors": [
102
+ "<div>Handwriting is unreadable, or response is blank, not in English, or too brief to evaluate. </div>",
103
+ "<div>Handwriting poorOverall appearance is distracting to unacceptable</div>",
104
+ "<div>Handwriting is generally legibleOverall appearance is acceptable or better</div>",
105
+ "<div></div>",
106
+ "<div></div>"
107
+ ]
108
+ }
109
+ ]
110
+ }
179
111
  ],
112
+ "excludeZero": true,
113
+ "maxPointsEnabled": true,
114
+ "addScaleEnabled": true,
115
+ id,
116
+ element
180
117
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/multi-trait-rubric",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "3.16.3-next.0+eb9349f8e",
4
+ "version": "3.16.3-next.2+72637af6c",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -15,7 +15,7 @@
15
15
  "react": "^16.8.1",
16
16
  "react-dom": "^16.8.1"
17
17
  },
18
- "gitHead": "eb9349f8edc90694b38c443dde19b869197cebdd",
18
+ "gitHead": "72637af6c8a418ea7baeb750d3cd9c15b3514e26",
19
19
  "scripts": {
20
20
  "postpublish": "../../scripts/postpublish"
21
21
  },