@pie-element/graphing-solution-set 6.1.2-next.1 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +1 -0
- package/CHANGELOG.md +856 -0
- package/LICENSE.md +5 -0
- package/README.md +20 -0
- package/configure/CHANGELOG.json +1 -0
- package/configure/CHANGELOG.md +816 -0
- package/configure/lib/configure.js +312 -0
- package/configure/lib/configure.js.map +1 -0
- package/configure/lib/correct-response.js +435 -0
- package/configure/lib/correct-response.js.map +1 -0
- package/configure/lib/defaults.js +357 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/graphing-config.js +408 -0
- package/configure/lib/graphing-config.js.map +1 -0
- package/configure/lib/index.js +163 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/utils.js +630 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +29 -0
- package/controller/CHANGELOG.json +1 -0
- package/controller/CHANGELOG.md +675 -0
- package/controller/lib/defaults.js +69 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +351 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/lib/utils.js +212 -0
- package/controller/lib/utils.js.map +1 -0
- package/controller/package.json +22 -0
- package/demo-gss.gif +0 -0
- package/docs/config-schema.json +1560 -0
- package/docs/config-schema.json.md +1114 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +54 -0
- package/docs/demo/index.html +1 -0
- package/docs/demo/session.js +6 -0
- package/docs/pie-schema.json +1800 -0
- package/docs/pie-schema.json.md +952 -0
- package/lib/index.js +164 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +355 -0
- package/lib/main.js.map +1 -0
- package/lib/utils.js +515 -0
- package/lib/utils.js.map +1 -0
- package/package.json +23 -86
- package/configure.js +0 -2
- package/controller.js +0 -1
- package/dist/author/configure.d.ts +0 -26
- package/dist/author/configure.js +0 -190
- package/dist/author/correct-response.d.ts +0 -33
- package/dist/author/correct-response.js +0 -206
- package/dist/author/defaults.d.ts +0 -238
- package/dist/author/defaults.js +0 -339
- package/dist/author/graphing-config.d.ts +0 -33
- package/dist/author/graphing-config.js +0 -237
- package/dist/author/index.d.ts +0 -62
- package/dist/author/index.js +0 -87
- package/dist/author/utils.d.ts +0 -46
- package/dist/author/utils.js +0 -474
- package/dist/browser/author/index.js +0 -1942
- package/dist/browser/author/index.js.map +0 -1
- package/dist/browser/browser-pUycHh7Y.js +0 -348
- package/dist/browser/browser-pUycHh7Y.js.map +0 -1
- package/dist/browser/controller/index.js +0 -193
- package/dist/browser/controller/index.js.map +0 -1
- package/dist/browser/delivery/index.js +0 -782
- package/dist/browser/delivery/index.js.map +0 -1
- package/dist/browser/dist-BxTk7Laj.js +0 -57671
- package/dist/browser/dist-BxTk7Laj.js.map +0 -1
- package/dist/browser/graphing-solution-set.css +0 -2
- package/dist/controller/defaults.d.ts +0 -64
- package/dist/controller/defaults.js +0 -54
- package/dist/controller/index.d.ts +0 -24
- package/dist/controller/index.js +0 -110
- package/dist/controller/utils.d.ts +0 -20
- package/dist/controller/utils.js +0 -39
- package/dist/delivery/index.d.ts +0 -22
- package/dist/delivery/index.js +0 -62
- package/dist/delivery/main.d.ts +0 -31
- package/dist/delivery/main.js +0 -198
- package/dist/delivery/utils.d.ts +0 -12
- package/dist/delivery/utils.js +0 -220
- package/dist/graphing-solution-set.css +0 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -405
- package/dist/index.js +0 -2
- package/dist/runtime-support.d.ts +0 -12
- package/dist/runtime-support.js +0 -12
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.CorrectResponse = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _styles = require("@mui/material/styles");
|
|
12
|
+
var _graphingSolutionSet = require("@pie-lib/graphing-solution-set");
|
|
13
|
+
var _configUi = require("@pie-lib/config-ui");
|
|
14
|
+
var _lodashEs = require("lodash-es");
|
|
15
|
+
var _material = require("@mui/material");
|
|
16
|
+
var _Radio = _interopRequireDefault(require("@mui/material/Radio"));
|
|
17
|
+
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
18
|
+
var _utils = require("./utils");
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
|
+
const SubtitleText = (0, _styles.styled)(_material.Typography)(({
|
|
21
|
+
theme
|
|
22
|
+
}) => ({
|
|
23
|
+
marginTop: theme.spacing(1.5),
|
|
24
|
+
marginBottom: theme.spacing(1)
|
|
25
|
+
}));
|
|
26
|
+
const RadioButtonClass = (0, _styles.styled)(_FormControlLabel.default)({
|
|
27
|
+
height: '20px',
|
|
28
|
+
width: 'fit-content',
|
|
29
|
+
padding: '.5rem 0'
|
|
30
|
+
});
|
|
31
|
+
const StyledRadio = (0, _styles.styled)(_Radio.default)({
|
|
32
|
+
color: '#000000 !important'
|
|
33
|
+
});
|
|
34
|
+
const ErrorMessage = (0, _styles.styled)('div')(({
|
|
35
|
+
theme
|
|
36
|
+
}) => ({
|
|
37
|
+
fontSize: theme.typography.fontSize - 2,
|
|
38
|
+
color: theme.palette.error.main,
|
|
39
|
+
paddingTop: theme.spacing(1)
|
|
40
|
+
}));
|
|
41
|
+
class CorrectResponse extends React.Component {
|
|
42
|
+
constructor(...args) {
|
|
43
|
+
super(...args);
|
|
44
|
+
(0, _defineProperty2.default)(this, "state", {
|
|
45
|
+
dialog: {
|
|
46
|
+
open: false
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
/*
|
|
50
|
+
* Function to handle the alert dialog open and close
|
|
51
|
+
* @param {boolean} open - open or close the dialog
|
|
52
|
+
* @param {function} callback - callback function to be called after setting the state
|
|
53
|
+
* */
|
|
54
|
+
(0, _defineProperty2.default)(this, "handleAlertDialog", (open, callback) => this.setState({
|
|
55
|
+
dialog: {
|
|
56
|
+
open
|
|
57
|
+
}
|
|
58
|
+
}, callback));
|
|
59
|
+
/*
|
|
60
|
+
* Function to change the marks on the graph
|
|
61
|
+
* @param {array} marks - marks to be added on the graph
|
|
62
|
+
* */
|
|
63
|
+
(0, _defineProperty2.default)(this, "changeMarks", marks => {
|
|
64
|
+
const {
|
|
65
|
+
model,
|
|
66
|
+
onChange
|
|
67
|
+
} = this.props;
|
|
68
|
+
const {
|
|
69
|
+
gssLineData
|
|
70
|
+
} = model;
|
|
71
|
+
if (gssLineData.selectedTool === 'lineA' && marks.length > 0) {
|
|
72
|
+
marks[0].fill = gssLineData['lineA'].lineType;
|
|
73
|
+
}
|
|
74
|
+
if (gssLineData.selectedTool === 'lineB' && marks.length > 1) {
|
|
75
|
+
marks[1].fill = gssLineData['lineB'].lineType;
|
|
76
|
+
}
|
|
77
|
+
if (marks.length === 0) {
|
|
78
|
+
gssLineData.selectedTool = 'lineA';
|
|
79
|
+
(0, _lodashEs.set)(model, 'gssLineData', gssLineData);
|
|
80
|
+
}
|
|
81
|
+
(0, _lodashEs.set)(model, 'answers.correctAnswer.marks', marks);
|
|
82
|
+
onChange(model);
|
|
83
|
+
});
|
|
84
|
+
/*
|
|
85
|
+
* Reset the graph to original state and remove all the elements added on the graph
|
|
86
|
+
* */
|
|
87
|
+
(0, _defineProperty2.default)(this, "onResetClick", () => {
|
|
88
|
+
const {
|
|
89
|
+
model,
|
|
90
|
+
onChange
|
|
91
|
+
} = this.props;
|
|
92
|
+
const {
|
|
93
|
+
gssLineData,
|
|
94
|
+
answers
|
|
95
|
+
} = model;
|
|
96
|
+
this.setState({
|
|
97
|
+
dialog: {
|
|
98
|
+
open: true,
|
|
99
|
+
title: 'Warning',
|
|
100
|
+
text: 'This will remove all the elements added on the graph and reset graph to original state. Are you sure you want to continue?',
|
|
101
|
+
onConfirm: () => {
|
|
102
|
+
// Reset the graph to original state
|
|
103
|
+
answers.correctAnswer.marks = [];
|
|
104
|
+
gssLineData.selectedTool = 'lineA';
|
|
105
|
+
gssLineData.lineA.lineType = 'Solid';
|
|
106
|
+
if (gssLineData.lineB) gssLineData.lineB.lineType = 'Solid';
|
|
107
|
+
(0, _lodashEs.set)(model, 'answers', answers);
|
|
108
|
+
(0, _lodashEs.set)(model, 'gssLineData', gssLineData);
|
|
109
|
+
onChange(model);
|
|
110
|
+
this.handleAlertDialog(false);
|
|
111
|
+
},
|
|
112
|
+
onClose: () => this.handleAlertDialog(false)
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
/*
|
|
117
|
+
* Function to change the number of lines on the graph
|
|
118
|
+
* @param {object} e - event object
|
|
119
|
+
* @param {number} value - number of lines to be added on the graph
|
|
120
|
+
* */
|
|
121
|
+
(0, _defineProperty2.default)(this, "changeNumberOfLines", (e, value) => {
|
|
122
|
+
const {
|
|
123
|
+
model
|
|
124
|
+
} = this.props;
|
|
125
|
+
let gssLineData = model.gssLineData;
|
|
126
|
+
if (gssLineData.selectedTool === 'solutionSet') {
|
|
127
|
+
this.setState({
|
|
128
|
+
dialog: {
|
|
129
|
+
open: true,
|
|
130
|
+
title: 'Warning',
|
|
131
|
+
text: 'Changing number of lines after adding solution set will remove added solution set. Are you sure you want to continue?',
|
|
132
|
+
onConfirm: () => {
|
|
133
|
+
this.changeLine(e, value);
|
|
134
|
+
this.handleAlertDialog(false);
|
|
135
|
+
},
|
|
136
|
+
onClose: () => this.handleAlertDialog(false)
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
} else {
|
|
140
|
+
this.changeLine(e, value);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
/*
|
|
144
|
+
* Function to change the number of line on the graph
|
|
145
|
+
* @param {object} e - event object
|
|
146
|
+
* @param {number} value - number of lines to be added on the graph
|
|
147
|
+
* */
|
|
148
|
+
(0, _defineProperty2.default)(this, "changeLine", (e, value) => {
|
|
149
|
+
const {
|
|
150
|
+
model,
|
|
151
|
+
onChange
|
|
152
|
+
} = this.props;
|
|
153
|
+
const {
|
|
154
|
+
answers
|
|
155
|
+
} = model;
|
|
156
|
+
let gssLineData = model.gssLineData;
|
|
157
|
+
//remove polygon from correct answer
|
|
158
|
+
answers.correctAnswer.marks = answers.correctAnswer.marks.filter(mark => mark.type !== 'polygon');
|
|
159
|
+
if (Number.parseInt(value) === 1) {
|
|
160
|
+
//remove lineB from gssLineData and correct answer
|
|
161
|
+
delete gssLineData.lineB;
|
|
162
|
+
if (answers.correctAnswer.marks.length > 1) answers.correctAnswer.marks.pop();
|
|
163
|
+
gssLineData.numberOfLines = 1;
|
|
164
|
+
gssLineData.selectedTool = 'lineA';
|
|
165
|
+
} else {
|
|
166
|
+
gssLineData.numberOfLines = 2;
|
|
167
|
+
if (answers.correctAnswer.marks.length > 0) gssLineData.selectedTool = 'lineB';
|
|
168
|
+
gssLineData.lineB = {
|
|
169
|
+
lineType: 'Solid'
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
//reset solution set
|
|
173
|
+
(0, _lodashEs.set)(model, 'answers', answers);
|
|
174
|
+
(0, _lodashEs.set)(model, 'gssLineData', gssLineData);
|
|
175
|
+
onChange(model);
|
|
176
|
+
});
|
|
177
|
+
/*
|
|
178
|
+
* Function to handle the changes to solution set on the graph
|
|
179
|
+
* @param {object} point - point selected on the graph
|
|
180
|
+
* */
|
|
181
|
+
(0, _defineProperty2.default)(this, "onSolutionSetSelected", point => {
|
|
182
|
+
const {
|
|
183
|
+
model,
|
|
184
|
+
onChange
|
|
185
|
+
} = this.props;
|
|
186
|
+
const {
|
|
187
|
+
answers,
|
|
188
|
+
gssLineData
|
|
189
|
+
} = model;
|
|
190
|
+
for (const section of gssLineData.sections) {
|
|
191
|
+
//check if the point is inside the polygon
|
|
192
|
+
if ((0, _utils.pointInsidePolygon)(point, section)) {
|
|
193
|
+
let polygon = {
|
|
194
|
+
points: section,
|
|
195
|
+
building: false,
|
|
196
|
+
type: 'polygon',
|
|
197
|
+
closed: true,
|
|
198
|
+
isSolution: true
|
|
199
|
+
};
|
|
200
|
+
//remove old answer section from correct answer
|
|
201
|
+
answers.correctAnswer.marks = answers.correctAnswer.marks.filter(mark => mark.type !== 'polygon');
|
|
202
|
+
//add new answer section to correct answer
|
|
203
|
+
answers.correctAnswer.marks.push(polygon);
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
(0, _lodashEs.set)(model, 'answers', answers);
|
|
208
|
+
onChange(model);
|
|
209
|
+
});
|
|
210
|
+
/*
|
|
211
|
+
* Function to handle the changes to line data on the graph
|
|
212
|
+
* @param {object} gssLineData - line data on the graph
|
|
213
|
+
* @param {string} oldSelectedTool - old selected tool
|
|
214
|
+
* */
|
|
215
|
+
(0, _defineProperty2.default)(this, "onChangeGssLineData", (gssLineData, oldSelectedTool) => {
|
|
216
|
+
const {
|
|
217
|
+
model
|
|
218
|
+
} = this.props;
|
|
219
|
+
const {
|
|
220
|
+
answers,
|
|
221
|
+
domain,
|
|
222
|
+
range
|
|
223
|
+
} = model;
|
|
224
|
+
//handle solution set changes
|
|
225
|
+
if (gssLineData.selectedTool === 'solutionSet') {
|
|
226
|
+
let lines = answers.correctAnswer.marks.filter(mark => mark.type !== 'polygon');
|
|
227
|
+
if (!(0, _utils.checkIfLinesAreAdded)(gssLineData, lines)) {
|
|
228
|
+
gssLineData.selectedTool = oldSelectedTool;
|
|
229
|
+
this.setState({
|
|
230
|
+
dialog: {
|
|
231
|
+
open: true,
|
|
232
|
+
title: 'Warning',
|
|
233
|
+
text: 'Please define the line(s) and then select a solution set for the item.',
|
|
234
|
+
onConfirm: () => this.handleAlertDialog(false)
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
} else {
|
|
238
|
+
let lines = answers.correctAnswer.marks.filter(mark => mark.type !== 'polygon');
|
|
239
|
+
gssLineData = (0, _utils.findSectionsInSolutionSet)(gssLineData, lines, domain, range);
|
|
240
|
+
}
|
|
241
|
+
this.handleGssLineDataChange(gssLineData, answers);
|
|
242
|
+
} else {
|
|
243
|
+
let polygons = answers.correctAnswer.marks.filter(mark => mark.type === 'polygon');
|
|
244
|
+
if (oldSelectedTool === 'solutionSet' && polygons.length > 0) {
|
|
245
|
+
this.setState({
|
|
246
|
+
dialog: {
|
|
247
|
+
open: true,
|
|
248
|
+
title: 'Warning',
|
|
249
|
+
text: 'Changing a line after adding a solution set will clear your selected solution set. Click \'Clear Solution Set\' to change the line. Otherwise, click \'Cancel\'.',
|
|
250
|
+
onConfirm: () => {
|
|
251
|
+
answers.correctAnswer.marks = answers.correctAnswer.marks.filter(mark => mark.type !== 'polygon');
|
|
252
|
+
this.handleGssLineDataChange(gssLineData, answers);
|
|
253
|
+
this.handleAlertDialog(false);
|
|
254
|
+
},
|
|
255
|
+
onConfirmText: 'CLEAR SOLUTION SET',
|
|
256
|
+
onClose: () => {
|
|
257
|
+
gssLineData.selectedTool = oldSelectedTool;
|
|
258
|
+
this.handleGssLineDataChange(gssLineData, answers);
|
|
259
|
+
this.handleAlertDialog(false);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
} else {
|
|
264
|
+
this.handleGssLineDataChange(gssLineData, answers);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
/*
|
|
269
|
+
* Function to handle the changes to line data on the graph
|
|
270
|
+
* @param {object} gssLineData - line data on the graph
|
|
271
|
+
* @param {object} answers - correct answer
|
|
272
|
+
* */
|
|
273
|
+
(0, _defineProperty2.default)(this, "handleGssLineDataChange", (gssLineData, answers) => {
|
|
274
|
+
const {
|
|
275
|
+
model,
|
|
276
|
+
onChange
|
|
277
|
+
} = this.props;
|
|
278
|
+
//handle line type changes from solid to dashed and vice versa
|
|
279
|
+
if (answers.correctAnswer.marks.length > 0 && answers.correctAnswer.marks[0] && gssLineData.lineA) {
|
|
280
|
+
answers.correctAnswer.marks[0].fill = gssLineData.lineA.lineType;
|
|
281
|
+
}
|
|
282
|
+
if (answers.correctAnswer.marks.length > 1 && answers.correctAnswer.marks[1] && gssLineData.lineB) {
|
|
283
|
+
answers.correctAnswer.marks[1].fill = gssLineData.lineB.lineType;
|
|
284
|
+
}
|
|
285
|
+
//check if line is added to the graph before switching to lineB
|
|
286
|
+
if (gssLineData.selectedTool === 'lineB' && answers.correctAnswer.marks.length === 0 || gssLineData.selectedTool === 'lineB' && answers.correctAnswer.marks[0].building) {
|
|
287
|
+
this.setState({
|
|
288
|
+
dialog: {
|
|
289
|
+
open: true,
|
|
290
|
+
title: 'Warning',
|
|
291
|
+
text: 'Please add Line A to the graph before adding Line B',
|
|
292
|
+
onConfirm: () => this.handleAlertDialog(false)
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
gssLineData.selectedTool = 'lineA';
|
|
296
|
+
}
|
|
297
|
+
//check if lineB is added to the graph before switching to lineA
|
|
298
|
+
if (gssLineData.selectedTool === 'lineA' && answers.correctAnswer.marks.length > 1 && answers.correctAnswer.marks[1].building) {
|
|
299
|
+
this.setState({
|
|
300
|
+
dialog: {
|
|
301
|
+
open: true,
|
|
302
|
+
title: 'Warning',
|
|
303
|
+
text: 'Please add Line B to the graph before switching to Line A',
|
|
304
|
+
onConfirm: () => this.handleAlertDialog(false)
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
gssLineData.selectedTool = 'lineB';
|
|
308
|
+
}
|
|
309
|
+
(0, _lodashEs.set)(model, 'gssLineData', gssLineData);
|
|
310
|
+
(0, _lodashEs.set)(model, 'answers', answers);
|
|
311
|
+
onChange(model);
|
|
312
|
+
});
|
|
313
|
+
/*
|
|
314
|
+
* Function to update the model
|
|
315
|
+
* @param {object} props - updated props
|
|
316
|
+
* */
|
|
317
|
+
(0, _defineProperty2.default)(this, "updateModel", props => {
|
|
318
|
+
const {
|
|
319
|
+
model,
|
|
320
|
+
onChange
|
|
321
|
+
} = this.props;
|
|
322
|
+
onChange({
|
|
323
|
+
...model,
|
|
324
|
+
...props
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
/*
|
|
329
|
+
* Render the component
|
|
330
|
+
* */
|
|
331
|
+
render() {
|
|
332
|
+
const {
|
|
333
|
+
errors,
|
|
334
|
+
model,
|
|
335
|
+
mathMlOptions = {}
|
|
336
|
+
} = this.props;
|
|
337
|
+
const {
|
|
338
|
+
dialog
|
|
339
|
+
} = this.state;
|
|
340
|
+
//get the default values to GssLineData
|
|
341
|
+
const {
|
|
342
|
+
gssLineData = {
|
|
343
|
+
numberOfLines: 1,
|
|
344
|
+
selectedTool: 'lineA',
|
|
345
|
+
lineA: {
|
|
346
|
+
lineType: 'Solid'
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
arrows,
|
|
350
|
+
coordinatesOnHover,
|
|
351
|
+
domain,
|
|
352
|
+
graph = {},
|
|
353
|
+
labels,
|
|
354
|
+
labelsEnabled,
|
|
355
|
+
range,
|
|
356
|
+
title,
|
|
357
|
+
titleEnabled,
|
|
358
|
+
answers
|
|
359
|
+
} = model || {};
|
|
360
|
+
const {
|
|
361
|
+
correctAnswerErrors = ''
|
|
362
|
+
} = errors || {};
|
|
363
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_material.Typography, {
|
|
364
|
+
component: "div",
|
|
365
|
+
variant: "h6"
|
|
366
|
+
}, "Define Line Type(s) and Correct Response"), /*#__PURE__*/React.createElement(SubtitleText, {
|
|
367
|
+
component: "div",
|
|
368
|
+
variant: "body1"
|
|
369
|
+
}, "Use this interface to choose how many lines students will be able to draw, and to define the correct answer."), /*#__PURE__*/React.createElement(SubtitleText, {
|
|
370
|
+
component: "div",
|
|
371
|
+
variant: "body1"
|
|
372
|
+
}, "Choose Number of Lines"), /*#__PURE__*/React.createElement(_material.RadioGroup, {
|
|
373
|
+
name: "numberOfLines",
|
|
374
|
+
value: gssLineData.numberOfLines,
|
|
375
|
+
onChange: this.changeNumberOfLines
|
|
376
|
+
}, /*#__PURE__*/React.createElement(RadioButtonClass, {
|
|
377
|
+
value: "1",
|
|
378
|
+
control: /*#__PURE__*/React.createElement(StyledRadio, {
|
|
379
|
+
checked: gssLineData.numberOfLines === 1
|
|
380
|
+
}),
|
|
381
|
+
label: "One"
|
|
382
|
+
}), /*#__PURE__*/React.createElement(RadioButtonClass, {
|
|
383
|
+
value: "2",
|
|
384
|
+
control: /*#__PURE__*/React.createElement(StyledRadio, {
|
|
385
|
+
checked: gssLineData.numberOfLines === 2
|
|
386
|
+
}),
|
|
387
|
+
label: "Two"
|
|
388
|
+
})), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_graphingSolutionSet.GraphContainer, {
|
|
389
|
+
style: correctAnswerErrors['correctAnswer'] && {
|
|
390
|
+
border: '2px solid red'
|
|
391
|
+
},
|
|
392
|
+
axesSettings: {
|
|
393
|
+
includeArrows: arrows
|
|
394
|
+
},
|
|
395
|
+
backgroundMarks: [],
|
|
396
|
+
coordinatesOnHover: coordinatesOnHover,
|
|
397
|
+
disabledLabels: true,
|
|
398
|
+
disabledTitle: true,
|
|
399
|
+
domain: domain,
|
|
400
|
+
draggableTools: true,
|
|
401
|
+
labels: labels,
|
|
402
|
+
marks: answers && answers.correctAnswer && answers.correctAnswer.marks ? answers.correctAnswer.marks : [],
|
|
403
|
+
onChangeMarks: newMarks => this.changeMarks(newMarks),
|
|
404
|
+
onCustomReset: this.onResetClick,
|
|
405
|
+
range: range,
|
|
406
|
+
showLabels: labelsEnabled,
|
|
407
|
+
showTitle: titleEnabled,
|
|
408
|
+
size: {
|
|
409
|
+
width: graph.width,
|
|
410
|
+
height: graph.height
|
|
411
|
+
},
|
|
412
|
+
title: title,
|
|
413
|
+
gssLineData: gssLineData,
|
|
414
|
+
onChangeGssLineData: this.onChangeGssLineData,
|
|
415
|
+
onSolutionSetSelected: this.onSolutionSetSelected,
|
|
416
|
+
toolbarTools: ['line', 'polygon'],
|
|
417
|
+
mathMlOptions: mathMlOptions
|
|
418
|
+
}), correctAnswerErrors['correctAnswer'] && /*#__PURE__*/React.createElement(ErrorMessage, null, correctAnswerErrors['correctAnswer'])), /*#__PURE__*/React.createElement(_configUi.AlertDialog, {
|
|
419
|
+
open: dialog.open,
|
|
420
|
+
title: dialog.title,
|
|
421
|
+
text: dialog.text,
|
|
422
|
+
onClose: dialog.onClose,
|
|
423
|
+
onConfirm: dialog.onConfirm,
|
|
424
|
+
onConfirmText: dialog.onConfirmText ? dialog.onConfirmText : 'OK'
|
|
425
|
+
}));
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
exports.CorrectResponse = CorrectResponse;
|
|
429
|
+
(0, _defineProperty2.default)(CorrectResponse, "propTypes", {
|
|
430
|
+
errors: _propTypes.default.object,
|
|
431
|
+
model: _propTypes.default.object.isRequired,
|
|
432
|
+
onChange: _propTypes.default.func.isRequired
|
|
433
|
+
});
|
|
434
|
+
var _default = exports.default = CorrectResponse;
|
|
435
|
+
//# sourceMappingURL=correct-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"correct-response.js","names":["React","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_styles","_graphingSolutionSet","_configUi","_lodashEs","_material","_Radio","_FormControlLabel","_utils","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SubtitleText","styled","Typography","theme","marginTop","spacing","marginBottom","RadioButtonClass","FormControlLabel","height","width","padding","StyledRadio","Radio","color","ErrorMessage","fontSize","typography","palette","error","main","paddingTop","CorrectResponse","Component","constructor","args","_defineProperty2","dialog","open","callback","setState","marks","model","onChange","props","gssLineData","selectedTool","length","fill","lineType","answers","title","text","onConfirm","correctAnswer","lineA","lineB","handleAlertDialog","onClose","value","changeLine","filter","mark","type","Number","parseInt","pop","numberOfLines","point","section","sections","pointInsidePolygon","polygon","points","building","closed","isSolution","push","oldSelectedTool","domain","range","lines","checkIfLinesAreAdded","findSectionsInSolutionSet","handleGssLineDataChange","polygons","onConfirmText","render","errors","mathMlOptions","state","arrows","coordinatesOnHover","graph","labels","labelsEnabled","titleEnabled","correctAnswerErrors","createElement","component","variant","RadioGroup","name","changeNumberOfLines","control","checked","label","Fragment","GraphContainer","style","border","axesSettings","includeArrows","backgroundMarks","disabledLabels","disabledTitle","draggableTools","onChangeMarks","newMarks","changeMarks","onCustomReset","onResetClick","showLabels","showTitle","size","onChangeGssLineData","onSolutionSetSelected","toolbarTools","AlertDialog","exports","PropTypes","object","isRequired","func","_default"],"sources":["../src/correct-response.jsx"],"sourcesContent":["import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { GraphContainer as Graph } from '@pie-lib/graphing-solution-set';\nimport { AlertDialog } from '@pie-lib/config-ui';\nimport { set } from 'lodash-es';\nimport { RadioGroup, Typography } from '@mui/material';\nimport Radio from '@mui/material/Radio';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport { findSectionsInSolutionSet, pointInsidePolygon, checkIfLinesAreAdded } from './utils';\n\nconst SubtitleText = styled(Typography)(({ theme }) => ({\n marginTop: theme.spacing(1.5),\n marginBottom: theme.spacing(1),\n}));\n\nconst RadioButtonClass = styled(FormControlLabel)({\n height: '20px',\n width: 'fit-content',\n padding: '.5rem 0',\n});\n\nconst StyledRadio = styled(Radio)({\n color: '#000000 !important',\n});\n\nconst ErrorMessage = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nexport class CorrectResponse extends React.Component {\n static propTypes = {\n errors: PropTypes.object,\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n };\n\n state = {\n dialog: {\n open: false,\n },\n };\n\n /*\n * Function to handle the alert dialog open and close\n * @param {boolean} open - open or close the dialog\n * @param {function} callback - callback function to be called after setting the state\n * */\n handleAlertDialog = (open, callback) =>\n this.setState(\n {\n dialog: { open },\n },\n callback,\n );\n\n /*\n * Function to change the marks on the graph\n * @param {array} marks - marks to be added on the graph\n * */\n changeMarks = (marks) => {\n const { model, onChange } = this.props;\n const { gssLineData } = model;\n if (gssLineData.selectedTool === 'lineA' && marks.length > 0) {\n marks[0].fill = gssLineData['lineA'].lineType;\n }\n if (gssLineData.selectedTool === 'lineB' && marks.length > 1) {\n marks[1].fill = gssLineData['lineB'].lineType;\n }\n if (marks.length === 0) {\n gssLineData.selectedTool = 'lineA';\n set(model, 'gssLineData', gssLineData);\n }\n set(model, 'answers.correctAnswer.marks', marks);\n onChange(model);\n };\n\n /*\n * Reset the graph to original state and remove all the elements added on the graph\n * */\n onResetClick = () => {\n const { model, onChange } = this.props;\n const { gssLineData, answers } = model;\n this.setState({\n dialog: {\n open: true,\n title: 'Warning',\n text: 'This will remove all the elements added on the graph and reset graph to original state. Are you sure you want to continue?',\n onConfirm: () => {\n // Reset the graph to original state\n answers.correctAnswer.marks = [];\n gssLineData.selectedTool = 'lineA';\n gssLineData.lineA.lineType = 'Solid';\n if (gssLineData.lineB) gssLineData.lineB.lineType = 'Solid';\n set(model, 'answers', answers);\n set(model, 'gssLineData', gssLineData);\n onChange(model);\n this.handleAlertDialog(false);\n },\n onClose: () => this.handleAlertDialog(false),\n },\n });\n };\n\n /*\n * Function to change the number of lines on the graph\n * @param {object} e - event object\n * @param {number} value - number of lines to be added on the graph\n * */\n changeNumberOfLines = (e, value) => {\n const { model } = this.props;\n let gssLineData = model.gssLineData;\n if (gssLineData.selectedTool === 'solutionSet') {\n this.setState({\n dialog: {\n open: true,\n title: 'Warning',\n text: 'Changing number of lines after adding solution set will remove added solution set. Are you sure you want to continue?',\n onConfirm: () => {\n this.changeLine(e, value);\n this.handleAlertDialog(false);\n },\n onClose: () => this.handleAlertDialog(false),\n },\n });\n } else {\n this.changeLine(e, value);\n }\n };\n\n /*\n * Function to change the number of line on the graph\n * @param {object} e - event object\n * @param {number} value - number of lines to be added on the graph\n * */\n changeLine = (e, value) => {\n const { model, onChange } = this.props;\n const { answers } = model;\n let gssLineData = model.gssLineData;\n //remove polygon from correct answer\n answers.correctAnswer.marks = answers.correctAnswer.marks.filter((mark) => mark.type !== 'polygon');\n if (Number.parseInt(value) === 1) {\n //remove lineB from gssLineData and correct answer\n delete gssLineData.lineB;\n if (answers.correctAnswer.marks.length > 1) answers.correctAnswer.marks.pop();\n gssLineData.numberOfLines = 1;\n gssLineData.selectedTool = 'lineA';\n } else {\n gssLineData.numberOfLines = 2;\n if (answers.correctAnswer.marks.length > 0) gssLineData.selectedTool = 'lineB';\n gssLineData.lineB = {\n lineType: 'Solid',\n };\n }\n //reset solution set\n set(model, 'answers', answers);\n set(model, 'gssLineData', gssLineData);\n onChange(model);\n };\n\n /*\n * Function to handle the changes to solution set on the graph\n * @param {object} point - point selected on the graph\n * */\n onSolutionSetSelected = (point) => {\n const { model, onChange } = this.props;\n const { answers, gssLineData } = model;\n for (const section of gssLineData.sections) {\n //check if the point is inside the polygon\n if (pointInsidePolygon(point, section)) {\n let polygon = {\n points: section,\n building: false,\n type: 'polygon',\n closed: true,\n isSolution: true,\n };\n //remove old answer section from correct answer\n answers.correctAnswer.marks = answers.correctAnswer.marks.filter((mark) => mark.type !== 'polygon');\n //add new answer section to correct answer\n answers.correctAnswer.marks.push(polygon);\n break;\n }\n }\n set(model, 'answers', answers);\n onChange(model);\n };\n\n /*\n * Function to handle the changes to line data on the graph\n * @param {object} gssLineData - line data on the graph\n * @param {string} oldSelectedTool - old selected tool\n * */\n onChangeGssLineData = (gssLineData, oldSelectedTool) => {\n const { model } = this.props;\n const { answers, domain, range } = model;\n //handle solution set changes\n if (gssLineData.selectedTool === 'solutionSet') {\n let lines = answers.correctAnswer.marks.filter((mark) => mark.type !== 'polygon');\n if (!checkIfLinesAreAdded(gssLineData, lines)) {\n gssLineData.selectedTool = oldSelectedTool;\n this.setState({\n dialog: {\n open: true,\n title: 'Warning',\n text: 'Please define the line(s) and then select a solution set for the item.',\n onConfirm: () => this.handleAlertDialog(false),\n },\n });\n } else {\n let lines = answers.correctAnswer.marks.filter((mark) => mark.type !== 'polygon');\n gssLineData = findSectionsInSolutionSet(gssLineData, lines, domain, range);\n }\n this.handleGssLineDataChange(gssLineData, answers);\n } else {\n let polygons = answers.correctAnswer.marks.filter((mark) => mark.type === 'polygon');\n if (oldSelectedTool === 'solutionSet' && polygons.length > 0) {\n this.setState({\n dialog: {\n open: true,\n title: 'Warning',\n text: 'Changing a line after adding a solution set will clear your selected solution set. Click \\'Clear Solution Set\\' to change the line. Otherwise, click \\'Cancel\\'.',\n onConfirm: () => {\n answers.correctAnswer.marks = answers.correctAnswer.marks.filter((mark) => mark.type !== 'polygon');\n this.handleGssLineDataChange(gssLineData, answers);\n this.handleAlertDialog(false);\n },\n onConfirmText: 'CLEAR SOLUTION SET',\n onClose: () => {\n gssLineData.selectedTool = oldSelectedTool;\n this.handleGssLineDataChange(gssLineData, answers);\n this.handleAlertDialog(false);\n },\n },\n });\n } else {\n this.handleGssLineDataChange(gssLineData, answers);\n }\n }\n };\n\n /*\n * Function to handle the changes to line data on the graph\n * @param {object} gssLineData - line data on the graph\n * @param {object} answers - correct answer\n * */\n handleGssLineDataChange = (gssLineData, answers) => {\n const { model, onChange } = this.props;\n //handle line type changes from solid to dashed and vice versa\n if (answers.correctAnswer.marks.length > 0 && answers.correctAnswer.marks[0] && gssLineData.lineA) {\n answers.correctAnswer.marks[0].fill = gssLineData.lineA.lineType;\n }\n if (answers.correctAnswer.marks.length > 1 && answers.correctAnswer.marks[1] && gssLineData.lineB) {\n answers.correctAnswer.marks[1].fill = gssLineData.lineB.lineType;\n }\n //check if line is added to the graph before switching to lineB\n if (\n (gssLineData.selectedTool === 'lineB' && answers.correctAnswer.marks.length === 0) ||\n (gssLineData.selectedTool === 'lineB' && answers.correctAnswer.marks[0].building)\n ) {\n this.setState({\n dialog: {\n open: true,\n title: 'Warning',\n text: 'Please add Line A to the graph before adding Line B',\n onConfirm: () => this.handleAlertDialog(false),\n },\n });\n gssLineData.selectedTool = 'lineA';\n }\n //check if lineB is added to the graph before switching to lineA\n if (\n gssLineData.selectedTool === 'lineA' &&\n answers.correctAnswer.marks.length > 1 &&\n answers.correctAnswer.marks[1].building\n ) {\n this.setState({\n dialog: {\n open: true,\n title: 'Warning',\n text: 'Please add Line B to the graph before switching to Line A',\n onConfirm: () => this.handleAlertDialog(false),\n },\n });\n gssLineData.selectedTool = 'lineB';\n }\n set(model, 'gssLineData', gssLineData);\n set(model, 'answers', answers);\n onChange(model);\n };\n\n /*\n * Function to update the model\n * @param {object} props - updated props\n * */\n updateModel = (props) => {\n const { model, onChange } = this.props;\n onChange({\n ...model,\n ...props,\n });\n };\n\n /*\n * Render the component\n * */\n render() {\n const { errors, model, mathMlOptions = {} } = this.props;\n const { dialog } = this.state;\n //get the default values to GssLineData\n const {\n gssLineData = {\n numberOfLines: 1,\n selectedTool: 'lineA',\n lineA: {\n lineType: 'Solid',\n },\n },\n arrows,\n coordinatesOnHover,\n domain,\n graph = {},\n labels,\n labelsEnabled,\n range,\n title,\n titleEnabled,\n answers,\n } = model || {};\n const { correctAnswerErrors = '' } = errors || {};\n return (\n <div>\n <Typography component=\"div\" variant=\"h6\">\n Define Line Type(s) and Correct Response\n </Typography>\n <SubtitleText component=\"div\" variant=\"body1\">\n Use this interface to choose how many lines students will be able to draw, and to define the correct answer.\n </SubtitleText>\n <SubtitleText component=\"div\" variant=\"body1\">\n Choose Number of Lines\n </SubtitleText>\n <RadioGroup name=\"numberOfLines\" value={gssLineData.numberOfLines} onChange={this.changeNumberOfLines}>\n <RadioButtonClass\n value=\"1\"\n control={<StyledRadio checked={gssLineData.numberOfLines === 1} />}\n label=\"One\"\n />\n <RadioButtonClass\n value=\"2\"\n control={<StyledRadio checked={gssLineData.numberOfLines === 2} />}\n label=\"Two\"\n />\n </RadioGroup>\n <React.Fragment>\n <Graph\n style={correctAnswerErrors['correctAnswer'] && { border: '2px solid red' }}\n axesSettings={{ includeArrows: arrows }}\n backgroundMarks={[]}\n coordinatesOnHover={coordinatesOnHover}\n disabledLabels={true}\n disabledTitle={true}\n domain={domain}\n draggableTools={true}\n labels={labels}\n marks={answers && answers.correctAnswer && answers.correctAnswer.marks ? answers.correctAnswer.marks : []}\n onChangeMarks={(newMarks) => this.changeMarks(newMarks)}\n onCustomReset={this.onResetClick}\n range={range}\n showLabels={labelsEnabled}\n showTitle={titleEnabled}\n size={{ width: graph.width, height: graph.height }}\n title={title}\n gssLineData={gssLineData}\n onChangeGssLineData={this.onChangeGssLineData}\n onSolutionSetSelected={this.onSolutionSetSelected}\n toolbarTools={['line', 'polygon']}\n mathMlOptions={mathMlOptions}\n />\n {correctAnswerErrors['correctAnswer'] && (\n <ErrorMessage>{correctAnswerErrors['correctAnswer']}</ErrorMessage>\n )}\n </React.Fragment>\n <AlertDialog\n open={dialog.open}\n title={dialog.title}\n text={dialog.text}\n onClose={dialog.onClose}\n onConfirm={dialog.onConfirm}\n onConfirmText={dialog.onConfirmText ? dialog.onConfirmText : 'OK'}\n />\n </div>\n );\n }\n}\n\nexport default CorrectResponse;\n"],"mappings":";;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,s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