math-exercises 2.1.18 → 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.
@@ -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,
@@ -1 +1 @@
1
- {"version":3,"file":"capacityConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/capacityConversion.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAyDF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
1
+ {"version":3,"file":"capacityConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/capacityConversion.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAwDF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
@@ -33,9 +33,8 @@ const getPropositions = (n, { answer, randomCapacity, randomUnitIndex, randomUni
33
33
  (0, exercise_1.addValidProp)(propositions, answer);
34
34
  const capacityDecimal = new decimal_1.Decimal(randomCapacity);
35
35
  while (propositions.length < n) {
36
- console.log("capactiy conv qcm");
37
36
  const wrongAnswer = capacityDecimal
38
- .multiplyByPowerOfTen((0, randint_1.randint)(-3, 4, [randomUnitIndex - randomUnitInstructionIndex]))
37
+ .multiplyByPowerOfTen((0, randint_1.randint)(-4, 5, [randomUnitIndex - randomUnitInstructionIndex]))
39
38
  .value.toString()
40
39
  .replace(".", ",");
41
40
  (0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer);
@@ -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 = "Rappelez-vous que 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 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":"integralFractions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralFractions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA6LF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAanD,CAAC"}
1
+ {"version":3,"file":"integralFractions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralFractions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAgMF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAanD,CAAC"}
@@ -35,7 +35,8 @@ const getIntegralFractionsQuestion = () => {
35
35
  lowerBound = (0, randint_1.randint)(-5, 5, [0]);
36
36
  upperBound = (0, randint_1.randint)(-5, 5, [0]);
37
37
  }
38
- } while (doesTrinomialVanishInInterval(trinomial, lowerBound, upperBound));
38
+ } while (doesTrinomialVanishInInterval(trinomial, lowerBound, upperBound) ||
39
+ affine.calculate(lowerBound) === 0);
39
40
  const fraction = questionType === "Trinomial"
40
41
  ? new fractionNode_1.FractionNode(affine.toTree(), trinomial.toTree())
41
42
  : new fractionNode_1.FractionNode(affine.coefficients[1].toTree(), affine.toTree());
@@ -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;AAmDF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,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)(-5, 6, [0, 1]);
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 = shouldEvaluate
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 $log(⁡${nb.toTex()})$, il est utile de transformer le nombre $${nb.toTex()}$ en une puissance de $10$.`;
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 . Exprimez $${nb.toTex()}$ en puissance de $10$ : $${powerTen.toTex()}$ \n
47
- 2 . Utilisez la propriété des logarithmes qui stipule que $\\log(a^{b}) = b\\times \\log(a) \\Leftrightarrow \\log(${powerTen.toTex()}) = ${tenthPower}\\times \\log(10)
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, 15),
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: 15,
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: "Rappelez-vous que le produit scalaire de deux vecteurs se calcule en multipliant les coordonnées correspondantes et en additionnant les résultats.",
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;
@@ -1 +1 @@
1
- {"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAkEtB,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAerD,CAAC"}
1
+ {"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAkEtB,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
@@ -9,7 +9,7 @@ const getIsTableProportionalQuestion = () => {
9
9
  const table = generateTable();
10
10
  const question = {
11
11
  answer: table.coeff ? "Oui" : "Non",
12
- instruction: `On considere le tableau ci-dessous, est-il proportionnel ?${table.table}`,
12
+ instruction: `On considère le tableau ci-dessous. Est-ce un tableau de proportionnalité ?${table.table}`,
13
13
  keys: [],
14
14
  answerFormat: "raw",
15
15
  style: { tableHasNoHeader: true },
@@ -22,7 +22,7 @@ const getPropositions = (n, { answer }) => {
22
22
  (0, exercise_1.addValidProp)(propositions, answer, "raw");
23
23
  (0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
24
24
  (0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
25
- (0, exercise_1.tryToAddWrongProp)(propositions, "On peut pas savoir", "raw");
25
+ (0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
26
26
  return (0, exercise_1.shuffleProps)(propositions, n);
27
27
  };
28
28
  const isAnswerValid = (ans, { answer }) => {
@@ -47,7 +47,7 @@ const generateTable = () => {
47
47
  };
48
48
  const generateYValues = (xValues) => {
49
49
  const flip = (0, coinFlip_1.coinFlip)();
50
- const coeff = (0, randint_1.randint)(1, 5);
50
+ const coeff = (0, randint_1.randint)(2, 6);
51
51
  return flip
52
52
  ? {
53
53
  values: xValues.map((value) => value * (0, randint_1.randint)(2, 5)),
@@ -59,7 +59,7 @@ const generateYValues = (xValues) => {
59
59
  };
60
60
  exports.isTableProportional = {
61
61
  id: "isVTableProportional",
62
- label: "Reconnaître si 2 grandeurs sont proportionnelles à partir d'un tableau.",
62
+ label: "Reconnaître un tableau de proportionnalité",
63
63
  levels: ["5ème"],
64
64
  isSingleStep: true,
65
65
  sections: ["Proportionnalité"],
@@ -41,7 +41,7 @@ const getArcValueQuestion = () => {
41
41
  : selectedFunction === "cos"
42
42
  ? new cosNode_1.CosNode(new variableNode_1.VariableNode("\\theta"))
43
43
  : new tanNode_1.TanNode(new variableNode_1.VariableNode("\\theta"));
44
- const instruction = `Quelle est la valeur en degrés de l'angle $\\theta$ si $${trigNode.toTex()} = ${trigValue.frenchify()}$ ? Arrondir à l'unité.`;
44
+ const instruction = `Quelle est la valeur en degrés de l'angle $\\theta$ sachant que $${trigNode.toTex()} = ${trigValue.frenchify()}$ ? Arrondir à l'unité.`;
45
45
  const answer = (0, round_1.round)(angleInDegrees, 0).toTree().toTex();
46
46
  const question = {
47
47
  answer: answer,
@@ -65,7 +65,7 @@ const isAnswerValid = (ans, { answer }) => {
65
65
  };
66
66
  exports.arcValue = {
67
67
  id: "arcValue",
68
- label: "Calculer l'angle en degrés donné une valeur trigonométrique",
68
+ label: "Calculer un angle via son cosinus/sinus/tangente",
69
69
  levels: ["1reSpé"],
70
70
  isSingleStep: true,
71
71
  sections: ["Trigonométrie"],
@@ -1,6 +1,7 @@
1
1
  import { Exercise } from "../../../exercises/exercise";
2
2
  type Identifiers = {
3
3
  degree: number;
4
+ trigoFunct: string;
4
5
  };
5
6
  export declare const calculateCosSinAndTan: Exercise<Identifiers>;
6
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA0DF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAavD,CAAC"}
1
+ {"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA0DF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAavD,CAAC"}
@@ -13,13 +13,13 @@ const random_1 = require("../../../utils/random");
13
13
  const trigo = ["sin", "tan", "cos"];
14
14
  const getCalculateCosSinAndTanQuestion = () => {
15
15
  const trigoFunct = (0, random_1.random)(trigo);
16
- const degree = (0, randint_1.randint)(1, 360);
16
+ const degree = (0, randint_1.randint)(1, 180);
17
17
  const question = {
18
18
  answer: getCorrectAnswer(degree, trigoFunct),
19
- instruction: `Calculer $${trigoFunct}(${new degree_1.DegreeNode(degree).toTex()})$, arrondir le resultat au dixième.`,
19
+ instruction: `Calculer $\\${trigoFunct}(${new degree_1.DegreeNode(degree).toTex()})$, arrondir le résultat au dixième.`,
20
20
  keys: [],
21
21
  answerFormat: "tex",
22
- identifiers: { degree },
22
+ identifiers: { degree, trigoFunct },
23
23
  };
24
24
  return question;
25
25
  };
@@ -58,7 +58,7 @@ const getCorrectAnswer = (degree, trigoFunct) => {
58
58
  };
59
59
  exports.calculateCosSinAndTan = {
60
60
  id: "calculateCosSinAndTan",
61
- label: "Calcul de tan/sin/cos avec des degrés",
61
+ label: "Calculer le cosinus/sinus/tangente d'un angle en degrés",
62
62
  levels: ["3ème"],
63
63
  isSingleStep: true,
64
64
  sections: ["Trigonométrie"],
@@ -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]} \\Leftrightarrow ${correctEquations[2]} \\Leftrightarrow ${correctEquations[3]}$ `;
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
- `\\frac{${opposite.length}}{\\tan(\\widehat{${angle.value}})}=${adjacent.name}`,
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
- `\\cos(\\widehat{${angle.value}})*${hypothenus.length}=${adjacent.name}`,
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
- `\\tan(\\widehat{${angle.value}})*${adjacent.length}=${opposite.name}`,
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
- `\\sin(\\widehat{${angle.value}})*${hypothenus.length}=${opposite.name}`,
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
- `\\frac{${adjacent.length}}{\\cos(${angle.value})}=${hypothenus.name}`,
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
- `\\frac{${opposite.length}}{\\sin(${angle.value})}=${hypothenus.name}`,
137
+ `${hypothenus.name}=\\frac{${opposite.length}}{\\sin(${angle.value})}`,
138
138
  ];
139
- return result.concat(`${answer}=${hypothenus.name}`);
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:
package/lib/index.d.ts CHANGED
@@ -1284,6 +1284,7 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1284
1284
  angleInDegrees: number;
1285
1285
  }> | import("./exercises/exercise").Exercise<{
1286
1286
  degree: number;
1287
+ trigoFunct: string;
1287
1288
  }> | import("./exercises/exercise").Exercise<{
1288
1289
  exercise: {
1289
1290
  a: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;CACF;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BE;AAEF,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA/BF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEgD,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
@@ -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
- return "0";
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}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.1.18",
3
+ "version": "2.1.20",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [