@pie-element/charting 5.6.1-beta.0 → 5.6.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
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","imageSupport","onConfigurationChanged","uploadSoundSupport","chartDimensions","labelsPlaceholders","maxImageWidth","maxImageHeight","scoringType","settingsPanelDisabled","spellCheck","studentInstructions","titlePlaceholder","withRubric","errors","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","categoryErrors","correctAnswerErrors","showPixeGuides","showInConfigPanel","defaultImageMaxWidth","defaultImageMaxHeight","panelProperties","label","studentInstructionsEnabled","rubricEnabled","Properties","onTeacherInstructionsChange","language","onPromptChange","onRationaleChange","onConfigChange","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;AAEA,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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T;AAGE,QAAA,QAAQ,EAAED,cAHZ;AAIE,QAAA,MAAM,EAAEX,MAJV;AAKE,QAAA,KAAK,EAAEgD,cALT;AAME,QAAA,mBAAmB,EAAEC;AANvB,QA9EF,CAdF,CADF;AAwGD;;;EAhM4Be,kBAAMC,S;;;iCAAxBzD,S,eACQ;AACjBG,EAAAA,cAAc,EAAEuD,sBAAUC,IADT;AAEjBpC,EAAAA,sBAAsB,EAAEmC,sBAAUC,IAFjB;AAGjBvC,EAAAA,OAAO,EAAEsC,sBAAUE,MAHF;AAIjBtC,EAAAA,YAAY,EAAEoC,sBAAUE,MAJP;AAKjBpC,EAAAA,kBAAkB,EAAEkC,sBAAUE,MALb;AAMjBxD,EAAAA,KAAK,EAAEsD,sBAAUE,MAAV,CAAiBC,UANP;AAOjBxC,EAAAA,aAAa,EAAEqC,sBAAUE,MAAV,CAAiBC;AAPf,C;iCADR7D,S,kBAoBW;AAAEoB,EAAAA,OAAO,EAAE;AAAX,C;;eA+KT,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\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 const gridValues = { range: getGridValues(range, graph.height, true) };\n const labelValues = { range: getLabelValues(range.step || 1) };\n\n this.state = { gridValues, labelValues };\n }\n\n static defaultProps = { classes: {} };\n\n onRationaleChange = (rationale) => this.props.onModelChanged({ ...this.props.model, rationale });\n\n onPromptChange = (prompt) => this.props.onModelChanged({ ...this.props.model, prompt });\n\n onTeacherInstructionsChange = (teacherInstructions) =>\n this.props.onModelChanged({ ...this.props.model, teacherInstructions });\n\n onChartTypeChange = (chartType) => this.props.onModelChanged({ ...this.props.model, chartType });\n\n onConfigChange = (config) => {\n const { model, onModelChanged } = 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 onModelChanged(updatedModel);\n };\n\n render() {\n const { classes, configuration, imageSupport, model, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n\n log('[render] model', model);\n\n const { graph } = model;\n const {\n chartDimensions = {},\n labelsPlaceholders = {},\n maxImageWidth = {},\n maxImageHeight = {},\n prompt = {},\n rationale = {},\n scoringType = {},\n settingsPanelDisabled,\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n titlePlaceholder = {},\n withRubric = {},\n } = configuration || {};\n const { errors, promptEnabled, rationaleEnabled, spellCheckEnabled, teacherInstructionsEnabled } = model || {};\n const { categoryErrors, correctAnswerErrors } = errors || {};\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 const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['all or nothing', 'partial scoring']),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Properties: panelProperties,\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,\n students can change the heights of bars (or other similar chart elements) created by the author; relabel\n 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 label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label={prompt.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n disableUnderline\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer label={rationale.label || 'Rationale'} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n <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 error={categoryErrors}\n correctAnswerErrors={correctAnswerErrors}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
@@ -1,324 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = exports.CorrectResponse = void 0;
11
-
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
17
-
18
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
-
20
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
-
22
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
-
24
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
25
-
26
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
27
-
28
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
29
-
30
- var React = _interopRequireWildcard(require("react"));
31
-
32
- var _propTypes = _interopRequireDefault(require("prop-types"));
33
-
34
- var _styles = require("@material-ui/core/styles");
35
-
36
- var _charting = require("@pie-lib/charting");
37
-
38
- var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
39
-
40
- var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
41
-
42
- var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
43
-
44
- var _excluded = ["editable", "interactive", "deletable"],
45
- _excluded2 = ["interactive", "editable", "index"];
46
-
47
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
48
-
49
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
50
-
51
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
52
-
53
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
54
-
55
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
56
-
57
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
58
-
59
- var styles = function styles(theme) {
60
- return {
61
- container: {
62
- marginTop: theme.spacing.unit * 3,
63
- marginBottom: theme.spacing.unit * 3,
64
- display: 'flex',
65
- flex: 1
66
- },
67
- button: {
68
- marginTop: theme.spacing.unit * 3,
69
- cursor: 'pointer',
70
- background: '#eee',
71
- padding: theme.spacing.unit * 2,
72
- width: 'fit-content',
73
- borderRadius: '4px'
74
- },
75
- column: {
76
- flex: 1
77
- },
78
- chartError: {
79
- border: '2px solid red'
80
- },
81
- errorText: {
82
- fontSize: theme.typography.fontSize - 2,
83
- color: 'red',
84
- paddingTop: theme.spacing.unit
85
- }
86
- };
87
- };
88
-
89
- var addCategoryProps = function addCategoryProps(correctAnswer, data) {
90
- return correctAnswer.map(function (correct, index) {
91
- return _objectSpread(_objectSpread({}, correct), {}, {
92
- editable: index < data.length ? data[index].editable : true,
93
- interactive: index < data.length ? data[index].interactive : true,
94
- deletable: index >= data.length ? true : false
95
- });
96
- });
97
- };
98
-
99
- var updateCorrectResponseData = function updateCorrectResponseData(correctAnswer, data) {
100
- if (!correctAnswer) {
101
- return data;
102
- }
103
-
104
- var correctAnswerData = (0, _toConsumableArray2["default"])(correctAnswer);
105
- var correctResponseDefinition = [];
106
- data.forEach(function (category, currentIndex) {
107
- var _correctAnswer$curren, _correctAnswer$curren2, _correctAnswer$curren3;
108
-
109
- var editable = category.editable;
110
- var interactive = category.interactive;
111
- var label = editable && (_correctAnswer$curren = correctAnswer[currentIndex]) !== null && _correctAnswer$curren !== void 0 && _correctAnswer$curren.label ? correctAnswer[currentIndex].label : category.label;
112
- var value = interactive && (_correctAnswer$curren2 = correctAnswer[currentIndex]) !== null && _correctAnswer$curren2 !== void 0 && _correctAnswer$curren2.value || interactive && ((_correctAnswer$curren3 = correctAnswer[currentIndex]) === null || _correctAnswer$curren3 === void 0 ? void 0 : _correctAnswer$curren3.value) == 0 ? correctAnswer[currentIndex].value : category.value;
113
- correctResponseDefinition[currentIndex] = {
114
- label: label,
115
- value: value,
116
- editable: category.editable,
117
- interactive: category.interactive
118
- };
119
- });
120
-
121
- if (correctResponseDefinition.length < correctAnswer.length) {
122
- var missingCategories = correctAnswerData.slice(correctResponseDefinition.length, correctAnswer.length);
123
- return addCategoryProps(correctResponseDefinition.concat(missingCategories), data);
124
- }
125
-
126
- return correctResponseDefinition;
127
- };
128
-
129
- var insertCategory = function insertCategory(correctAnswer, data) {
130
- var positionToInsert = data.length - 1;
131
- var _data = data[data.length - 1],
132
- editable = _data.editable,
133
- interactive = _data.interactive,
134
- deletable = _data.deletable,
135
- categoryToInsert = (0, _objectWithoutProperties2["default"])(_data, _excluded);
136
- correctAnswer.splice(positionToInsert, 0, categoryToInsert);
137
- var correctAnswerData = (0, _toConsumableArray2["default"])(correctAnswer);
138
- return addCategoryProps(correctAnswerData, data);
139
- };
140
-
141
- var removeCategory = function removeCategory(correctAnswer, data, positionToRemove) {
142
- correctAnswer.splice(positionToRemove, 1);
143
- var correctAnswerData = (0, _toConsumableArray2["default"])(correctAnswer);
144
- return addCategoryProps(correctAnswerData, data);
145
- };
146
-
147
- var CorrectResponse = /*#__PURE__*/function (_React$Component) {
148
- (0, _inherits2["default"])(CorrectResponse, _React$Component);
149
-
150
- var _super = _createSuper(CorrectResponse);
151
-
152
- function CorrectResponse(props) {
153
- var _this;
154
-
155
- (0, _classCallCheck2["default"])(this, CorrectResponse);
156
- _this = _super.call(this, props);
157
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeData", function (data) {
158
- var _this$props = _this.props,
159
- model = _this$props.model,
160
- onChange = _this$props.onChange;
161
-
162
- var _ref = model || {},
163
- correctAnswer = _ref.correctAnswer;
164
-
165
- onChange(_objectSpread(_objectSpread({}, model), {}, {
166
- correctAnswer: _objectSpread(_objectSpread({}, correctAnswer), {}, {
167
- data: data.map(function (_ref2) {
168
- var interactive = _ref2.interactive,
169
- editable = _ref2.editable,
170
- index = _ref2.index,
171
- keepAttrs = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2);
172
- return keepAttrs;
173
- })
174
- })
175
- }));
176
- });
177
- _this.state = {
178
- categories: updateCorrectResponseData(props.model.correctAnswer.data, props.model.data)
179
- };
180
- return _this;
181
- }
182
-
183
- (0, _createClass2["default"])(CorrectResponse, [{
184
- key: "UNSAFE_componentWillReceiveProps",
185
- value: function UNSAFE_componentWillReceiveProps(nextProps) {
186
- var _nextProps$model = nextProps.model;
187
- _nextProps$model = _nextProps$model === void 0 ? {} : _nextProps$model;
188
- var _nextProps$model$data = _nextProps$model.data,
189
- nextData = _nextProps$model$data === void 0 ? [] : _nextProps$model$data,
190
- _nextProps$model$corr = _nextProps$model.correctAnswer.data,
191
- nextCorrectAnswerData = _nextProps$model$corr === void 0 ? [] : _nextProps$model$corr;
192
- var _this$props$model = this.props.model;
193
- _this$props$model = _this$props$model === void 0 ? {} : _this$props$model;
194
- var _this$props$model$dat = _this$props$model.data,
195
- data = _this$props$model$dat === void 0 ? [] : _this$props$model$dat;
196
- var categories = this.state.categories;
197
- var nextCategories = [];
198
-
199
- if (nextData.length > data.length) {
200
- nextCategories = insertCategory(nextCorrectAnswerData, nextData);
201
- }
202
-
203
- if (nextData.length < data.length) {
204
- var removedIndex = nextData.length; // we need to remove the category from the correct answer data and categories, from the same index it was removed from the data
205
- // index is a property of the nextData category
206
-
207
- for (var index = 0; index < nextData.length; index++) {
208
- if (nextData[index].index !== index) {
209
- removedIndex = index;
210
- break;
211
- }
212
- }
213
-
214
- this.props.model.correctAnswer.data.splice(removedIndex, 1);
215
- nextCategories = removeCategory(categories, nextData, removedIndex);
216
- }
217
-
218
- if (!(0, _isEqual["default"])(nextCorrectAnswerData, this.props.model.correctAnswer.data)) {
219
- nextCategories = nextCorrectAnswerData.map(function (correct, index) {
220
- return _objectSpread(_objectSpread({}, correct), {}, {
221
- editable: index < data.length ? data[index].editable : true,
222
- interactive: index < data.length ? data[index].interactive : true
223
- });
224
- });
225
- } else if ((0, _isEmpty["default"])(nextCategories)) {
226
- nextCategories = updateCorrectResponseData(nextCorrectAnswerData, nextData);
227
- nextCorrectAnswerData.map(function (answer, currentIndex) {
228
- var dataExists = currentIndex < nextData.length;
229
- var label;
230
- var value;
231
- var deletable;
232
-
233
- if (dataExists) {
234
- label = nextData[currentIndex].editable ? answer.label : nextData[currentIndex].label;
235
- value = nextData[currentIndex].interactive ? answer.value : nextData[currentIndex].value;
236
- } else {
237
- label = answer.label;
238
- value = answer.value;
239
- deletable = true;
240
- }
241
-
242
- nextCorrectAnswerData[currentIndex] = {
243
- label: label,
244
- value: value
245
- };
246
- });
247
- }
248
-
249
- if (!(0, _isEqual["default"])(nextCategories, data) || !(0, _isEqual["default"])(nextCorrectAnswerData, categories) || !(0, _isEqual["default"])(nextCategories, categories) || (0, _isEmpty["default"])(nextCategories) && (0, _isEmpty["default"])(data)) {
250
- this.setState({
251
- categories: nextCategories
252
- });
253
- }
254
- }
255
- }, {
256
- key: "render",
257
- value: function render() {
258
- var _this2 = this;
259
-
260
- var _this$props2 = this.props,
261
- classes = _this$props2.classes,
262
- model = _this$props2.model,
263
- charts = _this$props2.charts,
264
- error = _this$props2.error,
265
- correctAnswerErrors = _this$props2.correctAnswerErrors;
266
- var categories = this.state.categories;
267
-
268
- var _ref3 = model || {},
269
- _ref3$domain = _ref3.domain,
270
- domain = _ref3$domain === void 0 ? {} : _ref3$domain,
271
- _ref3$range = _ref3.range,
272
- range = _ref3$range === void 0 ? {} : _ref3$range;
273
-
274
- var _ref4 = correctAnswerErrors || {},
275
- identicalError = _ref4.identicalError,
276
- categoriesError = _ref4.categoriesError;
277
-
278
- return /*#__PURE__*/React.createElement("div", null, "Define Correct Response", /*#__PURE__*/React.createElement("div", {
279
- className: classes.container
280
- }, /*#__PURE__*/React.createElement("div", {
281
- className: classes.column,
282
- key: "graph"
283
- }, /*#__PURE__*/React.createElement(_Typography["default"], {
284
- component: "div",
285
- type: "body1"
286
- }, /*#__PURE__*/React.createElement("span", null, "Use the tools below to define the correct answer.")), /*#__PURE__*/React.createElement("div", {
287
- key: "correct-response-graph-".concat(model.correctAnswer.name),
288
- className: identicalError || categoriesError ? classes.chartError : {}
289
- }, /*#__PURE__*/React.createElement(_charting.Chart, {
290
- chartType: model.chartType,
291
- size: model.graph,
292
- domain: domain,
293
- range: range,
294
- charts: charts,
295
- data: categories,
296
- title: model.title,
297
- onDataChange: function onDataChange(data) {
298
- return _this2.changeData(data);
299
- },
300
- addCategoryEnabled: model.addCategoryEnabled,
301
- categoryDefaultLabel: model.categoryDefaultLabel,
302
- error: error
303
- })), (identicalError || categoriesError) && /*#__PURE__*/React.createElement(_Typography["default"], {
304
- component: "div",
305
- type: "body1",
306
- className: classes.errorText
307
- }, /*#__PURE__*/React.createElement("span", null, identicalError || categoriesError)))));
308
- }
309
- }]);
310
- return CorrectResponse;
311
- }(React.Component);
312
-
313
- exports.CorrectResponse = CorrectResponse;
314
- (0, _defineProperty2["default"])(CorrectResponse, "propTypes", {
315
- classes: _propTypes["default"].object.isRequired,
316
- model: _propTypes["default"].object.isRequired,
317
- onChange: _propTypes["default"].func.isRequired,
318
- charts: _propTypes["default"].array
319
- });
320
-
321
- var _default = (0, _styles.withStyles)(styles)(CorrectResponse);
322
-
323
- exports["default"] = _default;
324
- //# sourceMappingURL=correct-response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/correct-response.jsx"],"names":["styles","theme","container","marginTop","spacing","unit","marginBottom","display","flex","button","cursor","background","padding","width","borderRadius","column","chartError","border","errorText","fontSize","typography","color","paddingTop","addCategoryProps","correctAnswer","data","map","correct","index","editable","length","interactive","deletable","updateCorrectResponseData","correctAnswerData","correctResponseDefinition","forEach","category","currentIndex","label","value","missingCategories","slice","concat","insertCategory","positionToInsert","categoryToInsert","splice","removeCategory","positionToRemove","CorrectResponse","props","model","onChange","keepAttrs","state","categories","nextProps","nextData","nextCorrectAnswerData","nextCategories","removedIndex","answer","dataExists","setState","classes","charts","error","correctAnswerErrors","domain","range","identicalError","categoriesError","name","chartType","graph","title","changeData","addCategoryEnabled","categoryDefaultLabel","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;AACNN,MAAAA,SAAS,EAAEF,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB,CAD1B;AAENK,MAAAA,MAAM,EAAE,SAFF;AAGNC,MAAAA,UAAU,EAAE,MAHN;AAINC,MAAAA,OAAO,EAAEX,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB,CAJxB;AAKNQ,MAAAA,KAAK,EAAE,aALD;AAMNC,MAAAA,YAAY,EAAE;AANR,KAPiB;AAezBC,IAAAA,MAAM,EAAE;AACNP,MAAAA,IAAI,EAAE;AADA,KAfiB;AAkBzBQ,IAAAA,UAAU,EAAE;AACVC,MAAAA,MAAM,EAAE;AADE,KAlBa;AAqBzBC,IAAAA,SAAS,EAAE;AACTC,MAAAA,QAAQ,EAAElB,KAAK,CAACmB,UAAN,CAAiBD,QAAjB,GAA4B,CAD7B;AAETE,MAAAA,KAAK,EAAE,KAFE;AAGTC,MAAAA,UAAU,EAAErB,KAAK,CAACG,OAAN,CAAcC;AAHjB;AArBc,GAAZ;AAAA,CAAf;;AA4BA,IAAMkB,gBAAgB,GAAG,SAAnBA,g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K,CAACuB,KAFd;AAGE,QAAA,MAAM,EAAEN,MAHV;AAIE,QAAA,KAAK,EAAEC,KAJT;AAKE,QAAA,MAAM,EAAEJ,MALV;AAME,QAAA,IAAI,EAAEV,UANR;AAOE,QAAA,KAAK,EAAEJ,KAAK,CAACwB,KAPf;AAQE,QAAA,YAAY,EAAE,sBAACnD,IAAD;AAAA,iBAAU,MAAI,CAACoD,UAAL,CAAgBpD,IAAhB,CAAV;AAAA,SARhB;AASE,QAAA,kBAAkB,EAAE2B,KAAK,CAAC0B,kBAT5B;AAUE,QAAA,oBAAoB,EAAE1B,KAAK,CAAC2B,oBAV9B;AAWE,QAAA,KAAK,EAAEZ;AAXT,QAJF,CALF,EAwBG,CAACI,cAAc,IAAIC,eAAnB,kBACC,oBAAC,sBAAD;AAAY,QAAA,SAAS,EAAC,KAAtB;AAA4B,QAAA,IAAI,EAAC,OAAjC;AAAyC,QAAA,SAAS,EAAEP,OAAO,CAAC/C;AAA5D,sBACE,kCAAOqD,cAAc,IAAIC,eAAzB,CADF,CAzBJ,CADF,CAFF,CADF;AAqCD;;;EA1IkCQ,KAAK,CAACC,S;;;iCAA9B/B,e,eACQ;AACjBe,EAAAA,OAAO,EAAEiB,sBAAUC,MAAV,CAAiBC,UADT;AAEjBhC,EAAAA,KAAK,EAAE8B,sBAAUC,MAAV,CAAiBC,UAFP;AAGjB/B,EAAAA,QAAQ,EAAE6B,sBAAUG,IAAV,CAAeD,UAHR;AAIjBlB,EAAAA,MAAM,EAAEgB,sBAAUI;AAJD,C;;eA4IN,wBAAWtF,MAAX,EAAmBkD,eAAnB,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 isEqual from 'lodash/isEqual';\nimport isEmpty from 'lodash/isEmpty';\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 button: {\n marginTop: theme.spacing.unit * 3,\n cursor: 'pointer',\n background: '#eee',\n padding: theme.spacing.unit * 2,\n width: 'fit-content',\n borderRadius: '4px',\n },\n column: {\n flex: 1,\n },\n chartError: {\n border: '2px solid red',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: 'red',\n paddingTop: theme.spacing.unit,\n },\n});\n\nconst addCategoryProps = (correctAnswer, data) =>\n correctAnswer.map((correct, index) => ({\n ...correct,\n editable: index < data.length ? data[index].editable : true,\n interactive: index < data.length ? data[index].interactive : true,\n deletable: index >= data.length ? true : false,\n }));\n\nconst updateCorrectResponseData = (correctAnswer, data) => {\n if (!correctAnswer) {\n return data;\n }\n\n const correctAnswerData = [...correctAnswer];\n let correctResponseDefinition = [];\n\n data.forEach((category, currentIndex) => {\n const editable = category.editable;\n const interactive = category.interactive;\n const label = editable && correctAnswer[currentIndex]?.label ? correctAnswer[currentIndex].label : category.label;\n const value =\n (interactive && correctAnswer[currentIndex]?.value) || (interactive && correctAnswer[currentIndex]?.value == 0)\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 if (correctResponseDefinition.length < correctAnswer.length) {\n const missingCategories = correctAnswerData.slice(correctResponseDefinition.length, correctAnswer.length);\n\n return addCategoryProps(correctResponseDefinition.concat(missingCategories), data);\n }\n\n return correctResponseDefinition;\n};\n\nconst insertCategory = (correctAnswer, data) => {\n const positionToInsert = data.length - 1;\n const { editable, interactive, deletable, ...categoryToInsert } = data[data.length - 1];\n\n correctAnswer.splice(positionToInsert, 0, categoryToInsert);\n const correctAnswerData = [...correctAnswer];\n\n return addCategoryProps(correctAnswerData, data);\n};\n\nconst removeCategory = (correctAnswer, data, positionToRemove) => {\n correctAnswer.splice(positionToRemove, 1);\n const correctAnswerData = [...correctAnswer];\n\n return addCategoryProps(correctAnswerData, data);\n};\n\nexport class CorrectResponse 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 categories: updateCorrectResponseData(props.model.correctAnswer.data, props.model.data),\n };\n }\n\n changeData = (data) => {\n const { model, onChange } = this.props;\n const { correctAnswer } = model || {};\n\n onChange({\n ...model,\n correctAnswer: {\n ...correctAnswer,\n data: data.map(({ interactive, editable, index, ...keepAttrs }) => keepAttrs),\n },\n });\n };\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { model: { data: nextData = [], correctAnswer: { data: nextCorrectAnswerData = [] } } = {} } = nextProps;\n const { model: { data = [] } = {} } = this.props;\n const { categories } = this.state;\n let nextCategories = [];\n\n if (nextData.length > data.length) {\n nextCategories = insertCategory(nextCorrectAnswerData, nextData);\n }\n\n if (nextData.length < data.length) {\n let removedIndex = nextData.length;\n\n // we need to remove the category from the correct answer data and categories, from the same index it was removed from the data\n // index is a property of the nextData category\n for (let index = 0; index < nextData.length; index++) {\n if (nextData[index].index !== index) {\n removedIndex = index;\n break;\n }\n }\n\n this.props.model.correctAnswer.data.splice(removedIndex, 1);\n nextCategories = removeCategory(categories, nextData, removedIndex);\n }\n\n if (!isEqual(nextCorrectAnswerData, this.props.model.correctAnswer.data)) {\n nextCategories = nextCorrectAnswerData.map((correct, index) => ({\n ...correct,\n editable: index < data.length ? data[index].editable : true,\n interactive: index < data.length ? data[index].interactive : true,\n }));\n } else if (isEmpty(nextCategories)) {\n nextCategories = updateCorrectResponseData(nextCorrectAnswerData, nextData);\n\n nextCorrectAnswerData.map((answer, currentIndex) => {\n const dataExists = currentIndex < nextData.length;\n let label;\n let value;\n let deletable;\n\n if (dataExists) {\n label = nextData[currentIndex].editable ? answer.label : nextData[currentIndex].label;\n value = nextData[currentIndex].interactive ? answer.value : nextData[currentIndex].value;\n } else {\n label = answer.label;\n value = answer.value;\n deletable = true;\n }\n\n nextCorrectAnswerData[currentIndex] = {\n label: label,\n value: value,\n };\n });\n }\n\n if (\n !isEqual(nextCategories, data) ||\n !isEqual(nextCorrectAnswerData, categories) ||\n !isEqual(nextCategories, categories) ||\n (isEmpty(nextCategories) && isEmpty(data))\n ) {\n this.setState({ categories: nextCategories });\n }\n }\n\n render() {\n const { classes, model, charts, error, correctAnswerErrors } = this.props;\n const { categories } = this.state;\n const { domain = {}, range = {} } = model || {};\n const { identicalError, categoriesError } = correctAnswerErrors || {};\n\n return (\n <div>\n Define Correct Response\n <div className={classes.container}>\n <div className={classes.column} key=\"graph\">\n <Typography component=\"div\" type=\"body1\">\n <span>Use the tools below to define the correct answer.</span>\n </Typography>\n\n <div\n key={`correct-response-graph-${model.correctAnswer.name}`}\n className={identicalError || categoriesError ? classes.chartError : {}}\n >\n <Chart\n chartType={model.chartType}\n size={model.graph}\n domain={domain}\n range={range}\n charts={charts}\n data={categories}\n title={model.title}\n onDataChange={(data) => this.changeData(data)}\n addCategoryEnabled={model.addCategoryEnabled}\n categoryDefaultLabel={model.categoryDefaultLabel}\n error={error}\n />\n </div>\n\n {(identicalError || categoriesError) && (\n <Typography component=\"div\" type=\"body1\" className={classes.errorText}>\n <span>{identicalError || categoriesError}</span>\n </Typography>\n )}\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default withStyles(styles)(CorrectResponse);\n"],"file":"correct-response.js"}
@@ -1,118 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- /**
9
- * NOTE: There's no functionality described for graphTitle,
10
- * rationale, scoringType, studentInstructions, teacherInstructions
11
- * so there's no implementation (they are only added in model)
12
- */
13
- // const createCategory = (label, value) => ({
14
- // label,
15
- // value,
16
- // interactive: true,
17
- // editable: true
18
- // });
19
- var _default = {
20
- model: {
21
- addCategoryEnabled: true,
22
- categoryDefaultLabel: 'Category',
23
- chartType: 'lineCross',
24
- correctAnswer: {},
25
- data: [],
26
- domain: {},
27
- graph: {
28
- width: 480,
29
- height: 480
30
- },
31
- prompt: '',
32
- promptEnabled: true,
33
- rationale: '',
34
- range: {
35
- label: '',
36
- max: 1,
37
- min: 0
38
- },
39
- scoringType: 'all or nothing',
40
- title: '',
41
- rationaleEnabled: true,
42
- teacherInstructionsEnabled: true,
43
- studentInstructionsEnabled: true
44
- },
45
- configuration: {
46
- spellCheck: {
47
- label: 'Spellcheck',
48
- settings: false,
49
- enabled: true
50
- },
51
- chartDimensions: {
52
- settings: false,
53
- label: 'Chart Dimensions',
54
- showInConfigPanel: true,
55
- width: {
56
- min: 50,
57
- max: 700,
58
- step: 20
59
- },
60
- height: {
61
- min: 400,
62
- max: 700,
63
- step: 20
64
- }
65
- },
66
- prompt: {
67
- settings: true,
68
- label: 'Item Stem'
69
- },
70
- rationale: {
71
- settings: true,
72
- label: 'Rationale'
73
- },
74
- scoringType: {
75
- settings: false,
76
- label: 'Scoring Type'
77
- },
78
- settingsPanelDisabled: false,
79
- studentInstructions: {
80
- settings: false,
81
- label: 'Student Instructions'
82
- },
83
- teacherInstructions: {
84
- settings: true,
85
- label: 'Teacher Instructions'
86
- },
87
- title: {
88
- settings: false,
89
- label: 'Chart Title'
90
- },
91
- titlePlaceholder: {
92
- settings: false,
93
- label: 'Click here to add a title'
94
- },
95
- labelsPlaceholders: {
96
- left: 'Click here to add a label for this axis',
97
- right: '',
98
- top: '',
99
- bottom: 'Click here to add a label for this axis'
100
- },
101
- maxImageWidth: {
102
- teacherInstructions: 300,
103
- prompt: 300,
104
- rationale: 300
105
- },
106
- maxImageHeight: {
107
- teacherInstructions: 300,
108
- prompt: 300,
109
- rationale: 300
110
- },
111
- withRubric: {
112
- settings: false,
113
- label: 'Add Rubric'
114
- }
115
- }
116
- };
117
- exports["default"] = _default;
118
- //# sourceMappingURL=defaults.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/defaults.js"],"names":["model","addCategoryEnabled","categoryDefaultLabel","chartType","correctAnswer","data","domain","graph","width","height","prompt","promptEnabled","rationale","range","label","max","min","scoringType","title","rationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","configuration","spellCheck","settings","enabled","chartDimensions","showInConfigPanel","step","settingsPanelDisabled","studentInstructions","teacherInstructions","titlePlaceholder","labelsPlaceholders","left","right","top","bottom","maxImageWidth","maxImageHeight","withRubric"],"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,IAAAA,MAAM,EAAE,EANH;AAOLC,IAAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAE,GADF;AAELC,MAAAA,MAAM,EAAE;AAFH,KAPF;AAWLC,IAAAA,MAAM,EAAE,EAXH;AAYLC,IAAAA,aAAa,EAAE,IAZV;AAaLC,IAAAA,SAAS,EAAE,EAbN;AAcLC,IAAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAE,EADF;AAELC,MAAAA,GAAG,EAAE,CAFA;AAGLC,MAAAA,GAAG,EAAE;AAHA,KAdF;AAmBLC,IAAAA,WAAW,EAAE,gBAnBR;AAoBLC,IAAAA,KAAK,EAAE,EApBF;AAqBLC,IAAAA,gBAAgB,EAAE,IArBb;AAsBLC,IAAAA,0BAA0B,EAAE,IAtBvB;AAuBLC,IAAAA,0BAA0B,EAAE;AAvBvB,GADM;AA0BbC,EAAAA,aAAa,EAAE;AACbC,IAAAA,UAAU,EAAE;AACVT,MAAAA,KAAK,EAAE,YADG;AAEVU,MAAAA,QAAQ,EAAE,KAFA;AAGVC,MAAAA,OAAO,EAAE;AAHC,KADC;AAMbC,IAAAA,eAAe,EAAE;AACfF,MAAAA,QA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A,MAAM,EAAE;AAJU,KAlDP;AAwDbC,IAAAA,aAAa,EAAE;AACbP,MAAAA,mBAAmB,EAAE,GADR;AAEbrB,MAAAA,MAAM,EAAE,GAFK;AAGbE,MAAAA,SAAS,EAAE;AAHE,KAxDF;AA6Db2B,IAAAA,cAAc,EAAE;AACdR,MAAAA,mBAAmB,EAAE,GADP;AAEdrB,MAAAA,MAAM,EAAE,GAFM;AAGdE,MAAAA,SAAS,EAAE;AAHG,KA7DH;AAkEb4B,IAAAA,UAAU,EAAE;AACVhB,MAAAA,QAAQ,EAAE,KADA;AAEVV,MAAAA,KAAK,EAAE;AAFG;AAlEC;AA1BF,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 graph: {\n width: 480,\n height: 480,\n },\n prompt: '',\n promptEnabled: true,\n rationale: '',\n range: {\n label: '',\n max: 1,\n min: 0,\n },\n scoringType: 'all or nothing',\n title: '',\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 settingsPanelDisabled: false,\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"}