@pie-element/graphing-solution-set 1.6.2-next.2 → 1.6.2-next.3
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/configure.js +398 -0
- package/configure/lib/configure.js.map +1 -0
- package/configure/lib/correct-response.js +601 -0
- package/configure/lib/correct-response.js.map +1 -0
- package/configure/lib/defaults.js +359 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/graphing-config.js +435 -0
- package/configure/lib/graphing-config.js.map +1 -0
- package/configure/lib/index.js +218 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/utils.js +754 -0
- package/configure/lib/utils.js.map +1 -0
- package/controller/lib/defaults.js +71 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +423 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +273 -0
- package/controller/lib/utils.js.map +1 -0
- package/lib/index.js +214 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +440 -0
- package/lib/main.js.map +1 -0
- package/lib/utils.js +604 -0
- package/lib/utils.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.Configure = void 0;
|
|
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
|
+
|
|
22
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
+
|
|
24
|
+
var _react = _interopRequireDefault(require("react"));
|
|
25
|
+
|
|
26
|
+
var _styles = require("@material-ui/core/styles");
|
|
27
|
+
|
|
28
|
+
var _configUi = require("@pie-lib/pie-toolbox/config-ui");
|
|
29
|
+
|
|
30
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
31
|
+
|
|
32
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
33
|
+
|
|
34
|
+
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
35
|
+
|
|
36
|
+
var _editableHtml = require("@pie-lib/pie-toolbox/editable-html");
|
|
37
|
+
|
|
38
|
+
var _graphingConfig = _interopRequireDefault(require("./graphing-config"));
|
|
39
|
+
|
|
40
|
+
var _correctResponse = _interopRequireDefault(require("./correct-response"));
|
|
41
|
+
|
|
42
|
+
var _intersection = _interopRequireDefault(require("lodash/intersection"));
|
|
43
|
+
|
|
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; }
|
|
47
|
+
|
|
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); }; }
|
|
49
|
+
|
|
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; } }
|
|
51
|
+
|
|
52
|
+
var Panel = _configUi.settings.Panel,
|
|
53
|
+
toggle = _configUi.settings.toggle,
|
|
54
|
+
radio = _configUi.settings.radio,
|
|
55
|
+
checkboxes = _configUi.settings.checkboxes,
|
|
56
|
+
textField = _configUi.settings.textField,
|
|
57
|
+
dropdown = _configUi.settings.dropdown;
|
|
58
|
+
var log = (0, _debug["default"])('@pie-element:graphing-solution-set:configure');
|
|
59
|
+
|
|
60
|
+
var styles = function styles(theme) {
|
|
61
|
+
return {
|
|
62
|
+
title: {
|
|
63
|
+
fontSize: '1.1rem',
|
|
64
|
+
display: 'block',
|
|
65
|
+
marginTop: theme.spacing.unit * 2,
|
|
66
|
+
marginBottom: theme.spacing.unit
|
|
67
|
+
},
|
|
68
|
+
promptHolder: {
|
|
69
|
+
width: '100%',
|
|
70
|
+
paddingTop: theme.spacing.unit * 2,
|
|
71
|
+
marginBottom: theme.spacing.unit * 2,
|
|
72
|
+
marginTop: theme.spacing.unit * 2
|
|
73
|
+
},
|
|
74
|
+
description: {
|
|
75
|
+
marginBottom: theme.spacing.unit * 2.5
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
var Configure = /*#__PURE__*/function (_React$Component) {
|
|
81
|
+
(0, _inherits2["default"])(Configure, _React$Component);
|
|
82
|
+
|
|
83
|
+
var _super = _createSuper(Configure);
|
|
84
|
+
|
|
85
|
+
function Configure() {
|
|
86
|
+
var _this;
|
|
87
|
+
|
|
88
|
+
(0, _classCallCheck2["default"])(this, Configure);
|
|
89
|
+
|
|
90
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
91
|
+
args[_key] = arguments[_key];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
95
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onRationaleChange", function (rationale) {
|
|
96
|
+
var _this$props = _this.props,
|
|
97
|
+
onModelChanged = _this$props.onModelChanged,
|
|
98
|
+
model = _this$props.model;
|
|
99
|
+
onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
100
|
+
rationale: rationale
|
|
101
|
+
}));
|
|
102
|
+
});
|
|
103
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onPromptChange", function (prompt) {
|
|
104
|
+
var _this$props2 = _this.props,
|
|
105
|
+
onModelChanged = _this$props2.onModelChanged,
|
|
106
|
+
model = _this$props2.model;
|
|
107
|
+
onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
108
|
+
prompt: prompt
|
|
109
|
+
}));
|
|
110
|
+
});
|
|
111
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTeacherInstructionsChange", function (teacherInstructions) {
|
|
112
|
+
var _this$props3 = _this.props,
|
|
113
|
+
onModelChanged = _this$props3.onModelChanged,
|
|
114
|
+
model = _this$props3.model;
|
|
115
|
+
onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
116
|
+
teacherInstructions: teacherInstructions
|
|
117
|
+
}));
|
|
118
|
+
});
|
|
119
|
+
return _this;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
(0, _createClass2["default"])(Configure, [{
|
|
123
|
+
key: "componentDidMount",
|
|
124
|
+
value:
|
|
125
|
+
/*
|
|
126
|
+
* Triggered when configure component is mounted
|
|
127
|
+
* */
|
|
128
|
+
function componentDidMount() {
|
|
129
|
+
var _this$props4 = this.props,
|
|
130
|
+
configuration = _this$props4.configuration,
|
|
131
|
+
onModelChanged = _this$props4.onModelChanged,
|
|
132
|
+
model = _this$props4.model;
|
|
133
|
+
|
|
134
|
+
var _ref = configuration || {},
|
|
135
|
+
title = _ref.title,
|
|
136
|
+
graphDimensions = _ref.graphDimensions;
|
|
137
|
+
|
|
138
|
+
var _ref2 = model || {},
|
|
139
|
+
arrows = _ref2.arrows,
|
|
140
|
+
showTitle = _ref2.titleEnabled,
|
|
141
|
+
showDimensions = _ref2.dimensionsEnabled; // This is used for offering support for old models which have the property arrows: boolean
|
|
142
|
+
// Same thing is set in the controller: packages/graphing/controller/src/index.js - model
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
if (typeof arrows === 'boolean') {
|
|
146
|
+
if (arrows) {
|
|
147
|
+
arrows = {
|
|
148
|
+
left: true,
|
|
149
|
+
right: true,
|
|
150
|
+
up: true,
|
|
151
|
+
down: true
|
|
152
|
+
};
|
|
153
|
+
} else {
|
|
154
|
+
arrows = {
|
|
155
|
+
left: false,
|
|
156
|
+
right: false,
|
|
157
|
+
up: false,
|
|
158
|
+
down: false
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
var titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;
|
|
164
|
+
var dimensionsEnabled = showDimensions === undefined || showDimensions === null ? graphDimensions.enabled : showDimensions;
|
|
165
|
+
onModelChanged && onModelChanged(_objectSpread(_objectSpread({}, model), {}, {
|
|
166
|
+
arrows: arrows,
|
|
167
|
+
titleEnabled: titleEnabled,
|
|
168
|
+
dimensionsEnabled: dimensionsEnabled
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
/*
|
|
172
|
+
* Triggered when the rationale is changed
|
|
173
|
+
* @param {string} rationale - The new rationale
|
|
174
|
+
* */
|
|
175
|
+
|
|
176
|
+
}, {
|
|
177
|
+
key: "render",
|
|
178
|
+
value:
|
|
179
|
+
/*
|
|
180
|
+
* Render the component
|
|
181
|
+
* */
|
|
182
|
+
function render() {
|
|
183
|
+
var _this$props5 = this.props,
|
|
184
|
+
classes = _this$props5.classes,
|
|
185
|
+
model = _this$props5.model,
|
|
186
|
+
configuration = _this$props5.configuration,
|
|
187
|
+
onConfigurationChanged = _this$props5.onConfigurationChanged,
|
|
188
|
+
onModelChanged = _this$props5.onModelChanged,
|
|
189
|
+
imageSupport = _this$props5.imageSupport,
|
|
190
|
+
uploadSoundSupport = _this$props5.uploadSoundSupport;
|
|
191
|
+
|
|
192
|
+
var _ref3 = configuration || {},
|
|
193
|
+
_ref3$arrows = _ref3.arrows,
|
|
194
|
+
arrows = _ref3$arrows === void 0 ? {} : _ref3$arrows,
|
|
195
|
+
_ref3$authoring = _ref3.authoring,
|
|
196
|
+
authoring = _ref3$authoring === void 0 ? {} : _ref3$authoring,
|
|
197
|
+
_ref3$coordinatesOnHo = _ref3.coordinatesOnHover,
|
|
198
|
+
coordinatesOnHover = _ref3$coordinatesOnHo === void 0 ? {} : _ref3$coordinatesOnHo,
|
|
199
|
+
_ref3$contentDimensio = _ref3.contentDimensions,
|
|
200
|
+
contentDimensions = _ref3$contentDimensio === void 0 ? {} : _ref3$contentDimensio,
|
|
201
|
+
_ref3$gridConfigurati = _ref3.gridConfigurations,
|
|
202
|
+
gridConfigurations = _ref3$gridConfigurati === void 0 ? [] : _ref3$gridConfigurati,
|
|
203
|
+
_ref3$graphDimensions = _ref3.graphDimensions,
|
|
204
|
+
graphDimensions = _ref3$graphDimensions === void 0 ? {} : _ref3$graphDimensions,
|
|
205
|
+
_ref3$instruction = _ref3.instruction,
|
|
206
|
+
instruction = _ref3$instruction === void 0 ? {} : _ref3$instruction,
|
|
207
|
+
_ref3$labels = _ref3.labels,
|
|
208
|
+
labels = _ref3$labels === void 0 ? {} : _ref3$labels,
|
|
209
|
+
_ref3$padding = _ref3.padding,
|
|
210
|
+
padding = _ref3$padding === void 0 ? {} : _ref3$padding,
|
|
211
|
+
_ref3$prompt = _ref3.prompt,
|
|
212
|
+
prompt = _ref3$prompt === void 0 ? {} : _ref3$prompt,
|
|
213
|
+
_ref3$rationale = _ref3.rationale,
|
|
214
|
+
rationale = _ref3$rationale === void 0 ? {} : _ref3$rationale,
|
|
215
|
+
_ref3$scoringType = _ref3.scoringType,
|
|
216
|
+
scoringType = _ref3$scoringType === void 0 ? {} : _ref3$scoringType,
|
|
217
|
+
settingsPanelDisabled = _ref3.settingsPanelDisabled,
|
|
218
|
+
_ref3$spellCheck = _ref3.spellCheck,
|
|
219
|
+
spellCheck = _ref3$spellCheck === void 0 ? {} : _ref3$spellCheck,
|
|
220
|
+
_ref3$studentInstruct = _ref3.studentInstructions,
|
|
221
|
+
studentInstructions = _ref3$studentInstruct === void 0 ? {} : _ref3$studentInstruct,
|
|
222
|
+
_ref3$teacherInstruct = _ref3.teacherInstructions,
|
|
223
|
+
teacherInstructions = _ref3$teacherInstruct === void 0 ? {} : _ref3$teacherInstruct,
|
|
224
|
+
_ref3$title = _ref3.title,
|
|
225
|
+
title = _ref3$title === void 0 ? {} : _ref3$title,
|
|
226
|
+
_ref3$maxImageWidth = _ref3.maxImageWidth,
|
|
227
|
+
maxImageWidth = _ref3$maxImageWidth === void 0 ? {} : _ref3$maxImageWidth,
|
|
228
|
+
_ref3$maxImageHeight = _ref3.maxImageHeight,
|
|
229
|
+
maxImageHeight = _ref3$maxImageHeight === void 0 ? {} : _ref3$maxImageHeight,
|
|
230
|
+
_ref3$withRubric = _ref3.withRubric,
|
|
231
|
+
withRubric = _ref3$withRubric === void 0 ? {} : _ref3$withRubric,
|
|
232
|
+
_ref3$language = _ref3.language,
|
|
233
|
+
language = _ref3$language === void 0 ? {} : _ref3$language,
|
|
234
|
+
_ref3$languageChoices = _ref3.languageChoices,
|
|
235
|
+
languageChoices = _ref3$languageChoices === void 0 ? {} : _ref3$languageChoices,
|
|
236
|
+
_ref3$mathMlOptions = _ref3.mathMlOptions,
|
|
237
|
+
mathMlOptions = _ref3$mathMlOptions === void 0 ? {} : _ref3$mathMlOptions;
|
|
238
|
+
|
|
239
|
+
var _ref4 = model || {},
|
|
240
|
+
_ref4$errors = _ref4.errors,
|
|
241
|
+
errors = _ref4$errors === void 0 ? {} : _ref4$errors,
|
|
242
|
+
labelsEnabled = _ref4.labelsEnabled,
|
|
243
|
+
dimensionsEnabled = _ref4.dimensionsEnabled,
|
|
244
|
+
promptEnabled = _ref4.promptEnabled,
|
|
245
|
+
rationaleEnabled = _ref4.rationaleEnabled,
|
|
246
|
+
spellCheckEnabled = _ref4.spellCheckEnabled,
|
|
247
|
+
teacherInstructionsEnabled = _ref4.teacherInstructionsEnabled,
|
|
248
|
+
titleEnabled = _ref4.titleEnabled;
|
|
249
|
+
|
|
250
|
+
var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
251
|
+
var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
252
|
+
var labelsPlaceholders = {
|
|
253
|
+
top: labels.top,
|
|
254
|
+
right: labels.right,
|
|
255
|
+
bottom: labels.bottom,
|
|
256
|
+
left: labels.left
|
|
257
|
+
};
|
|
258
|
+
var panelItemType = {
|
|
259
|
+
arrows: arrows.settings && checkboxes(arrows.label, {
|
|
260
|
+
left: arrows.left,
|
|
261
|
+
right: arrows.right,
|
|
262
|
+
up: arrows.up,
|
|
263
|
+
down: arrows.down
|
|
264
|
+
}),
|
|
265
|
+
titleEnabled: title.settings && toggle(title.label),
|
|
266
|
+
padding: padding.settings && toggle(padding.label),
|
|
267
|
+
labelsEnabled: labels.settings && toggle(labels.label),
|
|
268
|
+
'language.enabled': language.settings && toggle(language.label, true),
|
|
269
|
+
language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),
|
|
270
|
+
dimensionsEnabled: graphDimensions.settings && toggle(graphDimensions.label),
|
|
271
|
+
coordinatesOnHover: coordinatesOnHover.settings && toggle(coordinatesOnHover.label)
|
|
272
|
+
};
|
|
273
|
+
var panelProperties = {
|
|
274
|
+
'authoring.enabled': authoring.settings && toggle(authoring.label, true),
|
|
275
|
+
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
276
|
+
studentInstructionsEnabled: studentInstructions.settings && toggle(studentInstructions.label),
|
|
277
|
+
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
278
|
+
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
279
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
280
|
+
scoringType: scoringType.settings && radio(scoringType.label, ['dichotomous', 'partial scoring']),
|
|
281
|
+
rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label),
|
|
282
|
+
instruction: instruction.settings && textField(instruction.label)
|
|
283
|
+
};
|
|
284
|
+
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
285
|
+
dimensions: contentDimensions,
|
|
286
|
+
hideSettings: settingsPanelDisabled,
|
|
287
|
+
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
288
|
+
model: model,
|
|
289
|
+
configuration: configuration,
|
|
290
|
+
onChangeModel: onModelChanged,
|
|
291
|
+
onChangeConfiguration: onConfigurationChanged,
|
|
292
|
+
groups: {
|
|
293
|
+
Settings: panelItemType,
|
|
294
|
+
Properties: panelProperties
|
|
295
|
+
}
|
|
296
|
+
})
|
|
297
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
298
|
+
component: "div",
|
|
299
|
+
type: "body1",
|
|
300
|
+
className: classes.description
|
|
301
|
+
}, (instruction === null || instruction === void 0 ? void 0 : instruction.label) || ''), teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
302
|
+
label: teacherInstructions.label,
|
|
303
|
+
className: classes.promptHolder
|
|
304
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
|
|
305
|
+
className: classes.prompt,
|
|
306
|
+
markup: model.teacherInstructions || '',
|
|
307
|
+
onChange: this.onTeacherInstructionsChange,
|
|
308
|
+
imageSupport: imageSupport,
|
|
309
|
+
nonEmpty: false,
|
|
310
|
+
spellCheck: spellCheckEnabled,
|
|
311
|
+
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
|
|
312
|
+
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight,
|
|
313
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
314
|
+
languageCharactersProps: [{
|
|
315
|
+
language: 'spanish'
|
|
316
|
+
}, {
|
|
317
|
+
language: 'special'
|
|
318
|
+
}],
|
|
319
|
+
mathMlOptions: mathMlOptions
|
|
320
|
+
})), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
321
|
+
label: prompt.label,
|
|
322
|
+
className: classes.promptHolder
|
|
323
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
|
|
324
|
+
className: classes.prompt,
|
|
325
|
+
markup: model.prompt,
|
|
326
|
+
onChange: this.onPromptChange,
|
|
327
|
+
imageSupport: imageSupport,
|
|
328
|
+
nonEmpty: false,
|
|
329
|
+
spellCheck: spellCheckEnabled,
|
|
330
|
+
disableUnderline: true,
|
|
331
|
+
maxImageWidth: defaultImageMaxWidth,
|
|
332
|
+
maxImageHeight: defaultImageMaxHeight,
|
|
333
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
334
|
+
languageCharactersProps: [{
|
|
335
|
+
language: 'spanish'
|
|
336
|
+
}, {
|
|
337
|
+
language: 'special'
|
|
338
|
+
}],
|
|
339
|
+
mathMlOptions: mathMlOptions
|
|
340
|
+
})), /*#__PURE__*/_react["default"].createElement(_graphingConfig["default"], {
|
|
341
|
+
authoring: authoring,
|
|
342
|
+
gridConfigurations: gridConfigurations,
|
|
343
|
+
graphDimensions: graphDimensions,
|
|
344
|
+
labelsPlaceholders: labelsPlaceholders,
|
|
345
|
+
model: model,
|
|
346
|
+
showLabels: labelsEnabled,
|
|
347
|
+
dimensionsEnabled: dimensionsEnabled,
|
|
348
|
+
showTitle: titleEnabled,
|
|
349
|
+
titlePlaceholder: title.placeholder,
|
|
350
|
+
onChange: this.props.onModelChanged,
|
|
351
|
+
mathMlOptions: mathMlOptions
|
|
352
|
+
}), /*#__PURE__*/_react["default"].createElement(_correctResponse["default"], {
|
|
353
|
+
errors: errors,
|
|
354
|
+
model: model,
|
|
355
|
+
onChange: this.props.onModelChanged,
|
|
356
|
+
mathMlOptions: mathMlOptions
|
|
357
|
+
}), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
358
|
+
label: rationale.label || 'Rationale',
|
|
359
|
+
className: classes.promptHolder
|
|
360
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml.EditableHtml, {
|
|
361
|
+
className: classes.prompt,
|
|
362
|
+
markup: model.rationale || '',
|
|
363
|
+
onChange: this.onRationaleChange,
|
|
364
|
+
imageSupport: imageSupport,
|
|
365
|
+
spellCheck: spellCheckEnabled,
|
|
366
|
+
maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
|
|
367
|
+
maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight,
|
|
368
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
369
|
+
languageCharactersProps: [{
|
|
370
|
+
language: 'spanish'
|
|
371
|
+
}, {
|
|
372
|
+
language: 'special'
|
|
373
|
+
}],
|
|
374
|
+
mathMlOptions: mathMlOptions
|
|
375
|
+
})));
|
|
376
|
+
}
|
|
377
|
+
}]);
|
|
378
|
+
return Configure;
|
|
379
|
+
}(_react["default"].Component);
|
|
380
|
+
|
|
381
|
+
exports.Configure = Configure;
|
|
382
|
+
(0, _defineProperty2["default"])(Configure, "propTypes", {
|
|
383
|
+
onModelChanged: _propTypes["default"].func,
|
|
384
|
+
onConfigurationChanged: _propTypes["default"].func,
|
|
385
|
+
classes: _propTypes["default"].object,
|
|
386
|
+
imageSupport: _propTypes["default"].object,
|
|
387
|
+
uploadSoundSupport: _propTypes["default"].object,
|
|
388
|
+
model: _propTypes["default"].object.isRequired,
|
|
389
|
+
configuration: _propTypes["default"].object.isRequired
|
|
390
|
+
});
|
|
391
|
+
(0, _defineProperty2["default"])(Configure, "defaultProps", {
|
|
392
|
+
classes: {}
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
var _default = (0, _styles.withStyles)(styles)(Configure);
|
|
396
|
+
|
|
397
|
+
exports["default"] = _default;
|
|
398
|
+
//# sourceMappingURL=configure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/configure.jsx"],"names":["Panel","settings","toggle","radio","checkboxes","textField","dropdown","log","styles","theme","title","fontSize","display","marginTop","spacing","unit","marginBottom","promptHolder","width","paddingTop","description","Configure","rationale","props","onModelChanged","model","prompt","teacherInstructions","configuration","graphDimensions","arrows","showTitle","titleEnabled","showDimensions","dimensionsEnabled","left","right","up","down","undefined","enabled","classes","onConfigurationChanged","imageSupport","uploadSoundSupport","authoring","coordinatesOnHover","contentDimensions","gridConfigurations","instruction","labels","padding","scoringType","settingsPanelDisabled","spellCheck","studentInstructions","maxImageWidth","maxImageHeight","withRubric","language","languageChoices","mathMlOptions","errors","labelsEnabled","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","defaultImageMaxWidth","defaultImageMaxHeight","labelsPlaceholders","top","bottom","panelItemType","label","options","panelProperties","studentInstructionsEnabled","rubricEnabled","Settings","Properties","onTeacherInstructionsChange","onPromptChange","placeholder","onRationaleChange","React","Component","PropTypes","func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EjB9C,EAAAA,sBAAsB,EAAE6C,sBAAUC,IAFjB;AAGjB/C,EAAAA,OAAO,EAAE8C,sBAAUE,MAHF;AAIjB9C,EAAAA,YAAY,EAAE4C,sBAAUE,MAJP;AAKjB7C,EAAAA,kBAAkB,EAAE2C,sBAAUE,MALb;AAMjBhE,EAAAA,KAAK,EAAE8D,sBAAUE,MAAV,CAAiBC,UANP;AAOjB9D,EAAAA,aAAa,EAAE2D,sBAAUE,MAAV,CAAiBC;AAPf,C;iCADRrE,S,kBAWW;AAAEoB,EAAAA,OAAO,EAAE;AAAX,C;;eA+NT,wBAAWjC,MAAX,EAAmBa,SAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\n\nimport { settings, layout, InputContainer } from '@pie-lib/pie-toolbox/config-ui';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport Typography from '@material-ui/core/Typography';\nimport { EditableHtml } from '@pie-lib/pie-toolbox/editable-html';\nimport GraphingConfig from './graphing-config';\nimport CorrectResponse from './correct-response';\nimport intersection from 'lodash/intersection';\n\nconst { Panel, toggle, radio, checkboxes, textField, dropdown } = settings;\nconst log = debug('@pie-element:graphing-solution-set: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 promptHolder: {\n width: '100%',\n paddingTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n marginTop: theme.spacing.unit * 2,\n },\n description: {\n marginBottom: theme.spacing.unit * 2.5,\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 /*\n * Triggered when configure component is mounted\n * */\n componentDidMount() {\n const { configuration, onModelChanged, model } = this.props;\n const { title, graphDimensions } = configuration || {};\n let { arrows, titleEnabled: showTitle, dimensionsEnabled: showDimensions } = model || {};\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 const titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;\n const dimensionsEnabled =\n showDimensions === undefined || showDimensions === null ? graphDimensions.enabled : showDimensions;\n onModelChanged && onModelChanged({ ...model, arrows, titleEnabled, dimensionsEnabled });\n }\n\n /*\n * Triggered when the rationale is changed\n * @param {string} rationale - The new rationale\n * */\n onRationaleChange = (rationale) => {\n const { onModelChanged, model } = this.props;\n onModelChanged({ ...model, rationale });\n };\n\n /*\n * Triggered when the prompt is changed\n * @param {string} prompt - The new prompt\n * */\n onPromptChange = (prompt) => {\n const { onModelChanged, model } = this.props;\n onModelChanged({ ...model, prompt });\n };\n\n /*\n * Triggered when the teacher instructions are changed\n * @param {string} teacherInstructions - The new teacher instructions\n * */\n onTeacherInstructionsChange = (teacherInstructions) => {\n const { onModelChanged, model } = this.props;\n onModelChanged({ ...model, teacherInstructions });\n };\n\n /*\n * Render the component\n * */\n render() {\n const { classes, model, configuration, onConfigurationChanged, onModelChanged, imageSupport, uploadSoundSupport } =\n this.props;\n const {\n arrows = {},\n authoring = {},\n coordinatesOnHover = {},\n contentDimensions = {},\n gridConfigurations = [],\n graphDimensions = {},\n instruction = {},\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 language = {},\n languageChoices = {},\n mathMlOptions = {},\n } = configuration || {};\n const {\n errors = {},\n labelsEnabled,\n dimensionsEnabled,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n titleEnabled,\n } = model || {};\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 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 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n dimensionsEnabled: graphDimensions.settings && toggle(graphDimensions.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 instruction: instruction.settings && textField(instruction.label),\n };\n return (\n <layout.ConfigLayout\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={onModelChanged}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelItemType,\n Properties: panelProperties,\n }}\n />\n }\n >\n <Typography component=\"div\" type=\"body1\" className={classes.description}>\n {instruction?.label || ''}\n </Typography>\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 mathMlOptions={mathMlOptions}\n />\n </InputContainer>\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 mathMlOptions={mathMlOptions}\n />\n </InputContainer>\n )}\n <GraphingConfig\n authoring={authoring}\n gridConfigurations={gridConfigurations}\n graphDimensions={graphDimensions}\n labelsPlaceholders={labelsPlaceholders}\n model={model}\n showLabels={labelsEnabled}\n dimensionsEnabled={dimensionsEnabled}\n showTitle={titleEnabled}\n titlePlaceholder={title.placeholder}\n onChange={this.props.onModelChanged}\n mathMlOptions={mathMlOptions}\n />\n <CorrectResponse\n errors={errors}\n model={model}\n onChange={this.props.onModelChanged}\n mathMlOptions={mathMlOptions}\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 mathMlOptions={mathMlOptions}\n />\n </InputContainer>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default withStyles(styles)(Configure);\n"],"file":"configure.js"}
|