@pie-element/charting 10.3.4-next.3 → 11.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configure/lib/charting-config.js +149 -220
- package/configure/lib/charting-config.js.map +1 -1
- package/configure/lib/configure.js +279 -378
- package/configure/lib/configure.js.map +1 -1
- package/configure/lib/correct-response.js +183 -258
- package/configure/lib/correct-response.js.map +1 -1
- package/configure/lib/defaults.js +2 -4
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +99 -163
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/utils.js +24 -41
- package/configure/lib/utils.js.map +1 -1
- package/configure/package.json +12 -10
- package/controller/lib/defaults.js +2 -4
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +161 -230
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +4 -4
- package/lib/index.js +52 -99
- package/lib/index.js.map +1 -1
- package/lib/main.js +145 -208
- package/lib/main.js.map +1 -1
- package/package.json +12 -10
- package/esm/configure.js +0 -18067
- package/esm/configure.js.map +0 -1
- package/esm/controller.js +0 -4555
- package/esm/controller.js.map +0 -1
- package/esm/element.js +0 -10956
- package/esm/element.js.map +0 -1
- package/esm/package.json +0 -3
|
@@ -1,411 +1,312 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
7
|
+
exports.default = exports.Configure = void 0;
|
|
22
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
9
|
var _react = _interopRequireDefault(require("react"));
|
|
25
|
-
|
|
26
|
-
var _styles = require("@material-ui/core/styles");
|
|
27
|
-
|
|
10
|
+
var _styles = require("@mui/material/styles");
|
|
28
11
|
var _charting = require("@pie-lib/charting");
|
|
29
|
-
|
|
30
12
|
var _configUi = require("@pie-lib/config-ui");
|
|
31
|
-
|
|
32
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
33
|
-
|
|
34
14
|
var _debug = _interopRequireDefault(require("debug"));
|
|
35
|
-
|
|
36
|
-
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
37
|
-
|
|
15
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
38
16
|
var _editableHtml = _interopRequireDefault(require("@pie-lib/editable-html"));
|
|
39
|
-
|
|
40
17
|
var _chartingConfig = _interopRequireDefault(require("./charting-config"));
|
|
41
|
-
|
|
42
18
|
var _correctResponse = _interopRequireDefault(require("./correct-response"));
|
|
43
|
-
|
|
44
19
|
var _utils = require("./utils");
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChartTypeChange", function (chartType) {
|
|
113
|
-
return _this.props.onModelChanged(_objectSpread(_objectSpread({}, _this.props.model), {}, {
|
|
114
|
-
chartType: chartType
|
|
115
|
-
}));
|
|
116
|
-
});
|
|
117
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onConfigChange", function (config) {
|
|
118
|
-
var _this$props = _this.props,
|
|
119
|
-
model = _this$props.model,
|
|
120
|
-
onModelChanged = _this$props.onModelChanged;
|
|
121
|
-
var _this$state = _this.state,
|
|
122
|
-
oldGridValues = _this$state.gridValues,
|
|
123
|
-
oldLabelValues = _this$state.labelValues;
|
|
124
|
-
|
|
125
|
-
var updatedModel = _objectSpread(_objectSpread({}, model), config);
|
|
126
|
-
|
|
127
|
-
var graph = updatedModel.graph,
|
|
128
|
-
range = updatedModel.range;
|
|
129
|
-
var gridValues = {};
|
|
130
|
-
var labelValues = {};
|
|
131
|
-
var rangeConstraints = (0, _utils.applyConstraints)(range, graph.height, oldGridValues.range, oldLabelValues.range);
|
|
20
|
+
const log = (0, _debug.default)('@pie-element:graphing:configure');
|
|
21
|
+
const {
|
|
22
|
+
Panel,
|
|
23
|
+
toggle,
|
|
24
|
+
radio,
|
|
25
|
+
dropdown,
|
|
26
|
+
textField
|
|
27
|
+
} = _configUi.settings;
|
|
28
|
+
const PromptHolder = (0, _styles.styled)(_configUi.InputContainer)(({
|
|
29
|
+
theme
|
|
30
|
+
}) => ({
|
|
31
|
+
width: '100%',
|
|
32
|
+
paddingTop: theme.spacing(2),
|
|
33
|
+
marginBottom: theme.spacing(2)
|
|
34
|
+
}));
|
|
35
|
+
const Description = (0, _styles.styled)(_Typography.default)(({
|
|
36
|
+
theme
|
|
37
|
+
}) => ({
|
|
38
|
+
marginBottom: theme.spacing(2.5)
|
|
39
|
+
}));
|
|
40
|
+
const ErrorText = (0, _styles.styled)('div')(({
|
|
41
|
+
theme
|
|
42
|
+
}) => ({
|
|
43
|
+
fontSize: theme.typography.fontSize - 2,
|
|
44
|
+
color: theme.palette.error.main,
|
|
45
|
+
paddingTop: theme.spacing(1)
|
|
46
|
+
}));
|
|
47
|
+
const charts = [_charting.chartTypes.Bar(), _charting.chartTypes.Histogram(), _charting.chartTypes.LineDot(), _charting.chartTypes.LineCross(), _charting.chartTypes.DotPlot(), _charting.chartTypes.LinePlot()];
|
|
48
|
+
class Configure extends _react.default.Component {
|
|
49
|
+
constructor(props) {
|
|
50
|
+
super(props);
|
|
51
|
+
(0, _defineProperty2.default)(this, "onRationaleChange", rationale => this.props.onModelChanged({
|
|
52
|
+
...this.props.model,
|
|
53
|
+
rationale
|
|
54
|
+
}));
|
|
55
|
+
(0, _defineProperty2.default)(this, "onPromptChange", prompt => this.props.onModelChanged({
|
|
56
|
+
...this.props.model,
|
|
57
|
+
prompt
|
|
58
|
+
}));
|
|
59
|
+
(0, _defineProperty2.default)(this, "onTeacherInstructionsChange", teacherInstructions => this.props.onModelChanged({
|
|
60
|
+
...this.props.model,
|
|
61
|
+
teacherInstructions
|
|
62
|
+
}));
|
|
63
|
+
(0, _defineProperty2.default)(this, "onChartTypeChange", chartType => this.props.onModelChanged({
|
|
64
|
+
...this.props.model,
|
|
65
|
+
chartType
|
|
66
|
+
}));
|
|
67
|
+
(0, _defineProperty2.default)(this, "onConfigChange", config => {
|
|
68
|
+
const {
|
|
69
|
+
model,
|
|
70
|
+
onModelChanged
|
|
71
|
+
} = this.props;
|
|
72
|
+
const {
|
|
73
|
+
gridValues: oldGridValues,
|
|
74
|
+
labelValues: oldLabelValues
|
|
75
|
+
} = this.state;
|
|
76
|
+
const updatedModel = {
|
|
77
|
+
...model,
|
|
78
|
+
...config
|
|
79
|
+
};
|
|
80
|
+
const {
|
|
81
|
+
graph,
|
|
82
|
+
range
|
|
83
|
+
} = updatedModel;
|
|
84
|
+
const gridValues = {};
|
|
85
|
+
const labelValues = {};
|
|
86
|
+
const rangeConstraints = (0, _utils.applyConstraints)(range, graph.height, oldGridValues.range, oldLabelValues.range);
|
|
132
87
|
gridValues.range = rangeConstraints.gridValues;
|
|
133
88
|
labelValues.range = rangeConstraints.labelValues;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
labelValues: labelValues
|
|
89
|
+
this.setState({
|
|
90
|
+
gridValues,
|
|
91
|
+
labelValues
|
|
138
92
|
});
|
|
139
|
-
|
|
140
93
|
onModelChanged(updatedModel);
|
|
141
94
|
});
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
var _gridValues = {
|
|
95
|
+
const {
|
|
96
|
+
range: _range = {},
|
|
97
|
+
graph: _graph
|
|
98
|
+
} = props.model || {};
|
|
99
|
+
const _gridValues = {
|
|
149
100
|
range: (0, _utils.getGridValues)(_range, _graph.height, true)
|
|
150
101
|
};
|
|
151
|
-
|
|
102
|
+
const _labelValues = {
|
|
152
103
|
range: (0, _utils.getLabelValues)(_range.step || 1)
|
|
153
104
|
};
|
|
154
|
-
|
|
105
|
+
this.state = {
|
|
155
106
|
gridValues: _gridValues,
|
|
156
107
|
labelValues: _labelValues
|
|
157
108
|
};
|
|
158
|
-
return _this;
|
|
159
109
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
changeEditableEnabled: ((_chartingOptions$chan2 = chartingOptions.changeEditable) === null || _chartingOptions$chan2 === void 0 ? void 0 : _chartingOptions$chan2.settings) && toggle(chartingOptions.changeEditable.settingsLabel),
|
|
249
|
-
changeAddCategoryEnabled: ((_chartingOptions$addC = chartingOptions.addCategory) === null || _chartingOptions$addC === void 0 ? void 0 : _chartingOptions$addC.settings) && toggle(chartingOptions.addCategory.settingsLabel)
|
|
250
|
-
};
|
|
251
|
-
var panelProperties = {
|
|
252
|
-
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
253
|
-
studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
|
|
254
|
-
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
255
|
-
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
256
|
-
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
257
|
-
scoringType: scoringType.settings && radio(scoringType.label, ['all or nothing', 'partial scoring']),
|
|
258
|
-
rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label),
|
|
259
|
-
'language.enabled': language.settings && toggle(language.label, true),
|
|
260
|
-
language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),
|
|
261
|
-
instruction: instruction.settings && textField(instruction.label)
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
var getPluginProps = function getPluginProps() {
|
|
265
|
-
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
266
|
-
return _objectSpread(_objectSpread({}, baseInputConfiguration), props);
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
270
|
-
extraCSSRules: extraCSSRules,
|
|
271
|
-
dimensions: contentDimensions,
|
|
272
|
-
hideSettings: settingsPanelDisabled,
|
|
273
|
-
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
274
|
-
model: model,
|
|
275
|
-
configuration: configuration,
|
|
276
|
-
onChangeModel: onModelChanged,
|
|
277
|
-
onChangeConfiguration: onConfigurationChanged,
|
|
278
|
-
groups: {
|
|
279
|
-
Settings: panelItemType,
|
|
280
|
-
Properties: panelProperties
|
|
281
|
-
}
|
|
282
|
-
})
|
|
283
|
-
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
284
|
-
component: "div",
|
|
285
|
-
type: "body1",
|
|
286
|
-
className: classes.description
|
|
287
|
-
}, (instruction === null || instruction === void 0 ? void 0 : instruction.label) || ''), teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
288
|
-
label: teacherInstructions.label,
|
|
289
|
-
className: classes.promptHolder
|
|
290
|
-
}, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
291
|
-
className: classes.prompt,
|
|
292
|
-
markup: model.teacherInstructions || '',
|
|
293
|
-
onChange: this.onTeacherInstructionsChange,
|
|
294
|
-
imageSupport: imageSupport,
|
|
295
|
-
nonEmpty: false,
|
|
296
|
-
error: teacherInstructionsError,
|
|
297
|
-
spellCheck: spellCheckEnabled,
|
|
298
|
-
pluginProps: getPluginProps(teacherInstructions === null || teacherInstructions === void 0 ? void 0 : teacherInstructions.inputConfiguration),
|
|
299
|
-
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
|
|
300
|
-
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
|
|
301
|
-
uploadSoundSupport: uploadSoundSupport,
|
|
302
|
-
languageCharactersProps: [{
|
|
303
|
-
language: 'spanish'
|
|
304
|
-
}, {
|
|
305
|
-
language: 'special'
|
|
306
|
-
}],
|
|
307
|
-
mathMlOptions: mathMlOptions
|
|
308
|
-
}), teacherInstructionsError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
309
|
-
className: classes.errorText
|
|
310
|
-
}, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
311
|
-
label: prompt.label,
|
|
312
|
-
className: classes.promptHolder
|
|
313
|
-
}, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
314
|
-
className: classes.prompt,
|
|
315
|
-
markup: model.prompt,
|
|
316
|
-
onChange: this.onPromptChange,
|
|
317
|
-
imageSupport: imageSupport,
|
|
318
|
-
nonEmpty: false,
|
|
319
|
-
error: promptError,
|
|
320
|
-
spellCheck: spellCheckEnabled,
|
|
321
|
-
disableUnderline: true,
|
|
322
|
-
pluginProps: getPluginProps(prompt === null || prompt === void 0 ? void 0 : prompt.inputConfiguration),
|
|
323
|
-
maxImageWidth: defaultImageMaxWidth,
|
|
324
|
-
maxImageHeight: defaultImageMaxHeight,
|
|
325
|
-
uploadSoundSupport: uploadSoundSupport,
|
|
326
|
-
languageCharactersProps: [{
|
|
327
|
-
language: 'spanish'
|
|
328
|
-
}, {
|
|
329
|
-
language: 'special'
|
|
330
|
-
}],
|
|
331
|
-
mathMlOptions: mathMlOptions
|
|
332
|
-
}), promptError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
333
|
-
className: classes.errorText
|
|
334
|
-
}, promptError)), /*#__PURE__*/_react["default"].createElement(_charting.ConfigureChartPanel, {
|
|
335
|
-
model: model,
|
|
336
|
-
onChange: this.onConfigChange,
|
|
337
|
-
gridValues: gridValues,
|
|
338
|
-
labelValues: labelValues,
|
|
339
|
-
chartDimensions: chartDimensions,
|
|
340
|
-
charts: charts,
|
|
341
|
-
studentNewCategoryDefaultLabel: studentNewCategoryDefaultLabel,
|
|
342
|
-
availableChartTypes: availableChartTypes,
|
|
343
|
-
chartTypeLabel: chartTypeLabel
|
|
344
|
-
}), /*#__PURE__*/_react["default"].createElement(_chartingConfig["default"], {
|
|
345
|
-
model: model,
|
|
346
|
-
onChange: onModelChanged,
|
|
347
|
-
charts: charts,
|
|
348
|
-
labelsPlaceholders: labelsPlaceholders,
|
|
349
|
-
titlePlaceholder: titlePlaceholder,
|
|
350
|
-
showPixelGuides: showPixeGuides,
|
|
351
|
-
authorNewCategoryDefaults: authorNewCategoryDefaults,
|
|
352
|
-
chartingOptions: chartingOptions,
|
|
353
|
-
mathMlOptions: mathMlOptions,
|
|
354
|
-
labelsCharactersLimit: labelsCharactersLimit
|
|
355
|
-
}), /*#__PURE__*/_react["default"].createElement(_correctResponse["default"], {
|
|
356
|
-
config: graph,
|
|
110
|
+
render() {
|
|
111
|
+
const {
|
|
112
|
+
configuration,
|
|
113
|
+
imageSupport,
|
|
114
|
+
model,
|
|
115
|
+
onConfigurationChanged,
|
|
116
|
+
onModelChanged,
|
|
117
|
+
uploadSoundSupport
|
|
118
|
+
} = this.props;
|
|
119
|
+
log('[render] model', model);
|
|
120
|
+
const {
|
|
121
|
+
graph
|
|
122
|
+
} = model;
|
|
123
|
+
const {
|
|
124
|
+
baseInputConfiguration = {},
|
|
125
|
+
contentDimensions = {},
|
|
126
|
+
chartDimensions = {},
|
|
127
|
+
authorNewCategoryDefaults = {},
|
|
128
|
+
labelsPlaceholders = {},
|
|
129
|
+
instruction = {},
|
|
130
|
+
maxImageWidth = {},
|
|
131
|
+
maxImageHeight = {},
|
|
132
|
+
prompt = {},
|
|
133
|
+
rationale = {},
|
|
134
|
+
scoringType = {},
|
|
135
|
+
settingsPanelDisabled,
|
|
136
|
+
spellCheck = {},
|
|
137
|
+
studentInstructions = {},
|
|
138
|
+
teacherInstructions = {},
|
|
139
|
+
titlePlaceholder = {},
|
|
140
|
+
withRubric = {},
|
|
141
|
+
chartingOptions = {},
|
|
142
|
+
availableChartTypes = {},
|
|
143
|
+
mathMlOptions = {},
|
|
144
|
+
chartTypeLabel,
|
|
145
|
+
language = {},
|
|
146
|
+
languageChoices = {},
|
|
147
|
+
labelsCharactersLimit
|
|
148
|
+
} = configuration || {};
|
|
149
|
+
const {
|
|
150
|
+
errors,
|
|
151
|
+
extraCSSRules,
|
|
152
|
+
promptEnabled,
|
|
153
|
+
rationaleEnabled,
|
|
154
|
+
spellCheckEnabled,
|
|
155
|
+
teacherInstructionsEnabled,
|
|
156
|
+
studentNewCategoryDefaultLabel
|
|
157
|
+
} = model || {};
|
|
158
|
+
const {
|
|
159
|
+
categoryErrors,
|
|
160
|
+
correctAnswerErrors,
|
|
161
|
+
prompt: promptError,
|
|
162
|
+
rationale: rationaleError,
|
|
163
|
+
teacherInstructions: teacherInstructionsError
|
|
164
|
+
} = errors || {};
|
|
165
|
+
const {
|
|
166
|
+
gridValues,
|
|
167
|
+
labelValues
|
|
168
|
+
} = this.state;
|
|
169
|
+
const showPixeGuides = chartDimensions.showInConfigPanel || true;
|
|
170
|
+
const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
171
|
+
const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
172
|
+
const panelItemType = {
|
|
173
|
+
changeInteractiveEnabled: chartingOptions.changeInteractive?.settings && toggle(chartingOptions.changeInteractive.settingsLabel),
|
|
174
|
+
changeEditableEnabled: chartingOptions.changeEditable?.settings && toggle(chartingOptions.changeEditable.settingsLabel),
|
|
175
|
+
changeAddCategoryEnabled: chartingOptions.addCategory?.settings && toggle(chartingOptions.addCategory.settingsLabel)
|
|
176
|
+
};
|
|
177
|
+
const panelProperties = {
|
|
178
|
+
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
179
|
+
studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
|
|
180
|
+
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
181
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
182
|
+
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
183
|
+
scoringType: scoringType.settings && radio(scoringType.label, ['all or nothing', 'partial scoring']),
|
|
184
|
+
rubricEnabled: withRubric?.settings && toggle(withRubric?.label),
|
|
185
|
+
'language.enabled': language.settings && toggle(language.label, true),
|
|
186
|
+
language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),
|
|
187
|
+
instruction: instruction.settings && textField(instruction.label)
|
|
188
|
+
};
|
|
189
|
+
const getPluginProps = (props = {}) => ({
|
|
190
|
+
...baseInputConfiguration,
|
|
191
|
+
...props
|
|
192
|
+
});
|
|
193
|
+
return /*#__PURE__*/_react.default.createElement(_configUi.layout.ConfigLayout, {
|
|
194
|
+
extraCSSRules: extraCSSRules,
|
|
195
|
+
dimensions: contentDimensions,
|
|
196
|
+
hideSettings: settingsPanelDisabled,
|
|
197
|
+
settings: /*#__PURE__*/_react.default.createElement(Panel, {
|
|
357
198
|
model: model,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
})
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
199
|
+
configuration: configuration,
|
|
200
|
+
onChangeModel: onModelChanged,
|
|
201
|
+
onChangeConfiguration: onConfigurationChanged,
|
|
202
|
+
groups: {
|
|
203
|
+
Settings: panelItemType,
|
|
204
|
+
Properties: panelProperties
|
|
205
|
+
}
|
|
206
|
+
})
|
|
207
|
+
}, /*#__PURE__*/_react.default.createElement(Description, {
|
|
208
|
+
component: "div",
|
|
209
|
+
type: "body1"
|
|
210
|
+
}, instruction?.label || ''), teacherInstructionsEnabled && /*#__PURE__*/_react.default.createElement(PromptHolder, {
|
|
211
|
+
label: teacherInstructions.label
|
|
212
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
|
|
213
|
+
markup: model.teacherInstructions || '',
|
|
214
|
+
onChange: this.onTeacherInstructionsChange,
|
|
215
|
+
imageSupport: imageSupport,
|
|
216
|
+
nonEmpty: false,
|
|
217
|
+
error: teacherInstructionsError,
|
|
218
|
+
spellCheck: spellCheckEnabled,
|
|
219
|
+
pluginProps: getPluginProps(teacherInstructions?.inputConfiguration),
|
|
220
|
+
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
|
|
221
|
+
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
|
|
222
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
223
|
+
languageCharactersProps: [{
|
|
224
|
+
language: 'spanish'
|
|
225
|
+
}, {
|
|
226
|
+
language: 'special'
|
|
227
|
+
}],
|
|
228
|
+
mathMlOptions: mathMlOptions
|
|
229
|
+
}), teacherInstructionsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react.default.createElement(PromptHolder, {
|
|
230
|
+
label: prompt.label
|
|
231
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
|
|
232
|
+
markup: model.prompt,
|
|
233
|
+
onChange: this.onPromptChange,
|
|
234
|
+
imageSupport: imageSupport,
|
|
235
|
+
nonEmpty: false,
|
|
236
|
+
error: promptError,
|
|
237
|
+
spellCheck: spellCheckEnabled,
|
|
238
|
+
disableUnderline: true,
|
|
239
|
+
pluginProps: getPluginProps(prompt?.inputConfiguration),
|
|
240
|
+
maxImageWidth: defaultImageMaxWidth,
|
|
241
|
+
maxImageHeight: defaultImageMaxHeight,
|
|
242
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
243
|
+
languageCharactersProps: [{
|
|
244
|
+
language: 'spanish'
|
|
245
|
+
}, {
|
|
246
|
+
language: 'special'
|
|
247
|
+
}],
|
|
248
|
+
mathMlOptions: mathMlOptions
|
|
249
|
+
}), promptError && /*#__PURE__*/_react.default.createElement(ErrorText, null, promptError)), /*#__PURE__*/_react.default.createElement(_charting.ConfigureChartPanel, {
|
|
250
|
+
model: model,
|
|
251
|
+
onChange: this.onConfigChange,
|
|
252
|
+
gridValues: gridValues,
|
|
253
|
+
labelValues: labelValues,
|
|
254
|
+
chartDimensions: chartDimensions,
|
|
255
|
+
charts: charts,
|
|
256
|
+
studentNewCategoryDefaultLabel: studentNewCategoryDefaultLabel,
|
|
257
|
+
availableChartTypes: availableChartTypes,
|
|
258
|
+
chartTypeLabel: chartTypeLabel
|
|
259
|
+
}), /*#__PURE__*/_react.default.createElement(_chartingConfig.default, {
|
|
260
|
+
model: model,
|
|
261
|
+
onChange: onModelChanged,
|
|
262
|
+
charts: charts,
|
|
263
|
+
labelsPlaceholders: labelsPlaceholders,
|
|
264
|
+
titlePlaceholder: titlePlaceholder,
|
|
265
|
+
showPixelGuides: showPixeGuides,
|
|
266
|
+
authorNewCategoryDefaults: authorNewCategoryDefaults,
|
|
267
|
+
chartingOptions: chartingOptions,
|
|
268
|
+
mathMlOptions: mathMlOptions,
|
|
269
|
+
labelsCharactersLimit: labelsCharactersLimit
|
|
270
|
+
}), /*#__PURE__*/_react.default.createElement(_correctResponse.default, {
|
|
271
|
+
config: graph,
|
|
272
|
+
model: model,
|
|
273
|
+
onChange: onModelChanged,
|
|
274
|
+
charts: charts,
|
|
275
|
+
error: categoryErrors,
|
|
276
|
+
correctAnswerErrors: correctAnswerErrors,
|
|
277
|
+
studentNewCategoryDefaultLabel: studentNewCategoryDefaultLabel,
|
|
278
|
+
mathMlOptions: mathMlOptions,
|
|
279
|
+
labelsPlaceholders: labelsPlaceholders
|
|
280
|
+
}), rationaleEnabled && /*#__PURE__*/_react.default.createElement(PromptHolder, {
|
|
281
|
+
label: rationale.label || 'Rationale'
|
|
282
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
|
|
283
|
+
markup: model.rationale || '',
|
|
284
|
+
onChange: this.onRationaleChange,
|
|
285
|
+
imageSupport: imageSupport,
|
|
286
|
+
error: rationaleError,
|
|
287
|
+
spellCheck: spellCheckEnabled,
|
|
288
|
+
pluginProps: getPluginProps(rationale?.inputConfiguration),
|
|
289
|
+
maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
|
|
290
|
+
maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight,
|
|
291
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
292
|
+
languageCharactersProps: [{
|
|
293
|
+
language: 'spanish'
|
|
294
|
+
}, {
|
|
295
|
+
language: 'special'
|
|
296
|
+
}],
|
|
297
|
+
mathMlOptions: mathMlOptions
|
|
298
|
+
}), rationaleError && /*#__PURE__*/_react.default.createElement(ErrorText, null, rationaleError)));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
393
301
|
exports.Configure = Configure;
|
|
394
|
-
(0, _defineProperty2
|
|
395
|
-
onModelChanged: _propTypes
|
|
396
|
-
onConfigurationChanged: _propTypes
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
chartingOptions: _propTypes["default"].object
|
|
302
|
+
(0, _defineProperty2.default)(Configure, "propTypes", {
|
|
303
|
+
onModelChanged: _propTypes.default.func,
|
|
304
|
+
onConfigurationChanged: _propTypes.default.func,
|
|
305
|
+
imageSupport: _propTypes.default.object,
|
|
306
|
+
uploadSoundSupport: _propTypes.default.object,
|
|
307
|
+
model: _propTypes.default.object.isRequired,
|
|
308
|
+
configuration: _propTypes.default.object.isRequired,
|
|
309
|
+
chartingOptions: _propTypes.default.object
|
|
403
310
|
});
|
|
404
|
-
|
|
405
|
-
classes: {}
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
var _default = (0, _styles.withStyles)(styles)(Configure);
|
|
409
|
-
|
|
410
|
-
exports["default"] = _default;
|
|
311
|
+
var _default = exports.default = Configure;
|
|
411
312
|
//# sourceMappingURL=configure.js.map
|