@pie-element/ebsr 12.3.4-next.3 → 13.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configure/lib/defaults.js +23 -36
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +114 -202
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +188 -271
- package/configure/lib/main.js.map +1 -1
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.json +1972 -0
- package/configure/node_modules/@pie-element/multiple-choice/CHANGELOG.md +4213 -0
- package/configure/node_modules/@pie-element/multiple-choice/PRINT.md +35 -0
- package/configure/node_modules/@pie-element/multiple-choice/README.md +56 -0
- package/configure/node_modules/@pie-element/multiple-choice/choice.png +0 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.json +1387 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/CHANGELOG.md +3351 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/__tests__/root.test.js +248 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js +200 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js +211 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js +477 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js +18 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/configure/package.json +22 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.json +527 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/CHANGELOG.md +2316 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/__tests__/index.test.js +520 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/__tests__/utils.test.js +8 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js +33 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/defaults.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js +251 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js +16 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/lib/utils.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/controller/package.json +15 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json +2993 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/config-schema.json.md +2217 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/config.js +8 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/generate.js +61 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/index.html +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/pie.manifest.json +11 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/demo/session.js +7 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json +1332 -0
- package/configure/node_modules/@pie-element/multiple-choice/docs/pie-schema.json.md +1015 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/__tests__/choice-input-test.js +117 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/__tests__/index-test.js +151 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/__tests__/key-events-test.js +95 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/__tests__/multiple-choice-test.js +223 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/__tests__/session-updater-test.js +70 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js +370 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice-input.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js +197 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js +130 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/feedback-tick.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js +292 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js +54 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/main.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js +386 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/multiple-choice.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js +92 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/print.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js +37 -0
- package/configure/node_modules/@pie-element/multiple-choice/lib/session-updater.js.map +1 -0
- package/configure/node_modules/@pie-element/multiple-choice/package.json +39 -0
- package/configure/package.json +9 -6
- package/configure/src/__tests__/index.test.js +99 -108
- package/configure/src/index.js +13 -6
- package/configure/src/main.jsx +14 -18
- package/controller/lib/defaults.js +20 -32
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +224 -349
- package/controller/lib/index.js.map +1 -1
- package/controller/lib/utils.js +4 -18
- package/controller/lib/utils.js.map +1 -1
- package/controller/package.json +3 -3
- package/lib/index.js +113 -181
- package/lib/index.js.map +1 -1
- package/lib/print.js +120 -204
- package/lib/print.js.map +1 -1
- package/package.json +5 -13
- package/src/__tests__/index.test.js +18 -5
- package/configure/src/__tests__/__snapshots__/index.test.js.snap +0 -83
- package/esm/configure.js +0 -12003
- package/esm/configure.js.map +0 -1
- package/esm/controller.js +0 -3358
- package/esm/controller.js.map +0 -1
- package/esm/element.js +0 -2203
- package/esm/element.js.map +0 -1
- package/esm/package.json +0 -3
- package/esm/print.js +0 -4092
- package/esm/print.js.map +0 -1
- package/module/configure.js +0 -1
- package/module/controller.js +0 -6469
- package/module/demo.js +0 -77
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -115
- package/module/print.html +0 -18
- package/module/print.js +0 -1
package/configure/lib/main.js
CHANGED
|
@@ -1,305 +1,222 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
7
|
+
exports.default = exports.Main = void 0;
|
|
24
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
9
|
var _react = _interopRequireDefault(require("react"));
|
|
27
|
-
|
|
28
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
|
-
|
|
30
11
|
var _configUi = require("@pie-lib/config-ui");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
flex: 1,
|
|
56
|
-
height: theme.spacing.unit * 2.5
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
var Main = /*#__PURE__*/function (_React$Component) {
|
|
62
|
-
(0, _inherits2["default"])(Main, _React$Component);
|
|
63
|
-
|
|
64
|
-
var _super = _createSuper(Main);
|
|
65
|
-
|
|
66
|
-
function Main() {
|
|
67
|
-
var _this;
|
|
68
|
-
|
|
69
|
-
(0, _classCallCheck2["default"])(this, Main);
|
|
70
|
-
|
|
71
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
72
|
-
args[_key] = arguments[_key];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
76
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "removeExtraChoices", function (choices) {
|
|
77
|
-
var correctFound = false;
|
|
78
|
-
return (choices || []).map(function (choice) {
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
13
|
+
const {
|
|
14
|
+
Panel,
|
|
15
|
+
toggle,
|
|
16
|
+
radio,
|
|
17
|
+
dropdown
|
|
18
|
+
} = _configUi.settings;
|
|
19
|
+
const PartLabel = (0, _styles.styled)('div')(({
|
|
20
|
+
theme
|
|
21
|
+
}) => ({
|
|
22
|
+
paddingBottom: theme.spacing(2)
|
|
23
|
+
}));
|
|
24
|
+
const Divider = (0, _styles.styled)('div')(({
|
|
25
|
+
theme
|
|
26
|
+
}) => ({
|
|
27
|
+
flex: 1,
|
|
28
|
+
height: theme.spacing(2.5)
|
|
29
|
+
}));
|
|
30
|
+
class Main extends _react.default.Component {
|
|
31
|
+
constructor(...args) {
|
|
32
|
+
super(...args);
|
|
33
|
+
(0, _defineProperty2.default)(this, "removeExtraChoices", choices => {
|
|
34
|
+
let correctFound = false;
|
|
35
|
+
return (choices || []).map(choice => {
|
|
79
36
|
if (correctFound) {
|
|
80
37
|
choice.correct = false;
|
|
81
38
|
return choice;
|
|
82
39
|
}
|
|
83
|
-
|
|
84
40
|
if (choice.correct) {
|
|
85
41
|
correctFound = true;
|
|
86
42
|
}
|
|
87
|
-
|
|
88
43
|
return choice;
|
|
89
44
|
});
|
|
90
45
|
});
|
|
91
|
-
(0, _defineProperty2
|
|
92
|
-
|
|
93
|
-
|
|
46
|
+
(0, _defineProperty2.default)(this, "onModelChanged", (model, key) => {
|
|
47
|
+
const {
|
|
48
|
+
onModelChanged
|
|
49
|
+
} = this.props;
|
|
94
50
|
if (key === 'partA.choiceMode' && model.partA.choiceMode === 'radio') {
|
|
95
|
-
model.partA.choices =
|
|
51
|
+
model.partA.choices = this.removeExtraChoices(model.partA.choices);
|
|
96
52
|
return onModelChanged(model, true);
|
|
97
53
|
}
|
|
98
|
-
|
|
99
54
|
if (key === 'partB.choiceMode' && model.partB.choiceMode === 'radio') {
|
|
100
|
-
model.partB.choices =
|
|
55
|
+
model.partB.choices = this.removeExtraChoices(model.partB.choices);
|
|
101
56
|
return onModelChanged(model, true);
|
|
102
57
|
}
|
|
103
|
-
|
|
104
58
|
return onModelChanged(model);
|
|
105
59
|
});
|
|
106
|
-
return _this;
|
|
107
60
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
'partA.promptEnabled': promptA.settings && toggle(promptA.label),
|
|
223
|
-
'partA.teacherInstructionsEnabled': teacherInstructionsA.settings && toggle(teacherInstructionsA.label),
|
|
224
|
-
'partA.studentInstructionsEnabled': studentInstructionsA.settings && toggle(studentInstructionsA.label),
|
|
225
|
-
'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),
|
|
226
|
-
'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label)
|
|
227
|
-
};
|
|
228
|
-
var panelSettingsPartB = {
|
|
229
|
-
'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),
|
|
230
|
-
'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),
|
|
231
|
-
'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),
|
|
232
|
-
'partB.choicesLayout': choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),
|
|
233
|
-
'partB.gridColumns': choicesLayoutB.settings && modelPartB.choicesLayout === 'grid' && nrOfColumnsAvailable.partB.length > 0 && dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB)
|
|
234
|
-
};
|
|
235
|
-
var panelPropertiesPartB = {
|
|
236
|
-
'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),
|
|
237
|
-
'partB.promptEnabled': promptB.settings && toggle(promptB.label),
|
|
238
|
-
'partB.teacherInstructionsEnabled': teacherInstructionsB.settings && toggle(teacherInstructionsB.label),
|
|
239
|
-
'partB.studentInstructionsEnabled': studentInstructionsB.settings && toggle(studentInstructionsB.label),
|
|
240
|
-
'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),
|
|
241
|
-
'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label)
|
|
242
|
-
};
|
|
243
|
-
return /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
244
|
-
extraCSSRules: extraCSSRules,
|
|
245
|
-
dimensions: contentDimensions,
|
|
246
|
-
hideSettings: settingsPanelDisabled,
|
|
247
|
-
settings: /*#__PURE__*/_react["default"].createElement(Panel, {
|
|
248
|
-
model: model,
|
|
249
|
-
onChangeModel: this.onModelChanged,
|
|
250
|
-
configuration: configuration,
|
|
251
|
-
onChangeConfiguration: onConfigurationChanged,
|
|
252
|
-
groups: (_ref3 = {
|
|
253
|
-
'Settings for both': panelSettings
|
|
254
|
-
}, (0, _defineProperty2["default"])(_ref3, "Settings ".concat(firstPart), panelSettingsPartA), (0, _defineProperty2["default"])(_ref3, "Properties ".concat(firstPart), panelPropertiesPartA), (0, _defineProperty2["default"])(_ref3, "Settings ".concat(secondPart), panelSettingsPartB), (0, _defineProperty2["default"])(_ref3, "Properties ".concat(secondPart), panelPropertiesPartB), _ref3)
|
|
255
|
-
})
|
|
256
|
-
}, model.partLabels && /*#__PURE__*/_react["default"].createElement("div", {
|
|
257
|
-
className: classes.partLabel
|
|
258
|
-
}, firstPart), /*#__PURE__*/_react["default"].createElement("ebsr-multiple-choice-configure", {
|
|
259
|
-
id: "A",
|
|
260
|
-
key: "partA",
|
|
261
|
-
ref: function ref(_ref4) {
|
|
262
|
-
if (_ref4) {
|
|
263
|
-
// do not use destructuring to get model from props
|
|
264
|
-
_this2.partA = _ref4;
|
|
265
|
-
_this2.partA._model = _objectSpread(_objectSpread({}, _this2.props.model.partA), {}, {
|
|
266
|
-
errors: _this2.props.model.errors && _this2.props.model.errors.partA || {}
|
|
267
|
-
});
|
|
268
|
-
_this2.partA.configuration = _objectSpread(_objectSpread({}, partA), generalConfiguration);
|
|
269
|
-
}
|
|
61
|
+
render() {
|
|
62
|
+
const {
|
|
63
|
+
model,
|
|
64
|
+
configuration,
|
|
65
|
+
onConfigurationChanged
|
|
66
|
+
} = this.props;
|
|
67
|
+
const {
|
|
68
|
+
partLabelType,
|
|
69
|
+
partA: modelPartA,
|
|
70
|
+
partB: modelPartB,
|
|
71
|
+
extraCSSRules
|
|
72
|
+
} = model;
|
|
73
|
+
const {
|
|
74
|
+
contentDimensions = {},
|
|
75
|
+
partA = {},
|
|
76
|
+
partB = {},
|
|
77
|
+
partialScoring = {},
|
|
78
|
+
settingsPanelDisabled,
|
|
79
|
+
scoringType = {},
|
|
80
|
+
language = {},
|
|
81
|
+
languageChoices = {},
|
|
82
|
+
...generalConfiguration
|
|
83
|
+
} = configuration;
|
|
84
|
+
const {
|
|
85
|
+
feedback: feedbackA = {},
|
|
86
|
+
choiceMode: choiceModeA = {},
|
|
87
|
+
choicePrefix: choicePrefixA = {},
|
|
88
|
+
lockChoiceOrder: lockChoiceOrderA = {},
|
|
89
|
+
prompt: promptA = {},
|
|
90
|
+
teacherInstructions: teacherInstructionsA = {},
|
|
91
|
+
studentInstructions: studentInstructionsA = {},
|
|
92
|
+
choicesLayout: choicesLayoutA = {},
|
|
93
|
+
gridColumns: gridColumnsA = {},
|
|
94
|
+
rationale: rationaleA = {},
|
|
95
|
+
spellCheck: spellCheckA = {}
|
|
96
|
+
} = partA || {};
|
|
97
|
+
const {
|
|
98
|
+
feedback: feedbackB = {},
|
|
99
|
+
choiceMode: choiceModeB = {},
|
|
100
|
+
choicePrefix: choicePrefixB = {},
|
|
101
|
+
lockChoiceOrder: lockChoiceOrderB = {},
|
|
102
|
+
prompt: promptB = {},
|
|
103
|
+
teacherInstructions: teacherInstructionsB = {},
|
|
104
|
+
studentInstructions: studentInstructionsB = {},
|
|
105
|
+
choicesLayout: choicesLayoutB = {},
|
|
106
|
+
gridColumns: gridColumnsB = {},
|
|
107
|
+
rationale: rationaleB = {},
|
|
108
|
+
spellCheck: spellCheckB = {}
|
|
109
|
+
} = partB || {};
|
|
110
|
+
const type = partLabelType || 'Numbers';
|
|
111
|
+
const typeIsNumber = type === 'Numbers';
|
|
112
|
+
const firstPart = `Part ${typeIsNumber ? '1' : 'A'}`;
|
|
113
|
+
const secondPart = `Part ${typeIsNumber ? '2' : 'B'}`;
|
|
114
|
+
const nrOfColumnsAvailable = {
|
|
115
|
+
partA: modelPartA.choices && modelPartA.choices.length ? Array.from({
|
|
116
|
+
length: modelPartA.choices.length
|
|
117
|
+
}, (_, i) => `${i + 1}`) : [],
|
|
118
|
+
partB: modelPartB.choices && modelPartB.choices.length ? Array.from({
|
|
119
|
+
length: modelPartB.choices.length
|
|
120
|
+
}, (_, i) => `${i + 1}`) : []
|
|
121
|
+
};
|
|
122
|
+
const panelSettings = {
|
|
123
|
+
partLabels: generalConfiguration.partLabels.settings && toggle(generalConfiguration.partLabels.label),
|
|
124
|
+
partLabelType: model.partLabels && dropdown('', ['Numbers', 'Letters']),
|
|
125
|
+
partialScoring: partialScoring.settings && toggle(partialScoring.label),
|
|
126
|
+
scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),
|
|
127
|
+
'language.enabled': language.settings && toggle(language.label, true),
|
|
128
|
+
language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options)
|
|
129
|
+
};
|
|
130
|
+
const panelSettingsPartA = {
|
|
131
|
+
'partA.choiceMode': choiceModeA.settings && radio(choiceModeA.label, ['checkbox', 'radio']),
|
|
132
|
+
'partA.choicePrefix': choicePrefixA.settings && radio(choicePrefixA.label, ['numbers', 'letters']),
|
|
133
|
+
'partA.lockChoiceOrder': lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),
|
|
134
|
+
'partA.choicesLayout': choicesLayoutA.settings && dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),
|
|
135
|
+
'partA.gridColumns': choicesLayoutA.settings && modelPartA.choicesLayout === 'grid' && nrOfColumnsAvailable.partA.length > 0 && dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA)
|
|
136
|
+
};
|
|
137
|
+
const panelPropertiesPartA = {
|
|
138
|
+
'partA.feedbackEnabled': feedbackA.settings && toggle(feedbackA.label),
|
|
139
|
+
'partA.promptEnabled': promptA.settings && toggle(promptA.label),
|
|
140
|
+
'partA.teacherInstructionsEnabled': teacherInstructionsA.settings && toggle(teacherInstructionsA.label),
|
|
141
|
+
'partA.studentInstructionsEnabled': studentInstructionsA.settings && toggle(studentInstructionsA.label),
|
|
142
|
+
'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),
|
|
143
|
+
'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label)
|
|
144
|
+
};
|
|
145
|
+
const panelSettingsPartB = {
|
|
146
|
+
'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),
|
|
147
|
+
'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),
|
|
148
|
+
'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),
|
|
149
|
+
'partB.choicesLayout': choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),
|
|
150
|
+
'partB.gridColumns': choicesLayoutB.settings && modelPartB.choicesLayout === 'grid' && nrOfColumnsAvailable.partB.length > 0 && dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB)
|
|
151
|
+
};
|
|
152
|
+
const panelPropertiesPartB = {
|
|
153
|
+
'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),
|
|
154
|
+
'partB.promptEnabled': promptB.settings && toggle(promptB.label),
|
|
155
|
+
'partB.teacherInstructionsEnabled': teacherInstructionsB.settings && toggle(teacherInstructionsB.label),
|
|
156
|
+
'partB.studentInstructionsEnabled': studentInstructionsB.settings && toggle(studentInstructionsB.label),
|
|
157
|
+
'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),
|
|
158
|
+
'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label)
|
|
159
|
+
};
|
|
160
|
+
return /*#__PURE__*/_react.default.createElement(_configUi.layout.ConfigLayout, {
|
|
161
|
+
extraCSSRules: extraCSSRules,
|
|
162
|
+
dimensions: contentDimensions,
|
|
163
|
+
hideSettings: settingsPanelDisabled,
|
|
164
|
+
settings: /*#__PURE__*/_react.default.createElement(Panel, {
|
|
165
|
+
model: model,
|
|
166
|
+
onChangeModel: this.onModelChanged,
|
|
167
|
+
configuration: configuration,
|
|
168
|
+
onChangeConfiguration: onConfigurationChanged,
|
|
169
|
+
groups: {
|
|
170
|
+
'Settings for both': panelSettings,
|
|
171
|
+
[`Settings ${firstPart}`]: panelSettingsPartA,
|
|
172
|
+
[`Properties ${firstPart}`]: panelPropertiesPartA,
|
|
173
|
+
[`Settings ${secondPart}`]: panelSettingsPartB,
|
|
174
|
+
[`Properties ${secondPart}`]: panelPropertiesPartB
|
|
270
175
|
}
|
|
271
|
-
})
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}
|
|
176
|
+
})
|
|
177
|
+
}, model.partLabels && /*#__PURE__*/_react.default.createElement(PartLabel, null, firstPart), /*#__PURE__*/_react.default.createElement("ebsr-multiple-choice-configure", {
|
|
178
|
+
id: "A",
|
|
179
|
+
key: "partA",
|
|
180
|
+
ref: ref => {
|
|
181
|
+
if (ref) {
|
|
182
|
+
// do not use destructuring to get model from props
|
|
183
|
+
this.partA = ref;
|
|
184
|
+
this.partA._model = {
|
|
185
|
+
...this.props.model.partA,
|
|
186
|
+
errors: this.props.model.errors && this.props.model.errors.partA || {}
|
|
187
|
+
};
|
|
188
|
+
this.partA.configuration = {
|
|
189
|
+
...partA,
|
|
190
|
+
...generalConfiguration
|
|
191
|
+
};
|
|
287
192
|
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
193
|
+
}
|
|
194
|
+
}), /*#__PURE__*/_react.default.createElement(Divider, null), model.partLabels && /*#__PURE__*/_react.default.createElement(PartLabel, null, secondPart), /*#__PURE__*/_react.default.createElement("ebsr-multiple-choice-configure", {
|
|
195
|
+
id: "B",
|
|
196
|
+
key: "partB",
|
|
197
|
+
ref: ref => {
|
|
198
|
+
if (ref) {
|
|
199
|
+
// do not use destructuring to get model from props
|
|
200
|
+
this.partB = ref;
|
|
201
|
+
this.partB._model = {
|
|
202
|
+
...this.props.model.partB,
|
|
203
|
+
errors: this.props.model.errors && this.props.model.errors.partB || {}
|
|
204
|
+
};
|
|
205
|
+
this.partB.configuration = {
|
|
206
|
+
...partB,
|
|
207
|
+
...generalConfiguration
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
294
214
|
exports.Main = Main;
|
|
295
|
-
(0, _defineProperty2
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
onConfigurationChanged: _propTypes["default"].func
|
|
215
|
+
(0, _defineProperty2.default)(Main, "propTypes", {
|
|
216
|
+
configuration: _propTypes.default.object,
|
|
217
|
+
model: _propTypes.default.object,
|
|
218
|
+
onModelChanged: _propTypes.default.func,
|
|
219
|
+
onConfigurationChanged: _propTypes.default.func
|
|
301
220
|
});
|
|
302
|
-
var
|
|
303
|
-
var _default = Styled;
|
|
304
|
-
exports["default"] = _default;
|
|
221
|
+
var _default = exports.default = Main;
|
|
305
222
|
//# sourceMappingURL=main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["Panel","settings","toggle","radio","dropdown","styles","theme","partLabel","paddingBottom","spacing","unit","divider","flex","height","Main","choices","correctFound","map","choice","correct","model","key","onModelChanged","props","partA","choiceMode","removeExtraChoices","partB","classes","configuration","onConfigurationChanged","partLabelType","modelPartA","modelPartB","extraCSSRules","contentDimensions","partialScoring","settingsPanelDisabled","scoringType","language","languageChoices","generalConfiguration","feedback","feedbackA","choiceModeA","choicePrefix","choicePrefixA","lockChoiceOrder","lockChoiceOrderA","prompt","promptA","teacherInstructions","teacherInstructionsA","studentInstructions","studentInstructionsA","choicesLayout","choicesLayoutA","gridColumns","gridColumnsA","rationale","rationaleA","spellCheck","spellCheckA","feedbackB","choiceModeB","choicePrefixB","lockChoiceOrderB","promptB","teacherInstructionsB","studentInstructionsB","choicesLayoutB","gridColumnsB","rationaleB","spellCheckB","type","typeIsNumber","firstPart","secondPart","nrOfColumnsAvailable","length","Array","from","_","i","panelSettings","partLabels","label","enabled","options","panelSettingsPartA","panelPropertiesPartA","panelSettingsPartB","panelPropertiesPartB","ref","_model","errors","React","Component","PropTypes","object","func","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAQA,KAAR,GAA2CC,kBAA3C,CAAQD,KAAR;AAAA,IAAeE,MAAf,GAA2CD,kBAA3C,CAAeC,MAAf;AAAA,IAAuBC,KAAvB,GAA2CF,kBAA3C,CAAuBE,KAAvB;AAAA,IAA8BC,QAA9B,GAA2CH,kBAA3C,CAA8BG,QAA9B;;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAS,CAACC,KAAD;AAAA,SAAY;AACzBC,IAAAA,SAAS,EAAE;AACTC,MAAAA,aAAa,EAAEF,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB;AAD3B,KADc;AAIzBC,IAAAA,OAAO,EAAE;AACPC,MAAAA,IAAI,EAAE,CADC;AAEPC,MAAAA,MAAM,EAAEP,KAAK,CAACG,OAAN,CAAcC,IAAd,GAAqB;AAFtB;AAJgB,GAAZ;AAAA,CAAf;;IAUaI,I;;;;;;;;;;;;;;;2GASU,UAACC,OAAD,EAAa;AAChC,UAAIC,YAAY,GAAG,KAAnB;AAEA,aAAO,CAACD,OAAO,IAAI,EAAZ,EAAgBE,GAAhB,CAAoB,UAACC,MAAD,EAAY;AACrC,YAAIF,YAAJ,EAAkB;AAChBE,UAAAA,MAAM,CAACC,OAAP,GAAiB,KAAjB;AAEA,iBAAOD,MAAP;AACD;;AAED,YAAIA,MAAM,CAACC,OAAX,EAAoB;AAClBH,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,aAACgB,KAAD,EAAS;AACZ,cAAIA,KAAJ,EAAS;AACP;AACA,YAAA,MAAI,CAAClE,KAAL,GAAakE,KAAb;AACA,YAAA,MAAI,CAAClE,KAAL,CAAWmE,MAAX,mCACK,MAAI,CAACvE,KAAL,CAAWH,KAAX,CAAiBO,KADtB;AAEEoE,cAAAA,MAAM,EAAG,MAAI,CAACxE,KAAL,CAAWH,KAAX,CAAiB2E,MAAjB,IAA2B,MAAI,CAACxE,KAAL,CAAWH,KAAX,CAAiB2E,MAAjB,CAAwBpE,KAApD,IAA8D;AAFxE;AAIA,YAAA,MAAI,CAACA,KAAL,CAAWE,aAAX,mCACKF,KADL,GAEKc,oBAFL;AAID;AACF;AAhBH,QA3CF,CADF;AAgED;;;EAxNuBuD,kBAAMC,S;;;iCAAnBnF,I,eACQ;AACjBc,EAAAA,OAAO,EAAEsE,sBAAUC,MADF;AAEjBtE,EAAAA,aAAa,EAAEqE,sBAAUC,MAFR;AAGjB/E,EAAAA,KAAK,EAAE8E,sBAAUC,MAHA;AAIjB7E,EAAAA,cAAc,EAAE4E,sBAAUE,IAJT;AAKjBtE,EAAAA,sBAAsB,EAAEoE,sBAAUE;AALjB,C;AA0NrB,IAAMC,MAAM,GAAG,wBAAWhG,MAAX,EAAmBS,IAAnB,CAAf;eAEeuF,M","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { settings, layout } from '@pie-lib/config-ui';\nimport { withStyles } from '@material-ui/core/styles';\n\nconst { Panel, toggle, radio, dropdown } = settings;\n\nconst styles = (theme) => ({\n partLabel: {\n paddingBottom: theme.spacing.unit * 2,\n },\n divider: {\n flex: 1,\n height: theme.spacing.unit * 2.5,\n },\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n classes: PropTypes.object,\n configuration: PropTypes.object,\n model: PropTypes.object,\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n };\n\n removeExtraChoices = (choices) => {\n let correctFound = false;\n\n return (choices || []).map((choice) => {\n if (correctFound) {\n choice.correct = false;\n\n return choice;\n }\n\n if (choice.correct) {\n correctFound = true;\n }\n\n return choice;\n });\n };\n\n onModelChanged = (model, key) => {\n const { onModelChanged } = this.props;\n\n if (key === 'partA.choiceMode' && model.partA.choiceMode === 'radio') {\n model.partA.choices = this.removeExtraChoices(model.partA.choices);\n\n return onModelChanged(model, true);\n }\n\n if (key === 'partB.choiceMode' && model.partB.choiceMode === 'radio') {\n model.partB.choices = this.removeExtraChoices(model.partB.choices);\n\n return onModelChanged(model, true);\n }\n\n return onModelChanged(model);\n };\n\n render() {\n const { classes, model, configuration, onConfigurationChanged } = this.props;\n const { partLabelType, partA: modelPartA, partB: modelPartB, extraCSSRules } = model;\n const {\n contentDimensions = {},\n partA = {},\n partB = {},\n partialScoring = {},\n settingsPanelDisabled,\n scoringType = {},\n language = {},\n languageChoices = {},\n ...generalConfiguration\n } = configuration;\n const {\n feedback: feedbackA = {},\n choiceMode: choiceModeA = {},\n choicePrefix: choicePrefixA = {},\n lockChoiceOrder: lockChoiceOrderA = {},\n prompt: promptA = {},\n teacherInstructions: teacherInstructionsA = {},\n studentInstructions: studentInstructionsA = {},\n choicesLayout: choicesLayoutA = {},\n gridColumns: gridColumnsA = {},\n rationale: rationaleA = {},\n spellCheck: spellCheckA = {},\n } = partA || {};\n const {\n feedback: feedbackB = {},\n choiceMode: choiceModeB = {},\n choicePrefix: choicePrefixB = {},\n lockChoiceOrder: lockChoiceOrderB = {},\n prompt: promptB = {},\n teacherInstructions: teacherInstructionsB = {},\n studentInstructions: studentInstructionsB = {},\n choicesLayout: choicesLayoutB = {},\n gridColumns: gridColumnsB = {},\n rationale: rationaleB = {},\n spellCheck: spellCheckB = {},\n } = partB || {};\n\n const type = partLabelType || 'Numbers';\n const typeIsNumber = type === 'Numbers';\n const firstPart = `Part ${typeIsNumber ? '1' : 'A'}`;\n const secondPart = `Part ${typeIsNumber ? '2' : 'B'}`;\n const nrOfColumnsAvailable = {\n partA:\n modelPartA.choices && modelPartA.choices.length\n ? Array.from({ length: modelPartA.choices.length }, (_, i) => `${i + 1}`)\n : [],\n partB:\n modelPartB.choices && modelPartB.choices.length\n ? Array.from({ length: modelPartB.choices.length }, (_, i) => `${i + 1}`)\n : [],\n };\n\n const panelSettings = {\n partLabels: generalConfiguration.partLabels.settings && toggle(generalConfiguration.partLabels.label),\n partLabelType: model.partLabels && dropdown('', ['Numbers', 'Letters']),\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n\n const panelSettingsPartA = {\n 'partA.choiceMode': choiceModeA.settings && radio(choiceModeA.label, ['checkbox', 'radio']),\n 'partA.choicePrefix': choicePrefixA.settings && radio(choicePrefixA.label, ['numbers', 'letters']),\n 'partA.lockChoiceOrder': lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),\n 'partA.choicesLayout':\n choicesLayoutA.settings && dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),\n 'partA.gridColumns':\n choicesLayoutA.settings &&\n modelPartA.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partA.length > 0 &&\n dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA),\n };\n const panelPropertiesPartA = {\n 'partA.feedbackEnabled': feedbackA.settings && toggle(feedbackA.label),\n 'partA.promptEnabled': promptA.settings && toggle(promptA.label),\n 'partA.teacherInstructionsEnabled': teacherInstructionsA.settings && toggle(teacherInstructionsA.label),\n 'partA.studentInstructionsEnabled': studentInstructionsA.settings && toggle(studentInstructionsA.label),\n 'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),\n 'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label),\n };\n\n const panelSettingsPartB = {\n 'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),\n 'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),\n 'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),\n 'partB.choicesLayout':\n choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),\n 'partB.gridColumns':\n choicesLayoutB.settings &&\n modelPartB.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partB.length > 0 &&\n dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB),\n };\n const panelPropertiesPartB = {\n 'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),\n 'partB.promptEnabled': promptB.settings && toggle(promptB.label),\n 'partB.teacherInstructionsEnabled': teacherInstructionsB.settings && toggle(teacherInstructionsB.label),\n 'partB.studentInstructionsEnabled': studentInstructionsB.settings && toggle(studentInstructionsB.label),\n 'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),\n 'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label),\n };\n\n return (\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={this.onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Settings for both': panelSettings,\n [`Settings ${firstPart}`]: panelSettingsPartA,\n [`Properties ${firstPart}`]: panelPropertiesPartA,\n [`Settings ${secondPart}`]: panelSettingsPartB,\n [`Properties ${secondPart}`]: panelPropertiesPartB,\n }}\n />\n }\n >\n {model.partLabels && <div className={classes.partLabel}>{firstPart}</div>}\n <ebsr-multiple-choice-configure\n id=\"A\"\n key=\"partA\"\n ref={(ref) => {\n if (ref) {\n // do not use destructuring to get model from props\n this.partA = ref;\n this.partA._model = {\n ...this.props.model.partA,\n errors: (this.props.model.errors && this.props.model.errors.partA) || {},\n };\n this.partA.configuration = {\n ...partA,\n ...generalConfiguration,\n };\n }\n }}\n />\n\n <div className={classes.divider} />\n\n {model.partLabels && <div className={classes.partLabel}>{secondPart}</div>}\n <ebsr-multiple-choice-configure\n id=\"B\"\n key=\"partB\"\n ref={(ref) => {\n if (ref) {\n // do not use destructuring to get model from props\n this.partB = ref;\n this.partB._model = {\n ...this.props.model.partB,\n errors: (this.props.model.errors && this.props.model.errors.partB) || {},\n };\n this.partB.configuration = {\n ...partB,\n ...generalConfiguration,\n };\n }\n }}\n />\n </layout.ConfigLayout>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"file":"main.js"}
|
|
1
|
+
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_configUi","_styles","Panel","toggle","radio","dropdown","settings","PartLabel","styled","theme","paddingBottom","spacing","Divider","flex","height","Main","React","Component","constructor","args","_defineProperty2","default","choices","correctFound","map","choice","correct","model","key","onModelChanged","props","partA","choiceMode","removeExtraChoices","partB","render","configuration","onConfigurationChanged","partLabelType","modelPartA","modelPartB","extraCSSRules","contentDimensions","partialScoring","settingsPanelDisabled","scoringType","language","languageChoices","generalConfiguration","feedback","feedbackA","choiceModeA","choicePrefix","choicePrefixA","lockChoiceOrder","lockChoiceOrderA","prompt","promptA","teacherInstructions","teacherInstructionsA","studentInstructions","studentInstructionsA","choicesLayout","choicesLayoutA","gridColumns","gridColumnsA","rationale","rationaleA","spellCheck","spellCheckA","feedbackB","choiceModeB","choicePrefixB","lockChoiceOrderB","promptB","teacherInstructionsB","studentInstructionsB","choicesLayoutB","gridColumnsB","rationaleB","spellCheckB","type","typeIsNumber","firstPart","secondPart","nrOfColumnsAvailable","length","Array","from","_","i","panelSettings","partLabels","label","enabled","options","panelSettingsPartA","panelPropertiesPartA","panelSettingsPartB","panelPropertiesPartB","createElement","layout","ConfigLayout","dimensions","hideSettings","onChangeModel","onChangeConfiguration","groups","id","ref","_model","errors","exports","PropTypes","object","func","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { settings, layout } from '@pie-lib/config-ui';\nimport { styled } from '@mui/material/styles';\n\nconst { Panel, toggle, radio, dropdown } = settings;\n\nconst PartLabel = styled('div')(({ theme }) => ({\n paddingBottom: theme.spacing(2),\n}));\n\nconst Divider = styled('div')(({ theme }) => ({\n flex: 1,\n height: theme.spacing(2.5),\n}));\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object,\n model: PropTypes.object,\n onModelChanged: PropTypes.func,\n onConfigurationChanged: PropTypes.func,\n };\n\n removeExtraChoices = (choices) => {\n let correctFound = false;\n\n return (choices || []).map((choice) => {\n if (correctFound) {\n choice.correct = false;\n\n return choice;\n }\n\n if (choice.correct) {\n correctFound = true;\n }\n\n return choice;\n });\n };\n\n onModelChanged = (model, key) => {\n const { onModelChanged } = this.props;\n\n if (key === 'partA.choiceMode' && model.partA.choiceMode === 'radio') {\n model.partA.choices = this.removeExtraChoices(model.partA.choices);\n\n return onModelChanged(model, true);\n }\n\n if (key === 'partB.choiceMode' && model.partB.choiceMode === 'radio') {\n model.partB.choices = this.removeExtraChoices(model.partB.choices);\n\n return onModelChanged(model, true);\n }\n\n return onModelChanged(model);\n };\n\n render() {\n const { model, configuration, onConfigurationChanged } = this.props;\n const { partLabelType, partA: modelPartA, partB: modelPartB, extraCSSRules } = model;\n const {\n contentDimensions = {},\n partA = {},\n partB = {},\n partialScoring = {},\n settingsPanelDisabled,\n scoringType = {},\n language = {},\n languageChoices = {},\n ...generalConfiguration\n } = configuration;\n const {\n feedback: feedbackA = {},\n choiceMode: choiceModeA = {},\n choicePrefix: choicePrefixA = {},\n lockChoiceOrder: lockChoiceOrderA = {},\n prompt: promptA = {},\n teacherInstructions: teacherInstructionsA = {},\n studentInstructions: studentInstructionsA = {},\n choicesLayout: choicesLayoutA = {},\n gridColumns: gridColumnsA = {},\n rationale: rationaleA = {},\n spellCheck: spellCheckA = {},\n } = partA || {};\n const {\n feedback: feedbackB = {},\n choiceMode: choiceModeB = {},\n choicePrefix: choicePrefixB = {},\n lockChoiceOrder: lockChoiceOrderB = {},\n prompt: promptB = {},\n teacherInstructions: teacherInstructionsB = {},\n studentInstructions: studentInstructionsB = {},\n choicesLayout: choicesLayoutB = {},\n gridColumns: gridColumnsB = {},\n rationale: rationaleB = {},\n spellCheck: spellCheckB = {},\n } = partB || {};\n\n const type = partLabelType || 'Numbers';\n const typeIsNumber = type === 'Numbers';\n const firstPart = `Part ${typeIsNumber ? '1' : 'A'}`;\n const secondPart = `Part ${typeIsNumber ? '2' : 'B'}`;\n const nrOfColumnsAvailable = {\n partA:\n modelPartA.choices && modelPartA.choices.length\n ? Array.from({ length: modelPartA.choices.length }, (_, i) => `${i + 1}`)\n : [],\n partB:\n modelPartB.choices && modelPartB.choices.length\n ? Array.from({ length: modelPartB.choices.length }, (_, i) => `${i + 1}`)\n : [],\n };\n\n const panelSettings = {\n partLabels: generalConfiguration.partLabels.settings && toggle(generalConfiguration.partLabels.label),\n partLabelType: model.partLabels && dropdown('', ['Numbers', 'Letters']),\n partialScoring: partialScoring.settings && toggle(partialScoring.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),\n 'language.enabled': language.settings && toggle(language.label, true),\n language: language.settings && language.enabled && dropdown(languageChoices.label, languageChoices.options),\n };\n\n const panelSettingsPartA = {\n 'partA.choiceMode': choiceModeA.settings && radio(choiceModeA.label, ['checkbox', 'radio']),\n 'partA.choicePrefix': choicePrefixA.settings && radio(choicePrefixA.label, ['numbers', 'letters']),\n 'partA.lockChoiceOrder': lockChoiceOrderA.settings && toggle(lockChoiceOrderA.label),\n 'partA.choicesLayout':\n choicesLayoutA.settings && dropdown(choicesLayoutA.label, ['vertical', 'grid', 'horizontal']),\n 'partA.gridColumns':\n choicesLayoutA.settings &&\n modelPartA.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partA.length > 0 &&\n dropdown(gridColumnsA.label, nrOfColumnsAvailable.partA),\n };\n const panelPropertiesPartA = {\n 'partA.feedbackEnabled': feedbackA.settings && toggle(feedbackA.label),\n 'partA.promptEnabled': promptA.settings && toggle(promptA.label),\n 'partA.teacherInstructionsEnabled': teacherInstructionsA.settings && toggle(teacherInstructionsA.label),\n 'partA.studentInstructionsEnabled': studentInstructionsA.settings && toggle(studentInstructionsA.label),\n 'partA.rationaleEnabled': rationaleA.settings && toggle(rationaleA.label),\n 'partA.spellCheckEnabled': spellCheckA.settings && toggle(spellCheckA.label),\n };\n\n const panelSettingsPartB = {\n 'partB.choiceMode': choiceModeB.settings && radio(choiceModeB.label, ['checkbox', 'radio']),\n 'partB.choicePrefix': choicePrefixB.settings && radio(choicePrefixB.label, ['numbers', 'letters']),\n 'partB.lockChoiceOrder': lockChoiceOrderB.settings && toggle(lockChoiceOrderB.label),\n 'partB.choicesLayout':\n choicesLayoutB.settings && dropdown(choicesLayoutB.label, ['vertical', 'grid', 'horizontal']),\n 'partB.gridColumns':\n choicesLayoutB.settings &&\n modelPartB.choicesLayout === 'grid' &&\n nrOfColumnsAvailable.partB.length > 0 &&\n dropdown(gridColumnsB.label, nrOfColumnsAvailable.partB),\n };\n const panelPropertiesPartB = {\n 'partB.feedbackEnabled': feedbackB.settings && toggle(feedbackB.label),\n 'partB.promptEnabled': promptB.settings && toggle(promptB.label),\n 'partB.teacherInstructionsEnabled': teacherInstructionsB.settings && toggle(teacherInstructionsB.label),\n 'partB.studentInstructionsEnabled': studentInstructionsB.settings && toggle(studentInstructionsB.label),\n 'partB.rationaleEnabled': rationaleB.settings && toggle(rationaleB.label),\n 'partB.spellCheckEnabled': spellCheckB.settings && toggle(spellCheckB.label),\n };\n\n return (\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={this.onModelChanged}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n 'Settings for both': panelSettings,\n [`Settings ${firstPart}`]: panelSettingsPartA,\n [`Properties ${firstPart}`]: panelPropertiesPartA,\n [`Settings ${secondPart}`]: panelSettingsPartB,\n [`Properties ${secondPart}`]: panelPropertiesPartB,\n }}\n />\n }\n >\n {model.partLabels && <PartLabel>{firstPart}</PartLabel>}\n <ebsr-multiple-choice-configure\n id=\"A\"\n key=\"partA\"\n ref={(ref) => {\n if (ref) {\n // do not use destructuring to get model from props\n this.partA = ref;\n this.partA._model = {\n ...this.props.model.partA,\n errors: (this.props.model.errors && this.props.model.errors.partA) || {},\n };\n this.partA.configuration = {\n ...partA,\n ...generalConfiguration,\n };\n }\n }}\n />\n\n <Divider />\n\n {model.partLabels && <PartLabel>{secondPart}</PartLabel>}\n <ebsr-multiple-choice-configure\n id=\"B\"\n key=\"partB\"\n ref={(ref) => {\n if (ref) {\n // do not use destructuring to get model from props\n this.partB = ref;\n this.partB._model = {\n ...this.props.model.partB,\n errors: (this.props.model.errors && this.props.model.errors.partB) || {},\n };\n this.partB.configuration = {\n ...partB,\n ...generalConfiguration,\n };\n }\n }}\n />\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAEA,MAAM;EAAEI,KAAK;EAAEC,MAAM;EAAEC,KAAK;EAAEC;AAAS,CAAC,GAAGC,kBAAQ;AAEnD,MAAMC,SAAS,GAAG,IAAAC,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EAC9CC,aAAa,EAAED,KAAK,CAACE,OAAO,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC;AAEH,MAAMC,OAAO,GAAG,IAAAJ,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EAC5CI,IAAI,EAAE,CAAC;EACPC,MAAM,EAAEL,KAAK,CAACE,OAAO,CAAC,GAAG;AAC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