math-exercises 3.0.156 → 3.0.157
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/math/calcul/proportionality/proportionalityTableCoefficient.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts +4 -1
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +148 -31
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts +4 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +124 -44
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +4 -1
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +5 -4
- package/lib/exercises/math/functions/linear/linearFromExercise.d.ts.map +1 -1
- package/lib/exercises/math/functions/linear/linearFromExercise.js +4 -3
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.js +1 -1
- package/lib/exercises/math/geometry/euclidian/recognizeHomothetyCenter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/recognizeHomothetyCenter.js +4 -5
- package/lib/exercises/math/geometry/euclidianConstructions/placeHomothetyCenter.js +4 -4
- package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.js +5 -3
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +18 -5
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +45 -21
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +33 -12
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +38 -15
- package/lib/exercises/math/percent/findTVA.d.ts.map +1 -1
- package/lib/exercises/math/percent/findTVA.js +17 -11
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.js +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.js +1 -1
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableSituations.js +114 -20
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.js +2 -2
- package/lib/exercises/math/probaStat/stats1var/etendueTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/etendueTable.js +5 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithList.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithTable.js +19 -5
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +34 -29
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.js +3 -3
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.js +2 -2
- package/lib/exercises/math/probaStat/twoStepExperiments/twoStepExperimentProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/twoStepExperimentProbas.js +18 -10
- package/lib/exercises/math/spaceGeometry/solids/recognizeSolidFromSolidPattern.js +1 -1
- package/lib/exercises/math/spaceGeometry/sphere/index.d.ts +2 -0
- package/lib/exercises/math/spaceGeometry/sphere/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/sphere/index.js +3 -1
- package/lib/exercises/math/spaceGeometry/sphere/pinPointLatLon.2d.d.ts +12 -0
- package/lib/exercises/math/spaceGeometry/sphere/pinPointLatLon.2d.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sphere/pinPointLatLon.2d.js +205 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts +13 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +215 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.3d.d.ts +14 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.3d.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.3d.js +390 -0
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +1 -1
- package/lib/exercises/vea/setVEA.d.ts.map +1 -1
- package/lib/exercises/vea/setVEA.js +4 -0
- package/lib/index.d.ts +24 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/utils/arrays/dichoFilter.d.ts +2 -0
- package/lib/utils/arrays/dichoFilter.d.ts.map +1 -0
- package/lib/utils/arrays/dichoFilter.js +11 -0
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ const getAnswer = (identifiers) => {
|
|
|
25
25
|
return answer;
|
|
26
26
|
};
|
|
27
27
|
const getHint = () => {
|
|
28
|
-
return `Le coefficient de proportionnalité est le
|
|
28
|
+
return `Le coefficient de proportionnalité est le nombre par lequel on multiplie les valeurs de la première ligne pour obtenir les valeurs de la deuxième ligne.`;
|
|
29
29
|
};
|
|
30
30
|
const getCorrection = (identifiers) => {
|
|
31
31
|
const { xValues, yValues } = identifiers;
|
|
@@ -4,6 +4,9 @@ type Identifiers = {
|
|
|
4
4
|
isSum: boolean;
|
|
5
5
|
b: number;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type Options = {
|
|
8
|
+
answerInputTypes: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare const factorizeEquation: Exercise<Identifiers, Options>;
|
|
8
11
|
export {};
|
|
9
12
|
//# sourceMappingURL=factorizeEquation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factorizeEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/factorizeEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"factorizeEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/factorizeEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAyCrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+QF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAsBF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyB5D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../exercises/exercise.js";
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { SetVEA } from "../../../../exercises/vea/setVEA.js";
|
|
3
4
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
5
|
import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationSolutionNode.js";
|
|
5
6
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
@@ -9,9 +10,30 @@ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
|
9
10
|
import { square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
10
11
|
import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
|
|
11
12
|
import { discreteSetParser } from "../../../../tree/parsers/discreteSetParser.js";
|
|
13
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
12
14
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
+
const getTexForEquationSolutionNode = (nodeAnswer, opts) => {
|
|
16
|
+
const answerInputTypeDefault = "S={...;...}";
|
|
17
|
+
const answerInputType = opts.answerInputTypes.includes(answerInputTypeDefault)
|
|
18
|
+
? answerInputTypeDefault
|
|
19
|
+
: opts.answerInputTypes[0];
|
|
20
|
+
switch (answerInputType) {
|
|
21
|
+
case "x=... ou x=...":
|
|
22
|
+
{
|
|
23
|
+
const arrNodeAnswer = nodeAnswer.solutionsSet.elements;
|
|
24
|
+
return arrNodeAnswer
|
|
25
|
+
.map((node) => `x=${node.toTex()}`)
|
|
26
|
+
.join("\\text{ ou }");
|
|
27
|
+
}
|
|
28
|
+
break;
|
|
29
|
+
case "S={...;...}":
|
|
30
|
+
return nodeAnswer.toTex();
|
|
31
|
+
default:
|
|
32
|
+
throw new Error("Unsupported answerInputType: " + answerInputType);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
|
|
36
|
+
const opts = optsIn ?? optsDefault;
|
|
15
37
|
const { a, isSum, b } = identifiers;
|
|
16
38
|
const propositions = [];
|
|
17
39
|
addValidProp(propositions, answer);
|
|
@@ -19,19 +41,19 @@ const getPropositions = (n, { answer, ...identifiers }) => {
|
|
|
19
41
|
new NumberNode(0),
|
|
20
42
|
frac(multiply(isSum ? 1 : -1, b), a),
|
|
21
43
|
]);
|
|
22
|
-
tryToAddWrongProp(propositions, new EquationSolutionNode(solutions).simplify()
|
|
44
|
+
tryToAddWrongProp(propositions, getTexForEquationSolutionNode(new EquationSolutionNode(solutions).simplify(), opts));
|
|
23
45
|
solutions = new DiscreteSetNode([new NumberNode(0)]);
|
|
24
46
|
tryToAddWrongProp(propositions, new EquationSolutionNode(solutions).simplify().toTex());
|
|
25
47
|
solutions = new DiscreteSetNode([frac(multiply(isSum ? 1 : -1, b), a)]);
|
|
26
|
-
tryToAddWrongProp(propositions, new EquationSolutionNode(solutions).simplify()
|
|
48
|
+
tryToAddWrongProp(propositions, getTexForEquationSolutionNode(new EquationSolutionNode(solutions).simplify(), opts));
|
|
27
49
|
solutions = new DiscreteSetNode([frac(multiply(isSum ? -1 : 1, b), a)]);
|
|
28
|
-
tryToAddWrongProp(propositions, new EquationSolutionNode(solutions).simplify()
|
|
50
|
+
tryToAddWrongProp(propositions, getTexForEquationSolutionNode(new EquationSolutionNode(solutions).simplify(), opts));
|
|
29
51
|
propWhile(propositions, n, () => {
|
|
30
52
|
throw Error("QCM not implemented");
|
|
31
53
|
});
|
|
32
54
|
return shuffleProps(propositions, n);
|
|
33
55
|
};
|
|
34
|
-
const
|
|
56
|
+
const getAnswerNode = (identifiers) => {
|
|
35
57
|
const { a, b, isSum } = identifiers;
|
|
36
58
|
// ax^2 + bx = x(ax + b) -> S = {0, -b/a}
|
|
37
59
|
// ax^2 - bx = x(ax - b) -> S = {0, b/a}
|
|
@@ -39,8 +61,13 @@ const getAnswer = (identifiers) => {
|
|
|
39
61
|
new NumberNode(0),
|
|
40
62
|
frac(multiply(isSum ? -1 : 1, b), a),
|
|
41
63
|
]);
|
|
42
|
-
const
|
|
43
|
-
return
|
|
64
|
+
const nodeAnswer = new EquationSolutionNode(solutions).simplify();
|
|
65
|
+
return nodeAnswer;
|
|
66
|
+
};
|
|
67
|
+
const getAnswer = (identifiers, optsIn) => {
|
|
68
|
+
const opts = optsIn ?? optsDefault;
|
|
69
|
+
const answerNode = getAnswerNode(identifiers);
|
|
70
|
+
return getTexForEquationSolutionNode(answerNode, opts);
|
|
44
71
|
};
|
|
45
72
|
const getInstruction = (identifiers) => {
|
|
46
73
|
const { a, isSum, b } = identifiers;
|
|
@@ -49,7 +76,7 @@ const getInstruction = (identifiers) => {
|
|
|
49
76
|
const eq = add(left, multiply(isSum ? 1 : -1, right));
|
|
50
77
|
return `En factorisant $${eq
|
|
51
78
|
.simplify({ forbidFactorize: true })
|
|
52
|
-
.toTex()}$, résoudre l'équation:
|
|
79
|
+
.toTex()}$, résoudre l'équation :
|
|
53
80
|
$$
|
|
54
81
|
${left.toTex()} = ${multiply(isSum ? -1 : 1, right).toTex()}
|
|
55
82
|
$$`;
|
|
@@ -67,7 +94,12 @@ ${left.toTex()} = ${multiply(isSum ? -1 : 1, right).toTex()} \\iff ${eq
|
|
|
67
94
|
.toTex()} = 0
|
|
68
95
|
$$`;
|
|
69
96
|
};
|
|
70
|
-
const getCorrection = (identifiers) => {
|
|
97
|
+
const getCorrection = (identifiers, optsIn) => {
|
|
98
|
+
const opts = optsIn ?? optsDefault;
|
|
99
|
+
const answerInputTypeDefault = "S={...;...}";
|
|
100
|
+
const answerInputType = opts.answerInputTypes.includes(answerInputTypeDefault)
|
|
101
|
+
? answerInputTypeDefault
|
|
102
|
+
: opts.answerInputTypes[0];
|
|
71
103
|
const { a, isSum, b } = identifiers;
|
|
72
104
|
const left = multiply(a, square("x"));
|
|
73
105
|
const right = multiply(b, "x");
|
|
@@ -82,55 +114,140 @@ $$
|
|
|
82
114
|
x\\left(${factorizedInside}\\right) = 0
|
|
83
115
|
$$
|
|
84
116
|
|
|
85
|
-
Cette équation a deux solutions possibles:
|
|
117
|
+
Cette équation a deux solutions possibles :
|
|
86
118
|
|
|
87
119
|
- $x = 0$
|
|
88
|
-
- ou $${factorizedInside} = 0 \\iff x = ${factorizedAnswer}$
|
|
89
120
|
|
|
90
|
-
|
|
121
|
+
ou
|
|
122
|
+
|
|
123
|
+
- $${factorizedInside} = 0 \\iff x = ${factorizedAnswer}$
|
|
124
|
+
|
|
125
|
+
${(() => {
|
|
126
|
+
switch (answerInputType) {
|
|
127
|
+
case "x=... ou x=...":
|
|
128
|
+
return `Les solutions sont donc :`;
|
|
129
|
+
case "S={...;...}":
|
|
130
|
+
return `L'ensemble solution de l'équation est donc :`;
|
|
131
|
+
default:
|
|
132
|
+
throw new Error("Unsupported answerInputType: " + answerInputType);
|
|
133
|
+
}
|
|
134
|
+
})()}
|
|
91
135
|
|
|
92
136
|
$$
|
|
93
|
-
${getAnswer(identifiers)}
|
|
137
|
+
${getAnswer(identifiers, opts)}
|
|
94
138
|
$$`;
|
|
95
139
|
};
|
|
96
|
-
const getKeys = () => {
|
|
97
|
-
|
|
140
|
+
const getKeys = (_, optsIn) => {
|
|
141
|
+
const opts = optsIn ?? optsDefault;
|
|
142
|
+
const { answerInputTypes } = opts;
|
|
143
|
+
return [
|
|
144
|
+
...answerInputTypes.reduce((acc, answerInputType) => {
|
|
145
|
+
const specialSet = new Set((() => {
|
|
146
|
+
switch (answerInputType) {
|
|
147
|
+
case "x=... ou x=...":
|
|
148
|
+
return ["x", "equal", "ou"];
|
|
149
|
+
case "S={...;...}":
|
|
150
|
+
return ["S", "equal", "lbrace", "semicolon", "rbrace"];
|
|
151
|
+
default:
|
|
152
|
+
throw new Error("Unsupported answerInputType: " + answerInputType);
|
|
153
|
+
}
|
|
154
|
+
})());
|
|
155
|
+
return new Set([...acc, ...specialSet]);
|
|
156
|
+
}, new Set()),
|
|
157
|
+
];
|
|
98
158
|
};
|
|
99
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
159
|
+
const isAnswerValid = (ans, { answer: _, ...identifiers }, optsIn) => {
|
|
160
|
+
const opts = optsIn ?? optsDefault;
|
|
161
|
+
const answerNode = getAnswerNode(identifiers);
|
|
162
|
+
const arrNodeAnswer = answerNode.solutionsSet.elements;
|
|
163
|
+
function getParsedNodesForAnswerInputType(ans, answerInputType) {
|
|
164
|
+
switch (answerInputType) {
|
|
165
|
+
case "x=... ou x=...":
|
|
166
|
+
{
|
|
167
|
+
const formated = ans
|
|
168
|
+
.replaceAll("text{ ou }", ";")
|
|
169
|
+
.replaceAll("x", "")
|
|
170
|
+
.replaceAll("=", "");
|
|
171
|
+
console.log("formated", formated);
|
|
172
|
+
// if (formated === "\\varnothing") {
|
|
173
|
+
// return EmptySet;
|
|
174
|
+
// }
|
|
175
|
+
const elements = formated.split(";").map((e) => parseAlgebraic(e));
|
|
176
|
+
return elements;
|
|
177
|
+
}
|
|
178
|
+
break;
|
|
179
|
+
case "S={...;...}":
|
|
180
|
+
{
|
|
181
|
+
const discreteSetNodeCandidate = discreteSetParser(ans);
|
|
182
|
+
if (discreteSetNodeCandidate) {
|
|
183
|
+
return discreteSetNodeCandidate.elements;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
break;
|
|
190
|
+
default:
|
|
191
|
+
throw new Error("Unsupported answerInputType: " + answerInputType);
|
|
192
|
+
}
|
|
105
193
|
}
|
|
106
|
-
|
|
107
|
-
|
|
194
|
+
function isAnswerValidForAnswerInputType(answerInputType) {
|
|
195
|
+
try {
|
|
196
|
+
const arrAns = getParsedNodesForAnswerInputType(ans, answerInputType);
|
|
197
|
+
return SetVEA.isArrayOfNodesValid(arrAns, arrNodeAnswer);
|
|
198
|
+
}
|
|
199
|
+
catch (_) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
108
202
|
}
|
|
203
|
+
return opts.answerInputTypes.some((answerInputType) => isAnswerValidForAnswerInputType(answerInputType));
|
|
109
204
|
};
|
|
110
|
-
const getFactorizeEquationQuestion = () => {
|
|
205
|
+
const getFactorizeEquationQuestion = (optsIn) => {
|
|
206
|
+
const opts = optsIn ?? optsDefault;
|
|
111
207
|
const a = randint(1, 10);
|
|
112
208
|
const b = randint(1, 10);
|
|
113
209
|
const isSum = coinFlip();
|
|
114
210
|
const identifiers = { a, isSum, b };
|
|
115
|
-
return getQuestionFromIdentifiers(identifiers);
|
|
211
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
116
212
|
};
|
|
117
|
-
const getQuestionFromIdentifiers = (identifiers) => {
|
|
213
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
118
214
|
return {
|
|
119
|
-
answer: getAnswer(identifiers),
|
|
215
|
+
answer: getAnswer(identifiers, opts),
|
|
120
216
|
instruction: getInstruction(identifiers),
|
|
121
|
-
keys: getKeys(identifiers),
|
|
217
|
+
keys: getKeys(identifiers, opts),
|
|
122
218
|
answerFormat: "tex",
|
|
123
219
|
identifiers,
|
|
124
220
|
hint: getHint(identifiers),
|
|
125
|
-
correction: getCorrection(identifiers),
|
|
221
|
+
correction: getCorrection(identifiers, opts),
|
|
222
|
+
options: opts,
|
|
126
223
|
};
|
|
127
224
|
};
|
|
225
|
+
const optsDefault = {
|
|
226
|
+
answerInputTypes: ["x=... ou x=...", "S={...;...}"],
|
|
227
|
+
};
|
|
228
|
+
const options = [
|
|
229
|
+
{
|
|
230
|
+
id: "answerInputTypes",
|
|
231
|
+
label: "Format(s) de réponse",
|
|
232
|
+
target: GeneratorOptionTarget.generation,
|
|
233
|
+
type: GeneratorOptionType.multiselect,
|
|
234
|
+
values: ["x=... ou x=...", "S={...;...}"],
|
|
235
|
+
defaultValue: optsDefault.answerInputTypes,
|
|
236
|
+
},
|
|
237
|
+
];
|
|
128
238
|
export const factorizeEquation = {
|
|
129
239
|
id: "factorizeEquation",
|
|
130
240
|
connector: "=",
|
|
131
241
|
label: "Résoudre une équation se ramenant au premier degré",
|
|
132
242
|
isSingleStep: true,
|
|
133
243
|
generator: (nb, opts) => getDistinctQuestions(() => getFactorizeEquationQuestion(opts), nb),
|
|
244
|
+
options,
|
|
245
|
+
validateOptions: (opts) => {
|
|
246
|
+
return {
|
|
247
|
+
valid: !!(opts?.answerInputTypes && opts?.answerInputTypes.length > 0),
|
|
248
|
+
message: "Veuillez choisir au moins un format de réponse.",
|
|
249
|
+
};
|
|
250
|
+
},
|
|
134
251
|
qcmTimer: 60,
|
|
135
252
|
freeTimer: 60,
|
|
136
253
|
getPropositions,
|
|
@@ -5,6 +5,9 @@ type Identifiers = {
|
|
|
5
5
|
c: number;
|
|
6
6
|
d: number;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type Options = {
|
|
9
|
+
answerInputTypes: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare const multiplicationEquation: Exercise<Identifiers, Options>;
|
|
9
12
|
export {};
|
|
10
13
|
//# sourceMappingURL=multiplicationEquation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAuCrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqMF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAsBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAejE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { Rational } from "../../../../math/numbers/rationals/rational.js";
|
|
4
4
|
import { Polynomial } from "../../../../math/polynomials/polynomial.js";
|
|
@@ -10,6 +10,27 @@ import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
|
10
10
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
11
11
|
import { SetVEA } from "../../../../exercises/vea/setVEA.js";
|
|
12
12
|
import { discreteSetParser } from "../../../../tree/parsers/discreteSetParser.js";
|
|
13
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
14
|
+
const getTexForEquationSolutionNode = (nodeAnswer, opts) => {
|
|
15
|
+
const answerInputTypeDefault = "S={...;...}";
|
|
16
|
+
const answerInputType = opts.answerInputTypes.includes(answerInputTypeDefault)
|
|
17
|
+
? answerInputTypeDefault
|
|
18
|
+
: opts.answerInputTypes[0];
|
|
19
|
+
switch (answerInputType) {
|
|
20
|
+
case "x=... ou x=...":
|
|
21
|
+
{
|
|
22
|
+
const arrNodeAnswer = nodeAnswer.solutionsSet.elements;
|
|
23
|
+
return arrNodeAnswer
|
|
24
|
+
.map((node) => `x=${node.toTex()}`)
|
|
25
|
+
.join("\\text{ ou }");
|
|
26
|
+
}
|
|
27
|
+
break;
|
|
28
|
+
case "S={...;...}":
|
|
29
|
+
return nodeAnswer.toTex();
|
|
30
|
+
default:
|
|
31
|
+
throw new Error("Unsupported answerInputType: " + answerInputType);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
13
34
|
const getStatementNode = (identifiers) => {
|
|
14
35
|
const { a, b, c, d } = identifiers;
|
|
15
36
|
const polynome1 = new Polynomial([b, a]);
|
|
@@ -27,13 +48,88 @@ $$
|
|
|
27
48
|
${getStartStatement(identifiers)}
|
|
28
49
|
$$`;
|
|
29
50
|
};
|
|
30
|
-
const
|
|
51
|
+
const getAnswerNode = (identifiers) => {
|
|
31
52
|
const { a, b, c, d } = identifiers;
|
|
32
53
|
const sol1 = new Rational(-b, a).simplify().toTree();
|
|
33
54
|
const sol2 = new Rational(-d, c).simplify().toTree();
|
|
34
55
|
const sortedSols = -b / a < -d / c ? [sol1, sol2] : [sol2, sol1];
|
|
35
|
-
const
|
|
36
|
-
return
|
|
56
|
+
const nodeAnswer = new EquationSolutionNode(new DiscreteSetNode(sortedSols));
|
|
57
|
+
return nodeAnswer;
|
|
58
|
+
};
|
|
59
|
+
const getAnswer = (identifiers, optsIn) => {
|
|
60
|
+
const opts = optsIn ?? optsDefault;
|
|
61
|
+
const answerNode = getAnswerNode(identifiers);
|
|
62
|
+
return getTexForEquationSolutionNode(answerNode, opts);
|
|
63
|
+
};
|
|
64
|
+
const isAnswerValid = (ans, { answer: _, ...identifiers }, optsIn) => {
|
|
65
|
+
const opts = optsIn ?? optsDefault;
|
|
66
|
+
const answerNode = getAnswerNode(identifiers);
|
|
67
|
+
const arrNodeAnswer = answerNode.solutionsSet.elements;
|
|
68
|
+
function getParsedNodesForAnswerInputType(ans, answerInputType) {
|
|
69
|
+
switch (answerInputType) {
|
|
70
|
+
case "x=... ou x=...":
|
|
71
|
+
{
|
|
72
|
+
const formated = ans
|
|
73
|
+
.replaceAll("text{ ou }", ";")
|
|
74
|
+
.replaceAll("x", "")
|
|
75
|
+
.replaceAll("=", "");
|
|
76
|
+
console.log("formated", formated);
|
|
77
|
+
// if (formated === "\\varnothing") {
|
|
78
|
+
// return EmptySet;
|
|
79
|
+
// }
|
|
80
|
+
const elements = formated.split(";").map((e) => parseAlgebraic(e));
|
|
81
|
+
return elements;
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
case "S={...;...}":
|
|
85
|
+
{
|
|
86
|
+
const discreteSetNodeCandidate = discreteSetParser(ans);
|
|
87
|
+
if (discreteSetNodeCandidate) {
|
|
88
|
+
return discreteSetNodeCandidate.elements;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
95
|
+
default:
|
|
96
|
+
throw new Error("Unsupported answerInputType: " + answerInputType);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function isAnswerValidForAnswerInputType(answerInputType) {
|
|
100
|
+
try {
|
|
101
|
+
const arrAns = getParsedNodesForAnswerInputType(ans, answerInputType);
|
|
102
|
+
return SetVEA.isArrayOfNodesValid(arrAns, arrNodeAnswer);
|
|
103
|
+
}
|
|
104
|
+
catch (_) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return opts.answerInputTypes.some((answerInputType) => isAnswerValidForAnswerInputType(answerInputType));
|
|
109
|
+
};
|
|
110
|
+
const getPropositions = (n, { answer }, optsIn) => {
|
|
111
|
+
const opts = optsIn ?? optsDefault;
|
|
112
|
+
const propositions = [];
|
|
113
|
+
addValidProp(propositions, answer);
|
|
114
|
+
propWhile(propositions, n, () => {
|
|
115
|
+
let a, b, c, d;
|
|
116
|
+
let counter = 0;
|
|
117
|
+
do {
|
|
118
|
+
counter++;
|
|
119
|
+
if (counter > 1000)
|
|
120
|
+
throw new Error("Too many iterations in multiplicationEquation");
|
|
121
|
+
a = randint(-9, 10, [0]);
|
|
122
|
+
b = randint(-9, 10, [0]);
|
|
123
|
+
c = randint(-9, 10, [0]);
|
|
124
|
+
d = randint(-9, 10, [0]);
|
|
125
|
+
} while (a / c === b / d);
|
|
126
|
+
const sol1 = new Rational(-b, a).simplify().toTree();
|
|
127
|
+
const sol2 = new Rational(-d, c).simplify().toTree();
|
|
128
|
+
const sortedSols = -b / a < -d / c ? [sol1, sol2] : [sol2, sol1];
|
|
129
|
+
const wrongAnswer = getTexForEquationSolutionNode(new EquationSolutionNode(new DiscreteSetNode(sortedSols)), opts);
|
|
130
|
+
tryToAddWrongProp(propositions, wrongAnswer);
|
|
131
|
+
});
|
|
132
|
+
return shuffle(propositions);
|
|
37
133
|
};
|
|
38
134
|
const getHint = () => {
|
|
39
135
|
return "Un produit est nul si et seulement si un des deux facteurs est nul. Il faut donc trouver les valeurs de $x$ qui rendent un des deux facteurs nul.";
|
|
@@ -59,7 +155,8 @@ ${alignTex([
|
|
|
59
155
|
|
|
60
156
|
Ainsi, $${getAnswer(identifiers)}$`;
|
|
61
157
|
};
|
|
62
|
-
const getMultiplicationEquation = () => {
|
|
158
|
+
const getMultiplicationEquation = (optsIn) => {
|
|
159
|
+
const opts = optsIn ?? optsDefault;
|
|
63
160
|
// (ax + b)(cx + d) = 0
|
|
64
161
|
let a, b, c, d;
|
|
65
162
|
let counter = 0;
|
|
@@ -73,59 +170,42 @@ const getMultiplicationEquation = () => {
|
|
|
73
170
|
d = randint(-9, 10, [0]);
|
|
74
171
|
} while (a / c === b / d);
|
|
75
172
|
const identifiers = { a, b, c, d };
|
|
76
|
-
return getQuestionFromIdentifiers(identifiers);
|
|
173
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
77
174
|
};
|
|
78
|
-
const getQuestionFromIdentifiers = (identifiers) => {
|
|
175
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
79
176
|
const question = {
|
|
80
|
-
instruction: getInstruction(identifiers),
|
|
81
|
-
startStatement: getStartStatement(identifiers),
|
|
82
|
-
answer: getAnswer(identifiers),
|
|
177
|
+
instruction: getInstruction(identifiers, opts),
|
|
178
|
+
startStatement: getStartStatement(identifiers, opts),
|
|
179
|
+
answer: getAnswer(identifiers, opts),
|
|
83
180
|
keys: ["x", "S", "equal", "lbrace", "rbrace", "semicolon", "ou"],
|
|
84
181
|
answerFormat: "tex",
|
|
85
182
|
identifiers,
|
|
86
|
-
hint: getHint(identifiers),
|
|
87
|
-
correction: getCorrection(identifiers),
|
|
183
|
+
hint: getHint(identifiers, opts),
|
|
184
|
+
correction: getCorrection(identifiers, opts),
|
|
185
|
+
options: opts,
|
|
88
186
|
};
|
|
89
187
|
return question;
|
|
90
188
|
};
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
addValidProp(propositions, answer);
|
|
94
|
-
propWhile(propositions, n, () => {
|
|
95
|
-
let a, b, c, d;
|
|
96
|
-
let counter = 0;
|
|
97
|
-
do {
|
|
98
|
-
counter++;
|
|
99
|
-
if (counter > 1000)
|
|
100
|
-
throw new Error("Too many iterations in multiplicationEquation");
|
|
101
|
-
a = randint(-9, 10, [0]);
|
|
102
|
-
b = randint(-9, 10, [0]);
|
|
103
|
-
c = randint(-9, 10, [0]);
|
|
104
|
-
d = randint(-9, 10, [0]);
|
|
105
|
-
} while (a / c === b / d);
|
|
106
|
-
const sol1 = new Rational(-b, a).simplify().toTree();
|
|
107
|
-
const sol2 = new Rational(-d, c).simplify().toTree();
|
|
108
|
-
const sortedSols = -b / a < -d / c ? [sol1, sol2] : [sol2, sol1];
|
|
109
|
-
const wrongAnswer = new EquationSolutionNode(new DiscreteSetNode(sortedSols)).toTex();
|
|
110
|
-
tryToAddWrongProp(propositions, wrongAnswer);
|
|
111
|
-
});
|
|
112
|
-
return shuffle(propositions);
|
|
113
|
-
};
|
|
114
|
-
const isAnswerValid = (ans, { a, b, c, d }) => {
|
|
115
|
-
const parsed = discreteSetParser(ans);
|
|
116
|
-
if (!parsed)
|
|
117
|
-
return false;
|
|
118
|
-
const sol1 = new Rational(-b, a).simplify().toTree();
|
|
119
|
-
const sol2 = new Rational(-d, c).simplify().toTree();
|
|
120
|
-
const sortedSols = -b / a < -d / c ? [sol1, sol2] : [sol2, sol1];
|
|
121
|
-
return SetVEA.isArrayOfNodesValid(parsed.elements, sortedSols);
|
|
189
|
+
const optsDefault = {
|
|
190
|
+
answerInputTypes: ["x=... ou x=...", "S={...;...}"],
|
|
122
191
|
};
|
|
192
|
+
const options = [
|
|
193
|
+
{
|
|
194
|
+
id: "answerInputTypes",
|
|
195
|
+
label: "Format(s) de réponse",
|
|
196
|
+
target: GeneratorOptionTarget.generation,
|
|
197
|
+
type: GeneratorOptionType.multiselect,
|
|
198
|
+
values: ["x=... ou x=...", "S={...;...}"],
|
|
199
|
+
defaultValue: optsDefault.answerInputTypes,
|
|
200
|
+
},
|
|
201
|
+
];
|
|
123
202
|
export const multiplicationEquation = {
|
|
124
203
|
id: "multiplicationEquation",
|
|
125
204
|
connector: "\\iff",
|
|
126
205
|
label: "Résoudre une équation produit nul",
|
|
127
206
|
isSingleStep: false,
|
|
128
|
-
generator: (nb) => getDistinctQuestions(getMultiplicationEquation, nb),
|
|
207
|
+
generator: (nb, opts) => getDistinctQuestions(() => getMultiplicationEquation(opts), nb),
|
|
208
|
+
options,
|
|
129
209
|
qcmTimer: 60,
|
|
130
210
|
freeTimer: 60,
|
|
131
211
|
getPropositions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"halfPieChartCommenting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/halfPieChartCommenting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"halfPieChartCommenting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/halfPieChartCommenting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,KAAK,EAAE,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoQF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAmBxD,CAAC"}
|
|
@@ -79,7 +79,10 @@ const getGGBOptions = (identifiers) => {
|
|
|
79
79
|
// const angleM = (angleA + angleB) / 2;
|
|
80
80
|
const angleM = angleA +
|
|
81
81
|
Math.atan2(Math.sin(angleB - angleA), Math.cos(angleB - angleA)) / 2;
|
|
82
|
-
|
|
82
|
+
const cosM = Math.cos(angleM);
|
|
83
|
+
const sinM = Math.sin(angleM);
|
|
84
|
+
const offsetY = cosM > 0 ? -0.1 : 0;
|
|
85
|
+
return [0.8 * cosM, 1.2 * sinM + offsetY];
|
|
83
86
|
};
|
|
84
87
|
const ggb = new GeogebraConstructor({
|
|
85
88
|
commands: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawAffineFromPointAndLeadingCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"drawAffineFromPointAndLeadingCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAyJF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA4FF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CACvD,WAAW,EACX,OAAO,CAqBR,CAAC"}
|
|
@@ -27,6 +27,7 @@ const getCorrection = (identifiers) => {
|
|
|
27
27
|
const offsetVert = coeff.leftChild.evaluate();
|
|
28
28
|
const isUp = Math.sign(offsetVert) >= 0;
|
|
29
29
|
const offsetHoriz = coeff.rightChild.evaluate();
|
|
30
|
+
const [vAbsOffsetHoriz, vAbsOffsetVert] = [offsetHoriz, offsetVert].map((v) => Math.abs(v));
|
|
30
31
|
return `La fonction $${funcName}$ est une fonction affine.
|
|
31
32
|
Sa représentation graphique est une droite, que l'on va nommer $d$.
|
|
32
33
|
|
|
@@ -37,12 +38,12 @@ Comme le coefficient directeur est égal à $${texCoeff} = ${coeff.toTex({
|
|
|
37
38
|
allowMinusAnywhereInFraction: true,
|
|
38
39
|
explicitNumberWriting: true,
|
|
39
40
|
})}$
|
|
40
|
-
alors à partir de $A$, on se déplace verticalement de $${
|
|
41
|
-
quand on se déplace horizontalement de $${
|
|
41
|
+
alors à partir de $A$, on se déplace verticalement de $${vAbsOffsetVert.frenchify()}$ carreau${vAbsOffsetVert > 1 ? "x" : ""} vers le ${isUp ? `haut` : `bas`}
|
|
42
|
+
quand on se déplace horizontalement de $${vAbsOffsetHoriz.frenchify()}$ carreau${vAbsOffsetHoriz > 1 ? "x" : ""} vers la droite.
|
|
42
43
|
|
|
43
44
|
C'est-à-dire que le point $B$ de coordonnées $(${pointB.x.toTex()}; ${pointB.y.toTex()})$ appartient à $d$.
|
|
44
45
|
|
|
45
|
-
On trace donc la droite passant $A(${pointA.x.toTex()}; ${pointA.y.toTex()})$ et $B(${pointB.x
|
|
46
|
+
On trace donc la droite passant par $A(${pointA.x.toTex()}; ${pointA.y.toTex()})$ et par $B(${pointB.x
|
|
46
47
|
.evaluate()
|
|
47
48
|
.frenchify()}; ${pointB.y.evaluate().frenchify()})$.`;
|
|
48
49
|
};
|
|
@@ -51,7 +52,7 @@ const getInstruction = (identifiers) => {
|
|
|
51
52
|
const pointA = PointConstructor.fromIdentifiers(pointIdsA);
|
|
52
53
|
const coeff = NodeConstructor.fromIdentifiers(leadingCoeff);
|
|
53
54
|
const texCoeff = numberType === "Fraction" ? coeff.toTex() : coeff.evaluate().frenchify();
|
|
54
|
-
return `La fonction affine $${funcName}$ a pour représentation graphique une droite de
|
|
55
|
+
return `La fonction affine $${funcName}$ a pour représentation graphique une droite de coefficient directeur $${texCoeff}$ et qui passe par le point de coordonnées $\\left(${pointA.x.toTex()}; ${pointA.y.toTex()}\\right)$.
|
|
55
56
|
|
|
56
57
|
Dans le repère, tracer la représentation graphique de la fonction $${funcName}$.`;
|
|
57
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linearFromExercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/linear/linearFromExercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAqCrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"linearFromExercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/linear/linearFromExercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAqCrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAwWF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAkBpD,CAAC"}
|
|
@@ -217,7 +217,7 @@ La distance parcourue en $\\textrm{km}$ en $x \\ \\textrm{h}$ est $${texADecimal
|
|
|
217
217
|
Quel est la masse de fientes de pigeon en $\\textrm{g}$ pour $x$ jours ?`,
|
|
218
218
|
hint: `Quel calcul permet de trouver la masse reçue en $1$ jour ?
|
|
219
219
|
|
|
220
|
-
Inspire toi de ce calcul pour déterminer la masse reçue en $x \\ \\textrm{
|
|
220
|
+
Inspire toi de ce calcul pour déterminer la masse reçue en $x \\ \\textrm{jours}$.`,
|
|
221
221
|
correction: (x1, y1) => {
|
|
222
222
|
const nodeA = frac(y1, x1);
|
|
223
223
|
const texADecimal = nodeA.simplify({ fractionsToDecimal: true }).toTex();
|
|
@@ -265,8 +265,9 @@ const getCorrection = (identifiers) => {
|
|
|
265
265
|
};
|
|
266
266
|
const isAnswerValid = (ans, { answer }) => {
|
|
267
267
|
return parseAlgebraic(ans)
|
|
268
|
-
.
|
|
269
|
-
.
|
|
268
|
+
.evaluate({ x: 1 })
|
|
269
|
+
.toTree()
|
|
270
|
+
.equals(parseAlgebraic(answer).evaluate({ x: 1 }).toTree());
|
|
270
271
|
};
|
|
271
272
|
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
272
273
|
const propositions = [];
|
|
@@ -113,7 +113,7 @@ const getCorrection = (identifiers) => {
|
|
|
113
113
|
const { nameObjSrc, nameObjDst, transformationIds, pointsDict } = identifiers;
|
|
114
114
|
const pointsIds = Object.values(pointsDict);
|
|
115
115
|
return `L'angle $\\widehat{${pointsIds[1].name}${pointsIds[0].name}${pointsIds[2].name}}$ vaut $60°$.
|
|
116
|
-
L'image de $${nameObjSrc[0]}$ par ${getStrForTransformation(transformationIds)} est $${nameObjDst[
|
|
116
|
+
L'image de $${nameObjSrc[0]}$ par ${getStrForTransformation(transformationIds)} est $${nameObjDst[0]}$ et celle de $${nameObjSrc[1]}$ est $${nameObjDst[1]}$.
|
|
117
117
|
L'image de $[${nameObjSrc}]$ par ${getStrForTransformation(transformationIds)} est donc $[${nameObjDst}]$.`;
|
|
118
118
|
};
|
|
119
119
|
const getSegmentSrc = (identifiers) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeHomothetyCenter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/recognizeHomothetyCenter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAiE7C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"recognizeHomothetyCenter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/recognizeHomothetyCenter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAiE7C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAsSF,KAAK,OAAO,GAAG;IACb,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAyBF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBnE,CAAC"}
|