@pie-element/graphing 3.5.0 → 3.5.1-beta.587
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/CHANGELOG.md +498 -0
- package/configure/CHANGELOG.md +482 -0
- package/configure/lib/configure.js +174 -56
- package/configure/lib/configure.js.map +1 -1
- package/configure/lib/correct-response.js +340 -62
- package/configure/lib/correct-response.js.map +1 -1
- package/configure/lib/defaults.js +281 -13
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/graphing-config.js +323 -177
- package/configure/lib/graphing-config.js.map +1 -1
- package/configure/lib/index.js +63 -18
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/utils.js +165 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +6 -5
- package/controller/CHANGELOG.md +114 -0
- package/controller/lib/defaults.js +11 -1
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +85 -23
- package/controller/lib/index.js.map +1 -1
- package/controller/lib/utils.js +8 -6
- package/controller/lib/utils.js.map +1 -1
- package/controller/package.json +4 -4
- package/docs/config-schema.json +1166 -10
- package/docs/config-schema.json.md +816 -9
- package/docs/demo/config.js +2 -2
- package/docs/demo/generate.js +31 -19
- package/docs/pie-schema.json +725 -463
- package/docs/pie-schema.json.md +504 -87
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/lib/main.js +23 -21
- package/lib/main.js.map +1 -1
- package/lib/utils.js +3 -1
- package/lib/utils.js.map +1 -1
- package/package.json +7 -6
|
@@ -39,17 +39,20 @@ var _graphingConfig = _interopRequireDefault(require("./graphing-config"));
|
|
|
39
39
|
|
|
40
40
|
var _correctResponse = _interopRequireDefault(require("./correct-response"));
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
var _intersection = _interopRequireDefault(require("lodash/intersection"));
|
|
43
43
|
|
|
44
|
-
function
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
|
+
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; }
|
|
45
47
|
|
|
46
48
|
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); }; }
|
|
47
49
|
|
|
48
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
50
|
+
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; } }
|
|
49
51
|
|
|
50
52
|
var Panel = _configUi.settings.Panel,
|
|
51
53
|
toggle = _configUi.settings.toggle,
|
|
52
|
-
radio = _configUi.settings.radio
|
|
54
|
+
radio = _configUi.settings.radio,
|
|
55
|
+
checkboxes = _configUi.settings.checkboxes;
|
|
53
56
|
var log = (0, _debug["default"])('@pie-element:graphing:configure');
|
|
54
57
|
|
|
55
58
|
var styles = function styles(theme) {
|
|
@@ -119,67 +122,147 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
(0, _createClass2["default"])(Configure, [{
|
|
122
|
-
key: "
|
|
123
|
-
value: function
|
|
125
|
+
key: "componentDidMount",
|
|
126
|
+
value: function componentDidMount() {
|
|
124
127
|
var _this$props4 = this.props,
|
|
125
|
-
classes = _this$props4.classes,
|
|
126
|
-
model = _this$props4.model,
|
|
127
128
|
configuration = _this$props4.configuration,
|
|
128
|
-
onConfigurationChanged = _this$props4.onConfigurationChanged,
|
|
129
129
|
onModelChanged = _this$props4.onModelChanged,
|
|
130
|
-
|
|
131
|
-
var config = model.graph;
|
|
130
|
+
model = _this$props4.model;
|
|
132
131
|
|
|
133
132
|
var _ref = configuration || {},
|
|
134
|
-
|
|
135
|
-
arrows = _ref$arrows === void 0 ? {} : _ref$arrows,
|
|
136
|
-
_ref$title = _ref.title,
|
|
137
|
-
title = _ref$title === void 0 ? {} : _ref$title,
|
|
138
|
-
_ref$padding = _ref.padding,
|
|
139
|
-
padding = _ref$padding === void 0 ? {} : _ref$padding,
|
|
140
|
-
_ref$labels = _ref.labels,
|
|
141
|
-
labels = _ref$labels === void 0 ? {} : _ref$labels,
|
|
142
|
-
_ref$rationale = _ref.rationale,
|
|
143
|
-
rationale = _ref$rationale === void 0 ? {} : _ref$rationale,
|
|
144
|
-
_ref$scoringType = _ref.scoringType,
|
|
145
|
-
scoringType = _ref$scoringType === void 0 ? {} : _ref$scoringType,
|
|
146
|
-
_ref$studentInstructi = _ref.studentInstructions,
|
|
147
|
-
studentInstructions = _ref$studentInstructi === void 0 ? {} : _ref$studentInstructi,
|
|
148
|
-
_ref$teacherInstructi = _ref.teacherInstructions,
|
|
149
|
-
teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
|
|
150
|
-
_ref$prompt = _ref.prompt,
|
|
151
|
-
prompt = _ref$prompt === void 0 ? {} : _ref$prompt,
|
|
152
|
-
_ref$authoring = _ref.authoring,
|
|
153
|
-
authoring = _ref$authoring === void 0 ? {} : _ref$authoring;
|
|
154
|
-
|
|
155
|
-
log('[render] model', model);
|
|
133
|
+
availableTools = _ref.availableTools;
|
|
156
134
|
|
|
157
135
|
var _ref2 = model || {},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
136
|
+
arrows = _ref2.arrows; // This is used for offering support for old models which have the property arrows: boolean
|
|
137
|
+
// Same thing is set in the controller: packages/graphing/controller/src/index.js - model
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
if (typeof arrows === 'boolean') {
|
|
141
|
+
if (arrows) {
|
|
142
|
+
arrows = {
|
|
143
|
+
left: true,
|
|
144
|
+
right: true,
|
|
145
|
+
up: true,
|
|
146
|
+
down: true
|
|
147
|
+
};
|
|
148
|
+
} else {
|
|
149
|
+
arrows = {
|
|
150
|
+
left: false,
|
|
151
|
+
right: false,
|
|
152
|
+
up: false,
|
|
153
|
+
down: false
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
var toolbarTools = (0, _intersection["default"])(availableTools || [], model.toolbarTools || []);
|
|
159
|
+
onModelChanged && onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
160
|
+
arrows: arrows,
|
|
161
|
+
toolbarTools: toolbarTools
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "render",
|
|
166
|
+
value: function render() {
|
|
167
|
+
var _this$props5 = this.props,
|
|
168
|
+
classes = _this$props5.classes,
|
|
169
|
+
model = _this$props5.model,
|
|
170
|
+
configuration = _this$props5.configuration,
|
|
171
|
+
onConfigurationChanged = _this$props5.onConfigurationChanged,
|
|
172
|
+
onModelChanged = _this$props5.onModelChanged,
|
|
173
|
+
imageSupport = _this$props5.imageSupport,
|
|
174
|
+
uploadSoundSupport = _this$props5.uploadSoundSupport;
|
|
175
|
+
|
|
176
|
+
var _ref3 = configuration || {},
|
|
177
|
+
_ref3$arrows = _ref3.arrows,
|
|
178
|
+
arrows = _ref3$arrows === void 0 ? {} : _ref3$arrows,
|
|
179
|
+
_ref3$authoring = _ref3.authoring,
|
|
180
|
+
authoring = _ref3$authoring === void 0 ? {} : _ref3$authoring,
|
|
181
|
+
_ref3$availableTools = _ref3.availableTools,
|
|
182
|
+
availableTools = _ref3$availableTools === void 0 ? [] : _ref3$availableTools,
|
|
183
|
+
_ref3$coordinatesOnHo = _ref3.coordinatesOnHover,
|
|
184
|
+
coordinatesOnHover = _ref3$coordinatesOnHo === void 0 ? {} : _ref3$coordinatesOnHo,
|
|
185
|
+
_ref3$gridConfigurati = _ref3.gridConfigurations,
|
|
186
|
+
gridConfigurations = _ref3$gridConfigurati === void 0 ? [] : _ref3$gridConfigurati,
|
|
187
|
+
_ref3$graphDimensions = _ref3.graphDimensions,
|
|
188
|
+
graphDimensions = _ref3$graphDimensions === void 0 ? {} : _ref3$graphDimensions,
|
|
189
|
+
_ref3$labels = _ref3.labels,
|
|
190
|
+
labels = _ref3$labels === void 0 ? {} : _ref3$labels,
|
|
191
|
+
_ref3$padding = _ref3.padding,
|
|
192
|
+
padding = _ref3$padding === void 0 ? {} : _ref3$padding,
|
|
193
|
+
_ref3$prompt = _ref3.prompt,
|
|
194
|
+
prompt = _ref3$prompt === void 0 ? {} : _ref3$prompt,
|
|
195
|
+
_ref3$rationale = _ref3.rationale,
|
|
196
|
+
rationale = _ref3$rationale === void 0 ? {} : _ref3$rationale,
|
|
197
|
+
_ref3$scoringType = _ref3.scoringType,
|
|
198
|
+
scoringType = _ref3$scoringType === void 0 ? {} : _ref3$scoringType,
|
|
199
|
+
settingsPanelDisabled = _ref3.settingsPanelDisabled,
|
|
200
|
+
_ref3$spellCheck = _ref3.spellCheck,
|
|
201
|
+
spellCheck = _ref3$spellCheck === void 0 ? {} : _ref3$spellCheck,
|
|
202
|
+
_ref3$studentInstruct = _ref3.studentInstructions,
|
|
203
|
+
studentInstructions = _ref3$studentInstruct === void 0 ? {} : _ref3$studentInstruct,
|
|
204
|
+
_ref3$teacherInstruct = _ref3.teacherInstructions,
|
|
205
|
+
teacherInstructions = _ref3$teacherInstruct === void 0 ? {} : _ref3$teacherInstruct,
|
|
206
|
+
_ref3$title = _ref3.title,
|
|
207
|
+
title = _ref3$title === void 0 ? {} : _ref3$title,
|
|
208
|
+
_ref3$maxImageWidth = _ref3.maxImageWidth,
|
|
209
|
+
maxImageWidth = _ref3$maxImageWidth === void 0 ? {} : _ref3$maxImageWidth,
|
|
210
|
+
_ref3$maxImageHeight = _ref3.maxImageHeight,
|
|
211
|
+
maxImageHeight = _ref3$maxImageHeight === void 0 ? {} : _ref3$maxImageHeight,
|
|
212
|
+
_ref3$withRubric = _ref3.withRubric,
|
|
213
|
+
withRubric = _ref3$withRubric === void 0 ? {} : _ref3$withRubric;
|
|
214
|
+
|
|
215
|
+
var _ref4 = model || {},
|
|
216
|
+
_ref4$errors = _ref4.errors,
|
|
217
|
+
errors = _ref4$errors === void 0 ? {} : _ref4$errors,
|
|
218
|
+
labelsEnabled = _ref4.labelsEnabled,
|
|
219
|
+
promptEnabled = _ref4.promptEnabled,
|
|
220
|
+
rationaleEnabled = _ref4.rationaleEnabled,
|
|
221
|
+
spellCheckEnabled = _ref4.spellCheckEnabled,
|
|
222
|
+
teacherInstructionsEnabled = _ref4.teacherInstructionsEnabled,
|
|
223
|
+
titleEnabled = _ref4.titleEnabled;
|
|
161
224
|
|
|
225
|
+
log('[render] model', model);
|
|
226
|
+
var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
227
|
+
var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
228
|
+
var labelsPlaceholders = {
|
|
229
|
+
top: labels.top,
|
|
230
|
+
right: labels.right,
|
|
231
|
+
bottom: labels.bottom,
|
|
232
|
+
left: labels.left
|
|
233
|
+
};
|
|
234
|
+
var panelItemType = {
|
|
235
|
+
arrows: arrows.settings && checkboxes(arrows.label, {
|
|
236
|
+
left: arrows.left,
|
|
237
|
+
right: arrows.right,
|
|
238
|
+
up: arrows.up,
|
|
239
|
+
down: arrows.down
|
|
240
|
+
}),
|
|
241
|
+
titleEnabled: title.settings && toggle(title.label),
|
|
242
|
+
padding: padding.settings && toggle(padding.label),
|
|
243
|
+
labelsEnabled: labels.settings && toggle(labels.label),
|
|
244
|
+
coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label)
|
|
245
|
+
};
|
|
246
|
+
var panelProperties = {
|
|
247
|
+
'authoring.enabled': authoring.settings && toggle(authoring.label, true),
|
|
248
|
+
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
249
|
+
studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
|
|
250
|
+
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
251
|
+
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
252
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
253
|
+
scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring']),
|
|
254
|
+
rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label)
|
|
255
|
+
};
|
|
162
256
|
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
257
|
+
hideSettings: settingsPanelDisabled,
|
|
163
258
|
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
164
259
|
model: model,
|
|
165
260
|
configuration: configuration,
|
|
166
261
|
onChangeModel: onModelChanged,
|
|
167
262
|
onChangeConfiguration: onConfigurationChanged,
|
|
168
263
|
groups: {
|
|
169
|
-
'Item Type':
|
|
170
|
-
|
|
171
|
-
'title.enabled': title.settings && toggle(title.label, true),
|
|
172
|
-
padding: padding.settings && toggle(padding.label),
|
|
173
|
-
labels: labels.settings && toggle(labels.label)
|
|
174
|
-
},
|
|
175
|
-
Properties: {
|
|
176
|
-
'authoring.enabled': authoring.settings && toggle(authoring.label, true),
|
|
177
|
-
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
178
|
-
studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
|
|
179
|
-
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
180
|
-
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
181
|
-
scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring'])
|
|
182
|
-
}
|
|
264
|
+
'Item Type': panelItemType,
|
|
265
|
+
Properties: panelProperties
|
|
183
266
|
}
|
|
184
267
|
})
|
|
185
268
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -195,7 +278,16 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
195
278
|
markup: model.teacherInstructions || '',
|
|
196
279
|
onChange: this.onTeacherInstructionsChange,
|
|
197
280
|
imageSupport: imageSupport,
|
|
198
|
-
nonEmpty: false
|
|
281
|
+
nonEmpty: false,
|
|
282
|
+
spellCheck: spellCheckEnabled,
|
|
283
|
+
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
|
|
284
|
+
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
|
|
285
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
286
|
+
languageCharactersProps: [{
|
|
287
|
+
language: 'spanish'
|
|
288
|
+
}, {
|
|
289
|
+
language: 'special'
|
|
290
|
+
}]
|
|
199
291
|
})), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
200
292
|
label: prompt.label,
|
|
201
293
|
className: classes.promptHolder
|
|
@@ -205,7 +297,16 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
205
297
|
onChange: this.onPromptChange,
|
|
206
298
|
imageSupport: imageSupport,
|
|
207
299
|
nonEmpty: false,
|
|
208
|
-
|
|
300
|
+
spellCheck: spellCheckEnabled,
|
|
301
|
+
disableUnderline: true,
|
|
302
|
+
maxImageWidth: defaultImageMaxWidth,
|
|
303
|
+
maxImageHeight: defaultImageMaxHeight,
|
|
304
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
305
|
+
languageCharactersProps: [{
|
|
306
|
+
language: 'spanish'
|
|
307
|
+
}, {
|
|
308
|
+
language: 'special'
|
|
309
|
+
}]
|
|
209
310
|
})), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
210
311
|
label: rationale.label || 'Rationale',
|
|
211
312
|
className: classes.promptHolder
|
|
@@ -213,14 +314,30 @@ var Configure = /*#__PURE__*/function (_React$Component) {
|
|
|
213
314
|
className: classes.prompt,
|
|
214
315
|
markup: model.rationale || '',
|
|
215
316
|
onChange: this.onRationaleChange,
|
|
216
|
-
imageSupport: imageSupport
|
|
317
|
+
imageSupport: imageSupport,
|
|
318
|
+
spellCheck: spellCheckEnabled,
|
|
319
|
+
maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
|
|
320
|
+
maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight,
|
|
321
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
322
|
+
languageCharactersProps: [{
|
|
323
|
+
language: 'spanish'
|
|
324
|
+
}, {
|
|
325
|
+
language: 'special'
|
|
326
|
+
}]
|
|
217
327
|
})), /*#__PURE__*/_react["default"].createElement(_graphingConfig["default"], {
|
|
218
|
-
|
|
219
|
-
|
|
328
|
+
authoring: authoring,
|
|
329
|
+
availableTools: availableTools,
|
|
330
|
+
gridConfigurations: gridConfigurations,
|
|
331
|
+
graphDimensions: graphDimensions,
|
|
332
|
+
labelsPlaceholders: labelsPlaceholders,
|
|
220
333
|
model: model,
|
|
334
|
+
showLabels: labelsEnabled,
|
|
335
|
+
showTitle: titleEnabled,
|
|
336
|
+
titlePlaceholder: title.placeholder,
|
|
221
337
|
onChange: this.props.onModelChanged
|
|
222
338
|
}), /*#__PURE__*/_react["default"].createElement(_correctResponse["default"], {
|
|
223
|
-
|
|
339
|
+
availableTools: availableTools,
|
|
340
|
+
errors: errors,
|
|
224
341
|
model: model,
|
|
225
342
|
onChange: this.props.onModelChanged
|
|
226
343
|
})));
|
|
@@ -235,6 +352,7 @@ exports.Configure = Configure;
|
|
|
235
352
|
onConfigurationChanged: _propTypes["default"].func,
|
|
236
353
|
classes: _propTypes["default"].object,
|
|
237
354
|
imageSupport: _propTypes["default"].object,
|
|
355
|
+
uploadSoundSupport: _propTypes["default"].object,
|
|
238
356
|
model: _propTypes["default"].object.isRequired,
|
|
239
357
|
configuration: _propTypes["default"].object.isRequired
|
|
240
358
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","Configure","rationale","props","onModelChanged","model","teacherInstructions","classes","configuration","onConfigurationChanged","imageSupport","config","graph","arrows","padding","labels","scoringType","studentInstructions","authoring","teacherInstructionsEnabled","promptEnabled","rationaleEnabled","label","Properties","studentInstructionsEnabled","onTeacherInstructionsChange","onPromptChange","onRationaleChange","enabled","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;IAEQA,K,GAAyBC,kB,CAAzBD,K;IAAOE,M,GAAkBD,kB,CAAlBC,M;IAAQC,K,GAAUF,kB,CAAVE,K;AACvB,IAAMC,GAAG,GAAG,uBAAM,iCAAN,CAAZ;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAAAC,KAAK;AAAA,SAAK;AACvBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,QAAQ,EAAE,QADL;AAELC,MAAAA,OAAO,EAAE,OAFJ;AAGLC,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAA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F,CAzCJ,eAsDE,gCAAC,0BAAD;AACE,QAAA,gBAAgB,EAAEQ,SAAS,IAAIA,SAAS,CAACU,OAD3C;AAEE,QAAA,MAAM,EAAEjB,MAFV;AAGE,QAAA,KAAK,EAAEN,KAHT;AAIE,QAAA,QAAQ,EAAE,KAAKF,KAAL,CAAWC;AAJvB,QAtDF,eA6DE,gCAAC,2BAAD;AACE,QAAA,MAAM,EAAEO,MADV;AAEE,QAAA,KAAK,EAAEN,KAFT;AAGE,QAAA,QAAQ,EAAE,KAAKF,KAAL,CAAWC;AAHvB,QA7DF,CAjCF,CADF;AAuGD;;;EAhK4ByB,kBAAMC,S;;;iCAAxB7B,S,eACQ;AACjBG,EAAAA,cAAc,EAAE2B,sBAAUC,IADT;AAEjBvB,EAAAA,sBAAsB,EAAEsB,sBAAUC,IAFjB;AAGjBzB,EAAAA,OAAO,EAAEwB,sBAAUE,MAHF;AAIjBvB,EAAAA,YAAY,EAAEqB,sBAAUE,MAJP;AAKjB5B,EAAAA,KAAK,EAAE0B,sBAAUE,MAAV,CAAiBC,UALP;AAMjB1B,EAAAA,aAAa,EAAEuB,sBAAUE,MAAV,CAAiBC;AANf,C;iCADRjC,S,kBAUW;AAAEM,EAAAA,OAAO,EAAE;AAAX,C;;eAyJT,wBAAWrB,MAAX,EAAmBe,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport EditableHtml from '@pie-lib/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\n\nconst { Panel, toggle, radio } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = theme => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit\n },\n content: {\n marginTop: theme.spacing.unit * 2\n },\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n }\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired\n };\n\n static defaultProps = { classes: {} };\n\n onRationaleChange = rationale => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = prompt => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = teacherInstructions => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n onModelChanged,\n imageSupport\n } = this.props;\n const config = model.graph;\n\n const {\n arrows = {},\n title = {},\n padding = {},\n labels = {},\n rationale = {},\n scoringType = {},\n studentInstructions = {},\n teacherInstructions = {},\n prompt = {},\n authoring = {}\n } = configuration || {};\n log('[render] model', model);\n const { teacherInstructionsEnabled, promptEnabled, rationaleEnabled } =\n model || {};\n\n return (\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Item Type': {\n arrows: arrows.settings && toggle(arrows.label),\n 'title.enabled': title.settings && toggle(title.label, true),\n padding: padding.settings && toggle(padding.label),\n labels: labels.settings && toggle(labels.label),\n },\n Properties: {\n 'authoring.enabled':\n authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n studentInstructionsEnabled:\n studentInstructions.settings &&\n toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n scoringType:\n scoringType.settings &&\n radio(scoringType.label, ['dichotomous', 'partial scoring'])\n }\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This interaction asks a student to draw a line that meets specific\n criteria. The student will draw the line by clicking on two points\n on the graph.\n </span>\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label || 'Rationale'}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n />\n </InputContainer>\n )}\n\n <GraphingConfig\n authoringEnabled={authoring && authoring.enabled}\n config={config}\n model={model}\n onChange={this.props.onModelChanged}\n />\n\n <CorrectResponse\n config={config}\n model={model}\n onChange={this.props.onModelChanged}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
|
|
1
|
+
{"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","content","promptHolder","width","paddingBottom","prompt","paddingTop","Configure","rationale","props","onModelChanged","model","teacherInstructions","configuration","availableTools","arrows","left","right","up","down","toolbarTools","classes","onConfigurationChanged","imageSupport","uploadSoundSupport","authoring","coordinatesOnHover","gridConfigurations","graphDimensions","labels","padding","scoringType","settingsPanelDisabled","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","withRubric","errors","labelsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","titleEnabled","defaultImageMaxWidth","defaultImageMaxHeight","labelsPlaceholders","top","bottom","panelItemType","label","panelProperties","studentInstructionsEnabled","rubricEnabled","Properties","onTeacherInstructionsChange","language","onPromptChange","onRationaleChange","placeholder","React","Component","PropTypes","func","object","isRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAQA,KAAR,GAA6CC,kBAA7C,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA6CD,kBAA7C,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAA6CF,kBAA7C,CAAuBE,KAAvB;AAAA,IAA8BC,UAA9B,GAA6CH,kBAA7C,CAA8BG,UAA9B;AACA,IAAMC,GAAG,GAAG,uBAAM,iCAAN,CAAZ;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,KAAK,EAAE;AACLC,MAAAA,QAAQ,EAAE,QADL;AAELC,MAAAA,OAAO,EAAE,OAFJ;AAGLC,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAH3B;AAILC,MAAAA,YAAY,EAAEP,KAAK,CAACK,OAAN,CAAcC;AAJvB,KADkB;AAOzBE,IAAAA,OAAO,EAAE;AACPJ,MAAAA,SAAS,EAAEJ,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB;AADzB,KAPgB;AAUzBG,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,MADK;AAEZC,MAAAA,aAAa,EAAEX,KAAK,CAACK,OAAN,CAAcC,IAAd,GAAqB,CAFxB;AAGZC,MAAAA,YAAY,EAAEP,KAAK,CAACK,OAAN,C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E,gCAAC,2BAAD;AACE,QAAA,cAAc,EAAEI,cADlB;AAEE,QAAA,MAAM,EAAEwB,MAFV;AAGE,QAAA,KAAK,EAAE3B,KAHT;AAIE,QAAA,QAAQ,EAAE,KAAKF,KAAL,CAAWC;AAJvB,QAxEF,CAfF,CADF;AAiGD;;;EA1N4BmD,kBAAMC,S;;;iCAAxBvD,S,eACQ;AACjBG,EAAAA,cAAc,EAAEqD,sBAAUC,IADT;AAEjB1C,EAAAA,sBAAsB,EAAEyC,sBAAUC,IAFjB;AAGjB3C,EAAAA,OAAO,EAAE0C,sBAAUE,MAHF;AAIjB1C,EAAAA,YAAY,EAAEwC,sBAAUE,MAJP;AAKjBzC,EAAAA,kBAAkB,EAAEuC,sBAAUE,MALb;AAMjBtD,EAAAA,KAAK,EAAEoD,sBAAUE,MAAV,CAAiBC,UANP;AAOjBrD,EAAAA,aAAa,EAAEkD,sBAAUE,MAAV,CAAiBC;AAPf,C;iCADR3D,S,kBAWW;AAAEc,EAAAA,OAAO,EAAE;AAAX,C;;eAkNT,wBAAW7B,MAAX,EAAmBe,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport EditableHtml from '@pie-lib/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\nimport intersection from 'lodash/intersection';\n\nconst { Panel, toggle, radio, checkboxes } = settings;\nconst log = debug('@pie-element:graphing:configure');\n\nconst styles = (theme) => ({\n title: {\n fontSize: '1.1rem',\n display: 'block',\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit,\n },\n content: {\n marginTop: theme.spacing.unit * 2,\n },\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2,\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n },\n});\n\nexport class Configure extends React.Component {\n static propTypes = {\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n classes: PropTypes.object,\n imageSupport: PropTypes.object,\n uploadSoundSupport: PropTypes.object,\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\n };\n\n static defaultProps = { classes: {} };\n\n componentDidMount() {\n const { configuration, onModelChanged, model } = this.props;\n const { availableTools } = configuration || {};\n let { arrows } = model || {};\n\n // This is used for offering support for old models which have the property arrows: boolean\n // Same thing is set in the controller: packages/graphing/controller/src/index.js - model\n if (typeof arrows === 'boolean') {\n if (arrows) {\n arrows = { left: true, right: true, up: true, down: true };\n } else {\n arrows = { left: false, right: false, up: false, down: false };\n }\n }\n\n const toolbarTools = intersection(availableTools || [], model.toolbarTools || []);\n\n onModelChanged && onModelChanged({ ...model, arrows, toolbarTools });\n }\n\n onRationaleChange = (rationale) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, rationale });\n };\n\n onPromptChange = (prompt) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, prompt });\n };\n\n onTeacherInstructionsChange = (teacherInstructions) => {\n const { onModelChanged, model } = this.props;\n\n onModelChanged({ ...model, teacherInstructions });\n };\n\n render() {\n const { classes, model, configuration, onConfigurationChanged, onModelChanged, imageSupport, uploadSoundSupport } =\n this.props;\n const {\n arrows = {},\n authoring = {},\n availableTools = [],\n coordinatesOnHover = {},\n gridConfigurations = [],\n graphDimensions = {},\n labels = {},\n padding = {},\n prompt = {},\n rationale = {},\n scoringType = {},\n settingsPanelDisabled,\n spellCheck = {},\n studentInstructions = {},\n teacherInstructions = {},\n title = {},\n maxImageWidth = {},\n maxImageHeight = {},\n withRubric = {},\n } = configuration || {};\n const {\n errors = {},\n labelsEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n titleEnabled,\n } = model || {};\n\n log('[render] model', model);\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n const labelsPlaceholders = {\n top: labels.top,\n right: labels.right,\n bottom: labels.bottom,\n left: labels.left,\n };\n\n const panelItemType = {\n arrows:\n arrows.settings &&\n checkboxes(arrows.label, {\n left: arrows.left,\n right: arrows.right,\n up: arrows.up,\n down: arrows.down,\n }),\n titleEnabled: title.settings && toggle(title.label),\n padding: padding.settings && toggle(padding.label),\n labelsEnabled: labels.settings && toggle(labels.label),\n coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label),\n };\n const panelProperties = {\n 'authoring.enabled': authoring.settings && toggle(authoring.label, true),\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring']),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <layout.ConfigLayout\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Item Type': panelItemType,\n Properties: panelProperties,\n }}\n />\n }\n >\n <div className={classes.content}>\n <Typography component=\"div\" type=\"body1\">\n <span>\n This interaction asks a student to draw a line that meets specific criteria. The student will draw the\n line by clicking on two points on the graph.\n </span>\n </Typography>\n\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.teacherInstructions) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.teacherInstructions) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer label={prompt.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChange}\n imageSupport={imageSupport}\n nonEmpty={false}\n spellCheck={spellCheckEnabled}\n disableUnderline\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer label={rationale.label || 'Rationale'} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChange}\n imageSupport={imageSupport}\n spellCheck={spellCheckEnabled}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </InputContainer>\n )}\n\n <GraphingConfig\n authoring={authoring}\n availableTools={availableTools}\n gridConfigurations={gridConfigurations}\n graphDimensions={graphDimensions}\n labelsPlaceholders={labelsPlaceholders}\n model={model}\n showLabels={labelsEnabled}\n showTitle={titleEnabled}\n titlePlaceholder={title.placeholder}\n onChange={this.props.onModelChanged}\n />\n\n <CorrectResponse\n availableTools={availableTools}\n errors={errors}\n model={model}\n onChange={this.props.onModelChanged}\n />\n </div>\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
|