@pie-element/number-line 11.3.4-next.3 → 12.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -11
- package/configure/CHANGELOG.md +0 -11
- package/configure/lib/arrows.js +68 -103
- package/configure/lib/arrows.js.map +1 -1
- package/configure/lib/card-bar.js +41 -62
- package/configure/lib/card-bar.js.map +1 -1
- package/configure/lib/defaults.js +5 -7
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/domain.js +60 -116
- package/configure/lib/domain.js.map +1 -1
- package/configure/lib/index.js +124 -194
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +586 -722
- package/configure/lib/main.js.map +1 -1
- package/configure/lib/number-text-field.js +15 -86
- package/configure/lib/number-text-field.js.map +1 -1
- package/configure/lib/point-config.js +69 -129
- package/configure/lib/point-config.js.map +1 -1
- package/configure/lib/size.js +43 -77
- package/configure/lib/size.js.map +1 -1
- package/configure/lib/ticks.js +89 -151
- package/configure/lib/ticks.js.map +1 -1
- package/configure/lib/utils.js +2 -4
- package/configure/lib/utils.js.map +1 -1
- package/configure/package.json +10 -7
- package/controller/CHANGELOG.md +0 -11
- package/controller/lib/defaults.js +5 -6
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +171 -286
- package/controller/lib/index.js.map +1 -1
- package/controller/lib/tickUtils.js +96 -169
- package/controller/lib/tickUtils.js.map +1 -1
- package/controller/lib/utils.js +55 -88
- package/controller/lib/utils.js.map +1 -1
- package/controller/package.json +3 -3
- package/lib/data-converter.js +19 -23
- package/lib/data-converter.js.map +1 -1
- package/lib/draggable/index.js +104 -43
- package/lib/draggable/index.js.map +1 -1
- package/lib/index.js +118 -205
- package/lib/index.js.map +1 -1
- package/lib/number-line/colors.js +3 -13
- package/lib/number-line/colors.js.map +1 -1
- package/lib/number-line/feedback.js +53 -69
- package/lib/number-line/feedback.js.map +1 -1
- package/lib/number-line/graph/arrow.js +19 -38
- package/lib/number-line/graph/arrow.js.map +1 -1
- package/lib/number-line/graph/elements/base.js +7 -13
- package/lib/number-line/graph/elements/base.js.map +1 -1
- package/lib/number-line/graph/elements/builder.js +6 -7
- package/lib/number-line/graph/elements/builder.js.map +1 -1
- package/lib/number-line/graph/elements/line.js +209 -265
- package/lib/number-line/graph/elements/line.js.map +1 -1
- package/lib/number-line/graph/elements/point.js +170 -201
- package/lib/number-line/graph/elements/point.js.map +1 -1
- package/lib/number-line/graph/elements/ray.js +147 -185
- package/lib/number-line/graph/elements/ray.js.map +1 -1
- package/lib/number-line/graph/index.js +217 -283
- package/lib/number-line/graph/index.js.map +1 -1
- package/lib/number-line/graph/line.js +12 -22
- package/lib/number-line/graph/line.js.map +1 -1
- package/lib/number-line/graph/stacks.js +31 -54
- package/lib/number-line/graph/stacks.js.map +1 -1
- package/lib/number-line/graph/tick-utils.js +120 -209
- package/lib/number-line/graph/tick-utils.js.map +1 -1
- package/lib/number-line/graph/ticks.js +144 -225
- package/lib/number-line/graph/ticks.js.map +1 -1
- package/lib/number-line/index.js +331 -395
- package/lib/number-line/index.js.map +1 -1
- package/lib/number-line/point-chooser/button.js +33 -58
- package/lib/number-line/point-chooser/button.js.map +1 -1
- package/lib/number-line/point-chooser/img.js +2 -3
- package/lib/number-line/point-chooser/img.js.map +1 -1
- package/lib/number-line/point-chooser/index.js +152 -148
- package/lib/number-line/point-chooser/index.js.map +1 -1
- package/lib/number-line/point-chooser/styles.js +29 -52
- package/lib/number-line/point-chooser/styles.js.map +1 -1
- package/lib/number-line/transitions/fade.js +70 -49
- package/lib/number-line/transitions/fade.js.map +1 -1
- package/lib/number-line/transitions/index.js +2 -4
- package/lib/number-line/transitions/index.js.map +1 -1
- package/package.json +16 -13
- package/esm/configure.js +0 -84095
- package/esm/configure.js.map +0 -1
- package/esm/controller.js +0 -68122
- package/esm/controller.js.map +0 -1
- package/esm/element.js +0 -44487
- package/esm/element.js.map +0 -1
- package/esm/package.json +0 -3
package/configure/lib/main.js
CHANGED
|
@@ -1,205 +1,141 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
4
|
Object.defineProperty(exports, "__esModule", {
|
|
8
5
|
value: true
|
|
9
6
|
});
|
|
10
|
-
exports.toPointType = exports
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
|
|
16
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
17
|
-
|
|
18
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
-
|
|
20
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
21
|
-
|
|
22
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
23
|
-
|
|
24
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
-
|
|
26
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
-
|
|
7
|
+
exports.toPointType = exports.default = exports.Main = void 0;
|
|
28
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
-
|
|
30
9
|
var _react = _interopRequireDefault(require("react"));
|
|
31
|
-
|
|
32
10
|
var _configUi = require("@pie-lib/config-ui");
|
|
33
|
-
|
|
34
|
-
var _editableHtml = _interopRequireDefault(require("@pie-lib/editable-html"));
|
|
35
|
-
|
|
11
|
+
var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
|
|
36
12
|
var _numberLine = require("@pie-element/number-line");
|
|
37
|
-
|
|
38
13
|
var _numberTextField = _interopRequireDefault(require("./number-text-field"));
|
|
39
|
-
|
|
40
14
|
var _cardBar = _interopRequireDefault(require("./card-bar"));
|
|
41
|
-
|
|
42
15
|
var _size = _interopRequireDefault(require("./size"));
|
|
43
|
-
|
|
44
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
45
|
-
|
|
46
17
|
var _domain = _interopRequireDefault(require("./domain"));
|
|
47
|
-
|
|
48
18
|
var _arrows = _interopRequireDefault(require("./arrows"));
|
|
49
|
-
|
|
50
19
|
var _pointConfig = _interopRequireDefault(require("./point-config"));
|
|
51
|
-
|
|
52
20
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
53
|
-
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
var _Info = _interopRequireDefault(require("@material-ui/icons/Info"));
|
|
59
|
-
|
|
60
|
-
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
61
|
-
|
|
21
|
+
var _styles = require("@mui/material/styles");
|
|
22
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
23
|
+
var _Info = _interopRequireDefault(require("@mui/icons-material/Info"));
|
|
24
|
+
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
62
25
|
var _ticks = _interopRequireDefault(require("./ticks"));
|
|
63
|
-
|
|
64
26
|
var _defaults = require("./defaults");
|
|
65
|
-
|
|
66
27
|
var _utils = require("./utils");
|
|
67
|
-
|
|
68
28
|
var math = _interopRequireWildcard(require("mathjs"));
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
flexRow: {
|
|
149
|
-
display: 'flex',
|
|
150
|
-
alignItems: 'center',
|
|
151
|
-
gap: '10px'
|
|
152
|
-
},
|
|
153
|
-
description: {
|
|
154
|
-
marginBottom: theme.spacing.unit * 2.5
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
var toPointType = function toPointType(response) {
|
|
29
|
+
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); }
|
|
30
|
+
const trimModel = model => ({
|
|
31
|
+
...model,
|
|
32
|
+
feedback: undefined,
|
|
33
|
+
prompt: undefined,
|
|
34
|
+
teacherInstructions: undefined,
|
|
35
|
+
graph: {
|
|
36
|
+
...model.graph,
|
|
37
|
+
title: undefined,
|
|
38
|
+
disabled: true
|
|
39
|
+
},
|
|
40
|
+
correctResponse: undefined
|
|
41
|
+
});
|
|
42
|
+
const {
|
|
43
|
+
lineIsSwitched,
|
|
44
|
+
switchGraphLine,
|
|
45
|
+
toGraphFormat,
|
|
46
|
+
toSessionFormat
|
|
47
|
+
} = _numberLine.dataConverter;
|
|
48
|
+
const {
|
|
49
|
+
Panel,
|
|
50
|
+
toggle
|
|
51
|
+
} = _configUi.settings;
|
|
52
|
+
let minorLimits = {};
|
|
53
|
+
let minorValues = {};
|
|
54
|
+
let majorValues = {};
|
|
55
|
+
const StyledNumberTextField = (0, _styles.styled)(_numberTextField.default)({
|
|
56
|
+
width: '150px'
|
|
57
|
+
});
|
|
58
|
+
const Row = (0, _styles.styled)('div')(({
|
|
59
|
+
theme
|
|
60
|
+
}) => ({
|
|
61
|
+
display: 'flex',
|
|
62
|
+
flexWrap: 'wrap',
|
|
63
|
+
'& > *': {
|
|
64
|
+
paddingRight: theme.spacing(2)
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
67
|
+
const PointTypeChooser = (0, _styles.styled)('div')(({
|
|
68
|
+
theme
|
|
69
|
+
}) => ({
|
|
70
|
+
margin: `${theme.spacing(2.5)}px 0`
|
|
71
|
+
}));
|
|
72
|
+
const StyledInputContainer = (0, _styles.styled)(_configUi.InputContainer)(({
|
|
73
|
+
theme
|
|
74
|
+
}) => ({
|
|
75
|
+
paddingTop: theme.spacing(2),
|
|
76
|
+
marginBottom: theme.spacing(2),
|
|
77
|
+
width: '100%'
|
|
78
|
+
}));
|
|
79
|
+
const StyledFormSection = (0, _styles.styled)(_configUi.FormSection)(({
|
|
80
|
+
theme
|
|
81
|
+
}) => ({
|
|
82
|
+
marginBottom: theme.spacing(4)
|
|
83
|
+
}));
|
|
84
|
+
const ErrorText = (0, _styles.styled)('div')(({
|
|
85
|
+
theme
|
|
86
|
+
}) => ({
|
|
87
|
+
fontSize: theme.typography.fontSize - 2,
|
|
88
|
+
color: theme.palette.error.main,
|
|
89
|
+
paddingTop: theme.spacing(1)
|
|
90
|
+
}));
|
|
91
|
+
const FlexRow = (0, _styles.styled)('div')({
|
|
92
|
+
display: 'flex',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
gap: '10px'
|
|
95
|
+
});
|
|
96
|
+
const FlexRowFormSection = (0, _styles.styled)(_configUi.FormSection)({
|
|
97
|
+
display: 'flex',
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
gap: '10px'
|
|
100
|
+
});
|
|
101
|
+
const Description = (0, _styles.styled)(_Typography.default)(({
|
|
102
|
+
theme
|
|
103
|
+
}) => ({
|
|
104
|
+
marginBottom: theme.spacing(2.5)
|
|
105
|
+
}));
|
|
106
|
+
const toPointType = response => {
|
|
160
107
|
function rest(response) {
|
|
161
108
|
if (response.pointType) {
|
|
162
109
|
if (response.direction) {
|
|
163
|
-
return
|
|
110
|
+
return `${response.pointType[0]}${response.direction[0]}`;
|
|
164
111
|
}
|
|
165
|
-
|
|
166
112
|
return response.pointType[0];
|
|
167
113
|
}
|
|
168
|
-
|
|
169
|
-
return "".concat(response.leftPoint[0]).concat(response.rightPoint[0]);
|
|
114
|
+
return `${response.leftPoint[0]}${response.rightPoint[0]}`;
|
|
170
115
|
}
|
|
171
|
-
|
|
172
|
-
return "".concat(response.type[0]).concat(rest(response)).toUpperCase();
|
|
116
|
+
return `${response.type[0]}${rest(response)}`.toUpperCase();
|
|
173
117
|
};
|
|
174
|
-
|
|
175
118
|
exports.toPointType = toPointType;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
onChange = _this$props.onChange;
|
|
191
|
-
|
|
192
|
-
var graph = _objectSpread(_objectSpread({}, model.graph), obj);
|
|
193
|
-
|
|
194
|
-
var respIndex = [];
|
|
195
|
-
model.correctResponse.forEach(function (correctResp, key) {
|
|
119
|
+
class Main extends _react.default.Component {
|
|
120
|
+
constructor(props) {
|
|
121
|
+
super(props);
|
|
122
|
+
(0, _defineProperty2.default)(this, "graphChange", obj => {
|
|
123
|
+
const {
|
|
124
|
+
model,
|
|
125
|
+
onChange
|
|
126
|
+
} = this.props;
|
|
127
|
+
let graph = {
|
|
128
|
+
...model.graph,
|
|
129
|
+
...obj
|
|
130
|
+
};
|
|
131
|
+
let respIndex = [];
|
|
132
|
+
model.correctResponse.forEach((correctResp, key) => {
|
|
196
133
|
if (correctResp.domainPosition < graph.domain.min || correctResp.domainPosition > graph.domain.max || correctResp.size && (correctResp.domainPosition + correctResp.size < graph.domain.min || correctResp.domainPosition + correctResp.size > graph.domain.max)) {
|
|
197
134
|
respIndex.push(key);
|
|
198
135
|
}
|
|
199
136
|
});
|
|
200
|
-
|
|
201
137
|
if (respIndex.length > 0) {
|
|
202
|
-
|
|
138
|
+
this.setState({
|
|
203
139
|
correctAnswerDialog: {
|
|
204
140
|
open: true,
|
|
205
141
|
text: 'This\n' + 'change would make it impossible for students to plot one or more elements in the current\n' + 'correct answer. If you proceed, all such elements will be removed from the correct\n' + 'answer.',
|
|
@@ -207,29 +143,23 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
207
143
|
graph: model.graph
|
|
208
144
|
}
|
|
209
145
|
});
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
graph = _this.reloadTicksData(graph);
|
|
146
|
+
}
|
|
147
|
+
//reload ticks value whenever domain and width is changed
|
|
148
|
+
graph = this.reloadTicksData(graph);
|
|
214
149
|
onChange({
|
|
215
|
-
graph
|
|
150
|
+
graph
|
|
216
151
|
});
|
|
217
152
|
});
|
|
218
|
-
(0, _defineProperty2
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
Object.entries(availableTypes || {}).forEach(function (_ref2) {
|
|
229
|
-
var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
|
|
230
|
-
type = _ref3[0],
|
|
231
|
-
value = _ref3[1];
|
|
232
|
-
|
|
153
|
+
(0, _defineProperty2.default)(this, "changeSize", ({
|
|
154
|
+
width,
|
|
155
|
+
height
|
|
156
|
+
}) => this.graphChange({
|
|
157
|
+
width,
|
|
158
|
+
height
|
|
159
|
+
}));
|
|
160
|
+
(0, _defineProperty2.default)(this, "getAdjustedHeight", (availableTypes, maxNumberOfPoints) => {
|
|
161
|
+
let onlyPFAvailable = true;
|
|
162
|
+
Object.entries(availableTypes || {}).forEach(([type, value]) => {
|
|
233
163
|
if (type !== 'PF' && value) {
|
|
234
164
|
onlyPFAvailable = false;
|
|
235
165
|
return;
|
|
@@ -237,74 +167,83 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
237
167
|
});
|
|
238
168
|
return maxNumberOfPoints && (maxNumberOfPoints === 1 || onlyPFAvailable) ? 100 : 50 + (maxNumberOfPoints || 20) * 25;
|
|
239
169
|
});
|
|
240
|
-
(0, _defineProperty2
|
|
170
|
+
(0, _defineProperty2.default)(this, "changeMaxNoOfPoints", (e, maxNumberOfPoints) => {
|
|
241
171
|
maxNumberOfPoints = Math.floor(maxNumberOfPoints);
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
_this.setState({
|
|
172
|
+
if (this.props.model.correctResponse.length > maxNumberOfPoints) {
|
|
173
|
+
this.setState({
|
|
245
174
|
dialog: {
|
|
246
175
|
open: true,
|
|
247
176
|
text: 'To use this value, you must first remove one or more elements from the correct answers.'
|
|
248
177
|
}
|
|
249
178
|
});
|
|
250
|
-
|
|
251
179
|
return;
|
|
252
180
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
return _this.graphChange({
|
|
265
|
-
title: title
|
|
181
|
+
const {
|
|
182
|
+
model: {
|
|
183
|
+
graph: {
|
|
184
|
+
availableTypes
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} = this.props;
|
|
188
|
+
const height = this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
|
|
189
|
+
this.graphChange({
|
|
190
|
+
maxNumberOfPoints,
|
|
191
|
+
height
|
|
266
192
|
});
|
|
267
193
|
});
|
|
268
|
-
(0, _defineProperty2
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
194
|
+
(0, _defineProperty2.default)(this, "changeGraphTitle", title => this.graphChange({
|
|
195
|
+
title
|
|
196
|
+
}));
|
|
197
|
+
/*
|
|
198
|
+
* Gets triggered whenever ticks related data is changed by user.
|
|
199
|
+
* */
|
|
200
|
+
(0, _defineProperty2.default)(this, "changeTicks", object => {
|
|
201
|
+
const {
|
|
202
|
+
model,
|
|
203
|
+
onChange
|
|
204
|
+
} = this.props;
|
|
205
|
+
let {
|
|
206
|
+
ticks
|
|
207
|
+
} = object;
|
|
208
|
+
const correctResponse = _numberLine.tickUtils.snapElements(model.graph.domain, ticks, model.correctResponse);
|
|
209
|
+
const initialElements = model.graph.initialElements ? _numberLine.tickUtils.snapElements(model.graph.domain, ticks, model.graph.initialElements) : [];
|
|
210
|
+
let updatedGraph = this.updateMajorValue({
|
|
211
|
+
...model.graph,
|
|
212
|
+
ticks
|
|
284
213
|
});
|
|
285
|
-
|
|
214
|
+
const graph = {
|
|
215
|
+
...updatedGraph,
|
|
216
|
+
initialElements
|
|
217
|
+
};
|
|
286
218
|
onChange({
|
|
287
|
-
graph
|
|
288
|
-
correctResponse
|
|
219
|
+
graph,
|
|
220
|
+
correctResponse
|
|
289
221
|
});
|
|
290
222
|
});
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
223
|
+
/*
|
|
224
|
+
* This function is duplicated in controller/index.js
|
|
225
|
+
* This function will reload ticks data whenever graph object is changed and also sets required tick object
|
|
226
|
+
* for rendering Ticks Components.
|
|
227
|
+
* @param graph object containing domain, ticks and width value
|
|
228
|
+
* @return graph object with updated ticks values
|
|
229
|
+
* */
|
|
230
|
+
(0, _defineProperty2.default)(this, "reloadTicksData", graph => {
|
|
231
|
+
const {
|
|
232
|
+
domain,
|
|
233
|
+
ticks,
|
|
234
|
+
width
|
|
235
|
+
} = graph;
|
|
236
|
+
//Set tick interval type if not present for legacy number line models depending upon minor value
|
|
296
237
|
if (!ticks.tickIntervalType) {
|
|
297
238
|
if (ticks.minor > 0.5) {
|
|
298
239
|
ticks.tickIntervalType = 'Integer';
|
|
299
240
|
} else {
|
|
300
241
|
ticks.tickIntervalType = 'Decimal';
|
|
301
242
|
}
|
|
302
|
-
}
|
|
243
|
+
}
|
|
244
|
+
// This section will calculate minor and major values array and assign respective value
|
|
303
245
|
// to different tick types object
|
|
304
|
-
|
|
305
|
-
|
|
306
246
|
minorLimits = _numberLine.tickUtils.getMinorLimits(domain, width);
|
|
307
|
-
|
|
308
247
|
if (minorLimits.min >= 1) {
|
|
309
248
|
/*
|
|
310
249
|
* In this scenario only integer tick will be enabled
|
|
@@ -325,11 +264,9 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
325
264
|
if (ticks.tickIntervalType === 'Integer') {
|
|
326
265
|
ticks.tickIntervalType = 'Fraction';
|
|
327
266
|
}
|
|
328
|
-
|
|
329
267
|
minorValues = _numberLine.tickUtils.generateMinorValues(minorLimits);
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
268
|
+
let minValue = math.number(math.fraction(minorValues.fraction[0]));
|
|
269
|
+
let maxValue = math.number(math.fraction(minorValues.fraction[minorValues.fraction.length - 1]));
|
|
333
270
|
if (ticks.minor < minValue || ticks.minor > maxValue) {
|
|
334
271
|
switch (ticks.tickIntervalType) {
|
|
335
272
|
case 'Fraction':
|
|
@@ -337,7 +274,6 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
337
274
|
ticks.fractionTick = minorValues.fraction[minorValues.fraction.length - 1];
|
|
338
275
|
ticks.decimalTick = minorValues.decimal[0];
|
|
339
276
|
break;
|
|
340
|
-
|
|
341
277
|
case 'Decimal':
|
|
342
278
|
case 'Integer':
|
|
343
279
|
ticks.minor = minorValues.decimal[minorValues.decimal.length - 1];
|
|
@@ -347,30 +283,26 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
347
283
|
} else {
|
|
348
284
|
switch (ticks.tickIntervalType) {
|
|
349
285
|
case 'Fraction':
|
|
350
|
-
|
|
286
|
+
let fraction = math.fraction(math.number(ticks.minor));
|
|
351
287
|
ticks.fractionTick = fraction.n + '/' + fraction.d;
|
|
352
288
|
ticks.decimalTick = ticks.decimalTick ? ticks.decimalTick : minorValues.decimal[0];
|
|
353
289
|
break;
|
|
354
|
-
|
|
355
290
|
case 'Decimal':
|
|
356
291
|
case 'Integer':
|
|
357
292
|
ticks.decimalTick = ticks.minor;
|
|
358
293
|
ticks.fractionTick = ticks.fractionTick ? ticks.fractionTick : minorValues.fraction[0];
|
|
359
294
|
}
|
|
360
295
|
}
|
|
361
|
-
|
|
362
296
|
ticks.integerTick = 1;
|
|
363
297
|
} else if (minorLimits.min < 1 && minorLimits.max >= 1) {
|
|
364
298
|
/*
|
|
365
299
|
* In this scenario all integer, decimal or fraction tick will be enabled
|
|
366
300
|
* */
|
|
367
301
|
minorValues = _numberLine.tickUtils.generateMinorValues(minorLimits);
|
|
368
|
-
|
|
369
302
|
if (!(ticks.minor >= minorLimits.min && ticks.minor <= minorLimits.max)) {
|
|
370
303
|
if (minorLimits.min > 0.5) {
|
|
371
304
|
ticks.tickIntervalType = 'Integer';
|
|
372
305
|
}
|
|
373
|
-
|
|
374
306
|
switch (ticks.tickIntervalType) {
|
|
375
307
|
case 'Integer':
|
|
376
308
|
ticks.minor = math.number(math.ceil(minorLimits.min));
|
|
@@ -378,14 +310,12 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
378
310
|
ticks.decimalTick = minorLimits.min > 0.5 ? 0 : minorValues.decimal[0];
|
|
379
311
|
ticks.fractionTick = minorLimits.min > 0.5 ? '0' : minorValues.fraction[0];
|
|
380
312
|
break;
|
|
381
|
-
|
|
382
313
|
case 'Decimal':
|
|
383
314
|
ticks.minor = minorValues.decimal[0];
|
|
384
315
|
ticks.integerTick = 1;
|
|
385
316
|
ticks.decimalTick = ticks.minor;
|
|
386
317
|
ticks.fractionTick = minorValues.fraction[0];
|
|
387
318
|
break;
|
|
388
|
-
|
|
389
319
|
case 'Fraction':
|
|
390
320
|
ticks.minor = math.number(math.fraction(minorValues.fraction[0]));
|
|
391
321
|
ticks.integerTick = 1;
|
|
@@ -399,150 +329,158 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
399
329
|
ticks.decimalTick = minorLimits.min > 0.5 ? 0 : minorValues.decimal[0];
|
|
400
330
|
ticks.fractionTick = minorLimits.min > 0.5 ? '0' : minorValues.fraction[0];
|
|
401
331
|
break;
|
|
402
|
-
|
|
403
332
|
case 'Decimal':
|
|
404
333
|
ticks.integerTick = 1;
|
|
405
334
|
ticks.decimalTick = ticks.minor;
|
|
406
335
|
ticks.fractionTick = minorValues.fraction[0];
|
|
407
336
|
break;
|
|
408
|
-
|
|
409
337
|
case 'Fraction':
|
|
410
338
|
ticks.integerTick = 1;
|
|
411
339
|
ticks.decimalTick = minorValues.decimal[0];
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
ticks.fractionTick = _fraction.n + '/' + _fraction.d;
|
|
340
|
+
let fraction = math.fraction(math.number(ticks.minor));
|
|
341
|
+
ticks.fractionTick = fraction.n + '/' + fraction.d;
|
|
416
342
|
}
|
|
417
343
|
}
|
|
418
344
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
ticks
|
|
422
|
-
})
|
|
345
|
+
return this.updateMajorValue({
|
|
346
|
+
...graph,
|
|
347
|
+
ticks
|
|
348
|
+
});
|
|
423
349
|
});
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
350
|
+
/*
|
|
351
|
+
* This function is duplicated in controller/index.js
|
|
352
|
+
* This function will update major value whenever minor value is changed or tick type is changed
|
|
353
|
+
* @param graph object containing domain, ticks and width value
|
|
354
|
+
* @return graph object with updated ticks values
|
|
355
|
+
* */
|
|
356
|
+
(0, _defineProperty2.default)(this, "updateMajorValue", graph => {
|
|
357
|
+
const {
|
|
358
|
+
domain,
|
|
359
|
+
ticks,
|
|
360
|
+
width
|
|
361
|
+
} = graph;
|
|
428
362
|
majorValues = _numberLine.tickUtils.generateMajorValuesForMinor(ticks.minor, domain, width);
|
|
429
|
-
|
|
430
363
|
if (majorValues.decimal.indexOf(ticks.major) === -1) {
|
|
431
|
-
|
|
432
|
-
|
|
364
|
+
let currIndex = 0;
|
|
433
365
|
if (ticks.tickIntervalType === 'Integer') {
|
|
434
366
|
currIndex = majorValues.decimal.length > 4 ? 4 : majorValues.decimal.length - 1;
|
|
435
367
|
} else {
|
|
436
368
|
currIndex = majorValues.decimal.length - 1;
|
|
437
369
|
}
|
|
438
|
-
|
|
439
370
|
ticks.major = majorValues.decimal[currIndex];
|
|
440
371
|
}
|
|
441
|
-
|
|
442
372
|
graph.fraction = ticks.tickIntervalType === 'Fraction' && ticks.major < 1;
|
|
443
|
-
return
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "changeArrows", function (arrows) {
|
|
448
|
-
return _this.graphChange({
|
|
449
|
-
arrows: arrows
|
|
450
|
-
});
|
|
373
|
+
return {
|
|
374
|
+
...graph,
|
|
375
|
+
ticks
|
|
376
|
+
};
|
|
451
377
|
});
|
|
452
|
-
(0, _defineProperty2
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
378
|
+
(0, _defineProperty2.default)(this, "changeArrows", arrows => this.graphChange({
|
|
379
|
+
arrows
|
|
380
|
+
}));
|
|
381
|
+
(0, _defineProperty2.default)(this, "setDefaults", () => {
|
|
382
|
+
const {
|
|
383
|
+
graph: {
|
|
384
|
+
availableTypes,
|
|
385
|
+
maxNumberOfPoints
|
|
386
|
+
}
|
|
387
|
+
} = _defaults.model;
|
|
388
|
+
const height = this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
|
|
389
|
+
const graph = {
|
|
390
|
+
...(0, _cloneDeep.default)(_defaults.model.graph),
|
|
391
|
+
height
|
|
392
|
+
};
|
|
393
|
+
this.props.onChange({
|
|
394
|
+
graph
|
|
465
395
|
});
|
|
466
396
|
});
|
|
467
|
-
(0, _defineProperty2
|
|
397
|
+
(0, _defineProperty2.default)(this, "moveCorrectResponse", (index, el, position) => {
|
|
468
398
|
el.position = position;
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
399
|
+
const {
|
|
400
|
+
onChange,
|
|
401
|
+
model
|
|
402
|
+
} = this.props;
|
|
403
|
+
const update = toSessionFormat(el.type === 'line' && lineIsSwitched(el) ? switchGraphLine(el) : el);
|
|
404
|
+
const correctResponse = [...model.correctResponse];
|
|
474
405
|
correctResponse[index] = update;
|
|
475
406
|
onChange({
|
|
476
|
-
correctResponse
|
|
407
|
+
correctResponse
|
|
477
408
|
});
|
|
478
409
|
});
|
|
479
|
-
(0, _defineProperty2
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
410
|
+
(0, _defineProperty2.default)(this, "availableTypesChange", availableTypes => {
|
|
411
|
+
const {
|
|
412
|
+
model,
|
|
413
|
+
onChange
|
|
414
|
+
} = this.props;
|
|
415
|
+
const {
|
|
416
|
+
correctResponse,
|
|
417
|
+
graph: {
|
|
418
|
+
maxNumberOfPoints
|
|
419
|
+
}
|
|
420
|
+
} = model;
|
|
421
|
+
new Set(correctResponse.map(toPointType)).forEach(pointType => {
|
|
486
422
|
availableTypes[pointType] = true;
|
|
487
423
|
});
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
});
|
|
495
|
-
|
|
424
|
+
const height = this.getAdjustedHeight(availableTypes, maxNumberOfPoints);
|
|
425
|
+
const graph = {
|
|
426
|
+
...model.graph,
|
|
427
|
+
availableTypes,
|
|
428
|
+
height
|
|
429
|
+
};
|
|
496
430
|
onChange({
|
|
497
|
-
graph
|
|
431
|
+
graph
|
|
498
432
|
});
|
|
499
433
|
});
|
|
500
|
-
(0, _defineProperty2
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
return d === index;
|
|
507
|
-
});
|
|
508
|
-
});
|
|
434
|
+
(0, _defineProperty2.default)(this, "deleteCorrectResponse", indices => {
|
|
435
|
+
const {
|
|
436
|
+
model,
|
|
437
|
+
onChange
|
|
438
|
+
} = this.props;
|
|
439
|
+
const correctResponse = model.correctResponse.filter((v, index) => !indices.some(d => d === index));
|
|
509
440
|
onChange({
|
|
510
|
-
correctResponse
|
|
441
|
+
correctResponse
|
|
511
442
|
});
|
|
512
443
|
});
|
|
513
|
-
(0, _defineProperty2
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
444
|
+
(0, _defineProperty2.default)(this, "addCorrectResponse", data => {
|
|
445
|
+
const {
|
|
446
|
+
model,
|
|
447
|
+
onChange
|
|
448
|
+
} = this.props;
|
|
449
|
+
const correctResponse = [...model.correctResponse];
|
|
518
450
|
correctResponse.push(toSessionFormat(data));
|
|
519
451
|
onChange({
|
|
520
|
-
correctResponse
|
|
452
|
+
correctResponse
|
|
521
453
|
});
|
|
522
454
|
});
|
|
523
|
-
(0, _defineProperty2
|
|
524
|
-
|
|
455
|
+
(0, _defineProperty2.default)(this, "clearCorrectResponse", () => {
|
|
456
|
+
const {
|
|
457
|
+
onChange
|
|
458
|
+
} = this.props;
|
|
525
459
|
onChange({
|
|
526
460
|
correctResponse: []
|
|
527
461
|
});
|
|
528
462
|
});
|
|
529
|
-
(0, _defineProperty2
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
463
|
+
(0, _defineProperty2.default)(this, "undoCorrectResponse", () => {
|
|
464
|
+
const {
|
|
465
|
+
model,
|
|
466
|
+
onChange
|
|
467
|
+
} = this.props;
|
|
468
|
+
const correctResponse = [...model.correctResponse];
|
|
534
469
|
correctResponse.pop();
|
|
535
470
|
onChange({
|
|
536
|
-
correctResponse
|
|
471
|
+
correctResponse
|
|
537
472
|
});
|
|
538
473
|
});
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
474
|
+
const {
|
|
475
|
+
model: {
|
|
476
|
+
graph: {
|
|
477
|
+
availableTypes: _availableTypes,
|
|
478
|
+
maxNumberOfPoints: _maxNumberOfPoints
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
} = props;
|
|
482
|
+
const _height = this.getAdjustedHeight(_availableTypes, _maxNumberOfPoints);
|
|
483
|
+
this.state = {
|
|
546
484
|
dialog: {
|
|
547
485
|
open: false,
|
|
548
486
|
text: ''
|
|
@@ -552,397 +490,323 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
552
490
|
text: ''
|
|
553
491
|
}
|
|
554
492
|
};
|
|
555
|
-
|
|
556
|
-
_this.graphChange({
|
|
493
|
+
this.graphChange({
|
|
557
494
|
height: _height
|
|
558
495
|
});
|
|
559
|
-
|
|
560
|
-
return _this;
|
|
561
496
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
onChange: function onChange(prompt) {
|
|
724
|
-
return _onChange({
|
|
725
|
-
prompt: prompt
|
|
726
|
-
});
|
|
727
|
-
},
|
|
728
|
-
nonEmpty: false,
|
|
729
|
-
disableUnderline: true,
|
|
730
|
-
error: promptError,
|
|
731
|
-
toolbarOpts: toolbarOpts,
|
|
732
|
-
pluginProps: getPluginProps(prompt === null || prompt === void 0 ? void 0 : prompt.inputConfiguration),
|
|
733
|
-
spellCheck: spellCheckEnabled,
|
|
734
|
-
imageSupport: imageSupport,
|
|
735
|
-
uploadSoundSupport: uploadSoundSupport,
|
|
736
|
-
languageCharactersProps: [{
|
|
737
|
-
language: 'spanish'
|
|
738
|
-
}, {
|
|
739
|
-
language: 'special'
|
|
740
|
-
}],
|
|
741
|
-
mathMlOptions: mathMlOptions
|
|
742
|
-
}), promptError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
743
|
-
className: classes.errorText
|
|
744
|
-
}, promptError)), /*#__PURE__*/_react["default"].createElement(_cardBar["default"], {
|
|
745
|
-
header: "Set Up Number Line",
|
|
746
|
-
info: /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
747
|
-
classes: {
|
|
748
|
-
tooltip: classes.tooltip
|
|
749
|
-
},
|
|
750
|
-
disableFocusListener: true,
|
|
751
|
-
disableTouchListener: true,
|
|
752
|
-
placement: 'right',
|
|
753
|
-
title: validationMessage
|
|
754
|
-
}, /*#__PURE__*/_react["default"].createElement(_Info["default"], {
|
|
755
|
-
fontSize: 'small',
|
|
756
|
-
color: 'primary',
|
|
757
|
-
style: {
|
|
758
|
-
marginLeft: '8px'
|
|
497
|
+
componentDidMount() {
|
|
498
|
+
const {
|
|
499
|
+
configuration,
|
|
500
|
+
model,
|
|
501
|
+
onChange
|
|
502
|
+
} = this.props;
|
|
503
|
+
const {
|
|
504
|
+
title
|
|
505
|
+
} = configuration || {};
|
|
506
|
+
const {
|
|
507
|
+
titleEnabled: showTitle
|
|
508
|
+
} = model || {};
|
|
509
|
+
const titleEnabled = showTitle === undefined || showTitle === null ? title.enabled : showTitle;
|
|
510
|
+
onChange && onChange({
|
|
511
|
+
...model,
|
|
512
|
+
titleEnabled
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
render() {
|
|
516
|
+
const {
|
|
517
|
+
model,
|
|
518
|
+
onChange,
|
|
519
|
+
configuration,
|
|
520
|
+
onConfigurationChanged,
|
|
521
|
+
uploadSoundSupport,
|
|
522
|
+
imageSupport
|
|
523
|
+
} = this.props;
|
|
524
|
+
const {
|
|
525
|
+
baseInputConfiguration = {},
|
|
526
|
+
contentDimensions = {},
|
|
527
|
+
instruction = {},
|
|
528
|
+
teacherInstructions = {},
|
|
529
|
+
title = {},
|
|
530
|
+
prompt = {},
|
|
531
|
+
rationale = {},
|
|
532
|
+
spellCheck = {},
|
|
533
|
+
mathMlOptions = {},
|
|
534
|
+
numberLineDimensions = {},
|
|
535
|
+
maxMaxElements = 20,
|
|
536
|
+
hidePointConfigButtons = false,
|
|
537
|
+
availableTools = ['PF'],
|
|
538
|
+
settingsPanelDisabled = false
|
|
539
|
+
} = configuration || {};
|
|
540
|
+
const {
|
|
541
|
+
errors = {},
|
|
542
|
+
extraCSSRules,
|
|
543
|
+
spellCheckEnabled,
|
|
544
|
+
toolbarEditorPosition,
|
|
545
|
+
teacherInstructionsEnabled,
|
|
546
|
+
titleEnabled,
|
|
547
|
+
promptEnabled,
|
|
548
|
+
rationaleEnabled
|
|
549
|
+
} = model || {};
|
|
550
|
+
let {
|
|
551
|
+
graph
|
|
552
|
+
} = model;
|
|
553
|
+
graph = this.reloadTicksData(graph);
|
|
554
|
+
const {
|
|
555
|
+
dialog,
|
|
556
|
+
correctAnswerDialog
|
|
557
|
+
} = this.state;
|
|
558
|
+
const {
|
|
559
|
+
correctResponseError,
|
|
560
|
+
domainError,
|
|
561
|
+
maxError,
|
|
562
|
+
pointsError,
|
|
563
|
+
prompt: promptError,
|
|
564
|
+
rationale: rationaleError,
|
|
565
|
+
teacherInstructions: teacherInstructionsError,
|
|
566
|
+
widthError
|
|
567
|
+
} = errors || {};
|
|
568
|
+
const validationMessage = (0, _utils.generateValidationMessage)();
|
|
569
|
+
const correctResponse = (0, _cloneDeep.default)(model.correctResponse || []).map(toGraphFormat);
|
|
570
|
+
const initialModel = (0, _cloneDeep.default)(model);
|
|
571
|
+
initialModel['disabled'] = true;
|
|
572
|
+
const toolbarOpts = {
|
|
573
|
+
position: toolbarEditorPosition === 'top' ? 'top' : 'bottom'
|
|
574
|
+
};
|
|
575
|
+
const panelProperties = {
|
|
576
|
+
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
577
|
+
titleEnabled: title.settings && toggle(title.label),
|
|
578
|
+
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
579
|
+
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
580
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label)
|
|
581
|
+
};
|
|
582
|
+
const getPluginProps = (props = {}) => ({
|
|
583
|
+
...baseInputConfiguration,
|
|
584
|
+
...props
|
|
585
|
+
});
|
|
586
|
+
return /*#__PURE__*/_react.default.createElement(_configUi.layout.ConfigLayout, {
|
|
587
|
+
extraCSSRules: extraCSSRules,
|
|
588
|
+
dimensions: contentDimensions,
|
|
589
|
+
hideSettings: settingsPanelDisabled,
|
|
590
|
+
settings: /*#__PURE__*/_react.default.createElement(Panel, {
|
|
591
|
+
model: model,
|
|
592
|
+
configuration: configuration,
|
|
593
|
+
onChangeModel: onChange,
|
|
594
|
+
onChangeConfiguration: onConfigurationChanged,
|
|
595
|
+
groups: {
|
|
596
|
+
Properties: panelProperties
|
|
597
|
+
}
|
|
598
|
+
})
|
|
599
|
+
}, /*#__PURE__*/_react.default.createElement(Description, {
|
|
600
|
+
component: "div",
|
|
601
|
+
type: "body1"
|
|
602
|
+
}, instruction.label), teacherInstructionsEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
603
|
+
label: teacherInstructions.label
|
|
604
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
605
|
+
markup: model.teacherInstructions || '',
|
|
606
|
+
onChange: teacherInstructions => onChange({
|
|
607
|
+
teacherInstructions
|
|
608
|
+
}),
|
|
609
|
+
nonEmpty: false,
|
|
610
|
+
disableUnderline: true,
|
|
611
|
+
error: teacherInstructionsError,
|
|
612
|
+
toolbarOpts: toolbarOpts,
|
|
613
|
+
pluginProps: getPluginProps(teacherInstructions?.inputConfiguration),
|
|
614
|
+
spellCheck: spellCheckEnabled,
|
|
615
|
+
imageSupport: imageSupport,
|
|
616
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
617
|
+
languageCharactersProps: [{
|
|
618
|
+
language: 'spanish'
|
|
619
|
+
}, {
|
|
620
|
+
language: 'special'
|
|
621
|
+
}],
|
|
622
|
+
mathMlOptions: mathMlOptions
|
|
623
|
+
}), teacherInstructionsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, teacherInstructionsError)), promptEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
624
|
+
label: prompt.label
|
|
625
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
626
|
+
markup: model.prompt || '',
|
|
627
|
+
onChange: prompt => onChange({
|
|
628
|
+
prompt
|
|
629
|
+
}),
|
|
630
|
+
nonEmpty: false,
|
|
631
|
+
disableUnderline: true,
|
|
632
|
+
error: promptError,
|
|
633
|
+
toolbarOpts: toolbarOpts,
|
|
634
|
+
pluginProps: getPluginProps(prompt?.inputConfiguration),
|
|
635
|
+
spellCheck: spellCheckEnabled,
|
|
636
|
+
imageSupport: imageSupport,
|
|
637
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
638
|
+
languageCharactersProps: [{
|
|
639
|
+
language: 'spanish'
|
|
640
|
+
}, {
|
|
641
|
+
language: 'special'
|
|
642
|
+
}],
|
|
643
|
+
mathMlOptions: mathMlOptions
|
|
644
|
+
}), promptError && /*#__PURE__*/_react.default.createElement(ErrorText, null, promptError)), /*#__PURE__*/_react.default.createElement(_cardBar.default, {
|
|
645
|
+
header: "Set Up Number Line",
|
|
646
|
+
info: /*#__PURE__*/_react.default.createElement(_Tooltip.default, {
|
|
647
|
+
disableFocusListener: true,
|
|
648
|
+
disableTouchListener: true,
|
|
649
|
+
placement: 'right',
|
|
650
|
+
title: validationMessage,
|
|
651
|
+
slotProps: {
|
|
652
|
+
tooltip: {
|
|
653
|
+
sx: theme => ({
|
|
654
|
+
fontSize: theme.typography.fontSize - 2,
|
|
655
|
+
whiteSpace: 'pre',
|
|
656
|
+
maxWidth: '500px'
|
|
657
|
+
})
|
|
759
658
|
}
|
|
760
|
-
}))
|
|
761
|
-
}, "Set up the number line by entering the domain and number of tick marks to display. Labels on the number line can be edited or removed by clicking on the label."), /*#__PURE__*/_react["default"].createElement("div", {
|
|
762
|
-
className: classes.row
|
|
763
|
-
}, /*#__PURE__*/_react["default"].createElement(_domain["default"], {
|
|
764
|
-
domain: graph.domain,
|
|
765
|
-
errors: errors,
|
|
766
|
-
onChange: function onChange(domain) {
|
|
767
|
-
return _this2.graphChange({
|
|
768
|
-
domain: domain
|
|
769
|
-
});
|
|
770
659
|
}
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
ticks: graph.ticks,
|
|
777
|
-
minorLimits: minorLimits,
|
|
778
|
-
minorValues: minorValues,
|
|
779
|
-
majorValues: majorValues,
|
|
780
|
-
onChange: this.changeTicks
|
|
781
|
-
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
782
|
-
className: classes.flexRow
|
|
783
|
-
}, model.widthEnabled && /*#__PURE__*/_react["default"].createElement(_size["default"], {
|
|
784
|
-
size: graph,
|
|
785
|
-
min: numberLineDimensions.min,
|
|
786
|
-
max: numberLineDimensions.max,
|
|
787
|
-
step: numberLineDimensions.step,
|
|
788
|
-
onChange: this.changeSize
|
|
789
|
-
}), /*#__PURE__*/_react["default"].createElement("div", null), /*#__PURE__*/_react["default"].createElement(_arrows["default"], {
|
|
790
|
-
arrows: graph.arrows,
|
|
791
|
-
onChange: this.changeArrows
|
|
792
|
-
})), widthError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
793
|
-
className: classes.errorText
|
|
794
|
-
}, widthError), /*#__PURE__*/_react["default"].createElement(_numberLine.NumberLineComponent, {
|
|
795
|
-
onMoveElement: function onMoveElement() {},
|
|
796
|
-
onDeleteElements: function onDeleteElements() {},
|
|
797
|
-
onAddElement: function onAddElement() {},
|
|
798
|
-
onClearElements: function onClearElements() {},
|
|
799
|
-
onUndoElement: function onUndoElement() {},
|
|
800
|
-
minWidth: numberLineDimensions.min,
|
|
801
|
-
maxWidth: numberLineDimensions.max,
|
|
802
|
-
maxHeight: 70,
|
|
803
|
-
model: trimModel(initialModel)
|
|
804
|
-
}), titleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.FormSection, {
|
|
805
|
-
label: (title === null || title === void 0 ? void 0 : title.label) || 'Title',
|
|
806
|
-
className: classes.title
|
|
807
|
-
}, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
808
|
-
markup: graph.title || '',
|
|
809
|
-
onChange: this.changeGraphTitle,
|
|
810
|
-
toolbarOpts: toolbarOpts,
|
|
811
|
-
activePlugins: ['bold', 'html', 'italic', 'underline', 'strikethrough', 'image', 'math', 'languageCharacters', 'responseArea'],
|
|
812
|
-
pluginProps: getPluginProps(title === null || title === void 0 ? void 0 : title.inputConfiguration),
|
|
813
|
-
spellCheck: spellCheckEnabled,
|
|
814
|
-
imageSupport: imageSupport,
|
|
815
|
-
uploadSoundSupport: uploadSoundSupport,
|
|
816
|
-
languageCharactersProps: [{
|
|
817
|
-
language: 'spanish'
|
|
818
|
-
}, {
|
|
819
|
-
language: 'special'
|
|
820
|
-
}],
|
|
821
|
-
mathMlOptions: mathMlOptions
|
|
822
|
-
})), !graph.exhibitOnly && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_cardBar["default"], {
|
|
823
|
-
header: "Define Tool Set and Correct Response"
|
|
824
|
-
}, "Select answer type and place it on the number line. Intersecting points, line segments and/or rays will appear above the number line. ", /*#__PURE__*/_react["default"].createElement("i", null, "Note: A maximum of 20 points, line segments or rays may be plotted.")), /*#__PURE__*/_react["default"].createElement(_cardBar["default"], {
|
|
825
|
-
header: "Available Tools",
|
|
826
|
-
mini: true
|
|
827
|
-
}, "Click on the input options to be displayed to the students. All inputs will display by default."), /*#__PURE__*/_react["default"].createElement("div", {
|
|
828
|
-
className: classes.pointTypeChooser
|
|
829
|
-
}, /*#__PURE__*/_react["default"].createElement(_pointConfig["default"], {
|
|
830
|
-
onSelectionChange: this.availableTypesChange,
|
|
831
|
-
selection: graph.availableTypes,
|
|
832
|
-
availableTools: availableTools,
|
|
833
|
-
hideButtons: hidePointConfigButtons
|
|
834
|
-
})), /*#__PURE__*/_react["default"].createElement(_configUi.FormSection, {
|
|
835
|
-
className: classes.flexRow
|
|
836
|
-
}, /*#__PURE__*/_react["default"].createElement("label", null, "Max No of Elements"), /*#__PURE__*/_react["default"].createElement(_numberTextField["default"], {
|
|
837
|
-
className: classes.maxNumberOfPoints,
|
|
838
|
-
min: 1,
|
|
839
|
-
max: maxMaxElements,
|
|
840
|
-
onlyIntegersAllowed: true,
|
|
841
|
-
value: graph.maxNumberOfPoints,
|
|
842
|
-
onChange: this.changeMaxNoOfPoints
|
|
843
|
-
}), pointsError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
844
|
-
className: classes.errorText
|
|
845
|
-
}, pointsError)), /*#__PURE__*/_react["default"].createElement("label", null, "Correct Answer"), /*#__PURE__*/_react["default"].createElement(_numberLine.NumberLineComponent, {
|
|
846
|
-
onMoveElement: this.moveCorrectResponse,
|
|
847
|
-
onDeleteElements: this.deleteCorrectResponse,
|
|
848
|
-
onAddElement: this.addCorrectResponse,
|
|
849
|
-
onClearElements: this.clearCorrectResponse,
|
|
850
|
-
onUndoElement: this.undoCorrectResponse,
|
|
851
|
-
minWidth: numberLineDimensions.min,
|
|
852
|
-
maxWidth: numberLineDimensions.max,
|
|
853
|
-
answer: correctResponse //strip feedback for this model
|
|
854
|
-
,
|
|
855
|
-
model: trimModel(model)
|
|
856
|
-
}), correctResponseError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
857
|
-
className: classes.errorText
|
|
858
|
-
}, correctResponseError)), /*#__PURE__*/_react["default"].createElement(_configUi.AlertDialog, {
|
|
859
|
-
open: dialog.open,
|
|
860
|
-
title: "Warning",
|
|
861
|
-
text: dialog.text,
|
|
862
|
-
onConfirm: function onConfirm() {
|
|
863
|
-
return _this2.setState({
|
|
864
|
-
dialog: {
|
|
865
|
-
open: false
|
|
866
|
-
}
|
|
867
|
-
});
|
|
660
|
+
}, /*#__PURE__*/_react.default.createElement(_Info.default, {
|
|
661
|
+
fontSize: 'small',
|
|
662
|
+
color: 'primary',
|
|
663
|
+
style: {
|
|
664
|
+
marginLeft: '8px'
|
|
868
665
|
}
|
|
869
|
-
})
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
666
|
+
}))
|
|
667
|
+
}, "Set up the number line by entering the domain and number of tick marks to display. Labels on the number line can be edited or removed by clicking on the label."), /*#__PURE__*/_react.default.createElement(Row, null, /*#__PURE__*/_react.default.createElement(_domain.default, {
|
|
668
|
+
domain: graph.domain,
|
|
669
|
+
errors: errors,
|
|
670
|
+
onChange: domain => this.graphChange({
|
|
671
|
+
domain
|
|
672
|
+
})
|
|
673
|
+
})), maxError && /*#__PURE__*/_react.default.createElement(ErrorText, null, maxError), domainError && /*#__PURE__*/_react.default.createElement(ErrorText, null, domainError), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_configUi.FormSection, null, /*#__PURE__*/_react.default.createElement(_ticks.default, {
|
|
674
|
+
ticks: graph.ticks,
|
|
675
|
+
minorLimits: minorLimits,
|
|
676
|
+
minorValues: minorValues,
|
|
677
|
+
majorValues: majorValues,
|
|
678
|
+
onChange: this.changeTicks
|
|
679
|
+
}))), /*#__PURE__*/_react.default.createElement(FlexRow, null, model.widthEnabled && /*#__PURE__*/_react.default.createElement(_size.default, {
|
|
680
|
+
size: graph,
|
|
681
|
+
min: numberLineDimensions.min,
|
|
682
|
+
max: numberLineDimensions.max,
|
|
683
|
+
step: numberLineDimensions.step,
|
|
684
|
+
onChange: this.changeSize
|
|
685
|
+
}), /*#__PURE__*/_react.default.createElement("div", null), /*#__PURE__*/_react.default.createElement(_arrows.default, {
|
|
686
|
+
arrows: graph.arrows,
|
|
687
|
+
onChange: this.changeArrows
|
|
688
|
+
})), widthError && /*#__PURE__*/_react.default.createElement(ErrorText, null, widthError), /*#__PURE__*/_react.default.createElement(_numberLine.NumberLineComponent, {
|
|
689
|
+
onMoveElement: () => {},
|
|
690
|
+
onDeleteElements: () => {},
|
|
691
|
+
onAddElement: () => {},
|
|
692
|
+
onClearElements: () => {},
|
|
693
|
+
onUndoElement: () => {},
|
|
694
|
+
minWidth: numberLineDimensions.min,
|
|
695
|
+
maxWidth: numberLineDimensions.max,
|
|
696
|
+
maxHeight: 70,
|
|
697
|
+
model: trimModel(initialModel)
|
|
698
|
+
}), titleEnabled && /*#__PURE__*/_react.default.createElement(StyledFormSection, {
|
|
699
|
+
label: title?.label || 'Title'
|
|
700
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
701
|
+
markup: graph.title || '',
|
|
702
|
+
onChange: this.changeGraphTitle,
|
|
703
|
+
toolbarOpts: toolbarOpts,
|
|
704
|
+
activePlugins: ['bold', 'html', 'italic', 'underline', 'strikethrough', 'image', 'math', 'languageCharacters', 'responseArea'],
|
|
705
|
+
pluginProps: getPluginProps(title?.inputConfiguration),
|
|
706
|
+
spellCheck: spellCheckEnabled,
|
|
707
|
+
imageSupport: imageSupport,
|
|
708
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
709
|
+
languageCharactersProps: [{
|
|
710
|
+
language: 'spanish'
|
|
711
|
+
}, {
|
|
712
|
+
language: 'special'
|
|
713
|
+
}],
|
|
714
|
+
mathMlOptions: mathMlOptions
|
|
715
|
+
})), !graph.exhibitOnly && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_cardBar.default, {
|
|
716
|
+
header: "Define Tool Set and Correct Response"
|
|
717
|
+
}, "Select answer type and place it on the number line. Intersecting points, line segments and/or rays will appear above the number line. ", /*#__PURE__*/_react.default.createElement("i", null, "Note: A maximum of 20 points, line segments or rays may be plotted.")), /*#__PURE__*/_react.default.createElement(_cardBar.default, {
|
|
718
|
+
header: "Available Tools",
|
|
719
|
+
mini: true
|
|
720
|
+
}, "Click on the input options to be displayed to the students. All inputs will display by default."), /*#__PURE__*/_react.default.createElement(PointTypeChooser, null, /*#__PURE__*/_react.default.createElement(_pointConfig.default, {
|
|
721
|
+
onSelectionChange: this.availableTypesChange,
|
|
722
|
+
selection: graph.availableTypes,
|
|
723
|
+
availableTools: availableTools,
|
|
724
|
+
hideButtons: hidePointConfigButtons
|
|
725
|
+
})), /*#__PURE__*/_react.default.createElement(FlexRowFormSection, null, /*#__PURE__*/_react.default.createElement("label", null, "Max No of Elements"), /*#__PURE__*/_react.default.createElement(StyledNumberTextField, {
|
|
726
|
+
min: 1,
|
|
727
|
+
max: maxMaxElements,
|
|
728
|
+
onlyIntegersAllowed: true,
|
|
729
|
+
value: graph.maxNumberOfPoints,
|
|
730
|
+
onChange: this.changeMaxNoOfPoints
|
|
731
|
+
}), pointsError && /*#__PURE__*/_react.default.createElement(ErrorText, null, pointsError)), /*#__PURE__*/_react.default.createElement("label", null, "Correct Answer"), /*#__PURE__*/_react.default.createElement(_numberLine.NumberLineComponent, {
|
|
732
|
+
onMoveElement: this.moveCorrectResponse,
|
|
733
|
+
onDeleteElements: this.deleteCorrectResponse,
|
|
734
|
+
onAddElement: this.addCorrectResponse,
|
|
735
|
+
onClearElements: this.clearCorrectResponse,
|
|
736
|
+
onUndoElement: this.undoCorrectResponse,
|
|
737
|
+
minWidth: numberLineDimensions.min,
|
|
738
|
+
maxWidth: numberLineDimensions.max,
|
|
739
|
+
answer: correctResponse
|
|
740
|
+
//strip feedback for this model
|
|
741
|
+
,
|
|
742
|
+
model: trimModel(model)
|
|
743
|
+
}), correctResponseError && /*#__PURE__*/_react.default.createElement(ErrorText, null, correctResponseError)), /*#__PURE__*/_react.default.createElement(_configUi.AlertDialog, {
|
|
744
|
+
open: dialog.open,
|
|
745
|
+
title: "Warning",
|
|
746
|
+
text: dialog.text,
|
|
747
|
+
onConfirm: () => this.setState({
|
|
748
|
+
dialog: {
|
|
749
|
+
open: false
|
|
750
|
+
}
|
|
751
|
+
})
|
|
752
|
+
}), /*#__PURE__*/_react.default.createElement(_configUi.AlertDialog, {
|
|
753
|
+
open: correctAnswerDialog.open,
|
|
754
|
+
title: "Warning",
|
|
755
|
+
text: correctAnswerDialog.text,
|
|
756
|
+
onConfirm: () => {
|
|
757
|
+
let indices = this.state.correctAnswerDialog.indices;
|
|
758
|
+
if (indices && indices.length > 0) {
|
|
759
|
+
this.deleteCorrectResponse(indices);
|
|
760
|
+
}
|
|
761
|
+
this.setState({
|
|
762
|
+
correctAnswerDialog: {
|
|
763
|
+
open: false
|
|
878
764
|
}
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
imageSupport: imageSupport,
|
|
917
|
-
uploadSoundSupport: uploadSoundSupport,
|
|
918
|
-
languageCharactersProps: [{
|
|
919
|
-
language: 'spanish'
|
|
920
|
-
}, {
|
|
921
|
-
language: 'special'
|
|
922
|
-
}],
|
|
923
|
-
mathMlOptions: mathMlOptions
|
|
924
|
-
}), rationaleError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
925
|
-
className: classes.errorText
|
|
926
|
-
}, rationaleError)));
|
|
927
|
-
}
|
|
928
|
-
}]);
|
|
929
|
-
return Main;
|
|
930
|
-
}(_react["default"].Component);
|
|
931
|
-
|
|
765
|
+
});
|
|
766
|
+
},
|
|
767
|
+
onClose: () => {
|
|
768
|
+
const graph = this.state.correctAnswerDialog.graph;
|
|
769
|
+
onChange({
|
|
770
|
+
graph
|
|
771
|
+
});
|
|
772
|
+
this.setState({
|
|
773
|
+
correctAnswerDialog: {
|
|
774
|
+
open: false
|
|
775
|
+
}
|
|
776
|
+
});
|
|
777
|
+
},
|
|
778
|
+
onConfirmText: 'OK',
|
|
779
|
+
onCloseText: 'Cancel'
|
|
780
|
+
}), rationaleEnabled && /*#__PURE__*/_react.default.createElement(StyledInputContainer, {
|
|
781
|
+
label: rationale.label || 'Rationale'
|
|
782
|
+
}, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
|
|
783
|
+
markup: model.rationale || '',
|
|
784
|
+
onChange: rationale => onChange({
|
|
785
|
+
rationale
|
|
786
|
+
}),
|
|
787
|
+
error: rationaleError,
|
|
788
|
+
toolbarOpts: toolbarOpts,
|
|
789
|
+
spellCheck: spellCheckEnabled,
|
|
790
|
+
pluginProps: getPluginProps(rationale?.inputConfiguration),
|
|
791
|
+
imageSupport: imageSupport,
|
|
792
|
+
uploadSoundSupport: uploadSoundSupport,
|
|
793
|
+
languageCharactersProps: [{
|
|
794
|
+
language: 'spanish'
|
|
795
|
+
}, {
|
|
796
|
+
language: 'special'
|
|
797
|
+
}],
|
|
798
|
+
mathMlOptions: mathMlOptions
|
|
799
|
+
}), rationaleError && /*#__PURE__*/_react.default.createElement(ErrorText, null, rationaleError)));
|
|
800
|
+
}
|
|
801
|
+
}
|
|
932
802
|
exports.Main = Main;
|
|
933
|
-
(0, _defineProperty2
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
uploadSoundSupport: _propTypes["default"].object.isRequired
|
|
803
|
+
(0, _defineProperty2.default)(Main, "propTypes", {
|
|
804
|
+
model: _propTypes.default.object.isRequired,
|
|
805
|
+
configuration: _propTypes.default.object.isRequired,
|
|
806
|
+
onConfigurationChanged: _propTypes.default.func.isRequired,
|
|
807
|
+
onChange: _propTypes.default.func.isRequired,
|
|
808
|
+
imageSupport: _propTypes.default.object.isRequired,
|
|
809
|
+
uploadSoundSupport: _propTypes.default.object.isRequired
|
|
941
810
|
});
|
|
942
|
-
|
|
943
|
-
var _default = (0, _styles.withStyles)(styles, {
|
|
944
|
-
name: 'Main'
|
|
945
|
-
})(Main);
|
|
946
|
-
|
|
947
|
-
exports["default"] = _default;
|
|
811
|
+
var _default = exports.default = Main;
|
|
948
812
|
//# sourceMappingURL=main.js.map
|