@pie-element/inline-dropdown 4.5.1 → 4.5.2-next.120
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/defaults.js +1 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/main.js +108 -142
- package/configure/lib/main.js.map +1 -1
- package/configure/package.json +2 -2
- package/docs/config-schema.json +5 -0
- package/docs/config-schema.json.md +4 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.js"],"names":["model","disabled","mode","prompt","shuffle","markup","choices","alternateResponse","promptEnabled","rationaleEnabled","choiceRationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","toolbarEditorPosition","displayType","configuration","settings","label","spellCheck","enabled","lockChoiceOrder","partialScoring","rationale","teacherInstructions","choiceRationale","maxResponseAreas","maxResponseAreaChoices","maxImageWidth","maxImageHeight","withRubric"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,KADL;AAELC,IAAAA,IAAI,EAAE,QAFD;AAGLC,IAAAA,MAAM,EAAE,4CAHH;AAILC,IAAAA,OAAO,EAAE,IAJJ;AAKLC,IAAAA,MAAM,EAAE,EALH;AAMLC,IAAAA,OAAO,EAAE,EANJ;AAOLC,IAAAA,iBAAiB,EAAE,EAPd;AAQLC,IAAAA,aAAa,EAAE,IARV;AASLC,IAAAA,gBAAgB,EAAE,IATb;AAULC,IAAAA,sBAAsB,EAAE,IAVnB;AAWLC,IAAAA,0BAA0B,EAAE,IAXvB;AAYLC,IAAAA,0BAA0B,EAAE,IAZvB;AAaLC,IAAAA,qBAAqB,EAAE,QAblB;AAcLC,IAAAA,WAAW,EAAE;AAdR,GADM;AAiBbC,EAAAA,aAAa,EAAE;AACbZ,IAAAA,MAAM,EAAE;AACNa,MAAAA,QAAQ,EAAE,IADJ;AAENC,MAAAA,KAAK,EAAE;AAFD,KADK;AAKbC,IAAAA,UAAU,EAAE;
|
|
1
|
+
{"version":3,"sources":["../src/defaults.js"],"names":["model","disabled","mode","prompt","shuffle","markup","choices","alternateResponse","promptEnabled","rationaleEnabled","choiceRationaleEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","toolbarEditorPosition","displayType","configuration","settings","label","settingsPanelDisabled","spellCheck","enabled","lockChoiceOrder","partialScoring","rationale","teacherInstructions","choiceRationale","maxResponseAreas","maxResponseAreaChoices","maxImageWidth","maxImageHeight","withRubric"],"mappings":";;;;;;eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,QAAQ,EAAE,KADL;AAELC,IAAAA,IAAI,EAAE,QAFD;AAGLC,IAAAA,MAAM,EAAE,4CAHH;AAILC,IAAAA,OAAO,EAAE,IAJJ;AAKLC,IAAAA,MAAM,EAAE,EALH;AAMLC,IAAAA,OAAO,EAAE,EANJ;AAOLC,IAAAA,iBAAiB,EAAE,EAPd;AAQLC,IAAAA,aAAa,EAAE,IARV;AASLC,IAAAA,gBAAgB,EAAE,IATb;AAULC,IAAAA,sBAAsB,EAAE,IAVnB;AAWLC,IAAAA,0BAA0B,EAAE,IAXvB;AAYLC,IAAAA,0BAA0B,EAAE,IAZvB;AAaLC,IAAAA,qBAAqB,EAAE,QAblB;AAcLC,IAAAA,WAAW,EAAE;AAdR,GADM;AAiBbC,EAAAA,aAAa,EAAE;AACbZ,IAAAA,MAAM,EAAE;AACNa,MAAAA,QAAQ,EAAE,IADJ;AAENC,MAAAA,KAAK,EAAE;AAFD,KADK;AAKbC,IAAAA,qBAAqB,EAAE,KALV;AAMbC,IAAAA,UAAU,EAAE;AACVF,MAAAA,KAAK,EAAE,YADG;AAEVD,MAAAA,QAAQ,EAAE,KAFA;AAGVI,MAAAA,OAAO,EAAE;AAHC,KANC;AAWbC,IAAAA,eAAe,EAAE;AACfL,MAAAA,QAAQ,EAAE,IADK;AAEfC,MAAAA,KAAK,EAAE;AAFQ,KAXJ;AAebK,IAAAA,cAAc,EAAE;AACdN,MAAAA,QAAQ,EAAE,KADI;AAEdC,MAAAA,KAAK,EAAE;AAFO,KAfH;AAmBbM,IAAAA,SAAS,EAAE;AACTP,MAAAA,QAAQ,EAAE,IADD;AAETC,MAAAA,KAAK,EAAE;AAFE,KAnBE;AAuBbO,IAAAA,mBAAmB,EAAE;AACnBR,MAAAA,QAAQ,EAAE,IADS;AAEnBC,MAAAA,KAAK,EAAE;AAFY,KAvBR;AA2BbQ,IAAAA,eAAe,EAAE;AACfT,MAAAA,QAAQ,EAAE,IADK;AAEfC,MAAAA,KAAK,EAAE;AAFQ,KA3BJ;AA+BbJ,IAAAA,qBAAqB,EAAE;AACrBG,MAAAA,QAAQ,EAAE,KADW;AAErBC,MAAAA,KAAK,EAAE;AAFc,KA/BV;AAmCbS,IAAAA,gBAAgB,EAAE,EAnCL;AAoCbC,IAAAA,sBAAsB,EAAE,EApCX;AAqCbC,IAAAA,aAAa,EAAE;AACbJ,MAAAA,mBAAmB,EAAE,GADR;AAEbrB,MAAAA,MAAM,EAAE,GAFK;AAGboB,MAAAA,SAAS,EAAE;AAHE,KArCF;AA0CbM,IAAAA,cAAc,EAAE;AACdL,MAAAA,mBAAmB,EAAE,GADP;AAEdrB,MAAAA,MAAM,EAAE,GAFM;AAGdoB,MAAAA,SAAS,EAAE;AAHG,KA1CH;AA+CbO,IAAAA,UAAU,EAAE;AACVd,MAAAA,QAAQ,EAAE,KADA;AAEVC,MAAAA,KAAK,EAAE;AAFG;AA/CC;AAjBF,C","sourcesContent":["export default {\n model: {\n disabled: false,\n mode: 'gather',\n prompt: 'Use the dropdowns to complete the sentence',\n shuffle: true,\n markup: '',\n choices: {},\n alternateResponse: {},\n promptEnabled: true,\n rationaleEnabled: true,\n choiceRationaleEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n displayType: 'block',\n },\n configuration: {\n prompt: {\n settings: true,\n label: 'Prompt',\n },\n settingsPanelDisabled: false,\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n lockChoiceOrder: {\n settings: true,\n label: 'Lock Choice Order',\n },\n partialScoring: {\n settings: false,\n label: 'Allow Partial Scoring',\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n },\n choiceRationale: {\n settings: true,\n label: 'Choice Rationale',\n },\n toolbarEditorPosition: {\n settings: false,\n label: 'Toolbar Editor Position',\n },\n maxResponseAreas: 10,\n maxResponseAreaChoices: 10,\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n },\n};\n"],"file":"defaults.js"}
|
package/configure/lib/main.js
CHANGED
|
@@ -49,14 +49,6 @@ var _max = _interopRequireDefault(require("lodash/max"));
|
|
|
49
49
|
|
|
50
50
|
var _styles = require("@material-ui/core/styles");
|
|
51
51
|
|
|
52
|
-
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
53
|
-
|
|
54
|
-
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
|
|
55
|
-
|
|
56
|
-
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
|
|
57
|
-
|
|
58
|
-
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
59
|
-
|
|
60
52
|
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
61
53
|
|
|
62
54
|
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
@@ -90,29 +82,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
90
82
|
var toggle = _configUi.settings.toggle,
|
|
91
83
|
Panel = _configUi.settings.Panel;
|
|
92
84
|
|
|
93
|
-
var InfoDialog = function InfoDialog(_ref) {
|
|
94
|
-
var open = _ref.open,
|
|
95
|
-
onCancel = _ref.onCancel,
|
|
96
|
-
onOk = _ref.onOk,
|
|
97
|
-
title = _ref.title;
|
|
98
|
-
return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
99
|
-
open: open
|
|
100
|
-
}, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], null, title), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, onOk && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
101
|
-
onClick: onOk,
|
|
102
|
-
color: "primary"
|
|
103
|
-
}, "OK"), onCancel && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
104
|
-
onClick: onCancel,
|
|
105
|
-
color: "primary"
|
|
106
|
-
}, "Cancel")));
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
InfoDialog.propTypes = {
|
|
110
|
-
open: _propTypes["default"].bool,
|
|
111
|
-
onCancel: _propTypes["default"].func,
|
|
112
|
-
onOk: _propTypes["default"].func,
|
|
113
|
-
title: _propTypes["default"].string
|
|
114
|
-
};
|
|
115
|
-
|
|
116
85
|
var styles = function styles(theme) {
|
|
117
86
|
return {
|
|
118
87
|
promptHolder: {
|
|
@@ -148,17 +117,17 @@ var styles = function styles(theme) {
|
|
|
148
117
|
},
|
|
149
118
|
text: {
|
|
150
119
|
fontFamily: 'Cerebri Sans',
|
|
151
|
-
fontSize:
|
|
120
|
+
fontSize: theme.typography.fontSize + 2,
|
|
152
121
|
lineHeight: '19px',
|
|
153
122
|
color: '#495B8F',
|
|
154
|
-
marginRight:
|
|
123
|
+
marginRight: theme.spacing.unit
|
|
155
124
|
},
|
|
156
125
|
rationaleLabel: {
|
|
157
126
|
display: 'flex',
|
|
158
127
|
whiteSpace: 'break-spaces'
|
|
159
128
|
},
|
|
160
129
|
rationaleChoices: {
|
|
161
|
-
marginTop:
|
|
130
|
+
marginTop: theme.spacing.unit * 2
|
|
162
131
|
},
|
|
163
132
|
panelDetails: {
|
|
164
133
|
display: 'block'
|
|
@@ -166,18 +135,17 @@ var styles = function styles(theme) {
|
|
|
166
135
|
flexContainer: {
|
|
167
136
|
display: 'flex',
|
|
168
137
|
alignItems: 'center',
|
|
169
|
-
marginBottom:
|
|
138
|
+
marginBottom: theme.spacing.unit
|
|
170
139
|
},
|
|
171
140
|
tooltip: {
|
|
172
|
-
fontSize:
|
|
141
|
+
fontSize: theme.typography.fontSize - 2,
|
|
173
142
|
whiteSpace: 'pre',
|
|
174
143
|
maxWidth: '500px'
|
|
175
144
|
},
|
|
176
145
|
errorText: {
|
|
177
|
-
fontSize:
|
|
146
|
+
fontSize: theme.typography.fontSize - 2,
|
|
178
147
|
color: 'red',
|
|
179
|
-
paddingTop:
|
|
180
|
-
marginTop: '8px'
|
|
148
|
+
paddingTop: theme.spacing.unit
|
|
181
149
|
}
|
|
182
150
|
};
|
|
183
151
|
};
|
|
@@ -211,7 +179,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
211
179
|
|
|
212
180
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
213
181
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", {
|
|
214
|
-
|
|
182
|
+
warning: {
|
|
215
183
|
open: false
|
|
216
184
|
}
|
|
217
185
|
});
|
|
@@ -249,22 +217,22 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
249
217
|
});
|
|
250
218
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onCheck", function (callback) {
|
|
251
219
|
_this.setState({
|
|
252
|
-
|
|
220
|
+
warning: {
|
|
253
221
|
open: true,
|
|
254
|
-
|
|
255
|
-
|
|
222
|
+
text: 'Response areas with under 2 options or with no correct answers will be discarded.',
|
|
223
|
+
onClose: function onClose() {
|
|
256
224
|
_this.setState({
|
|
257
|
-
|
|
225
|
+
warning: {
|
|
258
226
|
open: false
|
|
259
227
|
}
|
|
260
|
-
}
|
|
228
|
+
});
|
|
261
229
|
},
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
230
|
+
onConfirm: function onConfirm() {
|
|
231
|
+
_this.setState({
|
|
232
|
+
warning: {
|
|
265
233
|
open: false
|
|
266
234
|
}
|
|
267
|
-
});
|
|
235
|
+
}, callback);
|
|
268
236
|
}
|
|
269
237
|
}
|
|
270
238
|
});
|
|
@@ -302,12 +270,19 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
302
270
|
|
|
303
271
|
if (shouldWarn) {
|
|
304
272
|
_this.setState({
|
|
305
|
-
|
|
273
|
+
warning: {
|
|
306
274
|
open: true,
|
|
307
|
-
|
|
308
|
-
|
|
275
|
+
text: 'Response areas with under 2 options or with no correct answers will be discarded.',
|
|
276
|
+
onClose: function onClose() {
|
|
309
277
|
_this.setState({
|
|
310
|
-
|
|
278
|
+
warning: {
|
|
279
|
+
open: false
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
},
|
|
283
|
+
onConfirm: function onConfirm() {
|
|
284
|
+
_this.setState({
|
|
285
|
+
warning: {
|
|
311
286
|
open: false
|
|
312
287
|
}
|
|
313
288
|
}, function () {
|
|
@@ -316,13 +291,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
316
291
|
slateMarkup: domMarkup.innerHTML
|
|
317
292
|
});
|
|
318
293
|
});
|
|
319
|
-
},
|
|
320
|
-
onCancel: function onCancel() {
|
|
321
|
-
return _this.setState({
|
|
322
|
-
dialog: {
|
|
323
|
-
open: false
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
294
|
}
|
|
327
295
|
}
|
|
328
296
|
});
|
|
@@ -339,12 +307,13 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
339
307
|
|
|
340
308
|
if (respAreaChoices[index] && respAreaChoices[index].length >= maxResponseAreaChoices) {
|
|
341
309
|
_this.setState({
|
|
342
|
-
|
|
310
|
+
warning: {
|
|
343
311
|
open: true,
|
|
344
|
-
|
|
345
|
-
|
|
312
|
+
text: "There are only ".concat(maxResponseAreaChoices, " answers allowed per choice."),
|
|
313
|
+
onClose: undefined,
|
|
314
|
+
onConfirm: function onConfirm() {
|
|
346
315
|
_this.setState({
|
|
347
|
-
|
|
316
|
+
warning: {
|
|
348
317
|
open: false
|
|
349
318
|
}
|
|
350
319
|
});
|
|
@@ -363,12 +332,13 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
363
332
|
return prepareVal(r.label) === prepareVal(label);
|
|
364
333
|
})) {
|
|
365
334
|
_this.setState({
|
|
366
|
-
|
|
335
|
+
warning: {
|
|
367
336
|
open: true,
|
|
368
|
-
|
|
369
|
-
|
|
337
|
+
text: 'Duplicate answers are not allowed.',
|
|
338
|
+
onClose: undefined,
|
|
339
|
+
onConfirm: function onConfirm() {
|
|
370
340
|
_this.setState({
|
|
371
|
-
|
|
341
|
+
warning: {
|
|
372
342
|
open: false
|
|
373
343
|
}
|
|
374
344
|
});
|
|
@@ -404,8 +374,8 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
404
374
|
});
|
|
405
375
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onSelectChoice", function (respIndex, selectedIndex) {
|
|
406
376
|
var respAreaChoices = _this.state.respAreaChoices;
|
|
407
|
-
respAreaChoices[respIndex] = respAreaChoices[respIndex].map(function (
|
|
408
|
-
return _objectSpread(_objectSpread({},
|
|
377
|
+
respAreaChoices[respIndex] = respAreaChoices[respIndex].map(function (choice, index) {
|
|
378
|
+
return _objectSpread(_objectSpread({}, choice), {}, {
|
|
409
379
|
correct: index === selectedIndex
|
|
410
380
|
});
|
|
411
381
|
});
|
|
@@ -451,7 +421,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
451
421
|
value: function render() {
|
|
452
422
|
var _this2 = this;
|
|
453
423
|
|
|
454
|
-
var
|
|
424
|
+
var warning = this.state.warning;
|
|
455
425
|
var _this$props = this.props,
|
|
456
426
|
classes = _this$props.classes,
|
|
457
427
|
model = _this$props.model,
|
|
@@ -460,42 +430,43 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
460
430
|
imageSupport = _this$props.imageSupport,
|
|
461
431
|
uploadSoundSupport = _this$props.uploadSoundSupport;
|
|
462
432
|
|
|
463
|
-
var
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
withRubric =
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
choiceRationaleEnabled =
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
433
|
+
var _ref = configuration || {},
|
|
434
|
+
_ref$choiceRationale = _ref.choiceRationale,
|
|
435
|
+
choiceRationale = _ref$choiceRationale === void 0 ? {} : _ref$choiceRationale,
|
|
436
|
+
_ref$lockChoiceOrder = _ref.lockChoiceOrder,
|
|
437
|
+
lockChoiceOrder = _ref$lockChoiceOrder === void 0 ? {} : _ref$lockChoiceOrder,
|
|
438
|
+
maxResponseAreas = _ref.maxResponseAreas,
|
|
439
|
+
_ref$maxImageWidth = _ref.maxImageWidth,
|
|
440
|
+
maxImageWidth = _ref$maxImageWidth === void 0 ? {} : _ref$maxImageWidth,
|
|
441
|
+
_ref$maxImageHeight = _ref.maxImageHeight,
|
|
442
|
+
maxImageHeight = _ref$maxImageHeight === void 0 ? {} : _ref$maxImageHeight,
|
|
443
|
+
_ref$partialScoring = _ref.partialScoring,
|
|
444
|
+
partialScoring = _ref$partialScoring === void 0 ? {} : _ref$partialScoring,
|
|
445
|
+
_ref$prompt = _ref.prompt,
|
|
446
|
+
prompt = _ref$prompt === void 0 ? {} : _ref$prompt,
|
|
447
|
+
_ref$rationale = _ref.rationale,
|
|
448
|
+
rationale = _ref$rationale === void 0 ? {} : _ref$rationale,
|
|
449
|
+
settingsPanelDisabled = _ref.settingsPanelDisabled,
|
|
450
|
+
_ref$spellCheck = _ref.spellCheck,
|
|
451
|
+
spellCheck = _ref$spellCheck === void 0 ? {} : _ref$spellCheck,
|
|
452
|
+
_ref$teacherInstructi = _ref.teacherInstructions,
|
|
453
|
+
teacherInstructions = _ref$teacherInstructi === void 0 ? {} : _ref$teacherInstructi,
|
|
454
|
+
_ref$withRubric = _ref.withRubric,
|
|
455
|
+
withRubric = _ref$withRubric === void 0 ? {} : _ref$withRubric;
|
|
456
|
+
|
|
457
|
+
var _ref2 = model || {},
|
|
458
|
+
choiceRationaleEnabled = _ref2.choiceRationaleEnabled,
|
|
459
|
+
choices = _ref2.choices,
|
|
460
|
+
errors = _ref2.errors,
|
|
461
|
+
promptEnabled = _ref2.promptEnabled,
|
|
462
|
+
rationaleEnabled = _ref2.rationaleEnabled,
|
|
463
|
+
spellCheckEnabled = _ref2.spellCheckEnabled,
|
|
464
|
+
teacherInstructionsEnabled = _ref2.teacherInstructionsEnabled,
|
|
465
|
+
toolbarEditorPosition = _ref2.toolbarEditorPosition;
|
|
466
|
+
|
|
467
|
+
var _ref3 = errors || {},
|
|
468
|
+
responseAreasError = _ref3.responseAreasError,
|
|
469
|
+
responseAreaChoicesError = _ref3.responseAreaChoicesError;
|
|
499
470
|
|
|
500
471
|
var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
501
472
|
var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
@@ -539,22 +510,26 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
539
510
|
});
|
|
540
511
|
};
|
|
541
512
|
|
|
542
|
-
var toolbarOpts = {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
case 'top':
|
|
546
|
-
toolbarOpts.position = 'top';
|
|
547
|
-
break;
|
|
548
|
-
|
|
549
|
-
default:
|
|
550
|
-
toolbarOpts.position = 'bottom';
|
|
551
|
-
break;
|
|
552
|
-
}
|
|
553
|
-
|
|
513
|
+
var toolbarOpts = {
|
|
514
|
+
position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
|
|
515
|
+
};
|
|
554
516
|
var validationMessage = (0, _utils.generateValidationMessage)(configuration);
|
|
517
|
+
var panelSettings = {
|
|
518
|
+
partialScoring: partialScoring.settings && toggle(partialScoring.label),
|
|
519
|
+
lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label)
|
|
520
|
+
};
|
|
521
|
+
var panelProperties = {
|
|
522
|
+
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
523
|
+
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
524
|
+
choiceRationaleEnabled: choiceRationale.settings && toggle(choiceRationale.label),
|
|
525
|
+
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
526
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
527
|
+
rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label)
|
|
528
|
+
};
|
|
555
529
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
556
530
|
className: classes.design
|
|
557
531
|
}, /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
532
|
+
hideSettings: settingsPanelDisabled,
|
|
558
533
|
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
559
534
|
model: model,
|
|
560
535
|
configuration: configuration,
|
|
@@ -565,18 +540,8 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
565
540
|
return onConfigurationChanged(configuration, true);
|
|
566
541
|
},
|
|
567
542
|
groups: {
|
|
568
|
-
Settings:
|
|
569
|
-
|
|
570
|
-
lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label)
|
|
571
|
-
},
|
|
572
|
-
Properties: {
|
|
573
|
-
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
574
|
-
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
575
|
-
choiceRationaleEnabled: choiceRationale.settings && toggle(choiceRationale.label),
|
|
576
|
-
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
577
|
-
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),
|
|
578
|
-
rubricEnabled: (withRubric === null || withRubric === void 0 ? void 0 : withRubric.settings) && toggle(withRubric === null || withRubric === void 0 ? void 0 : withRubric.label)
|
|
579
|
-
}
|
|
543
|
+
Settings: panelSettings,
|
|
544
|
+
Properties: panelProperties
|
|
580
545
|
}
|
|
581
546
|
})
|
|
582
547
|
}, /*#__PURE__*/_react["default"].createElement("div", null, teacherInstructionsEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
@@ -651,16 +616,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
651
616
|
}, /*#__PURE__*/_react["default"].createElement(_Info["default"], {
|
|
652
617
|
fontSize: 'small',
|
|
653
618
|
color: 'primary'
|
|
654
|
-
}))),
|
|
655
|
-
className: classes.errorText
|
|
656
|
-
}, responseAreasError), responseAreaChoicesError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
657
|
-
className: classes.errorText
|
|
658
|
-
}, responseAreaChoicesError), /*#__PURE__*/_react["default"].createElement(InfoDialog, {
|
|
659
|
-
open: dialog.open,
|
|
660
|
-
title: dialog.message,
|
|
661
|
-
onCancel: dialog.onCancel,
|
|
662
|
-
onOk: dialog.onOk
|
|
663
|
-
}), /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
619
|
+
}))), /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
664
620
|
activePlugins: _editableHtml.ALL_PLUGINS,
|
|
665
621
|
toolbarOpts: {
|
|
666
622
|
position: 'top'
|
|
@@ -709,7 +665,17 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
709
665
|
}, {
|
|
710
666
|
language: 'special'
|
|
711
667
|
}]
|
|
712
|
-
}), /*#__PURE__*/_react["default"].createElement("
|
|
668
|
+
}), responseAreasError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
669
|
+
className: classes.errorText
|
|
670
|
+
}, responseAreasError), responseAreaChoicesError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
671
|
+
className: classes.errorText
|
|
672
|
+
}, responseAreaChoicesError), /*#__PURE__*/_react["default"].createElement("br", null), choiceRationaleEnabled && renderChoiceRationale(), /*#__PURE__*/_react["default"].createElement(_configUi.AlertDialog, {
|
|
673
|
+
open: warning.open,
|
|
674
|
+
title: "Warning",
|
|
675
|
+
text: warning.text,
|
|
676
|
+
onClose: warning.onClose,
|
|
677
|
+
onConfirm: warning.onConfirm
|
|
678
|
+
}))));
|
|
713
679
|
}
|
|
714
680
|
}]);
|
|
715
681
|
return Main;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["toggle","settings","Panel","InfoDialog","open","onCancel","onOk","title","propTypes","PropTypes","bool","func","string","styles","theme","promptHolder","width","paddingBottom","spacing","unit","marginBottom","prompt","paddingTop","markup","minHeight","design","choiceConfiguration","switchElement","justifyContent","margin","addButton","text","fontFamily","fontSize","lineHeight","color","marginRight","rationaleLabel","display","whiteSpace","rationaleChoices","marginTop","panelDetails","flexContainer","alignItems","tooltip","maxWidth","errorText","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","prepareVal","html","tmp","value","textContent","innerText","Main","dialog","newVal","props","onModelChanged","model","onModelChange","rationale","index","choice","indexOfChoice","choices","findIndex","elem","label","splice","teacherInstructions","slateMarkup","callback","setState","message","respAreaChoices","state","domMarkup","allRespAreas","querySelectorAll","allChoices","forEach","el","dataset","existingRespAreaChoices","obj","key","newRespAreaChoices","shouldWarn","newChoices","length","find","c","correct","remove","maxResponseAreaChoices","configuration","r","map","parseInt","filter","val","isNaN","push","respIndex","selectedIndex","ch","nProps","newState","domNode","ReactDOM","findDOMNode","classes","onConfigurationChanged","imageSupport","uploadSoundSupport","partialScoring","lockChoiceOrder","choiceRationale","spellCheck","maxResponseAreas","maxImageWidth","maxImageHeight","withRubric","rationaleEnabled","choiceRationaleEnabled","promptEnabled","teacherInstructionsEnabled","spellCheckEnabled","errors","rubricEnabled","responseAreasError","responseAreaChoicesError","defaultImageMaxWidth","defaultImageMaxHeight","renderChoiceRationale","Object","keys","__html","onChoiceRationaleChanged","toolbarOpts","toolbarEditorPosition","position","validationMessage","Settings","Properties","onTeacherInstructionsChanged","language","onPromptChanged","onRationaleChanged","ALL_PLUGINS","type","options","duplicates","respAreaToolbar","node","onToolbarDone","onAddChoice","onCheck","onRemoveChoice","data","get","onSelectChoice","onChange","onBlur","React","Component","object","isRequired","disableSidePanel","shape","add","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAQA,MAAR,GAA0BC,kBAA1B,CAAQD,MAAR;AAAA,IAAgBE,KAAhB,GAA0BD,kBAA1B,CAAgBC,KAAhB;;AAEA,IAAMC,UAAU,GAAG,SAAbA,UAAa;AAAA,MAAGC,IAAH,QAAGA,IAAH;AAAA,MAASC,QAAT,QAASA,QAAT;AAAA,MAAmBC,IAAnB,QAAmBA,IAAnB;AAAA,MAAyBC,KAAzB,QAAyBA,KAAzB;AAAA,sBACjB,gCAAC,kBAAD;AAAQ,IAAA,IAAI,EAAEH;AAAd,kBACE,gCAAC,uBAAD,QAAcG,KAAd,CADF,eAEE,gCAAC,yBAAD,QACGD,IAAI,iBACH,gCAAC,kBAAD;AAAQ,IAAA,OAAO,EAAEA,IAAjB;AAAuB,IAAA,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B7G,EAAAA,KAAK,EAAEzD,sBAAUqK,MAAV,CAAiBC,UAFP;AAGjBC,EAAAA,gBAAgB,EAAEvK,sBAAUC,IAHX;AAIjBuD,EAAAA,cAAc,EAAExD,sBAAUE,IAAV,CAAeoK,UAJd;AAKjBvD,EAAAA,sBAAsB,EAAE/G,sBAAUE,IAAV,CAAeoK,UALtB;AAMjBxD,EAAAA,OAAO,EAAE9G,sBAAUqK,MAAV,CAAiBC,UANT;AAOjBtD,EAAAA,YAAY,EAAEhH,sBAAUwK,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEzK,sBAAUE,IAAV,CAAeoK,UADQ;AAE5B,cAAQtK,sBAAUE,IAAV,CAAeoK;AAFK,GAAhB,CAPG;AAWjBrD,EAAAA,kBAAkB,EAAEjH,sBAAUwK,KAAV,CAAgB;AAClCC,IAAAA,GAAG,EAAEzK,sBAAUE,IAAV,CAAeoK,UADc;AAElC,cAAQtK,sBAAUE,IAAV,CAAeoK;AAFW,GAAhB;AAXH,C;AAifrB,IAAMI,MAAM,GAAG,wBAAWtK,MAAX,EAAmBgD,IAAnB,CAAf;eAEesH,M","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\nimport { InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport isUndefined from 'lodash/isUndefined';\nimport isEmpty from 'lodash/isEmpty';\nimport reduce from 'lodash/reduce';\nimport max from 'lodash/max';\nimport { withStyles } from '@material-ui/core/styles';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport ExpansionPanel from '@material-ui/core/ExpansionPanel';\nimport ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';\nimport ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Info from '@material-ui/icons/Info';\nimport InlineDropdownToolbar from './inline-dropdown-toolbar';\nimport { generateValidationMessage } from './utils';\n\nconst { toggle, Panel } = settings;\n\nconst InfoDialog = ({ open, onCancel, onOk, title }) => (\n <Dialog open={open}>\n <DialogTitle>{title}</DialogTitle>\n <DialogActions>\n {onOk && (\n <Button onClick={onOk} color=\"primary\">\n OK\n </Button>\n )}\n {onCancel && (\n <Button onClick={onCancel} color=\"primary\">\n Cancel\n </Button>\n )}\n </DialogActions>\n </Dialog>\n);\n\nInfoDialog.propTypes = {\n open: PropTypes.bool,\n onCancel: PropTypes.func,\n onOk: PropTypes.func,\n title: PropTypes.string,\n};\n\nconst styles = (theme) => ({\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n },\n markup: {\n minHeight: '100px',\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '100px',\n },\n },\n design: {\n paddingTop: theme.spacing.unit * 3,\n },\n choiceConfiguration: {\n paddingTop: theme.spacing.unit * 2,\n paddingBottom: theme.spacing.unit * 2,\n },\n switchElement: {\n justifyContent: 'space-between',\n margin: 0,\n },\n addButton: {\n float: 'right',\n },\n text: {\n fontFamily: 'Cerebri Sans',\n fontSize: '16px',\n lineHeight: '19px',\n color: '#495B8F',\n marginRight: '5px',\n },\n rationaleLabel: {\n display: 'flex',\n whiteSpace: 'break-spaces',\n },\n rationaleChoices: {\n marginTop: '16px',\n },\n panelDetails: {\n display: 'block',\n },\n flexContainer: {\n display: 'flex',\n alignItems: 'center',\n marginBottom: '5px',\n },\n tooltip: {\n fontSize: '12px',\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n errorText: {\n fontSize: '12px',\n color: 'red',\n paddingTop: '5px',\n marginTop: '8px',\n },\n});\n\nconst createElementFromHTML = (htmlString) => {\n const div = document.createElement('div');\n\n div.innerHTML = (htmlString || '').trim();\n\n return div;\n};\n\nconst prepareVal = (html) => {\n const tmp = document.createElement('DIV');\n\n tmp.innerHTML = html;\n\n const value = tmp.textContent || tmp.innerText || '';\n\n return value.trim();\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n state = {\n dialog: {\n open: false,\n },\n };\n\n componentDidMount() {\n const {\n model: { choices },\n } = this.props;\n\n this.setState({ respAreaChoices: cloneDeep(choices) });\n }\n\n UNSAFE_componentWillReceiveProps(nProps) {\n const newState = {};\n\n if (\n !isEqual(nProps.model.choices, this.props.model.choices) ||\n !isEqual(nProps.model.choices, this.state.respAreaChoices)\n ) {\n newState.respAreaChoices = cloneDeep(nProps.model.choices);\n }\n\n if (!isEmpty(newState)) {\n this.setState(newState);\n }\n }\n\n componentDidUpdate() {\n //eslint-disable-next-line\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n onModelChange = (newVal) => {\n this.props.onModelChanged({\n ...this.props.model,\n ...newVal,\n });\n };\n\n onPromptChanged = (prompt) => {\n this.onModelChange({ prompt });\n };\n\n onRationaleChanged = (rationale) => {\n this.onModelChange({ rationale });\n };\n\n onChoiceRationaleChanged = (index, choice) => {\n const { model } = this.props;\n const indexOfChoice =\n model.choices &&\n model.choices[index] &&\n model.choices[index].findIndex((elem) => elem.label === choice.label && elem.value === choice.value);\n\n model.choices[index] && model.choices[index].splice(indexOfChoice, 1, choice);\n\n this.onModelChange(model);\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.onModelChange({ teacherInstructions });\n };\n\n onMarkupChanged = (slateMarkup) => {\n this.onModelChange({ slateMarkup });\n };\n\n onCheck = (callback) => {\n this.setState({\n dialog: {\n open: true,\n message: 'Response areas with under 2 options or with no correct answers will be discarded',\n onOk: () => {\n this.setState(\n {\n dialog: {\n open: false,\n },\n },\n callback,\n );\n },\n onCancel: () =>\n this.setState({\n dialog: {\n open: false,\n },\n }),\n },\n });\n };\n\n onChange = (markup) => {\n const { respAreaChoices } = this.state;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll('[data-type=\"inline_dropdown\"]');\n\n const allChoices = {};\n\n allRespAreas.forEach((el) => {\n allChoices[el.dataset.index] = el.dataset.value || '';\n });\n\n const existingRespAreaChoices = reduce(\n respAreaChoices,\n (obj, choices, key) => {\n if (!isUndefined(allChoices[key])) {\n obj[key] = respAreaChoices[key];\n }\n\n return obj;\n },\n {},\n );\n\n const newRespAreaChoices = {};\n let shouldWarn = false;\n\n allRespAreas.forEach((el, index) => {\n const newChoices = existingRespAreaChoices[el.dataset.index] || [];\n\n if (newChoices.length < 2 || !newChoices.find((c) => c.correct)) {\n el.remove();\n shouldWarn = true;\n } else {\n newRespAreaChoices[index] = existingRespAreaChoices[el.dataset.index] || [];\n el.dataset.index = index;\n }\n });\n\n if (shouldWarn) {\n this.setState({\n dialog: {\n open: true,\n message: 'Response areas with under 2 options or with no correct answers will be discarded',\n onOk: () => {\n this.setState(\n {\n dialog: {\n open: false,\n },\n },\n () =>\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML,\n }),\n );\n },\n onCancel: () =>\n this.setState({\n dialog: {\n open: false,\n },\n }),\n },\n });\n } else {\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML,\n });\n }\n };\n\n onAddChoice = (index, label) => {\n const { respAreaChoices } = this.state;\n const { maxResponseAreaChoices } = this.props.configuration;\n\n if (respAreaChoices[index] && respAreaChoices[index].length >= maxResponseAreaChoices) {\n this.setState({\n dialog: {\n open: true,\n message: `There are only ${maxResponseAreaChoices} answers allowed per choice.`,\n onOk: () => {\n this.setState({\n dialog: {\n open: false,\n },\n });\n },\n },\n });\n\n return;\n }\n\n if (!respAreaChoices[index]) {\n respAreaChoices[index] = [];\n }\n\n if ((respAreaChoices[index] || []).find((r) => prepareVal(r.label) === prepareVal(label))) {\n this.setState({\n dialog: {\n open: true,\n message: 'Duplicate answers are not allowed.',\n onOk: () => {\n this.setState({\n dialog: {\n open: false,\n },\n });\n },\n },\n });\n\n return;\n }\n\n const value =\n (respAreaChoices[index] &&\n max(respAreaChoices[index].map((c) => parseInt(c.value)).filter((val) => !isNaN(val)))) ||\n 0;\n\n respAreaChoices[index].push({\n label,\n value: `${value + 1}`,\n correct: false,\n });\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onRemoveChoice = (respIndex, index) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex].splice(index, 1);\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onSelectChoice = (respIndex, selectedIndex) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex] = respAreaChoices[respIndex].map((ch, index) => ({\n ...ch,\n correct: index === selectedIndex,\n }));\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n render() {\n const { dialog } = this.state;\n const { classes, model, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } = this.props;\n const {\n prompt = {},\n partialScoring = {},\n lockChoiceOrder = {},\n rationale = {},\n choiceRationale = {},\n teacherInstructions = {},\n spellCheck = {},\n maxResponseAreas,\n maxImageWidth = {},\n maxImageHeight = {},\n withRubric = {},\n } = configuration || {};\n const {\n rationaleEnabled,\n choiceRationaleEnabled,\n promptEnabled,\n teacherInstructionsEnabled,\n choices,\n spellCheckEnabled,\n errors,\n rubricEnabled,\n } = model || {};\n const { responseAreasError, responseAreaChoicesError } = errors || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const renderChoiceRationale = () =>\n (Object.keys(choices) || []).map((key, index) => (\n <div key={key} className={classes.rationaleChoices}>\n <ExpansionPanel>\n <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>\n <Typography className={classes.text}>{`Rationale for response area #${index + 1}`}</Typography>\n </ExpansionPanelSummary>\n <ExpansionPanelDetails className={classes.panelDetails}>\n {(choices[key] || []).map((choice) => (\n <InputContainer\n key={choice.label}\n label={\n <span\n className={classes.rationaleLabel}\n dangerouslySetInnerHTML={{\n __html: `${rationale.label} for ${choice.label} (${choice.correct ? 'correct' : 'incorrect'})`,\n }}\n />\n }\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={choice.rationale || ''}\n spellCheck={spellCheckEnabled}\n onChange={(c) =>\n this.onChoiceRationaleChanged(key, {\n ...choice,\n rationale: c,\n })\n }\n imageSupport={imageSupport}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n />\n </InputContainer>\n ))}\n </ExpansionPanelDetails>\n </ExpansionPanel>\n </div>\n ));\n\n const toolbarOpts = {};\n\n switch (model.toolbarEditorPosition) {\n case 'top':\n toolbarOpts.position = 'top';\n break;\n default:\n toolbarOpts.position = 'bottom';\n break;\n }\n\n const validationMessage = generateValidationMessage(configuration);\n\n return (\n <div className={classes.design}>\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => this.onModelChange(model)}\n onChangeConfiguration={(configuration) => onConfigurationChanged(configuration, true)}\n groups={{\n Settings: {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n },\n Properties: {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n choiceRationaleEnabled: choiceRationale.settings && toggle(choiceRationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n },\n }}\n />\n }\n >\n <div>\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\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.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\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} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\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 <div className={classes.flexContainer}>\n <Typography className={classes.text}>Define Template, Choices, and Correct Responses</Typography>\n <Tooltip\n classes={{ tooltip: classes.tooltip }}\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} />\n </Tooltip>\n </div>\n {responseAreasError && <div className={classes.errorText}>{responseAreasError}</div>}\n {responseAreaChoicesError && <div className={classes.errorText}>{responseAreaChoicesError}</div>}\n\n <InfoDialog open={dialog.open} title={dialog.message} onCancel={dialog.onCancel} onOk={dialog.onOk} />\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n toolbarOpts={{ position: 'top' }}\n responseAreaProps={{\n type: 'inline-dropdown',\n options: {\n duplicates: true,\n },\n maxResponseAreas: maxResponseAreas,\n respAreaToolbar: (node, value, onToolbarDone) => {\n const { respAreaChoices } = this.state;\n\n return () => (\n <InlineDropdownToolbar\n onAddChoice={this.onAddChoice}\n onCheck={this.onCheck}\n onRemoveChoice={(index) => this.onRemoveChoice(node.data.get('index'), index)}\n onSelectChoice={(index) => this.onSelectChoice(node.data.get('index'), index)}\n node={node}\n value={value}\n onToolbarDone={onToolbarDone}\n choices={respAreaChoices[node.data.get('index')]}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n />\n );\n },\n }}\n spellCheck={spellCheckEnabled}\n className={classes.markup}\n markup={model.slateMarkup || ''}\n onChange={this.onChange}\n imageSupport={imageSupport}\n disableImageAlignmentButtons={true}\n onBlur={this.onBlur}\n disabled={false}\n highlightShape={false}\n error={responseAreasError}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n <br />\n {choiceRationaleEnabled && renderChoiceRationale()}\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"file":"main.js"}
|
|
1
|
+
{"version":3,"sources":["../src/main.jsx"],"names":["toggle","settings","Panel","styles","theme","promptHolder","width","paddingBottom","spacing","unit","marginBottom","prompt","paddingTop","markup","minHeight","design","choiceConfiguration","switchElement","justifyContent","margin","addButton","text","fontFamily","fontSize","typography","lineHeight","color","marginRight","rationaleLabel","display","whiteSpace","rationaleChoices","marginTop","panelDetails","flexContainer","alignItems","tooltip","maxWidth","errorText","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","prepareVal","html","tmp","value","textContent","innerText","Main","warning","open","newVal","props","onModelChanged","model","onModelChange","rationale","index","choice","indexOfChoice","choices","findIndex","elem","label","splice","teacherInstructions","slateMarkup","callback","setState","onClose","onConfirm","respAreaChoices","state","domMarkup","allRespAreas","querySelectorAll","allChoices","forEach","el","dataset","existingRespAreaChoices","obj","key","newRespAreaChoices","shouldWarn","newChoices","length","find","c","correct","remove","maxResponseAreaChoices","configuration","undefined","r","map","parseInt","filter","val","isNaN","push","respIndex","selectedIndex","nProps","newState","domNode","ReactDOM","findDOMNode","classes","onConfigurationChanged","imageSupport","uploadSoundSupport","choiceRationale","lockChoiceOrder","maxResponseAreas","maxImageWidth","maxImageHeight","partialScoring","settingsPanelDisabled","spellCheck","withRubric","choiceRationaleEnabled","errors","promptEnabled","rationaleEnabled","spellCheckEnabled","teacherInstructionsEnabled","toolbarEditorPosition","responseAreasError","responseAreaChoicesError","defaultImageMaxWidth","defaultImageMaxHeight","renderChoiceRationale","Object","keys","__html","onChoiceRationaleChanged","toolbarOpts","position","validationMessage","panelSettings","panelProperties","rubricEnabled","Settings","Properties","onTeacherInstructionsChanged","language","onPromptChanged","onRationaleChanged","ALL_PLUGINS","type","options","duplicates","respAreaToolbar","node","onToolbarDone","onAddChoice","onCheck","onRemoveChoice","data","get","onSelectChoice","onChange","onBlur","React","Component","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAQA,MAAR,GAA0BC,kBAA1B,CAAQD,MAAR;AAAA,IAAgBE,KAAhB,GAA0BD,kBAA1B,CAAgBC,KAAhB;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,YAAY,EAAE;AACZC,MAAAA,KAAK,EAAE,MADK;AAEZC,MAAAA,aAAa,EAAEH,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB,CAFxB;AAGZC,MAAAA,YAAY,EAAEN,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB;AAHvB,KADW;AAMzBE,IAAAA,MAAM,EAAE;AACNC,MAAAA,UAAU,EAAER,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB,CAD3B;AAENH,MAAAA,KAAK,EAAE;AAFD,KANiB;AAUzBO,IAAAA,MAAM,EAAE;AACNC,MAAAA,SAAS,EAAE,OADL;AAENF,MAAAA,UAAU,EAAER,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB,CAF3B;AAGNH,MAAAA,KAAK,EAAE,MAHD;AAIN,sCAAgC;AAC9BQ,QAAAA,SAAS,EAAE;AADmB;AAJ1B,KAViB;AAkBzBC,IAAAA,MAAM,EAAE;AACNH,MAAAA,UAAU,EAAER,KAAK,CAACI,OAAN,CAAcC,IAAd,GAAqB;AAD3B,KAlBiB;AAqBzBO,IAAAA,mBAAmB,EAAE;AACnBJ,MAAAA,U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oC+F,wBAApC,CA9G/B,eAgHE,2CAhHF,EAiHGR,sBAAsB,IAAIW,qBAAqB,EAjHlD,eAmHE,gCAAC,qBAAD;AACE,QAAA,IAAI,EAAEnF,OAAO,CAACC,IADhB;AAEE,QAAA,KAAK,EAAC,SAFR;AAGE,QAAA,IAAI,EAAED,OAAO,CAAChC,IAHhB;AAIE,QAAA,OAAO,EAAEgC,OAAO,CAACoB,OAJnB;AAKE,QAAA,SAAS,EAAEpB,OAAO,CAACqB;AALrB,QAnHF,CAfF,CADF,CADF;AA+ID;;;EAlduB8F,kBAAMC,S;;;iCAAnBrH,I,eACQ;AACjB4C,EAAAA,aAAa,EAAE0E,sBAAUC,MAAV,CAAiBC,UADf;AAEjBlH,EAAAA,KAAK,EAAEgH,sBAAUC,MAAV,CAAiBC,UAFP;AAGjBC,EAAAA,gBAAgB,EAAEH,sBAAUI,IAHX;AAIjBrH,EAAAA,cAAc,EAAEiH,sBAAUK,IAAV,CAAeH,UAJd;AAKjB3D,EAAAA,sBAAsB,EAAEyD,sBAAUK,IAAV,CAAeH,UALtB;AAMjB5D,EAAAA,OAAO,EAAE0D,sBAAUC,MAAV,CAAiBC,UANT;AAOjB1D,EAAAA,YAAY,EAAEwD,sBAAUM,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEP,sBAAUK,IAAV,CAAeH,UADQ;AAE5B,cAAQF,sBAAUK,IAAV,CAAeH;AAFK,GAAhB,CAPG;AAWjBzD,EAAAA,kBAAkB,EAAEuD,sBAAUM,KAAV,CAAgB;AAClCC,IAAAA,GAAG,EAAEP,sBAAUK,IAAV,CAAeH,UADc;AAElC,cAAQF,sBAAUK,IAAV,CAAeH;AAFW,GAAhB;AAXH,C;AAodrB,IAAMM,MAAM,GAAG,wBAAW/K,MAAX,EAAmBiD,IAAnB,CAAf;eAEe8H,M","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\nimport { AlertDialog, InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport isUndefined from 'lodash/isUndefined';\nimport isEmpty from 'lodash/isEmpty';\nimport reduce from 'lodash/reduce';\nimport max from 'lodash/max';\nimport { withStyles } from '@material-ui/core/styles';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport ExpansionPanel from '@material-ui/core/ExpansionPanel';\nimport ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';\nimport ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Info from '@material-ui/icons/Info';\nimport InlineDropdownToolbar from './inline-dropdown-toolbar';\nimport { generateValidationMessage } from './utils';\n\nconst { toggle, Panel } = settings;\n\nconst styles = (theme) => ({\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2,\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n },\n markup: {\n minHeight: '100px',\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '100px',\n },\n },\n design: {\n paddingTop: theme.spacing.unit * 3,\n },\n choiceConfiguration: {\n paddingTop: theme.spacing.unit * 2,\n paddingBottom: theme.spacing.unit * 2,\n },\n switchElement: {\n justifyContent: 'space-between',\n margin: 0,\n },\n addButton: {\n float: 'right',\n },\n text: {\n fontFamily: 'Cerebri Sans',\n fontSize: theme.typography.fontSize + 2,\n lineHeight: '19px',\n color: '#495B8F',\n marginRight: theme.spacing.unit,\n },\n rationaleLabel: {\n display: 'flex',\n whiteSpace: 'break-spaces',\n },\n rationaleChoices: {\n marginTop: theme.spacing.unit * 2,\n },\n panelDetails: {\n display: 'block',\n },\n flexContainer: {\n display: 'flex',\n alignItems: 'center',\n marginBottom: theme.spacing.unit,\n },\n tooltip: {\n fontSize: theme.typography.fontSize - 2,\n whiteSpace: 'pre',\n maxWidth: '500px',\n },\n errorText: {\n fontSize: theme.typography.fontSize - 2,\n color: 'red',\n paddingTop: theme.spacing.unit,\n },\n});\n\nconst createElementFromHTML = (htmlString) => {\n const div = document.createElement('div');\n\n div.innerHTML = (htmlString || '').trim();\n\n return div;\n};\n\nconst prepareVal = (html) => {\n const tmp = document.createElement('DIV');\n\n tmp.innerHTML = html;\n\n const value = tmp.textContent || tmp.innerText || '';\n\n return value.trim();\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n uploadSoundSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n state = {\n warning: { open: false },\n };\n\n componentDidMount() {\n const {\n model: { choices },\n } = this.props;\n\n this.setState({ respAreaChoices: cloneDeep(choices) });\n }\n\n UNSAFE_componentWillReceiveProps(nProps) {\n const newState = {};\n\n if (\n !isEqual(nProps.model.choices, this.props.model.choices) ||\n !isEqual(nProps.model.choices, this.state.respAreaChoices)\n ) {\n newState.respAreaChoices = cloneDeep(nProps.model.choices);\n }\n\n if (!isEmpty(newState)) {\n this.setState(newState);\n }\n }\n\n componentDidUpdate() {\n //eslint-disable-next-line\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n onModelChange = (newVal) => {\n this.props.onModelChanged({ ...this.props.model, ...newVal });\n };\n\n onPromptChanged = (prompt) => {\n this.onModelChange({ prompt });\n };\n\n onRationaleChanged = (rationale) => {\n this.onModelChange({ rationale });\n };\n\n onChoiceRationaleChanged = (index, choice) => {\n const { model } = this.props;\n const indexOfChoice =\n model.choices &&\n model.choices[index] &&\n model.choices[index].findIndex((elem) => elem.label === choice.label && elem.value === choice.value);\n\n model.choices[index] && model.choices[index].splice(indexOfChoice, 1, choice);\n\n this.onModelChange(model);\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.onModelChange({ teacherInstructions });\n };\n\n onMarkupChanged = (slateMarkup) => {\n this.onModelChange({ slateMarkup });\n };\n\n onCheck = (callback) => {\n this.setState({\n warning: {\n open: true,\n text: 'Response areas with under 2 options or with no correct answers will be discarded.',\n onClose: () => {\n this.setState({ warning: { open: false } });\n },\n onConfirm: () => {\n this.setState({ warning: { open: false } }, callback);\n },\n },\n });\n };\n\n onChange = (markup) => {\n const { respAreaChoices } = this.state;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll('[data-type=\"inline_dropdown\"]');\n const allChoices = {};\n\n allRespAreas.forEach((el) => {\n allChoices[el.dataset.index] = el.dataset.value || '';\n });\n\n const existingRespAreaChoices = reduce(\n respAreaChoices,\n (obj, choices, key) => {\n if (!isUndefined(allChoices[key])) {\n obj[key] = respAreaChoices[key];\n }\n\n return obj;\n },\n {},\n );\n\n const newRespAreaChoices = {};\n let shouldWarn = false;\n\n allRespAreas.forEach((el, index) => {\n const newChoices = existingRespAreaChoices[el.dataset.index] || [];\n\n if (newChoices.length < 2 || !newChoices.find((c) => c.correct)) {\n el.remove();\n shouldWarn = true;\n } else {\n newRespAreaChoices[index] = existingRespAreaChoices[el.dataset.index] || [];\n el.dataset.index = index;\n }\n });\n\n if (shouldWarn) {\n this.setState({\n warning: {\n open: true,\n text: 'Response areas with under 2 options or with no correct answers will be discarded.',\n onClose: () => {\n this.setState({ warning: { open: false } });\n },\n onConfirm: () => {\n this.setState({ warning: { open: false } }, () =>\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML,\n }),\n );\n },\n },\n });\n } else {\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML,\n });\n }\n };\n\n onAddChoice = (index, label) => {\n const { respAreaChoices } = this.state;\n const { maxResponseAreaChoices } = this.props.configuration;\n\n if (respAreaChoices[index] && respAreaChoices[index].length >= maxResponseAreaChoices) {\n this.setState({\n warning: {\n open: true,\n text: `There are only ${maxResponseAreaChoices} answers allowed per choice.`,\n onClose: undefined,\n onConfirm: () => {\n this.setState({ warning: { open: false } });\n },\n },\n });\n\n return;\n }\n\n if (!respAreaChoices[index]) {\n respAreaChoices[index] = [];\n }\n\n if ((respAreaChoices[index] || []).find((r) => prepareVal(r.label) === prepareVal(label))) {\n this.setState({\n warning: {\n open: true,\n text: 'Duplicate answers are not allowed.',\n onClose: undefined,\n onConfirm: () => {\n this.setState({ warning: { open: false } });\n },\n },\n });\n\n return;\n }\n\n const value =\n (respAreaChoices[index] &&\n max(respAreaChoices[index].map((c) => parseInt(c.value)).filter((val) => !isNaN(val)))) ||\n 0;\n\n respAreaChoices[index].push({\n label,\n value: `${value + 1}`,\n correct: false,\n });\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onRemoveChoice = (respIndex, index) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex].splice(index, 1);\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onSelectChoice = (respIndex, selectedIndex) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex] = respAreaChoices[respIndex].map((choice, index) => ({\n ...choice,\n correct: index === selectedIndex,\n }));\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n render() {\n const { warning } = this.state;\n const { classes, model, configuration, onConfigurationChanged, imageSupport, uploadSoundSupport } = this.props;\n const {\n choiceRationale = {},\n lockChoiceOrder = {},\n maxResponseAreas,\n maxImageWidth = {},\n maxImageHeight = {},\n partialScoring = {},\n prompt = {},\n rationale = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n withRubric = {},\n } = configuration || {};\n const {\n choiceRationaleEnabled,\n choices,\n errors,\n promptEnabled,\n rationaleEnabled,\n spellCheckEnabled,\n teacherInstructionsEnabled,\n toolbarEditorPosition,\n } = model || {};\n const { responseAreasError, responseAreaChoicesError } = errors || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const renderChoiceRationale = () =>\n (Object.keys(choices) || []).map((key, index) => (\n <div key={key} className={classes.rationaleChoices}>\n <ExpansionPanel>\n <ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>\n <Typography className={classes.text}>{`Rationale for response area #${index + 1}`}</Typography>\n </ExpansionPanelSummary>\n\n <ExpansionPanelDetails className={classes.panelDetails}>\n {(choices[key] || []).map((choice) => (\n <InputContainer\n key={choice.label}\n label={\n <span\n className={classes.rationaleLabel}\n dangerouslySetInnerHTML={{\n __html: `${rationale.label} for ${choice.label} (${choice.correct ? 'correct' : 'incorrect'})`,\n }}\n />\n }\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={choice.rationale || ''}\n spellCheck={spellCheckEnabled}\n onChange={(c) => this.onChoiceRationaleChanged(key, { ...choice, rationale: c })}\n imageSupport={imageSupport}\n maxImageWidth={(maxImageWidth && maxImageWidth.rationale) || defaultImageMaxWidth}\n maxImageHeight={(maxImageHeight && maxImageHeight.rationale) || defaultImageMaxHeight}\n uploadSoundSupport={uploadSoundSupport}\n />\n </InputContainer>\n ))}\n </ExpansionPanelDetails>\n </ExpansionPanel>\n </div>\n ));\n\n const toolbarOpts = {\n position: toolbarEditorPosition === 'top' ? 'top' : 'bottom',\n };\n\n const validationMessage = generateValidationMessage(configuration);\n\n const panelSettings = {\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder: lockChoiceOrder.settings && toggle(lockChoiceOrder.label),\n };\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n rationaleEnabled: rationale.settings && toggle(rationale.label),\n choiceRationaleEnabled: choiceRationale.settings && toggle(choiceRationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n rubricEnabled: withRubric?.settings && toggle(withRubric?.label),\n };\n\n return (\n <div className={classes.design}>\n <layout.ConfigLayout\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => this.onModelChange(model)}\n onChangeConfiguration={(configuration) => onConfigurationChanged(configuration, true)}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n <div>\n {teacherInstructionsEnabled && (\n <InputContainer label={teacherInstructions.label} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\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.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\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} className={classes.promptHolder}>\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\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 <div className={classes.flexContainer}>\n <Typography className={classes.text}>Define Template, Choices, and Correct Responses</Typography>\n <Tooltip\n classes={{ tooltip: classes.tooltip }}\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'} />\n </Tooltip>\n </div>\n\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n toolbarOpts={{ position: 'top' }}\n responseAreaProps={{\n type: 'inline-dropdown',\n options: {\n duplicates: true,\n },\n maxResponseAreas: maxResponseAreas,\n respAreaToolbar: (node, value, onToolbarDone) => {\n const { respAreaChoices } = this.state;\n\n return () => (\n <InlineDropdownToolbar\n onAddChoice={this.onAddChoice}\n onCheck={this.onCheck}\n onRemoveChoice={(index) => this.onRemoveChoice(node.data.get('index'), index)}\n onSelectChoice={(index) => this.onSelectChoice(node.data.get('index'), index)}\n node={node}\n value={value}\n onToolbarDone={onToolbarDone}\n choices={respAreaChoices[node.data.get('index')]}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n />\n );\n },\n }}\n spellCheck={spellCheckEnabled}\n className={classes.markup}\n markup={model.slateMarkup || ''}\n onChange={this.onChange}\n imageSupport={imageSupport}\n disableImageAlignmentButtons={true}\n onBlur={this.onBlur}\n disabled={false}\n highlightShape={false}\n error={responseAreasError}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n {responseAreasError && <div className={classes.errorText}>{responseAreasError}</div>}\n {responseAreaChoicesError && <div className={classes.errorText}>{responseAreaChoicesError}</div>}\n\n <br />\n {choiceRationaleEnabled && renderChoiceRationale()}\n\n <AlertDialog\n open={warning.open}\n title=\"Warning\"\n text={warning.text}\n onClose={warning.onClose}\n onConfirm={warning.onConfirm}\n />\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"file":"main.js"}
|
package/configure/package.json
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"@material-ui/core": "^3.9.2",
|
|
9
9
|
"@material-ui/icons": "^3.0.1",
|
|
10
10
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
11
|
-
"@pie-lib/config-ui": "^11.
|
|
12
|
-
"@pie-lib/editable-html": "^9.
|
|
11
|
+
"@pie-lib/config-ui": "^11.2.0",
|
|
12
|
+
"@pie-lib/editable-html": "^9.4.0",
|
|
13
13
|
"@pie-lib/math-rendering": "^2.5.1",
|
|
14
14
|
"classnames": "^2.2.6",
|
|
15
15
|
"debug": "^3.1.0",
|
package/docs/config-schema.json
CHANGED
|
@@ -115,6 +115,11 @@
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
|
+
"settingsPanelDisabled": {
|
|
119
|
+
"description": "Indicates if the settings panel is not available",
|
|
120
|
+
"type": "boolean",
|
|
121
|
+
"title": "settingsPanelDisabled"
|
|
122
|
+
},
|
|
118
123
|
"scoringType": {
|
|
119
124
|
"title": "ConfigureProp",
|
|
120
125
|
"type": "object",
|
|
@@ -86,6 +86,10 @@ Indicates if the item has to be displayed in the Settings Panel
|
|
|
86
86
|
|
|
87
87
|
Indicates the label for the item that has to be displayed in the Settings Panel
|
|
88
88
|
|
|
89
|
+
# `settingsPanelDisabled` (boolean)
|
|
90
|
+
|
|
91
|
+
Indicates if the settings panel is not available
|
|
92
|
+
|
|
89
93
|
# `scoringType` (object)
|
|
90
94
|
|
|
91
95
|
Properties of the `scoringType` object:
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"repository": "pie-framework/pie-elements",
|
|
7
|
-
"version": "4.5.
|
|
7
|
+
"version": "4.5.2-next.120+851bb10e8",
|
|
8
8
|
"description": "",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@material-ui/core": "^3.9.2",
|
|
15
15
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
16
16
|
"@pie-lib/correct-answer-toggle": "^2.3.47",
|
|
17
|
-
"@pie-lib/mask-markup": "^1.12.
|
|
17
|
+
"@pie-lib/mask-markup": "^1.12.21",
|
|
18
18
|
"@pie-lib/math-rendering": "^2.5.1",
|
|
19
19
|
"@pie-lib/render-ui": "^4.13.7",
|
|
20
20
|
"classnames": "^2.2.5",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"author": "",
|
|
27
27
|
"license": "ISC",
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "851bb10e8e0f8605c2c39f4f5c64cf689a6c6e1e",
|
|
29
29
|
"main": "lib/index.js",
|
|
30
30
|
"module": "src/index.js"
|
|
31
31
|
}
|