math-exercises 2.1.19 → 2.1.20
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/calculLitteral/equation/equationType3Exercise.js +1 -1
- package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +2 -2
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
- package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +7 -13
- package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.js +1 -1
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +8 -8
- package/lib/exercises/pc/weight/weightOnTheMoon.js +2 -2
- package/lib/tree/nodes/functions/log10Node.js +3 -3
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ const getEquationType3ExerciseQuestion = () => {
|
|
|
27
27
|
hint: "Isolez le terme $x$ dans la partie gauche de l'equation.",
|
|
28
28
|
correction: `Commencer par soustraire $${b}$ des deux côtés de l'équation pour
|
|
29
29
|
l'éliminer du côté gauche, ensuite, diviser les deux côtés de l'équation par
|
|
30
|
-
$${a}$ pour isoler $x$, ce qui donne : $ ${a}x = ${c}${b < 0 ? "+" + Math.abs(b) : "-" + Math.abs(b)} \\Leftrightarrow x=\\frac{${c}${b < 0 ? "+" + Math.abs(b) : "-" + Math.abs(b)}}{${a}} \\Leftrightarrow ${answer}$.`,
|
|
30
|
+
$${a}$ pour isoler $x$, ce qui donne : \n $ ${a}x = ${c}${b < 0 ? "+" + Math.abs(b) : "-" + Math.abs(b)} \\Leftrightarrow x=\\frac{${c}${b < 0 ? "+" + Math.abs(b) : "-" + Math.abs(b)}}{${a}} \\Leftrightarrow ${answer}$.`,
|
|
31
31
|
startStatement: statementTree.toTex(),
|
|
32
32
|
answer,
|
|
33
33
|
keys: equationKeys_1.equationKeys,
|
|
@@ -16,8 +16,8 @@ const getExponentialEquation = () => {
|
|
|
16
16
|
const equation = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new variableNode_1.VariableNode("y"));
|
|
17
17
|
const answer = new equalNode_1.EqualNode(new variableNode_1.VariableNode("y"), new multiplyNode_1.MultiplyNode(new variableNode_1.VariableNode("C"), new expNode_1.ExpNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new variableNode_1.VariableNode("x"))))).toTex();
|
|
18
18
|
const correctionequation = new equalNode_1.EqualNode(new substractNode_1.SubstractNode(new variableNode_1.VariableNode("y'"), new multiplyNode_1.MultiplyNode(a.toTree(), new variableNode_1.VariableNode("y"))).simplify(), new numberNode_1.NumberNode(0)).toTex();
|
|
19
|
-
const hint = "
|
|
20
|
-
const correction = `La solution est $y = Ce^{ax}$, où $C$ est une constante d'intégration.
|
|
19
|
+
const hint = "La solution générale d'une équation différentielle de la forme $y' = ay$ est de la forme $y = Ce^{ax}$, où $C$ est une constante d'intégration.";
|
|
20
|
+
const correction = `La solution générale d'une équation différentielle de la forme $y' = ay$ est de la forme $y = Ce^{ax}$, où $C$ est une constante d'intégration.
|
|
21
21
|
\n Donc, la solution générale de l'équation différentielle $y' = ${a}y$ est $y = Ce^{${a}x}$.`;
|
|
22
22
|
const question = {
|
|
23
23
|
instruction: `Résoudre l'équation différentielle suivante : $y' = ${equation.toTex()}$.`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA+CF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
|
|
@@ -6,16 +6,11 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const decimal_1 = require("../../../../math/numbers/decimals/decimal");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
8
|
const log10Node_1 = require("../../../../tree/nodes/functions/log10Node");
|
|
9
|
-
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
10
9
|
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
11
|
-
const probaFlip_1 = require("../../../../utils/probaFlip");
|
|
12
10
|
const getLog10PowerSimplifyingQuestion = () => {
|
|
13
|
-
const tenthPower = (0, randint_1.randint)(-
|
|
14
|
-
const shouldEvaluate = (0, probaFlip_1.probaFlip)(0.7);
|
|
11
|
+
const tenthPower = (0, randint_1.randint)(-6, 8, [1]);
|
|
15
12
|
console.log("log10 power simp q");
|
|
16
|
-
const nb =
|
|
17
|
-
? new decimal_1.Decimal(1).multiplyByPowerOfTen(tenthPower).toTree()
|
|
18
|
-
: new powerNode_1.PowerNode(new numberNode_1.NumberNode(10), new numberNode_1.NumberNode(tenthPower));
|
|
13
|
+
const nb = new decimal_1.Decimal(1).multiplyByPowerOfTen(tenthPower).toTree();
|
|
19
14
|
const answer = tenthPower + "";
|
|
20
15
|
const question = {
|
|
21
16
|
answer,
|
|
@@ -39,13 +34,12 @@ const getPropositions = (n, { answer, tenthPower }) => {
|
|
|
39
34
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
40
35
|
};
|
|
41
36
|
const getHint = (nb) => {
|
|
42
|
-
return `Pour calculer
|
|
37
|
+
return `Pour calculer $\\log(${nb.toTex()})$, il est utile de transformer le nombre $${nb.toTex()}$ en une puissance de $10$.`;
|
|
43
38
|
};
|
|
44
39
|
const getCorrection = (tenthPower, nb) => {
|
|
45
40
|
const powerTen = new powerNode_1.PowerNode((10).toTree(), tenthPower.toTree());
|
|
46
|
-
return `1 .
|
|
47
|
-
2 .
|
|
48
|
-
\\Leftrightarrow \\log(${nb.toTex()}) = ${tenthPower}$.
|
|
41
|
+
return `1 . On exprime $${nb.toTex()}$ en puissance de $10$ : $${nb.toTex()} = ${powerTen.toTex()}$ \n
|
|
42
|
+
2 . On utilise la propriété $\\log(a^{b}) = b\\times \\log(a)$. On a alors $\\log(${nb.toTex()}) = \\log(${powerTen.toTex()}) = ${tenthPower}\\times \\log(10) = ${tenthPower}$.
|
|
49
43
|
`;
|
|
50
44
|
};
|
|
51
45
|
const isAnswerValid = (ans, { answer, tenthPower }) => {
|
|
@@ -58,11 +52,11 @@ exports.log10PowerSimplifying = {
|
|
|
58
52
|
levels: ["TermTech", "MathComp"],
|
|
59
53
|
isSingleStep: true,
|
|
60
54
|
sections: ["Logarithme décimal", "Puissances"],
|
|
61
|
-
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLog10PowerSimplifyingQuestion, nb,
|
|
55
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLog10PowerSimplifyingQuestion, nb, 10),
|
|
62
56
|
qcmTimer: 60,
|
|
63
57
|
freeTimer: 60,
|
|
64
58
|
getPropositions,
|
|
65
59
|
isAnswerValid,
|
|
66
|
-
maxAllowedQuestions:
|
|
60
|
+
maxAllowedQuestions: 10,
|
|
67
61
|
subject: "Mathématiques",
|
|
68
62
|
};
|
|
@@ -23,7 +23,7 @@ const getScalarProductViaCoordsQuestion = () => {
|
|
|
23
23
|
uCoords: [u.x.toTex(), u.y.toTex()],
|
|
24
24
|
vCoords: [v.x.toTex(), v.y.toTex()],
|
|
25
25
|
},
|
|
26
|
-
hint: "
|
|
26
|
+
hint: "Le produit scalaire de deux vecteurs se calcule en multipliant les coordonnées correspondantes et en additionnant les résultats.",
|
|
27
27
|
correction: `Le produit scalaire de $${u.toTex()}$ et $${v.toTex()}$ est calculé comme suit : $(${u.x.toTex()} \\times ${v.x.toTex()}) + (${u.y.toTex()} \\times ${v.y.toTex()}) = ${answer}$.`,
|
|
28
28
|
};
|
|
29
29
|
return question;
|
|
@@ -90,7 +90,7 @@ const getCorrection = (sides, sideLengths, randSideQuestion, randSide, angle, an
|
|
|
90
90
|
const opposite = sidesWithLentgh.filter((value) => value.name !== hypothenus.name && value.name !== adjacent.name)[0];
|
|
91
91
|
const correctEquations = getCorrectEquations({ name: sides[randSideQuestion], length: sideLengths[randSideQuestion] }, { name: sides[randSide], length: sideLengths[randSide] }, hypothenus, { name: angle, value: angleValue }, adjacent, opposite, answer);
|
|
92
92
|
return `On utilise la relation $${correctEquations[0]}$, on a donc :
|
|
93
|
-
$${correctEquations[1]}
|
|
93
|
+
$${correctEquations[1]}$, donc $${correctEquations[2]}$. Ainsi $${correctEquations[3]}$ `;
|
|
94
94
|
};
|
|
95
95
|
const getCorrectEquations = (randSideQuestion, randSide, hypothenus, angle, adjacent, opposite, answer) => {
|
|
96
96
|
let result;
|
|
@@ -101,12 +101,12 @@ const getCorrectEquations = (randSideQuestion, randSide, hypothenus, angle, adja
|
|
|
101
101
|
? [
|
|
102
102
|
`\\tan(\\widehat{${angle.name}})=\\frac{${opposite.name}}{${adjacent.name}}`,
|
|
103
103
|
`\\tan(\\widehat{${angle.value}})=\\frac{${opposite.length}}{${adjacent.name}}`,
|
|
104
|
-
|
|
104
|
+
`${adjacent.name}=\\frac{${opposite.length}}{\\tan(\\widehat{${angle.value}})}`,
|
|
105
105
|
]
|
|
106
106
|
: [
|
|
107
107
|
`\\cos(\\widehat{${angle.name}})=\\frac{${adjacent.name}}{${hypothenus.name}}`,
|
|
108
108
|
`\\cos(\\widehat{${angle.value}})=\\frac{${adjacent.name}}{${hypothenus.length}}`,
|
|
109
|
-
|
|
109
|
+
`${adjacent.name}=\\cos(\\widehat{${angle.value}})\\times${hypothenus.length}`,
|
|
110
110
|
];
|
|
111
111
|
return result.concat(`${answer}=${adjacent.name}`);
|
|
112
112
|
case opposite.name:
|
|
@@ -115,12 +115,12 @@ const getCorrectEquations = (randSideQuestion, randSide, hypothenus, angle, adja
|
|
|
115
115
|
? [
|
|
116
116
|
`\\tan(\\widehat{${angle.name}})=\\frac{${opposite.name}}{${adjacent.name}}`,
|
|
117
117
|
`\\tan(\\widehat{${angle.value}})=\\frac{${opposite.name}}{${adjacent.length}}`,
|
|
118
|
-
|
|
118
|
+
`${opposite.name}=\\tan(\\widehat{${angle.value}})*${adjacent.length}`,
|
|
119
119
|
]
|
|
120
120
|
: [
|
|
121
121
|
`\\sin(\\widehat{${angle.name}})=\\frac{${opposite.name}}{${hypothenus.name}}`,
|
|
122
122
|
`\\sin(\\widehat{${angle.value}})=\\frac{${opposite.name}}{${hypothenus.length}}`,
|
|
123
|
-
|
|
123
|
+
`${opposite.name}=\\sin(\\widehat{${angle.value}})\\times${hypothenus.length}`,
|
|
124
124
|
];
|
|
125
125
|
return result.concat(`${answer}=${opposite.name}`);
|
|
126
126
|
case hypothenus.name:
|
|
@@ -129,14 +129,14 @@ const getCorrectEquations = (randSideQuestion, randSide, hypothenus, angle, adja
|
|
|
129
129
|
? [
|
|
130
130
|
`\\cos(\\widehat{${angle.name}})=\\frac{${adjacent.name}}{${hypothenus.name}}`,
|
|
131
131
|
`\\cos(\\widehat{${angle.value}})=\\frac{${adjacent.length}}{${hypothenus.name}}`,
|
|
132
|
-
|
|
132
|
+
`${hypothenus.name}=\\frac{${adjacent.length}}{\\cos(${angle.value})}`,
|
|
133
133
|
]
|
|
134
134
|
: [
|
|
135
135
|
`\\sin(\\widehat{${angle.name}})=\\frac{${opposite.name}}{${hypothenus.name}}`,
|
|
136
136
|
`\\sin(\\widehat{${angle.value}})=\\frac{${opposite.length}}{${hypothenus.name}}`,
|
|
137
|
-
|
|
137
|
+
`${hypothenus.name}=\\frac{${opposite.length}}{\\sin(${angle.value})}`,
|
|
138
138
|
];
|
|
139
|
-
return result.concat(`${
|
|
139
|
+
return result.concat(`${hypothenus.name}=${answer}`);
|
|
140
140
|
default:
|
|
141
141
|
return [];
|
|
142
142
|
}
|
|
@@ -51,11 +51,11 @@ const getPropositions = (n, { answer, originIsMoon, weight }) => {
|
|
|
51
51
|
const getCorrection = (origin, weight, answer, gt, gl) => {
|
|
52
52
|
switch (origin) {
|
|
53
53
|
case "Terre":
|
|
54
|
-
return `1 . Trouver la masse de l'objet en utilisant son poids sur Terre $p_T$ et l'accélération due à la gravité terrestre $g_T$ : \n $m = \\frac{p_T}{g_T} \\Leftrightarrow m=${(0, round_1.round)(weight / gt.evaluate(), 1)}$. \n \\
|
|
54
|
+
return `1 . Trouver la masse de l'objet en utilisant son poids sur Terre $p_T$ et l'accélération due à la gravité terrestre $g_T$ : \n $m = \\frac{p_T}{g_T} \\Leftrightarrow m=${(0, round_1.round)(weight / gt.evaluate(), 1)}\\text{kg}$. \n \\
|
|
55
55
|
2 . Utiliser la masse trouvée et l'accélération due à la gravité sur la Lune $g_L$ pour calculer le poids sur la Lune $p_L$ : $p_L = m \\ \\cdot g_L \\Leftrightarrow$ $p_L = ${(0, frenchify_1.frenchify)(answer)}$.`;
|
|
56
56
|
case "Lune":
|
|
57
57
|
return `1 . Trouver la masse de l'objet en utilisant son poids sur la Lune $p_L$ et l'accélération due à la gravité luanire $g_L$ :
|
|
58
|
-
$m = \\frac{p_L}{g_L} \\Leftrightarrow m=${(0, round_1.round)(weight / gl.evaluate(), 1)}$. \n \\
|
|
58
|
+
$m = \\frac{p_L}{g_L} \\Leftrightarrow m=${(0, round_1.round)(weight / gl.evaluate(), 1)}\\text{kg}$. \n \\
|
|
59
59
|
2 . Utiliser la masse trouvée et l'accélération due à la gravité sur la Terre $g_T$ pour calculer le poids sur la Terre $p_T$ :
|
|
60
60
|
$p_T = m \\ \\cdot g_T \\Leftrightarrow p_T = ${(0, frenchify_1.frenchify)(answer)}$.`;
|
|
61
61
|
default:
|
|
@@ -27,9 +27,9 @@ class Log10Node {
|
|
|
27
27
|
}
|
|
28
28
|
toTex() {
|
|
29
29
|
const tex = this.child.toTex();
|
|
30
|
-
if (!this.opts?.allowLnOfOne && tex === "1") {
|
|
31
|
-
|
|
32
|
-
}
|
|
30
|
+
// if (!this.opts?.allowLnOfOne && tex === "1") {
|
|
31
|
+
// return "0";
|
|
32
|
+
// }
|
|
33
33
|
const shouldntUseBrackets = (0, absNode_1.isAbsNode)(this.child);
|
|
34
34
|
if (shouldntUseBrackets)
|
|
35
35
|
return `\\log${tex}`;
|