math-exercises 3.0.135 → 3.0.137

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.
Files changed (47) hide show
  1. package/lib/exercises/math/calcul/decimals/decimalFractionToDecimal.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/decimals/decimalFractionToDecimal.js +0 -2
  3. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -1
  4. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +0 -14
  5. package/lib/exercises/math/calculLitteral/factorisation/factoType3.d.ts +12 -0
  6. package/lib/exercises/math/calculLitteral/factorisation/factoType3.d.ts.map +1 -0
  7. package/lib/exercises/math/calculLitteral/factorisation/factoType3.js +115 -0
  8. package/lib/exercises/math/calculLitteral/factorisation/factoType4.d.ts +12 -0
  9. package/lib/exercises/math/calculLitteral/factorisation/factoType4.d.ts.map +1 -0
  10. package/lib/exercises/math/calculLitteral/factorisation/factoType4.js +112 -0
  11. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +2 -0
  12. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  13. package/lib/exercises/math/calculLitteral/factorisation/index.js +2 -0
  14. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts +1 -0
  15. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts.map +1 -1
  16. package/lib/exercises/math/derivation/derivative/sqrt/index.js +1 -1
  17. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts.map +1 -1
  18. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.js +83 -26
  19. package/lib/exercises/math/geometry/cartesian/index.d.ts +0 -1
  20. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  21. package/lib/exercises/math/geometry/cartesian/index.js +1 -1
  22. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.d.ts.map +1 -1
  23. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.js +1 -2
  24. package/lib/exercises/math/geometry/euclidianConstructions/index.js +2 -0
  25. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromHomothety.d.ts +16 -0
  26. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromHomothety.d.ts.map +1 -0
  27. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromHomothety.js +241 -0
  28. package/lib/exercises/math/geometry/euclidianConstructions/segmentImageFromHomothety.d.ts +16 -0
  29. package/lib/exercises/math/geometry/euclidianConstructions/segmentImageFromHomothety.d.ts.map +1 -0
  30. package/lib/exercises/math/geometry/euclidianConstructions/segmentImageFromHomothety.js +258 -0
  31. package/lib/geogebra/parsers/geogebraParser.d.ts +1 -0
  32. package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
  33. package/lib/geogebra/parsers/geogebraParser.js +38 -0
  34. package/lib/index.d.ts +17 -8
  35. package/lib/index.d.ts.map +1 -1
  36. package/lib/latexTester.d.ts.map +1 -1
  37. package/lib/latexTester.js +1 -0
  38. package/lib/math/utils/functions/functionComparison.d.ts.map +1 -1
  39. package/lib/math/utils/functions/functionComparison.js +0 -4
  40. package/lib/math/utils/functions/functionComposition.d.ts.map +1 -1
  41. package/lib/math/utils/functions/functionComposition.js +0 -10
  42. package/lib/math/utils/functions/functionDecomposition.d.ts.map +1 -1
  43. package/lib/math/utils/functions/functionDecomposition.js +0 -42
  44. package/lib/utils/arrays/arrayIntersection.d.ts +2 -0
  45. package/lib/utils/arrays/arrayIntersection.d.ts.map +1 -0
  46. package/lib/utils/arrays/arrayIntersection.js +8 -0
  47. package/package.json +1 -1
@@ -0,0 +1,241 @@
1
+ import { GeneratorOptionType, GeneratorOptionTarget, } from "../../../../exercises/exercise.js";
2
+ import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
3
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
4
+ import { red } from "../../../../geogebra/colors.js";
5
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
6
+ import { approxEqual } from "../../../../geogebra/parsers/approxEqual.js";
7
+ import { ggbPointToCoords } from "../../../../geogebra/parsers/ggbPointToCoords.js";
8
+ import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
9
+ import { VectorConstructor } from "../../../../math/geometry/vector.js";
10
+ import { randint } from "../../../../math/utils/random/randint.js";
11
+ import { round } from "../../../../math/utils/round.js";
12
+ import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
13
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
14
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
15
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
16
+ import { random, randomMany } from "../../../../utils/alea/random.js";
17
+ import { doWhile } from "../../../../utils/doWhile.js";
18
+ const getDivisorsOfVector = (vec) => {
19
+ return [2, 3, 4, 5, 7, 8, 9].filter((n) => [vec.x, vec.y].every((z) => z.evaluate() % n === 0));
20
+ };
21
+ const getRandomFactorNodeForVector = (vec, isPositiveFactorOnly = false, excludes = [], factorType) => {
22
+ let factorNode;
23
+ const divisorsOfVec = getDivisorsOfVector(vec);
24
+ if (divisorsOfVec.length > 0) {
25
+ switch (factorType) {
26
+ case "nombre à virgule":
27
+ {
28
+ let counter = -1;
29
+ let isFound = false;
30
+ while (!isFound && counter < 100) {
31
+ counter++;
32
+ const den = random(divisorsOfVec);
33
+ const num = randint(1, 3 * den, [den]);
34
+ const fracNode = frac(num, den);
35
+ const value = fracNode.evaluate();
36
+ if (round(value, 3) === value) {
37
+ factorNode = value.toTree();
38
+ isFound = true;
39
+ }
40
+ }
41
+ if (!isFound) {
42
+ factorNode = (2).toTree();
43
+ }
44
+ }
45
+ break;
46
+ default:
47
+ case "fraction":
48
+ {
49
+ const den = random(divisorsOfVec);
50
+ const num = randint(1, 3 * den, [den]);
51
+ factorNode = frac(num, den);
52
+ }
53
+ break;
54
+ }
55
+ }
56
+ else {
57
+ factorNode = randint(1, 5, excludes).toTree();
58
+ }
59
+ return multiply(isPositiveFactorOnly ? 1 : coinFlip() ? 1 : -1, factorNode);
60
+ };
61
+ const getInstruction = (identifiers) => {
62
+ const { nameTargetPoint, nameCenterPoint, factor } = identifiers;
63
+ const factorNode = NodeConstructor.fromIdentifiers(factor);
64
+ return `Placer l'image du point $${nameTargetPoint}$ par l'homothétie de centre $${nameCenterPoint}$ et de rapport $${factorNode.toTex()}$.`;
65
+ };
66
+ const getStartPoint = (identifiers) => {
67
+ const { pointsDict, nameCenterPoint } = identifiers;
68
+ return PointConstructor.fromIdentifiers(pointsDict[nameCenterPoint]);
69
+ };
70
+ const getEndPoint = (identifiers) => {
71
+ const { pointsDict, nameCenterPoint, nameTargetPoint, factor } = identifiers;
72
+ const [pointCenter, pointTarget] = [nameCenterPoint, nameTargetPoint].map((name) => PointConstructor.fromIdentifiers(pointsDict[name]));
73
+ const factorNode = NodeConstructor.fromIdentifiers(factor);
74
+ const vec1 = VectorConstructor.fromPoints(pointCenter, pointTarget);
75
+ const vec2 = vec1.times(factorNode);
76
+ return vec2.getEndPoint(pointCenter, "K");
77
+ };
78
+ const getHint = (identifiers) => {
79
+ const { factor, nameCenterPoint, nameTargetPoint } = identifiers;
80
+ const factorNode = NodeConstructor.fromIdentifiers(factor);
81
+ const isPositiveFactor = factorNode.evaluate() > 0;
82
+ return isPositiveFactor
83
+ ? `Le rapport de l'homothétie est positif.
84
+ On se place à partir du centre de l'homothétie, le point $${nameCenterPoint}$.
85
+ On se déplace dans le même sens que le déplacement de $${nameCenterPoint}$ vers $${nameTargetPoint}$.`
86
+ : `Le rapport de l'homothétie est négatif.
87
+ On se place à partir du centre de l'homothétie, le point $${nameCenterPoint}$.
88
+ On se déplace dans le même sens que le déplacement de $${nameTargetPoint}$ vers $${nameCenterPoint}$.`;
89
+ };
90
+ const getCorrection = (identifiers) => {
91
+ const { factor, nameCenterPoint, nameTargetPoint } = identifiers;
92
+ const factorNode = NodeConstructor.fromIdentifiers(factor);
93
+ const isPositiveFactor = factorNode.evaluate() > 0;
94
+ return isPositiveFactor
95
+ ? `On se place à partir du centre de l'homothétie, le point $${nameCenterPoint}$.
96
+ On se déplace dans le même sens que le déplacement de $${nameCenterPoint}$ vers $${nameTargetPoint}$.
97
+ On s'arrête quand on a parcouru la distance $${factorNode.toTex()} \\times ${nameCenterPoint}${nameTargetPoint}$.`
98
+ : `On se place à partir du centre de l'homothétie, le point $${nameCenterPoint}$.
99
+ On se déplace dans le même sens que le déplacement de $${nameTargetPoint}$ vers $${nameCenterPoint}$.
100
+ On s'arrête quand on a parcouru la distance $${multiply(-1, factorNode)
101
+ .simplify()
102
+ .toTex()} \\times ${nameCenterPoint}${nameTargetPoint}$.`;
103
+ };
104
+ const getGGBAnswer = (identifiers) => {
105
+ const startPoint = getStartPoint(identifiers);
106
+ const endPoint = getEndPoint(identifiers);
107
+ return [
108
+ ...endPoint.toGGBCommand(),
109
+ `a = Vector(${startPoint.name}, ${endPoint.name})`,
110
+ `SetColor(a, "${red}")`,
111
+ ];
112
+ };
113
+ const getStudentGGBOptions = (identifiers) => {
114
+ const points = Object.values(identifiers.pointsDict).map((p) => PointConstructor.fromIdentifiers(p));
115
+ const ggb = new GeogebraConstructor({
116
+ hideAxes: true,
117
+ isGridSimple: true,
118
+ customToolBar: toolBarConstructor({ point: true }),
119
+ commands: points.flatMap((p) => p.toGGBCommand({
120
+ size: 3,
121
+ style: 1,
122
+ })),
123
+ fontSize: 16,
124
+ });
125
+ const endPoint = getEndPoint(identifiers);
126
+ return ggb.getOptions({
127
+ coords: ggb.getCoordsForPoints([...points, endPoint]),
128
+ });
129
+ };
130
+ const isGGBAnswerValid = (ans, { ggbAnswer }) => {
131
+ const studentAns = ans;
132
+ if (studentAns.length !== 1)
133
+ return false;
134
+ const studentPoint = studentAns[0].split("=")[1];
135
+ if (studentPoint === undefined)
136
+ return false;
137
+ const coords = ggbPointToCoords(studentPoint);
138
+ const coordsAns = ggbPointToCoords(ggbAnswer[0].split("=")[1]);
139
+ return (approxEqual(coords.x, coordsAns.x, 0.2) &&
140
+ approxEqual(coords.y, coordsAns.y, 0.2));
141
+ };
142
+ const getPointImageFromHomothetyQuestion = (optsIn) => {
143
+ const opts = optsIn ?? optsDefault;
144
+ const { isPositiveFactorOnly, factorTypes } = opts;
145
+ const factorType = random(factorTypes);
146
+ function createRandomPoints() {
147
+ const points = [];
148
+ for (let i = 0; i < 4; i++) {
149
+ const name = String.fromCharCode(65 + i);
150
+ const newPoint = doWhile(() => PointConstructor.random(name, -3, 4), (p) => points.some((p2) => p.distanceTo(p2) < 2));
151
+ points.push(newPoint);
152
+ }
153
+ return points;
154
+ }
155
+ function createRandomIdentifiers(points) {
156
+ const [pointCenter, pointTarget] = randomMany(points, 2);
157
+ const vec1 = VectorConstructor.fromPoints(pointCenter, pointTarget);
158
+ const factorNode = getRandomFactorNodeForVector(vec1, isPositiveFactorOnly, [1], factorType).simplify();
159
+ const identifiers = {
160
+ pointsDict: Object.fromEntries(points.map((p) => [p.name, p.toIdentifiers()])),
161
+ nameTargetPoint: pointTarget.name,
162
+ nameCenterPoint: pointCenter.name,
163
+ factor: factorNode.toIdentifiers(),
164
+ };
165
+ return identifiers;
166
+ }
167
+ const pointOrigin = new Point("O", 0, 0);
168
+ const points = createRandomPoints();
169
+ let identifiers;
170
+ let counter = -1;
171
+ let isValidIdentifiers = false;
172
+ while (!isValidIdentifiers && counter < 100) {
173
+ counter++;
174
+ identifiers = createRandomIdentifiers(points);
175
+ isValidIdentifiers = (() => {
176
+ const endPoint = getEndPoint(identifiers);
177
+ return endPoint.distanceTo(pointOrigin) < 10;
178
+ })();
179
+ }
180
+ const defaultIdentifiers = {
181
+ pointsDict: Object.fromEntries([
182
+ new Point("A", 5, 0),
183
+ new Point("B", 0, 5),
184
+ new Point("C", -5, 0),
185
+ new Point("D", 0, -5),
186
+ ].map((point) => [point.name, point.toIdentifiers()])),
187
+ nameTargetPoint: "A",
188
+ nameCenterPoint: "B",
189
+ factor: frac(3, 5).toIdentifiers(),
190
+ };
191
+ return getQuestionFromIdentifiers(identifiers ?? defaultIdentifiers, opts);
192
+ };
193
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
194
+ const question = {
195
+ ggbAnswer: getGGBAnswer(identifiers, opts),
196
+ instruction: getInstruction(identifiers, opts),
197
+ studentGgbOptions: getStudentGGBOptions(identifiers, opts),
198
+ identifiers,
199
+ hint: getHint(identifiers, opts),
200
+ correction: getCorrection(identifiers, opts),
201
+ };
202
+ return question;
203
+ };
204
+ const options = [
205
+ {
206
+ id: "isPositiveFactorOnly",
207
+ label: "Rapports positifs uniquement",
208
+ type: GeneratorOptionType.checkbox,
209
+ target: GeneratorOptionTarget.generation,
210
+ defaultValue: false,
211
+ },
212
+ {
213
+ id: "factorTypes",
214
+ label: "Rapport: type de nombre",
215
+ type: GeneratorOptionType.multiselect,
216
+ target: GeneratorOptionTarget.generation,
217
+ values: ["fraction", "nombre à virgule"],
218
+ defaultValue: ["fraction", "nombre à virgule"],
219
+ },
220
+ ];
221
+ const optsDefault = {
222
+ isPositiveFactorOnly: false,
223
+ factorTypes: ["fraction", "nombre à virgule"],
224
+ };
225
+ export const pointImageFromHomothety = {
226
+ id: "pointImageFromHomothety",
227
+ label: "Placer l'image d'un point par une homothétie",
228
+ isSingleStep: true,
229
+ generator: (nb, opts) => getDistinctQuestions(() => getPointImageFromHomothetyQuestion(opts), nb),
230
+ ggbTimer: 60,
231
+ isGGBAnswerValid,
232
+ subject: "Mathématiques",
233
+ getHint,
234
+ getCorrection,
235
+ getGGBAnswer,
236
+ getStudentGGBOptions,
237
+ answerType: "GGB",
238
+ options,
239
+ getQuestionFromIdentifiers,
240
+ hasHintAndCorrection: true,
241
+ };
@@ -0,0 +1,16 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { PointIdentifiers } from "../../../../math/geometry/point.js";
3
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
4
+ type Identifiers = {
5
+ pointsDict: Record<string, PointIdentifiers>;
6
+ nameTargetPoints: string[];
7
+ nameCenterPoint: string;
8
+ factor: NodeIdentifiers;
9
+ };
10
+ type Options = {
11
+ isPositiveFactorOnly: boolean;
12
+ factorTypes: string[];
13
+ };
14
+ export declare const segmentImageFromHomothety: Exercise<Identifiers, Options>;
15
+ export {};
16
+ //# sourceMappingURL=segmentImageFromHomothety.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmentImageFromHomothety.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/segmentImageFromHomothety.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA4D7C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAgOF,KAAK,OAAO,GAAG;IACb,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAyBF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBpE,CAAC"}
@@ -0,0 +1,258 @@
1
+ import { GeneratorOptionType, GeneratorOptionTarget, } from "../../../../exercises/exercise.js";
2
+ import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
3
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
4
+ import { greenDark, greenMain, orange, purpleLight, } from "../../../../geogebra/colors.js";
5
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
6
+ import { GeogebraParser } from "../../../../geogebra/parsers/geogebraParser.js";
7
+ import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
8
+ import { VectorConstructor } from "../../../../math/geometry/vector.js";
9
+ import { randint } from "../../../../math/utils/random/randint.js";
10
+ import { round } from "../../../../math/utils/round.js";
11
+ import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
12
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
13
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
14
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
15
+ import { random, randomMany } from "../../../../utils/alea/random.js";
16
+ import { intersect } from "../../../../utils/arrays/arrayIntersection.js";
17
+ import { doWhile } from "../../../../utils/doWhile.js";
18
+ const getDivisorsOfVector = (vec) => {
19
+ return [2, 3, 4, 5, 7, 8, 9].filter((n) => [vec.x, vec.y].every((z) => z.evaluate() % n === 0));
20
+ };
21
+ const getRandomFactorNodeForVectors = (vecs, isPositiveFactorOnly = false, excludes = [], factorType) => {
22
+ let factorNode;
23
+ const divisorsOfVecs = intersect(vecs.map((vec) => getDivisorsOfVector(vec)));
24
+ if (divisorsOfVecs.length > 0) {
25
+ switch (factorType) {
26
+ case "nombre à virgule":
27
+ {
28
+ let counter = -1;
29
+ let isFound = false;
30
+ while (!isFound && counter < 100) {
31
+ counter++;
32
+ const den = random(divisorsOfVecs);
33
+ const num = randint(1, 3 * den, [den]);
34
+ const fracNode = frac(num, den);
35
+ const value = fracNode.evaluate();
36
+ if (round(value, 3) === value) {
37
+ factorNode = value.toTree();
38
+ isFound = true;
39
+ }
40
+ }
41
+ if (!isFound) {
42
+ factorNode = (2).toTree();
43
+ }
44
+ }
45
+ break;
46
+ default:
47
+ case "fraction":
48
+ {
49
+ const den = random(divisorsOfVecs);
50
+ const num = randint(1, 3 * den, [den]);
51
+ factorNode = frac(num, den);
52
+ }
53
+ break;
54
+ }
55
+ }
56
+ else {
57
+ factorNode = randint(1, 5, excludes).toTree();
58
+ }
59
+ return multiply(isPositiveFactorOnly ? 1 : coinFlip() ? 1 : -1, factorNode);
60
+ };
61
+ const getInstruction = (identifiers) => {
62
+ const { nameTargetPoints, nameCenterPoint, factor } = identifiers;
63
+ const factorNode = NodeConstructor.fromIdentifiers(factor);
64
+ return `Placer l'image du segment $[${nameTargetPoints[0]}${nameTargetPoints[1]}]$ par l'homothétie de centre $${nameCenterPoint}$ et de rapport $${factorNode.toTex()}$.`;
65
+ };
66
+ const getStartPoint = (identifiers) => {
67
+ const { pointsDict, nameCenterPoint } = identifiers;
68
+ return PointConstructor.fromIdentifiers(pointsDict[nameCenterPoint]);
69
+ };
70
+ const getEndPoints = (identifiers) => {
71
+ const { pointsDict, nameCenterPoint, nameTargetPoints, factor } = identifiers;
72
+ const [pointCenter, pointTarget1, pointTarget2] = [
73
+ nameCenterPoint,
74
+ ...nameTargetPoints,
75
+ ].map((name) => PointConstructor.fromIdentifiers(pointsDict[name]));
76
+ const factorNode = NodeConstructor.fromIdentifiers(factor);
77
+ return [pointTarget1, pointTarget2].map((pointTarget, i) => {
78
+ const vec1 = VectorConstructor.fromPoints(pointCenter, pointTarget);
79
+ const vec2 = vec1.times(factorNode);
80
+ return vec2.getEndPoint(pointCenter, `${nameTargetPoints[i]}'`);
81
+ });
82
+ };
83
+ const getHint = (identifiers) => {
84
+ const { nameTargetPoints } = identifiers;
85
+ return `Construis l'image de $${nameTargetPoints[0]}$, puis construis l'image de $${nameTargetPoints[1]}$ et enfin, relie les deux points.`;
86
+ };
87
+ const getCorrection = (identifiers) => {
88
+ const { factor, nameCenterPoint, nameTargetPoints } = identifiers;
89
+ const factorNode = NodeConstructor.fromIdentifiers(factor);
90
+ const isPositiveFactor = factorNode.evaluate() > 0;
91
+ return isPositiveFactor
92
+ ? `Pour placer l'image du segment, on place les images des deux extrémités.
93
+ On va placer l'image du point $${nameTargetPoints[0]}$.
94
+ On se place à partir du centre de l'homothétie, le point $${nameCenterPoint}$.
95
+ On se déplace dans le même sens que le déplacement de $${nameCenterPoint}$ vers $${nameTargetPoints[0]}$.
96
+ On s'arrête quand on a parcouru la distance $${factorNode.toTex()} \\times ${nameCenterPoint}${nameTargetPoints[0]}$.
97
+ On procède de la même façon pour $${nameTargetPoints[1]}$.`
98
+ : `Pour placer l'image du segment, on place les images des deux extrémités.
99
+ On va placer l'image du point $${nameTargetPoints[0]}$.
100
+ On se place à partir du centre de l'homothétie, le point $${nameCenterPoint}$.
101
+ On se déplace dans le même sens que le déplacement de $${nameTargetPoints[0]}$ vers $${nameCenterPoint}$.
102
+ On s'arrête quand on a parcouru la distance $${multiply(-1, factorNode)
103
+ .simplify()
104
+ .toTex()} \\times ${nameCenterPoint}${nameTargetPoints[0]}$.
105
+ On procède de la même façon pour $${nameTargetPoints[1]}$.`;
106
+ };
107
+ const getGGBAnswer = (identifiers) => {
108
+ const startPoint = getStartPoint(identifiers);
109
+ const endPoints = getEndPoints(identifiers);
110
+ return [
111
+ ...endPoints.flatMap((endPoint, i) => [
112
+ ...endPoint.toGGBCommand({ color: greenDark }),
113
+ `a_${i} = Vector(${startPoint.name}, ${endPoint.name})`,
114
+ `SetColor(a_${i}, "${purpleLight}")`,
115
+ ]),
116
+ `s2 = Segment(${endPoints.map((endPoint) => endPoint.name).join(",")})`,
117
+ `SetColor(s2, "${greenMain}")`,
118
+ ];
119
+ };
120
+ const getStudentGGBOptions = (identifiers) => {
121
+ const { nameTargetPoints } = identifiers;
122
+ const points = Object.values(identifiers.pointsDict).map((p) => PointConstructor.fromIdentifiers(p));
123
+ const ggb = new GeogebraConstructor({
124
+ hideAxes: true,
125
+ isGridSimple: true,
126
+ customToolBar: toolBarConstructor({ point: true, segment: true }),
127
+ commands: [
128
+ ...points.flatMap((p) => p.toGGBCommand({
129
+ size: 3,
130
+ style: 1,
131
+ })),
132
+ `s = Segment(${nameTargetPoints.join(",")})`,
133
+ `SetColor(s, "${orange}")`,
134
+ ],
135
+ fontSize: 16,
136
+ });
137
+ const endPoints = getEndPoints(identifiers);
138
+ return ggb.getOptions({
139
+ coords: ggb.getCoordsForPoints([...points, ...endPoints]),
140
+ });
141
+ };
142
+ const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
143
+ const endPoints = getEndPoints(identifiers);
144
+ const commands = ans;
145
+ const ggbParser = new GeogebraParser(commands);
146
+ const arrArrCoords = ggbParser.segmentsAsArrayOfCoords();
147
+ return arrArrCoords.some((arrCoords) => {
148
+ const [point1, point2] = arrCoords.map((coords, i) => new Point(`Z_${i}`, coords[0], coords[1]));
149
+ return [endPoints, endPoints.toReversed()].some((endPoints) => point1.distanceTo(endPoints[0]) < 0.5 &&
150
+ point2.distanceTo(endPoints[1]) < 0.5);
151
+ });
152
+ };
153
+ const getSegmentImageFromHomothetyQuestion = (optsIn) => {
154
+ const opts = optsIn ?? optsDefault;
155
+ const { isPositiveFactorOnly, factorTypes } = opts;
156
+ const factorType = random(factorTypes);
157
+ function createRandomPoints() {
158
+ const points = [];
159
+ for (let i = 0; i < 4; i++) {
160
+ const name = String.fromCharCode(65 + i);
161
+ const newPoint = doWhile(() => PointConstructor.random(name, -3, 4), (p) => points.some((p2) => p.distanceTo(p2) < 2));
162
+ points.push(newPoint);
163
+ }
164
+ return points;
165
+ }
166
+ function createRandomIdentifiers(points) {
167
+ const [pointCenter, pointTarget1, pointTarget2] = randomMany(points, 3);
168
+ const vec1 = VectorConstructor.fromPoints(pointCenter, pointTarget1);
169
+ const vec2 = VectorConstructor.fromPoints(pointCenter, pointTarget2);
170
+ const factorNode = getRandomFactorNodeForVectors([vec1, vec2], isPositiveFactorOnly, [1], factorType).simplify();
171
+ const identifiers = {
172
+ pointsDict: Object.fromEntries(points.map((p) => [p.name, p.toIdentifiers()])),
173
+ nameTargetPoints: [pointTarget1, pointTarget2].map((point) => point.name),
174
+ nameCenterPoint: pointCenter.name,
175
+ factor: factorNode.toIdentifiers(),
176
+ };
177
+ return identifiers;
178
+ }
179
+ const pointOrigin = new Point("O", 0, 0);
180
+ const points = createRandomPoints();
181
+ let identifiers;
182
+ let counter = -1;
183
+ let isValidIdentifiers = false;
184
+ while (!isValidIdentifiers && counter < 100) {
185
+ counter++;
186
+ identifiers = createRandomIdentifiers(points);
187
+ isValidIdentifiers = (() => {
188
+ if (counter < 50) {
189
+ const factorNode = NodeConstructor.fromIdentifiers(identifiers.factor);
190
+ const isIntegerFactor = factorNode.evaluate() % 1 === 0;
191
+ return !isIntegerFactor;
192
+ }
193
+ const endPoints = getEndPoints(identifiers);
194
+ return endPoints.every((endPoint) => endPoint.distanceTo(pointOrigin) < 10);
195
+ })();
196
+ }
197
+ const defaultIdentifiers = {
198
+ pointsDict: Object.fromEntries([
199
+ new Point("A", 4, 0),
200
+ new Point("B", 0, 4),
201
+ new Point("C", 0, 0),
202
+ new Point("D", 0, -4),
203
+ ].map((point) => [point.name, point.toIdentifiers()])),
204
+ nameTargetPoints: ["A", "D"],
205
+ nameCenterPoint: "B",
206
+ factor: (-2).toTree().toIdentifiers(),
207
+ };
208
+ return getQuestionFromIdentifiers(identifiers ?? defaultIdentifiers, opts);
209
+ };
210
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
211
+ const question = {
212
+ ggbAnswer: getGGBAnswer(identifiers, opts),
213
+ instruction: getInstruction(identifiers, opts),
214
+ studentGgbOptions: getStudentGGBOptions(identifiers, opts),
215
+ identifiers,
216
+ hint: getHint(identifiers, opts),
217
+ correction: getCorrection(identifiers, opts),
218
+ };
219
+ return question;
220
+ };
221
+ const options = [
222
+ {
223
+ id: "isPositiveFactorOnly",
224
+ label: "Rapports positifs uniquement",
225
+ type: GeneratorOptionType.checkbox,
226
+ target: GeneratorOptionTarget.generation,
227
+ defaultValue: false,
228
+ },
229
+ {
230
+ id: "factorTypes",
231
+ label: "Rapport: type de nombre",
232
+ type: GeneratorOptionType.multiselect,
233
+ target: GeneratorOptionTarget.generation,
234
+ values: ["fraction", "nombre à virgule"],
235
+ defaultValue: ["fraction", "nombre à virgule"],
236
+ },
237
+ ];
238
+ const optsDefault = {
239
+ isPositiveFactorOnly: false,
240
+ factorTypes: ["fraction", "nombre à virgule"],
241
+ };
242
+ export const segmentImageFromHomothety = {
243
+ id: "segmentImageFromHomothety",
244
+ label: "Placer l'image d'un segment par une homothétie",
245
+ isSingleStep: true,
246
+ generator: (nb, opts) => getDistinctQuestions(() => getSegmentImageFromHomothetyQuestion(opts), nb),
247
+ ggbTimer: 60,
248
+ isGGBAnswerValid,
249
+ subject: "Mathématiques",
250
+ getHint,
251
+ getCorrection,
252
+ getGGBAnswer,
253
+ getStudentGGBOptions,
254
+ answerType: "GGB",
255
+ options,
256
+ getQuestionFromIdentifiers,
257
+ hasHintAndCorrection: true,
258
+ };
@@ -3,6 +3,7 @@ export declare class GeogebraParser {
3
3
  constructor(studentCommands: string[]);
4
4
  pointCoords(name: string): number[] | undefined;
5
5
  vectors(): number[][];
6
+ segmentsAsArrayOfCoords(): number[][][];
6
7
  objectDict(): {
7
8
  [k: string]: string;
8
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"geogebraParser.d.ts","sourceRoot":"","sources":["../../../src/geogebra/parsers/geogebraParser.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;gBACP,eAAe,EAAE,MAAM,EAAE;IAIrC,WAAW,CAAC,IAAI,EAAE,MAAM;IAWxB,OAAO;IAyCP,UAAU;;;IAWV,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,MAAM;CAS5C"}
1
+ {"version":3,"file":"geogebraParser.d.ts","sourceRoot":"","sources":["../../../src/geogebra/parsers/geogebraParser.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;gBACP,eAAe,EAAE,MAAM,EAAE;IAIrC,WAAW,CAAC,IAAI,EAAE,MAAM;IAWxB,OAAO;IAyCP,uBAAuB;IAsCvB,UAAU;;;IAWV,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,MAAM;CAS5C"}
@@ -56,6 +56,44 @@ export class GeogebraParser {
56
56
  }
57
57
  return res;
58
58
  }
59
+ segmentsAsArrayOfCoords() {
60
+ //regex find string that starts with a undercase letter and then =Segment
61
+ const res = [];
62
+ const segments = this.commands.filter((cmd) => !!cmd.match(/^[a-z]=Segment/)?.length);
63
+ if (!segments)
64
+ return [];
65
+ for (const segment of segments) {
66
+ const pointCoords = [];
67
+ let command = segment.split("=Segment")[1];
68
+ command.replace("]", "").replace("[", "").replaceAll(" ", "");
69
+ let pointMatch = command.match(/[A-Z]|\(\d+(\.\d+)?,\s*\d+(\.\d+)?\)/);
70
+ let counter = 0;
71
+ while (pointMatch?.length) {
72
+ counter++;
73
+ if (counter > 1000)
74
+ throw new Error("Too many iterations in geogebraparser");
75
+ const name = pointMatch[0];
76
+ if (name.match(/[A-Z]/)?.length) {
77
+ const point = this.pointCoords(name);
78
+ if (point)
79
+ pointCoords.push(point);
80
+ }
81
+ else {
82
+ //point is (xxx,yyy)
83
+ const [x, y] = name
84
+ .replace("(", "")
85
+ .replace(")", "")
86
+ .split(",")
87
+ .map(parseFloat);
88
+ pointCoords.push([x, y]);
89
+ }
90
+ command = command.substring(pointMatch.index + 1);
91
+ pointMatch = command.match(/[A-Z]|\(\d+(\.\d+)?,\s*\d+(\.\d+)?\)/);
92
+ }
93
+ res.push(pointCoords);
94
+ }
95
+ return res;
96
+ }
59
97
  objectDict() {
60
98
  return Object.fromEntries(this.commands
61
99
  .filter((command) => command.includes("="))
package/lib/index.d.ts CHANGED
@@ -517,6 +517,20 @@ declare const mathExercises: (Exercise<{
517
517
  }, Record<string, string | boolean | string[]>> | Exercise<{
518
518
  a: number;
519
519
  b: number;
520
+ }, Record<string, string | boolean | string[]>> | Exercise<{
521
+ a: number;
522
+ b: number;
523
+ c: number;
524
+ d: number;
525
+ k: number;
526
+ isSubstract: boolean;
527
+ }, Record<string, string | boolean | string[]>> | Exercise<{
528
+ a: number;
529
+ b: number;
530
+ c: number;
531
+ d: number;
532
+ k: number;
533
+ isSubstract: boolean;
520
534
  }, Record<string, string | boolean | string[]>> | Exercise<{
521
535
  b: number;
522
536
  c: number;
@@ -839,6 +853,9 @@ declare const mathExercises: (Exercise<{
839
853
  affineB: number;
840
854
  }, Record<string, string | boolean | string[]>> | Exercise<{
841
855
  a: number;
856
+ }, Record<string, string | boolean | string[]>> | Exercise<{
857
+ a: number;
858
+ b: number;
842
859
  }, Record<string, string | boolean | string[]>> | Exercise<{
843
860
  nodeUIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
844
861
  nodeVIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
@@ -1590,14 +1607,6 @@ declare const mathExercises: (Exercise<{
1590
1607
  abscissTex: string;
1591
1608
  coeff: number;
1592
1609
  }, Record<string, string | boolean | string[]>> | Exercise<{
1593
- abscissType: import("./math/numbers/nombre.js").NumberType;
1594
- axisUnit: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1595
- absciss1: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1596
- absciss2: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1597
- }, {
1598
- questionType: "standard" | "\u00E9viter le comptage";
1599
- numberType: "Entiers" | "Rationnels" | "D\u00E9cimaux";
1600
- }> | Exercise<{
1601
1610
  vectorIdentifiers: import("./math/geometry/vector.js").VectorIdentifiers;
1602
1611
  pointIdentifiers: import("./math/geometry/point.js").PointIdentifiers;
1603
1612
  }, Record<string, string | boolean | string[]>> | Exercise<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,6BAA2B,YAiLrE,CAAC"}
1
+ {"version":3,"file":"latexTester.d.ts","sourceRoot":"","sources":["../src/latexTester.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,EAAE,6BAA2B,YAgLrE,CAAC"}
@@ -259,4 +259,5 @@ const validCmds = [
259
259
  "\\not",
260
260
  "\\nearrow",
261
261
  "\\searrow",
262
+ "\\mapsto",
262
263
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"functionComparison.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/functions/functionComparison.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAsElE,eAAO,MAAM,iBAAiB,GAC5B,OAAO,aAAa,EACpB,OAAO,aAAa,YAarB,CAAC"}
1
+ {"version":3,"file":"functionComparison.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/functions/functionComparison.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAkElE,eAAO,MAAM,iBAAiB,GAC5B,OAAO,aAAa,EACpB,OAAO,aAAa,YAarB,CAAC"}