@pie-element/graphing-solution-set 4.3.4-next.3 → 5.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/configure.js +289 -377
- package/configure/lib/configure.js.map +1 -1
- package/configure/lib/correct-response.js +309 -475
- package/configure/lib/correct-response.js.map +1 -1
- package/configure/lib/defaults.js +2 -4
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/graphing-config.js +329 -363
- package/configure/lib/graphing-config.js.map +1 -1
- package/configure/lib/index.js +126 -181
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/utils.js +178 -301
- package/configure/lib/utils.js.map +1 -1
- package/configure/package.json +12 -8
- package/controller/lib/defaults.js +2 -4
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +146 -218
- package/controller/lib/index.js.map +1 -1
- package/controller/lib/utils.js +85 -142
- package/controller/lib/utils.js.map +1 -1
- package/controller/package.json +3 -3
- package/lib/index.js +120 -170
- package/lib/index.js.map +1 -1
- package/lib/main.js +261 -350
- package/lib/main.js.map +1 -1
- package/lib/utils.js +142 -231
- package/lib/utils.js.map +1 -1
- package/package.json +14 -10
- package/esm/configure.js +0 -43958
- package/esm/configure.js.map +0 -1
- package/esm/controller.js +0 -22735
- package/esm/controller.js.map +0 -1
- package/esm/element.js +0 -26572
- package/esm/element.js.map +0 -1
- package/esm/package.json +0 -3
package/controller/lib/utils.js
CHANGED
|
@@ -1,273 +1,216 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.sortedAnswers = exports.removeInvalidSegments = exports.removeInvalidAnswers = exports.removeDuplicateSegments = exports.equalSegment = exports.equalPolygon = exports.equalMarks = exports.equalLine = exports.constructSegmentsFromPoints = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
8
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
15
|
-
|
|
16
9
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
17
|
-
|
|
18
10
|
var _uniqWith = _interopRequireDefault(require("lodash/uniqWith"));
|
|
19
|
-
|
|
20
11
|
var _differenceWith = _interopRequireDefault(require("lodash/differenceWith"));
|
|
21
|
-
|
|
22
|
-
var _excluded = ["type"];
|
|
23
|
-
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
-
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
-
|
|
28
12
|
/*
|
|
29
13
|
* Constant to check equal segments
|
|
30
14
|
* @param {Object} segment1 - segment 1
|
|
31
15
|
* @param {Object} segment2 - segment 2
|
|
32
16
|
* */
|
|
33
|
-
|
|
17
|
+
const equalSegment = (segment1, segment2) => {
|
|
34
18
|
// A.from = B.from, A.to = B.to OR A.from = B.to, A.to = B.from
|
|
35
19
|
// x1 = x3 & y1 = y3 & x2 = x4 & y2 = y4
|
|
36
|
-
return (0, _isEqual
|
|
37
|
-
};
|
|
20
|
+
return (0, _isEqual.default)(segment1.from, segment2.from) && (0, _isEqual.default)(segment1.to, segment2.to) || (0, _isEqual.default)(segment1.to, segment2.from) && (0, _isEqual.default)(segment1.from, segment2.to);
|
|
21
|
+
};
|
|
38
22
|
|
|
23
|
+
// this function is implemented in configure as well
|
|
39
24
|
/*
|
|
40
25
|
* Constant to get sorted answers
|
|
41
26
|
* @param {Object} answers - answers
|
|
42
27
|
* */
|
|
43
|
-
|
|
44
|
-
|
|
45
28
|
exports.equalSegment = equalSegment;
|
|
29
|
+
const sortedAnswers = answers => Object.keys(answers || {}).sort().reduce((result, key) => {
|
|
30
|
+
if (key !== 'correctAnswer') {
|
|
31
|
+
result[key] = answers[key];
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}, {});
|
|
46
35
|
|
|
47
|
-
var sortedAnswers = function sortedAnswers(answers) {
|
|
48
|
-
return Object.keys(answers || {}).sort().reduce(function (result, key) {
|
|
49
|
-
if (key !== 'correctAnswer') {
|
|
50
|
-
result[key] = answers[key];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return result;
|
|
54
|
-
}, {});
|
|
55
|
-
};
|
|
56
36
|
/*
|
|
57
37
|
* Constant to return line equation coefficients
|
|
58
38
|
* @param {Object} line - line
|
|
59
39
|
* */
|
|
60
|
-
|
|
61
|
-
|
|
62
40
|
exports.sortedAnswers = sortedAnswers;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
to:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
41
|
+
const returnLineEquationCoefficients = line => {
|
|
42
|
+
line = {
|
|
43
|
+
...line,
|
|
44
|
+
to: {
|
|
45
|
+
...line.to
|
|
46
|
+
},
|
|
47
|
+
from: {
|
|
48
|
+
...line.from
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const xA = line.from.x;
|
|
52
|
+
const yA = line.from.y;
|
|
53
|
+
const xB = line.to.x;
|
|
54
|
+
const yB = line.to.y;
|
|
73
55
|
return {
|
|
74
56
|
a: yB - yA,
|
|
75
57
|
b: xA - xB,
|
|
76
58
|
c: xB * yA - xA * yB
|
|
77
59
|
};
|
|
78
60
|
};
|
|
61
|
+
|
|
79
62
|
/*
|
|
80
63
|
* Constant to get significant decimals
|
|
81
64
|
* @param {Number} number - number
|
|
82
65
|
* */
|
|
66
|
+
const getSignificantDecimals = number => Math.round(number * 10000) / 10000;
|
|
83
67
|
|
|
84
|
-
|
|
85
|
-
var getSignificantDecimals = function getSignificantDecimals(number) {
|
|
86
|
-
return Math.round(number * 10000) / 10000;
|
|
87
|
-
};
|
|
88
68
|
/*
|
|
89
69
|
* Constant to check equal lines
|
|
90
70
|
* @param {Object} line1 - line 1
|
|
91
71
|
* @param {Object} line2 - line 2
|
|
92
72
|
* */
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var equalLine = function equalLine(line1, line2) {
|
|
73
|
+
const equalLine = (line1, line2) => {
|
|
96
74
|
// line equation: ax + by + c = 0
|
|
97
75
|
// 2 lines are equal if a1/a2 = b1/b2 = c1/c2, where a, b, c are the coefficients in line equation
|
|
98
76
|
// line equation knowing 2 points: (y - yA) / (yB - yA) = (x - xA) / (xB - xA)
|
|
99
77
|
// extending this equation, we get: x * (yB - yA) + y * (xA - xB) + (xB * yA - xA * yB) = 0
|
|
100
78
|
// where a = yB - yA; b = xA - xB; c = xB * yA - xA * yB
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
79
|
+
const {
|
|
80
|
+
a: a1,
|
|
81
|
+
b: b1,
|
|
82
|
+
c: c1
|
|
83
|
+
} = returnLineEquationCoefficients(line1);
|
|
84
|
+
const {
|
|
85
|
+
a: a2,
|
|
86
|
+
b: b2,
|
|
87
|
+
c: c2
|
|
88
|
+
} = returnLineEquationCoefficients(line2);
|
|
89
|
+
const proportions = [];
|
|
113
90
|
if (a2 !== 0) {
|
|
114
91
|
proportions.push(getSignificantDecimals(a1 / a2));
|
|
115
92
|
} else if (a1 !== a2) {
|
|
116
93
|
return false;
|
|
117
94
|
}
|
|
118
|
-
|
|
119
95
|
if (b2 !== 0) {
|
|
120
96
|
proportions.push(getSignificantDecimals(b1 / b2));
|
|
121
97
|
} else if (b1 !== b2) {
|
|
122
98
|
return false;
|
|
123
99
|
}
|
|
124
|
-
|
|
125
100
|
if (c2 !== 0) {
|
|
126
101
|
proportions.push(getSignificantDecimals(c1 / c2));
|
|
127
102
|
} else if (c1 !== c2) {
|
|
128
103
|
return false;
|
|
129
104
|
}
|
|
130
|
-
|
|
131
|
-
|
|
105
|
+
return _lodash.default.uniq(proportions).length === 1 && line1.fill === line2.fill;
|
|
106
|
+
// (y2 - y1)/(x2 - x1) = (y4 - y3)/(x4 - x3);
|
|
132
107
|
// return ((Math.abs((line1.to.y - line1.from.y) / (line1.to.x - line1.from.x))) === (Math.abs((line2.to.y - line2.from.y) / (line2.to.x - line2.from.x))));
|
|
133
108
|
};
|
|
109
|
+
|
|
134
110
|
/*
|
|
135
111
|
* Constant to construct segments from points
|
|
136
112
|
* @param {Array} points - points
|
|
137
113
|
* */
|
|
138
|
-
|
|
139
|
-
|
|
140
114
|
exports.equalLine = equalLine;
|
|
141
|
-
|
|
142
|
-
var constructSegmentsFromPoints = function constructSegmentsFromPoints(points) {
|
|
115
|
+
const constructSegmentsFromPoints = points => {
|
|
143
116
|
// takes the list of points that represent a polygon and transforms it into a list of segments; eg.:
|
|
144
117
|
// points: A, B, C, D => segments: AB, BC, CD, DA
|
|
145
|
-
return (points || []).map(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
};
|
|
150
|
-
});
|
|
118
|
+
return (points || []).map((point, index) => ({
|
|
119
|
+
from: point,
|
|
120
|
+
to: points[(index + 1) % points.length]
|
|
121
|
+
}));
|
|
151
122
|
};
|
|
123
|
+
|
|
152
124
|
/*
|
|
153
125
|
* Constant to remove duplicate segments
|
|
154
126
|
* @param {Array} segments - segments
|
|
155
127
|
* */
|
|
156
|
-
|
|
157
|
-
|
|
158
128
|
exports.constructSegmentsFromPoints = constructSegmentsFromPoints;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
129
|
+
const removeDuplicateSegments = segments => {
|
|
130
|
+
segments = segments || [];
|
|
131
|
+
// removes segments that are duplicates; eg. These segments are the same, so one will be removed:
|
|
162
132
|
// segment1: from: { x: 1, y: 1 }, to: { x: 2, y: 1 }
|
|
163
133
|
// segment2: from: { x: 2, y: 1 }, to: { x: 1, y: 1 }
|
|
164
|
-
|
|
165
|
-
return (0, _uniqWith["default"])(segments, function (s1, s2) {
|
|
166
|
-
return equalSegment(s1, s2);
|
|
167
|
-
});
|
|
134
|
+
return (0, _uniqWith.default)(segments, (s1, s2) => equalSegment(s1, s2));
|
|
168
135
|
};
|
|
136
|
+
|
|
169
137
|
/*
|
|
170
138
|
* Constant to remove invalid segments
|
|
171
139
|
* @param {Array} segments - segments
|
|
172
140
|
* */
|
|
173
|
-
|
|
174
|
-
|
|
175
141
|
exports.removeDuplicateSegments = removeDuplicateSegments;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
return segments.filter(function (segment) {
|
|
181
|
-
return !(0, _isEqual["default"])(segment.from, segment.to);
|
|
182
|
-
});
|
|
142
|
+
const removeInvalidSegments = segments => {
|
|
143
|
+
segments = segments || [];
|
|
144
|
+
// removes segments that start in a point and end in the same point (eg.: from: { x: 1, y: 1 }, to: { x: 1, y: 1 })
|
|
145
|
+
return segments.filter(segment => !(0, _isEqual.default)(segment.from, segment.to));
|
|
183
146
|
};
|
|
147
|
+
|
|
184
148
|
/*
|
|
185
149
|
* Constant to check equal polygons
|
|
186
150
|
* @param {Object} poly1 - polygon 1 points
|
|
187
151
|
* @param {Object} poly2 - polygon 2 points
|
|
188
152
|
* */
|
|
189
|
-
|
|
190
|
-
|
|
191
153
|
exports.removeInvalidSegments = removeInvalidSegments;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
154
|
+
const equalPolygon = (poly1, poly2) => {
|
|
155
|
+
const {
|
|
156
|
+
points: points1
|
|
157
|
+
} = poly1;
|
|
158
|
+
const {
|
|
159
|
+
points: points2
|
|
160
|
+
} = poly2;
|
|
161
|
+
// generate segments
|
|
162
|
+
const segments1 = constructSegmentsFromPoints(points1);
|
|
163
|
+
const segments2 = constructSegmentsFromPoints(points2);
|
|
164
|
+
const segments1NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments1));
|
|
165
|
+
const segments2NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments2));
|
|
166
|
+
const differentSegments1 = (0, _differenceWith.default)(segments1NoDuplicates, segments2NoDuplicates, equalSegment);
|
|
167
|
+
const differentSegments2 = (0, _differenceWith.default)(segments2NoDuplicates, segments1NoDuplicates, equalSegment);
|
|
203
168
|
return (!differentSegments1 || !differentSegments1.length) && (!differentSegments2 || !differentSegments2.length);
|
|
204
169
|
};
|
|
170
|
+
|
|
205
171
|
/*
|
|
206
172
|
* Constant to compare equal marks
|
|
207
173
|
* */
|
|
208
|
-
|
|
209
|
-
|
|
210
174
|
exports.equalPolygon = equalPolygon;
|
|
211
|
-
|
|
212
|
-
line:
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
polygon: function polygon(sessAnswer, poly) {
|
|
216
|
-
return equalPolygon(sessAnswer, poly);
|
|
217
|
-
}
|
|
175
|
+
const equalMarks = exports.equalMarks = {
|
|
176
|
+
line: (sessAnswer, mark) => equalLine(sessAnswer, mark),
|
|
177
|
+
polygon: (sessAnswer, poly) => equalPolygon(sessAnswer, poly)
|
|
218
178
|
};
|
|
179
|
+
|
|
219
180
|
/*
|
|
220
181
|
* Check if a point is correct and complete
|
|
221
182
|
* @param {Object} point - point object
|
|
222
183
|
* */
|
|
184
|
+
const completePoint = point => point && Number.isFinite(point.x) && Number.isFinite(point.y);
|
|
223
185
|
|
|
224
|
-
exports.equalMarks = equalMarks;
|
|
225
|
-
|
|
226
|
-
var completePoint = function completePoint(point) {
|
|
227
|
-
return point && Number.isFinite(point.x) && Number.isFinite(point.y);
|
|
228
|
-
};
|
|
229
186
|
/*
|
|
230
187
|
* Check if a line is complete
|
|
231
188
|
* @param {Object} item - mark object
|
|
232
189
|
* */
|
|
190
|
+
const completeFromTo = item => item && completeMark.point(item.from) && completeMark.point(item.to);
|
|
233
191
|
|
|
234
|
-
|
|
235
|
-
var completeFromTo = function completeFromTo(item) {
|
|
236
|
-
return item && completeMark.point(item.from) && completeMark.point(item.to);
|
|
237
|
-
};
|
|
238
192
|
/*
|
|
239
193
|
* Check if a point is correct and complete
|
|
240
194
|
* @param {Object} item - mark object
|
|
241
195
|
* */
|
|
196
|
+
const completePoints = item => item && item.points && item.points.length && (item.points.filter(point => completePoint(point)) || []).length === item.points.length;
|
|
242
197
|
|
|
243
|
-
|
|
244
|
-
var completePoints = function completePoints(item) {
|
|
245
|
-
return item && item.points && item.points.length && (item.points.filter(function (point) {
|
|
246
|
-
return completePoint(point);
|
|
247
|
-
}) || []).length === item.points.length;
|
|
248
|
-
};
|
|
249
198
|
/*
|
|
250
199
|
* Complete mark object for line and point
|
|
251
200
|
* */
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
var completeMark = {
|
|
201
|
+
const completeMark = {
|
|
255
202
|
point: completePoint,
|
|
256
203
|
line: completeFromTo,
|
|
257
204
|
polygon: completePoints
|
|
258
205
|
};
|
|
206
|
+
|
|
259
207
|
/*
|
|
260
208
|
* Function to remove invalid answers
|
|
261
209
|
* @param {Array} answers - answers array
|
|
262
210
|
* */
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
answer = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
268
|
-
return completeMark[type] ? completeMark[type](answer) : false;
|
|
269
|
-
}) : [];
|
|
270
|
-
};
|
|
271
|
-
|
|
211
|
+
const removeInvalidAnswers = answers => answers ? (answers || []).filter(({
|
|
212
|
+
type,
|
|
213
|
+
...answer
|
|
214
|
+
}) => completeMark[type] ? completeMark[type](answer) : false) : [];
|
|
272
215
|
exports.removeInvalidAnswers = removeInvalidAnswers;
|
|
273
216
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils.js"],"names":["equalSegment","segment1","segment2","from","to","sortedAnswers","answers","Object","keys","sort","reduce","result","key","returnLineEquationCoefficients","line","xA","x","yA","y","xB","yB","a","b","c","getSignificantDecimals","number","Math","round","equalLine","line1","line2","a1","b1","c1","a2","b2","c2","proportions","push","lodash","uniq","length","fill","constructSegmentsFromPoints","points","map","point","index","removeDuplicateSegments","segments","s1","s2","removeInvalidSegments","filter","segment","equalPolygon","poly1","poly2","points1","points2","segments1","segments2","segments1NoDuplicates","segments2NoDuplicates","differentSegments1","differentSegments2","equalMarks","sessAnswer","mark","polygon","poly","completePoint","Number","isFinite","completeFromTo","item","completeMark","completePoints","removeInvalidAnswers","type","answer"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACO,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,QAAD,EAAWC,QAAX,EAAwB;AAClD;AACA;AACA,SACG,yBAAQD,QAAQ,CAACE,IAAjB,EAAuBD,QAAQ,CAACC,IAAhC,KAAyC,yBAAQF,QAAQ,CAACG,EAAjB,EAAqBF,QAAQ,CAACE,EAA9B,CAA1C,IACC,yBAAQH,QAAQ,CAACG,EAAjB,EAAqBF,QA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mB6B,IAAI,CAACxE,IAAxB,CAAR,IAAyCyE,YAAY,CAAC9B,KAAb,CAAmB6B,IAAI,CAACvE,EAAxB,CAAnD;AAAA,CAAvB;AAEA;AACA;AACA;AACA;;;AACA,IAAMyE,cAAc,GAAG,SAAjBA,cAAiB,CAACF,IAAD;AAAA,SACrBA,IAAI,IACJA,IAAI,CAAC/B,MADL,IAEA+B,IAAI,CAAC/B,MAAL,CAAYH,MAFZ,IAGA,CAACkC,IAAI,CAAC/B,MAAL,CAAYS,MAAZ,CAAmB,UAACP,KAAD;AAAA,WAAWyB,aAAa,CAACzB,KAAD,CAAxB;AAAA,GAAnB,KAAuD,EAAxD,EAA4DL,MAA5D,KAAuEkC,IAAI,CAAC/B,MAAL,CAAYH,MAJ9D;AAAA,CAAvB;AAMA;AACA;AACA;;;AACA,IAAMmC,YAAY,GAAG;AACnB9B,EAAAA,KAAK,EAAEyB,aADY;AAEnBzD,EAAAA,IAAI,EAAE4D,cAFa;AAGnBL,EAAAA,OAAO,EAAEQ;AAHU,CAArB;AAMA;AACA;AACA;AACA;;AACO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACxE,OAAD;AAAA,SAClCA,OAAO,GACH,CAACA,OAAO,IAAI,EAAZ,EAAgB+C,MAAhB,CAAuB;AAAA,QAAG0B,IAAH,QAAGA,IAAH;AAAA,QAAYC,MAAZ;AAAA,WAA0BJ,YAAY,CAACG,IAAD,CAAZ,GAAqBH,YAAY,CAACG,IAAD,CAAZ,CAAmBC,MAAnB,CAArB,GAAkD,KAA5E;AAAA,GAAvB,CADG,GAEH,EAH8B;AAAA,CAA7B","sourcesContent":["import isEqual from 'lodash/isEqual';\nimport lodash from 'lodash';\nimport uniqWith from 'lodash/uniqWith';\nimport differenceWith from 'lodash/differenceWith';\n\n/*\n * Constant to check equal segments\n * @param {Object} segment1 - segment 1\n * @param {Object} segment2 - segment 2\n * */\nexport const equalSegment = (segment1, segment2) => {\n // A.from = B.from, A.to = B.to OR A.from = B.to, A.to = B.from\n // x1 = x3 & y1 = y3 & x2 = x4 & y2 = y4\n return (\n (isEqual(segment1.from, segment2.from) && isEqual(segment1.to, segment2.to)) ||\n (isEqual(segment1.to, segment2.from) && isEqual(segment1.from, segment2.to))\n );\n};\n\n// this function is implemented in configure as well\n/*\n * Constant to get sorted answers\n * @param {Object} answers - answers\n * */\nexport const sortedAnswers = (answers) =>\n Object.keys(answers || {})\n .sort()\n .reduce((result, key) => {\n if (key !== 'correctAnswer') {\n result[key] = answers[key];\n }\n return result;\n }, {});\n\n/*\n * Constant to return line equation coefficients\n * @param {Object} line - line\n * */\nconst returnLineEquationCoefficients = (line) => {\n line = { ...line, to: { ...line.to }, from: { ...line.from } };\n const xA = line.from.x;\n const yA = line.from.y;\n const xB = line.to.x;\n const yB = line.to.y;\n return {\n a: yB - yA,\n b: xA - xB,\n c: xB * yA - xA * yB,\n };\n};\n\n/*\n * Constant to get significant decimals\n * @param {Number} number - number\n * */\nconst getSignificantDecimals = (number) => Math.round(number * 10000) / 10000;\n\n/*\n * Constant to check equal lines\n * @param {Object} line1 - line 1\n * @param {Object} line2 - line 2\n * */\nexport const equalLine = (line1, line2) => {\n // line equation: ax + by + c = 0\n // 2 lines are equal if a1/a2 = b1/b2 = c1/c2, where a, b, c are the coefficients in line equation\n // line equation knowing 2 points: (y - yA) / (yB - yA) = (x - xA) / (xB - xA)\n // extending this equation, we get: x * (yB - yA) + y * (xA - xB) + (xB * yA - xA * yB) = 0\n // where a = yB - yA; b = xA - xB; c = xB * yA - xA * yB\n const { a: a1, b: b1, c: c1 } = returnLineEquationCoefficients(line1);\n const { a: a2, b: b2, c: c2 } = returnLineEquationCoefficients(line2);\n const proportions = [];\n if (a2 !== 0) {\n proportions.push(getSignificantDecimals(a1 / a2));\n } else if (a1 !== a2) {\n return false;\n }\n if (b2 !== 0) {\n proportions.push(getSignificantDecimals(b1 / b2));\n } else if (b1 !== b2) {\n return false;\n }\n if (c2 !== 0) {\n proportions.push(getSignificantDecimals(c1 / c2));\n } else if (c1 !== c2) {\n return false;\n }\n return lodash.uniq(proportions).length === 1 && line1.fill === line2.fill;\n // (y2 - y1)/(x2 - x1) = (y4 - y3)/(x4 - x3);\n // return ((Math.abs((line1.to.y - line1.from.y) / (line1.to.x - line1.from.x))) === (Math.abs((line2.to.y - line2.from.y) / (line2.to.x - line2.from.x))));\n};\n\n/*\n * Constant to construct segments from points\n * @param {Array} points - points\n * */\nexport const constructSegmentsFromPoints = (points) => {\n // takes the list of points that represent a polygon and transforms it into a list of segments; eg.:\n // points: A, B, C, D => segments: AB, BC, CD, DA\n return (points || []).map((point, index) => ({ from: point, to: points[(index + 1) % points.length] }));\n};\n\n/*\n * Constant to remove duplicate segments\n * @param {Array} segments - segments\n * */\nexport const removeDuplicateSegments = (segments) => {\n segments = segments || [];\n // removes segments that are duplicates; eg. These segments are the same, so one will be removed:\n // segment1: from: { x: 1, y: 1 }, to: { x: 2, y: 1 }\n // segment2: from: { x: 2, y: 1 }, to: { x: 1, y: 1 }\n return uniqWith(segments, (s1, s2) => equalSegment(s1, s2));\n};\n\n/*\n * Constant to remove invalid segments\n * @param {Array} segments - segments\n * */\nexport const removeInvalidSegments = (segments) => {\n segments = segments || [];\n // removes segments that start in a point and end in the same point (eg.: from: { x: 1, y: 1 }, to: { x: 1, y: 1 })\n return segments.filter((segment) => !isEqual(segment.from, segment.to));\n};\n\n/*\n * Constant to check equal polygons\n * @param {Object} poly1 - polygon 1 points\n * @param {Object} poly2 - polygon 2 points\n * */\nexport const equalPolygon = (poly1, poly2) => {\n const { points: points1 } = poly1;\n const { points: points2 } = poly2;\n // generate segments\n const segments1 = constructSegmentsFromPoints(points1);\n const segments2 = constructSegmentsFromPoints(points2);\n const segments1NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments1));\n const segments2NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments2));\n const differentSegments1 = differenceWith(segments1NoDuplicates, segments2NoDuplicates, equalSegment);\n const differentSegments2 = differenceWith(segments2NoDuplicates, segments1NoDuplicates, equalSegment);\n return (!differentSegments1 || !differentSegments1.length) && (!differentSegments2 || !differentSegments2.length);\n};\n\n/*\n * Constant to compare equal marks\n * */\nexport const equalMarks = {\n line: (sessAnswer, mark) => equalLine(sessAnswer, mark),\n polygon: (sessAnswer, poly) => equalPolygon(sessAnswer, poly),\n};\n\n/*\n * Check if a point is correct and complete\n * @param {Object} point - point object\n * */\nconst completePoint = (point) => point && Number.isFinite(point.x) && Number.isFinite(point.y);\n\n/*\n * Check if a line is complete\n * @param {Object} item - mark object\n * */\nconst completeFromTo = (item) => item && completeMark.point(item.from) && completeMark.point(item.to);\n\n/*\n * Check if a point is correct and complete\n * @param {Object} item - mark object\n * */\nconst completePoints = (item) =>\n item &&\n item.points &&\n item.points.length &&\n (item.points.filter((point) => completePoint(point)) || []).length === item.points.length;\n\n/*\n * Complete mark object for line and point\n * */\nconst completeMark = {\n point: completePoint,\n line: completeFromTo,\n polygon: completePoints,\n};\n\n/*\n * Function to remove invalid answers\n * @param {Array} answers - answers array\n * */\nexport const removeInvalidAnswers = (answers) =>\n answers\n ? (answers || []).filter(({ type, ...answer }) => (completeMark[type] ? completeMark[type](answer) : false))\n : [];\n"],"file":"utils.js"}
|
|
1
|
+
{"version":3,"file":"utils.js","names":["_isEqual","_interopRequireDefault","require","_lodash","_uniqWith","_differenceWith","equalSegment","segment1","segment2","isEqual","from","to","exports","sortedAnswers","answers","Object","keys","sort","reduce","result","key","returnLineEquationCoefficients","line","xA","x","yA","y","xB","yB","a","b","c","getSignificantDecimals","number","Math","round","equalLine","line1","line2","a1","b1","c1","a2","b2","c2","proportions","push","lodash","uniq","length","fill","constructSegmentsFromPoints","points","map","point","index","removeDuplicateSegments","segments","uniqWith","s1","s2","removeInvalidSegments","filter","segment","equalPolygon","poly1","poly2","points1","points2","segments1","segments2","segments1NoDuplicates","segments2NoDuplicates","differentSegments1","differenceWith","differentSegments2","equalMarks","sessAnswer","mark","polygon","poly","completePoint","Number","isFinite","completeFromTo","item","completeMark","completePoints","removeInvalidAnswers","type","answer"],"sources":["../src/utils.js"],"sourcesContent":["import isEqual from 'lodash/isEqual';\nimport lodash from 'lodash';\nimport uniqWith from 'lodash/uniqWith';\nimport differenceWith from 'lodash/differenceWith';\n\n/*\n * Constant to check equal segments\n * @param {Object} segment1 - segment 1\n * @param {Object} segment2 - segment 2\n * */\nexport const equalSegment = (segment1, segment2) => {\n // A.from = B.from, A.to = B.to OR A.from = B.to, A.to = B.from\n // x1 = x3 & y1 = y3 & x2 = x4 & y2 = y4\n return (\n (isEqual(segment1.from, segment2.from) && isEqual(segment1.to, segment2.to)) ||\n (isEqual(segment1.to, segment2.from) && isEqual(segment1.from, segment2.to))\n );\n};\n\n// this function is implemented in configure as well\n/*\n * Constant to get sorted answers\n * @param {Object} answers - answers\n * */\nexport const sortedAnswers = (answers) =>\n Object.keys(answers || {})\n .sort()\n .reduce((result, key) => {\n if (key !== 'correctAnswer') {\n result[key] = answers[key];\n }\n return result;\n }, {});\n\n/*\n * Constant to return line equation coefficients\n * @param {Object} line - line\n * */\nconst returnLineEquationCoefficients = (line) => {\n line = { ...line, to: { ...line.to }, from: { ...line.from } };\n const xA = line.from.x;\n const yA = line.from.y;\n const xB = line.to.x;\n const yB = line.to.y;\n return {\n a: yB - yA,\n b: xA - xB,\n c: xB * yA - xA * yB,\n };\n};\n\n/*\n * Constant to get significant decimals\n * @param {Number} number - number\n * */\nconst getSignificantDecimals = (number) => Math.round(number * 10000) / 10000;\n\n/*\n * Constant to check equal lines\n * @param {Object} line1 - line 1\n * @param {Object} line2 - line 2\n * */\nexport const equalLine = (line1, line2) => {\n // line equation: ax + by + c = 0\n // 2 lines are equal if a1/a2 = b1/b2 = c1/c2, where a, b, c are the coefficients in line equation\n // line equation knowing 2 points: (y - yA) / (yB - yA) = (x - xA) / (xB - xA)\n // extending this equation, we get: x * (yB - yA) + y * (xA - xB) + (xB * yA - xA * yB) = 0\n // where a = yB - yA; b = xA - xB; c = xB * yA - xA * yB\n const { a: a1, b: b1, c: c1 } = returnLineEquationCoefficients(line1);\n const { a: a2, b: b2, c: c2 } = returnLineEquationCoefficients(line2);\n const proportions = [];\n if (a2 !== 0) {\n proportions.push(getSignificantDecimals(a1 / a2));\n } else if (a1 !== a2) {\n return false;\n }\n if (b2 !== 0) {\n proportions.push(getSignificantDecimals(b1 / b2));\n } else if (b1 !== b2) {\n return false;\n }\n if (c2 !== 0) {\n proportions.push(getSignificantDecimals(c1 / c2));\n } else if (c1 !== c2) {\n return false;\n }\n return lodash.uniq(proportions).length === 1 && line1.fill === line2.fill;\n // (y2 - y1)/(x2 - x1) = (y4 - y3)/(x4 - x3);\n // return ((Math.abs((line1.to.y - line1.from.y) / (line1.to.x - line1.from.x))) === (Math.abs((line2.to.y - line2.from.y) / (line2.to.x - line2.from.x))));\n};\n\n/*\n * Constant to construct segments from points\n * @param {Array} points - points\n * */\nexport const constructSegmentsFromPoints = (points) => {\n // takes the list of points that represent a polygon and transforms it into a list of segments; eg.:\n // points: A, B, C, D => segments: AB, BC, CD, DA\n return (points || []).map((point, index) => ({ from: point, to: points[(index + 1) % points.length] }));\n};\n\n/*\n * Constant to remove duplicate segments\n * @param {Array} segments - segments\n * */\nexport const removeDuplicateSegments = (segments) => {\n segments = segments || [];\n // removes segments that are duplicates; eg. These segments are the same, so one will be removed:\n // segment1: from: { x: 1, y: 1 }, to: { x: 2, y: 1 }\n // segment2: from: { x: 2, y: 1 }, to: { x: 1, y: 1 }\n return uniqWith(segments, (s1, s2) => equalSegment(s1, s2));\n};\n\n/*\n * Constant to remove invalid segments\n * @param {Array} segments - segments\n * */\nexport const removeInvalidSegments = (segments) => {\n segments = segments || [];\n // removes segments that start in a point and end in the same point (eg.: from: { x: 1, y: 1 }, to: { x: 1, y: 1 })\n return segments.filter((segment) => !isEqual(segment.from, segment.to));\n};\n\n/*\n * Constant to check equal polygons\n * @param {Object} poly1 - polygon 1 points\n * @param {Object} poly2 - polygon 2 points\n * */\nexport const equalPolygon = (poly1, poly2) => {\n const { points: points1 } = poly1;\n const { points: points2 } = poly2;\n // generate segments\n const segments1 = constructSegmentsFromPoints(points1);\n const segments2 = constructSegmentsFromPoints(points2);\n const segments1NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments1));\n const segments2NoDuplicates = removeDuplicateSegments(removeInvalidSegments(segments2));\n const differentSegments1 = differenceWith(segments1NoDuplicates, segments2NoDuplicates, equalSegment);\n const differentSegments2 = differenceWith(segments2NoDuplicates, segments1NoDuplicates, equalSegment);\n return (!differentSegments1 || !differentSegments1.length) && (!differentSegments2 || !differentSegments2.length);\n};\n\n/*\n * Constant to compare equal marks\n * */\nexport const equalMarks = {\n line: (sessAnswer, mark) => equalLine(sessAnswer, mark),\n polygon: (sessAnswer, poly) => equalPolygon(sessAnswer, poly),\n};\n\n/*\n * Check if a point is correct and complete\n * @param {Object} point - point object\n * */\nconst completePoint = (point) => point && Number.isFinite(point.x) && Number.isFinite(point.y);\n\n/*\n * Check if a line is complete\n * @param {Object} item - mark object\n * */\nconst completeFromTo = (item) => item && completeMark.point(item.from) && completeMark.point(item.to);\n\n/*\n * Check if a point is correct and complete\n * @param {Object} item - mark object\n * */\nconst completePoints = (item) =>\n item &&\n item.points &&\n item.points.length &&\n (item.points.filter((point) => completePoint(point)) || []).length === item.points.length;\n\n/*\n * Complete mark object for line and point\n * */\nconst completeMark = {\n point: completePoint,\n line: completeFromTo,\n polygon: completePoints,\n};\n\n/*\n * Function to remove invalid answers\n * @param {Array} answers - answers array\n * */\nexport const removeInvalidAnswers = (answers) =>\n answers\n ? (answers || []).filter(({ type, ...answer }) => (completeMark[type] ? completeMark[type](answer) : false))\n : [];\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,eAAA,GAAAJ,sBAAA,CAAAC,OAAA;A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C9B,CAAC,CAAC,IAAI0D,MAAM,CAACC,QAAQ,CAAC7B,KAAK,CAAC5B,CAAC,CAAC;;AAE9F;AACA;AACA;AACA;AACA,MAAM0D,cAAc,GAAIC,IAAI,IAAKA,IAAI,IAAIC,YAAY,CAAChC,KAAK,CAAC+B,IAAI,CAAC3E,IAAI,CAAC,IAAI4E,YAAY,CAAChC,KAAK,CAAC+B,IAAI,CAAC1E,EAAE,CAAC;;AAErG;AACA;AACA;AACA;AACA,MAAM4E,cAAc,GAAIF,IAAI,IAC1BA,IAAI,IACJA,IAAI,CAACjC,MAAM,IACXiC,IAAI,CAACjC,MAAM,CAACH,MAAM,IAClB,CAACoC,IAAI,CAACjC,MAAM,CAACU,MAAM,CAAER,KAAK,IAAK2B,aAAa,CAAC3B,KAAK,CAAC,CAAC,IAAI,EAAE,EAAEL,MAAM,KAAKoC,IAAI,CAACjC,MAAM,CAACH,MAAM;;AAE3F;AACA;AACA;AACA,MAAMqC,YAAY,GAAG;EACnBhC,KAAK,EAAE2B,aAAa;EACpB3D,IAAI,EAAE8D,cAAc;EACpBL,OAAO,EAAEQ;AACX,CAAC;;AAED;AACA;AACA;AACA;AACO,MAAMC,oBAAoB,GAAI1E,OAAO,IAC1CA,OAAO,GACH,CAACA,OAAO,IAAI,EAAE,EAAEgD,MAAM,CAAC,CAAC;EAAE2B,IAAI;EAAE,GAAGC;AAAO,CAAC,KAAMJ,YAAY,CAACG,IAAI,CAAC,GAAGH,YAAY,CAACG,IAAI,CAAC,CAACC,MAAM,CAAC,GAAG,KAAM,CAAC,GAC1G,EAAE;AAAC9E,OAAA,CAAA4E,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
package/controller/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/graphing-solution-set-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0-beta.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"debug": "^4.1.1"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"babel-jest": "^
|
|
15
|
+
"babel-jest": "^29.7.0",
|
|
16
16
|
"babel-preset-env": "^1.6.1",
|
|
17
17
|
"babel-preset-stage-0": "^6.24.1",
|
|
18
|
-
"jest": "^
|
|
18
|
+
"jest": "^29.7.0"
|
|
19
19
|
},
|
|
20
20
|
"author": "",
|
|
21
21
|
"license": "ISC"
|