math-exercises 3.0.21 → 3.0.23
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/lib/exercises/exercise.d.ts +2 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +60 -28
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.js +5 -3
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +5 -3
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.js +14 -3
- package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expFactorization.js +5 -2
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +30 -29
- package/lib/exercises/math/geometry/euclidian/index.d.ts +1 -1
- package/lib/exercises/math/geometry/euclidian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/index.js +1 -2
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts +9 -0
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +205 -187
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +47 -16
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +3 -3
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts +2 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts +11 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +141 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/index.js +1 -0
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +38 -26
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.d.ts +2 -0
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +6 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/segment.d.ts +6 -2
- package/lib/math/geometry/segment.d.ts.map +1 -1
- package/lib/math/geometry/segment.js +11 -6
- package/lib/math/geometry/spacePoint.d.ts +2 -1
- package/lib/math/geometry/spacePoint.d.ts.map +1 -1
- package/lib/math/geometry/spacePoint.js +16 -2
- package/lib/math/geometry/triangle.d.ts +2 -1
- package/lib/math/geometry/triangle.d.ts.map +1 -1
- package/lib/math/geometry/triangle.js +31 -13
- package/lib/math/spaceGeometry/prism.d.ts +4 -0
- package/lib/math/spaceGeometry/prism.d.ts.map +1 -0
- package/lib/math/spaceGeometry/prism.js +3 -0
- package/lib/tree/nodes/algebraicNode.d.ts +4 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.d.ts +2 -2
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +4 -1
- package/lib/tree/nodes/functions/sinNode.d.ts +2 -2
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +4 -1
- package/lib/tree/nodes/functions/tanNode.d.ts +2 -2
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +4 -1
- package/package.json +1 -1
|
@@ -1,187 +1,205 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
// };
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
//
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
//
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { Angle } from "../../../../math/geometry/angle.js";
|
|
5
|
+
import { PointConstructor, } from "../../../../math/geometry/point.js";
|
|
6
|
+
import { RightTriangleConstructor } from "../../../../math/geometry/rightTriangle.js";
|
|
7
|
+
import { Segment, } from "../../../../math/geometry/segment.js";
|
|
8
|
+
import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangle.js";
|
|
9
|
+
import { VectorConstructor } from "../../../../math/geometry/vector.js";
|
|
10
|
+
import { round } from "../../../../math/utils/round.js";
|
|
11
|
+
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
12
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
13
|
+
const getPropositions = (n, { answer }) => {
|
|
14
|
+
const propositions = [];
|
|
15
|
+
addValidProp(propositions, answer, "raw");
|
|
16
|
+
tryToAddWrongProp(propositions, "Le théorème de Thalès", "raw");
|
|
17
|
+
tryToAddWrongProp(propositions, "La réciproque du théorème de Thalès", "raw");
|
|
18
|
+
tryToAddWrongProp(propositions, "Le théorème de Pythagore", "raw");
|
|
19
|
+
tryToAddWrongProp(propositions, "La réciproque du théorème de Pythagore", "raw");
|
|
20
|
+
return shuffleProps(propositions, n);
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
const { isAskingLength, isSegmentHeight } = identifiers;
|
|
24
|
+
return isSegmentHeight
|
|
25
|
+
? isAskingLength
|
|
26
|
+
? "Le théorème de Pythagore"
|
|
27
|
+
: "La réciproque du théorème de Pythagore"
|
|
28
|
+
: isAskingLength
|
|
29
|
+
? "Le théorème de Thalès"
|
|
30
|
+
: "La réciproque du théorème de Thalès";
|
|
31
|
+
};
|
|
32
|
+
const getInstruction = (identifiers) => {
|
|
33
|
+
const { isAskingLength, pointsIdentifiers, isSegmentHeight } = identifiers;
|
|
34
|
+
const points = pointsIdentifiers.map((p) => PointConstructor.fromIdentifiers(p));
|
|
35
|
+
let instruction = ``;
|
|
36
|
+
if (isSegmentHeight) {
|
|
37
|
+
if (isAskingLength) {
|
|
38
|
+
instruction = `calculer la longueur $${points[0].name}${points[1].name}$`;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
instruction = `prouver que le triangle $${points[1].name}${points[2].name}${points[3].name}$ est rectangle en $${points[3].name}$`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
if (isAskingLength) {
|
|
46
|
+
instruction = `calculer la longueur $${points[1].name}${points[3].name}$`;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
instruction = `prouver que les droites $\\left(${points[1].name}${points[3].name}\\right)$ et $\\left(${points[0].name}${points[4].name}\\right)$ sont parallèles`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return `On donne la figure ci-dessous${!isSegmentHeight && isAskingLength
|
|
53
|
+
? `, où les droites $\\left(${points[1].name}${points[3].name}\\right)$ et $\\left(${points[0].name}${points[4].name}\\right)$ sont parallèles.`
|
|
54
|
+
: "."}
|
|
55
|
+
|
|
56
|
+
Pour ${instruction}, il faut utiliser... `;
|
|
57
|
+
};
|
|
58
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
59
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
60
|
+
const getGGBOptions = (identifiers) => {
|
|
61
|
+
const { isAskingLength, lengths, pointsIdentifiers, isSegmentHeight } = identifiers;
|
|
62
|
+
const points = pointsIdentifiers.map((p) => PointConstructor.fromIdentifiers(p));
|
|
63
|
+
let segments;
|
|
64
|
+
if (isSegmentHeight) {
|
|
65
|
+
const withoutA = points.slice(1);
|
|
66
|
+
segments = withoutA.map((p, i) => new Segment(p, withoutA[(i + 1) % 3], {
|
|
67
|
+
lengthNode: new NumberNode(lengths[i]),
|
|
68
|
+
}));
|
|
69
|
+
segments.push(new Segment(points[3], points[0], {
|
|
70
|
+
lengthNode: new NumberNode(lengths[3]),
|
|
71
|
+
}));
|
|
72
|
+
segments.push(new Segment(points[0], points[1]));
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
segments = points.map((p, i) => new Segment(p, points[(i + 1) % points.length], {
|
|
76
|
+
lengthNode: new NumberNode(lengths[i]),
|
|
77
|
+
}));
|
|
78
|
+
segments.push(new Segment(points[1], points[3]));
|
|
79
|
+
}
|
|
80
|
+
const commands = [
|
|
81
|
+
...points.flatMap((p) => p.toGGBCommand()),
|
|
82
|
+
...segments.flatMap((s, i) => s.toGGBCommands(false, { color: "grey", thickness: 3 })),
|
|
83
|
+
...segments
|
|
84
|
+
.slice(0, segments.length - 1)
|
|
85
|
+
.flatMap((s, i) => s.getFitCaptionCommands({ size: "scriptsize", color: "red" })),
|
|
86
|
+
...(isAskingLength && isSegmentHeight
|
|
87
|
+
? new Angle([points[1], points[3], points[0]]).toCommands()
|
|
88
|
+
: []),
|
|
89
|
+
];
|
|
90
|
+
const ggb = new GeogebraConstructor({
|
|
91
|
+
commands,
|
|
92
|
+
hideAxes: true,
|
|
93
|
+
hideGrid: true,
|
|
94
|
+
});
|
|
95
|
+
return ggb.getOptions({
|
|
96
|
+
coords: ggb.getCoordsForPoints(points),
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
const getKeys = (identifiers) => {
|
|
100
|
+
return [];
|
|
101
|
+
};
|
|
102
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
103
|
+
throw Error("VEA not implemented");
|
|
104
|
+
};
|
|
105
|
+
const getPythagoreOrThalesQuestion = (opts) => {
|
|
106
|
+
const isSegmentHeight = coinFlip();
|
|
107
|
+
const isAskingLength = coinFlip();
|
|
108
|
+
let points;
|
|
109
|
+
let lengths;
|
|
110
|
+
const triangle = isSegmentHeight
|
|
111
|
+
? RightTriangleConstructor.randomNiceSides({ names: ["D", "B", "C"] })
|
|
112
|
+
: TriangleConstructor.randomNiceSides({ minAngle: 40 });
|
|
113
|
+
const summitNames = triangle.points.map((p) => p.name);
|
|
114
|
+
if (isSegmentHeight) {
|
|
115
|
+
const triangle = RightTriangleConstructor.randomNiceSides({
|
|
116
|
+
names: ["D", "B", "C"],
|
|
117
|
+
});
|
|
118
|
+
const ratio = round(0.4 + Math.random() * 0.2, 1);
|
|
119
|
+
const triangleLengths = triangle.sides.map((s) => s.getLength());
|
|
120
|
+
const A = VectorConstructor.fromPoints(triangle.points[2], triangle.points[0])
|
|
121
|
+
.times(ratio.toTree())
|
|
122
|
+
.getEndPoint(triangle.points[0], "A");
|
|
123
|
+
points = [A, triangle.points[1], triangle.points[2], triangle.points[0]];
|
|
124
|
+
lengths = [
|
|
125
|
+
round(triangleLengths[0], 2),
|
|
126
|
+
round(triangleLengths[1], 2),
|
|
127
|
+
round(triangleLengths[2], 2),
|
|
128
|
+
round(A.distanceTo(triangle.points[0]), 2),
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
const triangle = TriangleConstructor.randomNiceSides({ minAngle: 40 });
|
|
133
|
+
const ratio = round(0.4 + Math.random() * 0.2, 1);
|
|
134
|
+
const dName = "D";
|
|
135
|
+
const eName = "E";
|
|
136
|
+
const subTriangle = getSubTriangle({
|
|
137
|
+
triangle,
|
|
138
|
+
insidePointsNames: [dName, eName],
|
|
139
|
+
ratio,
|
|
140
|
+
isPapillon: false,
|
|
141
|
+
});
|
|
142
|
+
const triangleLengths = triangle.sides.map((s) => s.getLength());
|
|
143
|
+
const subTriangleLengths = subTriangle.sides.map((s) => s.getLength());
|
|
144
|
+
points = [
|
|
145
|
+
triangle.points[0],
|
|
146
|
+
subTriangle.points[0],
|
|
147
|
+
triangle.points[1],
|
|
148
|
+
subTriangle.points[2],
|
|
149
|
+
triangle.points[2],
|
|
150
|
+
];
|
|
151
|
+
lengths = [
|
|
152
|
+
round(triangleLengths[2] - subTriangleLengths[2], 2),
|
|
153
|
+
round(subTriangleLengths[2], 2),
|
|
154
|
+
round(subTriangleLengths[0], 2),
|
|
155
|
+
round(triangleLengths[0] - subTriangleLengths[0], 2),
|
|
156
|
+
round(triangleLengths[1], 2),
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
const identifiers = {
|
|
160
|
+
lengths,
|
|
161
|
+
pointsIdentifiers: points.map((p) => p.toIdentifiers()),
|
|
162
|
+
isAskingLength,
|
|
163
|
+
isSegmentHeight,
|
|
164
|
+
};
|
|
165
|
+
const question = {
|
|
166
|
+
answer: getAnswer(identifiers),
|
|
167
|
+
instruction: getInstruction(identifiers),
|
|
168
|
+
keys: getKeys(identifiers),
|
|
169
|
+
answerFormat: "raw",
|
|
170
|
+
identifiers,
|
|
171
|
+
// hint: getHint(identifiers),
|
|
172
|
+
// correction: getCorrection(identifiers),
|
|
173
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
174
|
+
};
|
|
175
|
+
return question;
|
|
176
|
+
};
|
|
177
|
+
export const pythagoreOrThales = {
|
|
178
|
+
id: "pythagoreOrThales",
|
|
179
|
+
label: "Choisir entre Thalès, Pythagore et leurs réciproques",
|
|
180
|
+
isSingleStep: true,
|
|
181
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPythagoreOrThalesQuestion(opts), nb),
|
|
182
|
+
qcmTimer: 60,
|
|
183
|
+
freeTimer: 60,
|
|
184
|
+
getPropositions,
|
|
185
|
+
isAnswerValid,
|
|
186
|
+
subject: "Mathématiques",
|
|
187
|
+
// getHint,
|
|
188
|
+
// getCorrection,
|
|
189
|
+
getInstruction,
|
|
190
|
+
getAnswer,
|
|
191
|
+
getGGBOptions,
|
|
192
|
+
hasGeogebra: true,
|
|
193
|
+
answerType: "QCU",
|
|
194
|
+
};
|
|
195
|
+
const getSubTriangle = ({ triangle, insidePointsNames, ratio, isPapillon, }) => {
|
|
196
|
+
const [A, B, C] = triangle.points;
|
|
197
|
+
const [dName, eName] = insidePointsNames;
|
|
198
|
+
const vecAB = VectorConstructor.fromPoints(A, B).times((1 - ratio).toTree());
|
|
199
|
+
const pointD = vecAB.getEndPoint(A, dName);
|
|
200
|
+
const vecCB = VectorConstructor.fromPoints(C, B).times((1 - ratio).toTree());
|
|
201
|
+
const pointE = vecCB.getEndPoint(C, eName);
|
|
202
|
+
return new Triangle([pointD, triangle.points[1], pointE], {
|
|
203
|
+
sidesLengths: triangle.sides.map((s) => round(s.getLength() * Math.abs(ratio), 2).toTree()),
|
|
204
|
+
});
|
|
205
|
+
};
|
|
@@ -8,6 +8,7 @@ export * from "./convexity/index.js";
|
|
|
8
8
|
export * from "./volumes/index.js";
|
|
9
9
|
export * from "./euclidianConstructions/index.js";
|
|
10
10
|
export * from "./shapes/index.js";
|
|
11
|
+
export * from "./euclidian/index.js";
|
|
11
12
|
export * from "./parametric/index.js";
|
|
12
13
|
export * from "./quadrilaterals/index.js";
|
|
13
14
|
export * from "./angles/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
|
@@ -9,7 +9,7 @@ export * from "./volumes/index.js";
|
|
|
9
9
|
// export * from "./triangles.js";
|
|
10
10
|
export * from "./euclidianConstructions/index.js";
|
|
11
11
|
export * from "./shapes/index.js";
|
|
12
|
-
|
|
12
|
+
export * from "./euclidian/index.js";
|
|
13
13
|
export * from "./parametric/index.js";
|
|
14
14
|
export * from "./quadrilaterals/index.js";
|
|
15
15
|
export * from "./angles/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAqBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAQzC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAqBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAQzC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA8DF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBvD,CAAC"}
|
|
@@ -83,7 +83,7 @@ const getGGBOptions = (identifiers) => {
|
|
|
83
83
|
const seg = new Segment(points[0], points[1]);
|
|
84
84
|
const commands = [
|
|
85
85
|
...triangle.commands,
|
|
86
|
-
...points.flatMap((p) => p.toGGBCommand({
|
|
86
|
+
...points.flatMap((p) => p.toGGBCommand({ color: "#444444", size: 4 })),
|
|
87
87
|
...seg.toGGBCommands(false),
|
|
88
88
|
];
|
|
89
89
|
if (identifiers.isPapillon) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polynomialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/polynomialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"polynomialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/polynomialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiBF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAcjE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAexE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,GAAG,CAAC,WAAW,CA8B7D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAWrD,CAAC"}
|
|
@@ -2,19 +2,34 @@ import { addValidProp, tryToAddWrongProp, } from "../../../exercises/exercise.js
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/polynomial.js";
|
|
4
4
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
5
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
5
6
|
import { shuffle } from "../../../utils/alea/shuffle.js";
|
|
7
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
8
|
+
const getInstruction = (identifiers) => {
|
|
9
|
+
const polynomial = new Polynomial(identifiers.coeffs);
|
|
10
|
+
return `Déterminer la forme générale des primitives de la fonction polynomiale $f$ définie par :
|
|
11
|
+
|
|
12
|
+
$$
|
|
13
|
+
f(x) = ${polynomial.toTex()}
|
|
14
|
+
$$`;
|
|
15
|
+
};
|
|
16
|
+
const getAnswer = (identifiers) => {
|
|
17
|
+
const polynomial = new Polynomial(identifiers.coeffs);
|
|
18
|
+
const integralPolynomial = polynomial.integrateToNode();
|
|
19
|
+
const answer = `${integralPolynomial.toTex()}`;
|
|
20
|
+
return answer;
|
|
21
|
+
};
|
|
6
22
|
export const getPolynomialPrimitive = () => {
|
|
7
23
|
const degree = randint(1, 4);
|
|
8
24
|
const polynomial = PolynomialConstructor.randomWithOrder(degree);
|
|
9
|
-
const
|
|
10
|
-
const answer = `${integralPolynomial.toTex()}`;
|
|
25
|
+
const identifiers = { coeffs: polynomial.coefficients };
|
|
11
26
|
const question = {
|
|
12
|
-
instruction:
|
|
27
|
+
instruction: getInstruction(identifiers),
|
|
13
28
|
startStatement: `F(x)`,
|
|
14
|
-
answer,
|
|
29
|
+
answer: getAnswer(identifiers),
|
|
15
30
|
keys: ["x", "C"],
|
|
16
31
|
answerFormat: "tex",
|
|
17
|
-
identifiers
|
|
32
|
+
identifiers,
|
|
18
33
|
};
|
|
19
34
|
return question;
|
|
20
35
|
};
|
|
@@ -28,22 +43,38 @@ export const getPolynomialPrimitivePropositions = (n, { answer, coeffs }) => {
|
|
|
28
43
|
}
|
|
29
44
|
return shuffle(propositions);
|
|
30
45
|
};
|
|
31
|
-
export const isPolynomialPrimitiveAnswerValid = (ans, { coeffs }) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
export const isPolynomialPrimitiveAnswerValid = (ans, { coeffs, answer }) => {
|
|
47
|
+
try {
|
|
48
|
+
const parsed = parseAlgebraic(ans);
|
|
49
|
+
if (!parsed)
|
|
50
|
+
return false;
|
|
51
|
+
// console.log(
|
|
52
|
+
// parsed
|
|
53
|
+
// .simplify({
|
|
54
|
+
// towardsDistribute: true,
|
|
55
|
+
// forbidFactorize: true,
|
|
56
|
+
// decimalToFractions: true,
|
|
57
|
+
// forceDistributeFractions: true,
|
|
58
|
+
// forceIsolateMonomCoeffs: true,
|
|
59
|
+
// })
|
|
60
|
+
// .toTex(),
|
|
61
|
+
// );
|
|
62
|
+
return (parsed
|
|
63
|
+
.simplify({
|
|
64
|
+
towardsDistribute: true,
|
|
65
|
+
forbidFactorize: true,
|
|
66
|
+
forceDistributeFractions: true,
|
|
67
|
+
})
|
|
68
|
+
.toTex() === answer);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
return handleVEAError(err);
|
|
72
|
+
}
|
|
40
73
|
};
|
|
41
74
|
export const polynomialPrimitive = {
|
|
42
75
|
id: "polynomialPrimitive",
|
|
43
76
|
connector: "=",
|
|
44
77
|
label: "Primitive d'une fonction polynomiale",
|
|
45
|
-
levels: ["TermSpé", "MathComp"],
|
|
46
|
-
sections: ["Primitives"],
|
|
47
78
|
isSingleStep: false,
|
|
48
79
|
generator: (nb) => getDistinctQuestions(getPolynomialPrimitive, nb),
|
|
49
80
|
qcmTimer: 60,
|
|
@@ -46,9 +46,9 @@ const getAnswer = (identifiers) => {
|
|
|
46
46
|
};
|
|
47
47
|
const getProbaFromTableWithContextQuestion = () => {
|
|
48
48
|
const aCapB = randint(1, 20);
|
|
49
|
-
const aCapBBarre = randint(1, 20);
|
|
50
|
-
const aBarreCapB = randint(1, 20);
|
|
51
|
-
const aBarreCapBBarre = randint(1, 20);
|
|
49
|
+
const aCapBBarre = randint(1, 20, [aCapB]);
|
|
50
|
+
const aBarreCapB = randint(1, 20, [aCapB, aCapBBarre]);
|
|
51
|
+
const aBarreCapBBarre = randint(1, 20, [aCapB, aCapBBarre, aBarreCapB]);
|
|
52
52
|
const total = aBarreCapB + aBarreCapBBarre + aCapB + aCapBBarre;
|
|
53
53
|
const aTotal = aCapB + aCapBBarre;
|
|
54
54
|
const bTotal = aCapB + aBarreCapB;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./spaceCoordinatesInPrism.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
l: number;
|
|
4
|
+
L: number;
|
|
5
|
+
h: number;
|
|
6
|
+
askedPoint: string;
|
|
7
|
+
givenPoints: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare const spaceCoordinatesInPrism: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=spaceCoordinatesInPrism.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceCoordinatesInPrism.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA0IF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAiBzD,CAAC"}
|