math-exercises 3.0.55 → 3.0.57

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 (147) hide show
  1. package/lib/exercises/math/calcul/arithmetics/index.d.ts +1 -0
  2. package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/arithmetics/index.js +1 -0
  4. package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.d.ts +8 -0
  5. package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.d.ts.map +1 -0
  6. package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.js +87 -0
  7. package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +2 -2
  9. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -1
  10. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +7 -1
  11. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts.map +1 -1
  12. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +65 -13
  13. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  14. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +43 -0
  15. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
  16. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +23 -0
  17. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
  18. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +23 -0
  19. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
  20. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +49 -0
  21. package/lib/exercises/math/conversion/capacityConversion.d.ts.map +1 -1
  22. package/lib/exercises/math/conversion/capacityConversion.js +68 -12
  23. package/lib/exercises/math/conversion/hoursToDecimal.d.ts.map +1 -1
  24. package/lib/exercises/math/conversion/hoursToDecimal.js +73 -15
  25. package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
  26. package/lib/exercises/math/conversion/lengthConversion.js +55 -6
  27. package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
  28. package/lib/exercises/math/conversion/massConversion.js +72 -16
  29. package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
  30. package/lib/exercises/math/conversion/volumeConversion.js +72 -12
  31. package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
  32. package/lib/exercises/math/functions/affines/signFunction.js +23 -11
  33. package/lib/exercises/math/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
  34. package/lib/exercises/math/functions/basics/imageFunctionGeogebra.js +16 -0
  35. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  36. package/lib/exercises/math/geometry/areas/triangleArea.js +34 -2
  37. package/lib/exercises/math/geometry/areas/triangleAreaV2.d.ts.map +1 -1
  38. package/lib/exercises/math/geometry/areas/triangleAreaV2.js +54 -8
  39. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
  40. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +12 -5
  41. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -1
  42. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +29 -1
  43. package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.d.ts.map +1 -1
  44. package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +25 -1
  45. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
  46. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +68 -29
  47. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -1
  48. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +56 -4
  49. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.d.ts.map +1 -1
  50. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.js +1 -0
  51. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -1
  52. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +71 -25
  53. package/lib/exercises/math/geometry/lines/index.d.ts +1 -0
  54. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  55. package/lib/exercises/math/geometry/lines/index.js +1 -0
  56. package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts +6 -0
  57. package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts.map +1 -1
  58. package/lib/exercises/math/geometry/vectors/findCoordForAligment.js +161 -92
  59. package/lib/exercises/math/geometry/vectors/index.d.ts +1 -0
  60. package/lib/exercises/math/geometry/vectors/index.d.ts.map +1 -1
  61. package/lib/exercises/math/geometry/vectors/index.js +1 -0
  62. package/lib/exercises/math/geometry/volumes/coneVolume.d.ts.map +1 -1
  63. package/lib/exercises/math/geometry/volumes/coneVolume.js +68 -6
  64. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
  65. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +55 -11
  66. package/lib/exercises/math/geometry/volumes/sphereVolume.d.ts.map +1 -1
  67. package/lib/exercises/math/geometry/volumes/sphereVolume.js +31 -3
  68. package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts.map +1 -1
  69. package/lib/exercises/math/geometry/volumes/volumeOfCube.js +46 -18
  70. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts.map +1 -1
  71. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +114 -63
  72. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
  73. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +102 -64
  74. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -1
  75. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +99 -53
  76. package/lib/exercises/math/limits/polynomLimit.d.ts +1 -1
  77. package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
  78. package/lib/exercises/math/limits/polynomLimit.js +28 -9
  79. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts +1 -1
  80. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts.map +1 -1
  81. package/lib/exercises/math/limits/polynomLimitNoFI.js +29 -10
  82. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  83. package/lib/exercises/math/powers/calculateNegativePower.js +59 -16
  84. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  85. package/lib/exercises/math/powers/decimalToScientific.js +55 -11
  86. package/lib/exercises/math/powers/index.d.ts +1 -0
  87. package/lib/exercises/math/powers/index.d.ts.map +1 -1
  88. package/lib/exercises/math/powers/index.js +1 -0
  89. package/lib/exercises/math/powers/powersDivision.d.ts +5 -2
  90. package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
  91. package/lib/exercises/math/powers/powersDivision.js +68 -53
  92. package/lib/exercises/math/powers/powersMixOperations.d.ts +1 -0
  93. package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
  94. package/lib/exercises/math/powers/powersMixOperations.js +88 -17
  95. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts +10 -0
  96. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts.map +1 -0
  97. package/lib/exercises/math/powers/powersOfTenMixOperations.js +129 -0
  98. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  99. package/lib/exercises/math/powers/powersOfTenToDecimal.js +32 -3
  100. package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
  101. package/lib/exercises/math/powers/powersProduct.js +1 -0
  102. package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
  103. package/lib/exercises/math/powers/scientificToDecimal.js +50 -10
  104. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  105. package/lib/exercises/math/primitive/polynomialPrimitive.js +1 -0
  106. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -1
  107. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +50 -3
  108. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
  109. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.js +32 -0
  110. package/lib/exercises/math/trigonometry/remarkableValues.d.ts.map +1 -1
  111. package/lib/exercises/math/trigonometry/remarkableValues.js +8 -0
  112. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  113. package/lib/exercises/math/trigonometry/trigonometry.js +67 -1
  114. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  115. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +89 -0
  116. package/lib/index.d.ts +22 -4
  117. package/lib/index.d.ts.map +1 -1
  118. package/lib/math/geometry/angle.d.ts.map +1 -1
  119. package/lib/math/geometry/angle.js +0 -5
  120. package/lib/math/geometry/vector.d.ts +3 -0
  121. package/lib/math/geometry/vector.d.ts.map +1 -1
  122. package/lib/math/geometry/vector.js +25 -0
  123. package/lib/math/numbers/decimals/decimal.d.ts +1 -0
  124. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  125. package/lib/math/numbers/decimals/decimal.js +2 -0
  126. package/lib/math/systems/generalSystem.d.ts +6 -1
  127. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  128. package/lib/math/systems/generalSystem.js +137 -0
  129. package/lib/math/utils/arithmetic/lcm.d.ts +2 -0
  130. package/lib/math/utils/arithmetic/lcm.d.ts.map +1 -0
  131. package/lib/math/utils/arithmetic/lcm.js +5 -0
  132. package/lib/playground.d.ts.map +1 -1
  133. package/lib/playground.js +1 -3
  134. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  135. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  136. package/lib/tree/nodes/equations/equalNode.d.ts +7 -1
  137. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  138. package/lib/tree/nodes/equations/equalNode.js +17 -9
  139. package/lib/tree/nodes/operators/addNode.js +1 -1
  140. package/lib/tree/nodes/operators/fractionNode.d.ts +2 -2
  141. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  142. package/lib/tree/nodes/operators/fractionNode.js +37 -17
  143. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  144. package/lib/tree/nodes/operators/powerNode.js +5 -0
  145. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  146. package/lib/tree/nodes/sets/intervalNode.js +3 -1
  147. package/package.json +1 -1
@@ -32,10 +32,36 @@ const getAnswer = (identifiers) => {
32
32
  return answer;
33
33
  };
34
34
  const getPowersOfTenToDecimalQuestion = () => {
35
- const randPower = randint(-9, 10);
35
+ const randPower = randint(-6, 7);
36
36
  const identifiers = { randPower };
37
37
  return getQuestionFromIdentifiers(identifiers);
38
38
  };
39
+ const getHint = (identifiers) => {
40
+ return `Si $x$ est un entier positif, alors $10^x$ est le nombre composé d'un $1$ suivi de $x$ zéros.
41
+
42
+ Si $x$ est un entier négatif, alors $10^x$ est le nombre composé d'un $1$ précédé de $x$ zéros.
43
+
44
+ Enfin, tout nombre élevé à la puissance $0$ est égal à $1$.`;
45
+ };
46
+ const getCorrection = (identifiers) => {
47
+ const { randPower } = identifiers;
48
+ const order = randPower < 0 ? "précédé" : "suivi";
49
+ let corr = "";
50
+ if (randPower === 0) {
51
+ corr = `Tout nombre élevé à la puissance $0$ est égal à $1$ : `;
52
+ }
53
+ else if (randPower === 1) {
54
+ corr = `Un nombre élevé à la puissance $1$ est égal à lui-même :`;
55
+ }
56
+ else {
57
+ corr = `$10^{${randPower}}$ est le nombre composé d'un $1$ ${order} de $${Math.abs(randPower)}$ zéros :`;
58
+ }
59
+ const final = `
60
+ $$
61
+ ${getStartStatement(identifiers)}=${getAnswer(identifiers)}
62
+ $$`;
63
+ return corr + final;
64
+ };
39
65
  const getQuestionFromIdentifiers = (identifiers) => {
40
66
  const question = {
41
67
  instruction: getInstruction(identifiers),
@@ -44,6 +70,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
44
70
  keys: [],
45
71
  answerFormat: "tex",
46
72
  identifiers,
73
+ hint: getHint(identifiers),
74
+ correction: getCorrection(identifiers),
47
75
  };
48
76
  return question;
49
77
  };
@@ -68,10 +96,10 @@ export const powersOfTenToDecimal = {
68
96
  connector: "=",
69
97
  label: "Écriture décimale d'une puissance de $10$",
70
98
  isSingleStep: true,
71
- generator: (nb) => getDistinctQuestions(getPowersOfTenToDecimalQuestion, nb, 19),
99
+ generator: (nb) => getDistinctQuestions(getPowersOfTenToDecimalQuestion, nb, 12),
72
100
  qcmTimer: 60,
73
101
  freeTimer: 60,
74
- maxAllowedQuestions: 19,
102
+ maxAllowedQuestions: 12,
75
103
  getPropositions,
76
104
  isAnswerValid,
77
105
  subject: "Mathématiques",
@@ -79,4 +107,5 @@ export const powersOfTenToDecimal = {
79
107
  getAnswer,
80
108
  getStartStatement,
81
109
  getQuestionFromIdentifiers,
110
+ hasHintAndCorrection: true,
82
111
  };
@@ -1 +1 @@
1
- {"version":3,"file":"powersProduct.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersProduct.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAM3B,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AA4IF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAuB7D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyBxD,CAAC"}
1
+ {"version":3,"file":"powersProduct.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersProduct.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAM3B,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AA6IF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAuB7D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAyBxD,CAAC"}
@@ -85,6 +85,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
85
85
  const getPropositions = (n, { answer, a, b, c }) => {
86
86
  const propositions = [];
87
87
  addValidProp(propositions, answer);
88
+ tryToAddWrongProp(propositions, power(a, add(b, c)).simplify().toTex());
88
89
  while (propositions.length < n) {
89
90
  const wrongExponent = b + c + randint(-11, 11, [0, -b - c]);
90
91
  const wrongAnswerTree = new Power(a === 1 || a === -1 ? randint(-3, 4, [-1, 1]) : a, wrongExponent).simplify();
@@ -1 +1 @@
1
- {"version":3,"file":"scientificToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/scientificToDecimal.ts"],"names":[],"mappings":"AAAA;;MAEM;AAYN,OAAO,EACL,QAAQ,EAST,MAAM,mBAAmB,CAAC;AAE3B,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAiDF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAYrD,CAAC"}
1
+ {"version":3,"file":"scientificToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/scientificToDecimal.ts"],"names":[],"mappings":"AAAA;;MAEM;AAaN,OAAO,EACL,QAAQ,EAeT,MAAM,mBAAmB,CAAC;AAE3B,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA8FF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * a*10^x vers décimal
3
3
  * */
4
+ import { numberVEA } from "../../../exercises/vea/numberVEA.js";
4
5
  import { Decimal, DecimalConstructor, } from "../../../math/numbers/decimals/decimal.js";
5
6
  import { randint } from "../../../math/utils/random/randint.js";
6
7
  import { NumberNode } from "../../../tree/nodes/numbers/numberNode.js";
@@ -8,22 +9,59 @@ import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
8
9
  import { PowerNode } from "../../../tree/nodes/operators/powerNode.js";
9
10
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../exercise.js";
10
11
  import { getDistinctQuestions } from "../../utils/getDistinctQuestions.js";
11
- const getScientificToDecimalQuestion = () => {
12
- const decScientific = DecimalConstructor.randomScientific(randint(1, 4));
13
- const tenPower = randint(-5, 6, [0, 1]);
12
+ const getInstruction = (identifiers) => {
13
+ return `Donner l'écriture décimale du nombre suivant :
14
+
15
+ $$
16
+ ${getStartStatement(identifiers)}
17
+ $$`;
18
+ };
19
+ const getAnswer = (identifiers) => {
20
+ const { decimal, tenPower } = identifiers;
21
+ const decScientific = new Decimal(decimal);
14
22
  const answer = decScientific.multiplyByPowerOfTen(tenPower).toTree().toTex();
15
- const statement = new MultiplyNode(new NumberNode(decScientific.value), new PowerNode(new NumberNode(10), new NumberNode(tenPower)));
16
- const statementTex = statement.toTex();
23
+ return answer;
24
+ };
25
+ const getHint = (identifiers) => {
26
+ const { decimal, tenPower } = identifiers;
27
+ return `Si $x$ est un entier négatif, alors multiplier par $10^x$ revient à déplacer la virgule de $x$ rangs vers la gauche.
28
+
29
+ Si $x$ est un entier positif, alors multiplier par $10^x$ revient à déplacer la virgule de $x$ rangs vers la droite.`;
30
+ };
31
+ const getCorrection = (identifiers) => {
32
+ const { decimal, tenPower } = identifiers;
33
+ return `On déplace la virgule de $${Math.abs(tenPower)}$ rangs vers la ${tenPower < 0 ? "gauche" : "droite"} :
34
+
35
+ $$
36
+ ${getStartStatement(identifiers)} = ${getAnswer(identifiers)}
37
+ $$`;
38
+ };
39
+ const getQuestionFromIdentifiers = (identifiers) => {
40
+ const { decimal, tenPower } = identifiers;
17
41
  const question = {
18
- instruction: `Donner l'écriture décimale de : $${statementTex}$`,
19
- startStatement: statementTex,
20
- answer: answer,
42
+ instruction: getInstruction(identifiers),
43
+ startStatement: getStartStatement(identifiers),
44
+ answer: getAnswer(identifiers),
21
45
  keys: [],
22
46
  answerFormat: "tex",
23
- identifiers: { decimal: decScientific.value, tenPower },
47
+ identifiers,
48
+ hint: getHint(identifiers),
49
+ correction: getCorrection(identifiers),
24
50
  };
25
51
  return question;
26
52
  };
53
+ const getStartStatement = (identifiers) => {
54
+ const { decimal, tenPower } = identifiers;
55
+ const statement = new MultiplyNode(new NumberNode(decimal), new PowerNode(new NumberNode(10), new NumberNode(tenPower)));
56
+ const statementTex = statement.toTex();
57
+ return statementTex;
58
+ };
59
+ const getScientificToDecimalQuestion = () => {
60
+ const decScientific = DecimalConstructor.randomScientific(randint(1, 4));
61
+ const tenPower = randint(-5, 6, [0, 1]);
62
+ const identifiers = { decimal: decScientific.value, tenPower };
63
+ return getQuestionFromIdentifiers(identifiers);
64
+ };
27
65
  const getPropositions = (n, { answer, tenPower, decimal }) => {
28
66
  const propositions = [];
29
67
  const decScientific = new Decimal(decimal);
@@ -39,7 +77,7 @@ const getPropositions = (n, { answer, tenPower, decimal }) => {
39
77
  return shuffleProps(propositions, n);
40
78
  };
41
79
  const isAnswerValid = (ans, { answer }) => {
42
- return ans === answer;
80
+ return numberVEA(ans, answer);
43
81
  };
44
82
  export const scientificToDecimal = {
45
83
  id: "scientificToDecimal",
@@ -52,4 +90,6 @@ export const scientificToDecimal = {
52
90
  getPropositions,
53
91
  isAnswerValid,
54
92
  subject: "Mathématiques",
93
+ getQuestionFromIdentifiers,
94
+ hasHintAndCorrection: true,
55
95
  };
@@ -1 +1 @@
1
- {"version":3,"file":"polynomialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/polynomialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiBF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAcjE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAexE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,GAAG,CAAC,WAAW,CAmB7D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAWrD,CAAC"}
1
+ {"version":3,"file":"polynomialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/polynomialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiBF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAcjE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAexE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,GAAG,CAAC,WAAW,CAqB7D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAWrD,CAAC"}
@@ -53,6 +53,7 @@ export const isPolynomialPrimitiveAnswerValid = (ans, { coeffs, answer }) => {
53
53
  towardsDistribute: true,
54
54
  forbidFactorize: true,
55
55
  forceDistributeFractions: true,
56
+ decimalToFractions: true,
56
57
  })
57
58
  .toTex() === answer);
58
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geometricFirstTermsGeneralSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAyDF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAgB/D,CAAC"}
1
+ {"version":3,"file":"geometricFirstTermsGeneralSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAgHF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAgB/D,CAAC"}
@@ -1,10 +1,52 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { randint } from "../../../../math/utils/random/randint.js";
4
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
5
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
7
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
4
8
  import { random } from "../../../../utils/alea/random.js";
9
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
10
+ const getHint = (identifiers) => {
11
+ return `On utilise la formule :
12
+
13
+ $$
14
+ S = \\text{premier terme} \\times \\frac{1-\\text{raison}^{\\text{nombre de termes}}}{1-\\text{raison}}
15
+ $$`;
16
+ };
17
+ const getCorrection = (identifiers) => {
18
+ const { firstRank, firstValue, nbTerms, reason } = identifiers;
19
+ return `On utilise la formule :
20
+
21
+ $$
22
+ S = \\text{premier terme} \\times \\frac{1-\\text{raison}^{\\text{nombre de termes}}}{1-\\text{raison}}
23
+ $$
24
+
25
+ Ici, la raison est $${reason}$, le premier terme est $${firstValue}$ et le nombre de termes est $${nbTerms}$.
26
+
27
+ On a donc :
28
+
29
+ ${alignTex([
30
+ [
31
+ "S",
32
+ "=",
33
+ multiply(firstValue, frac(substract(1, power(reason, nbTerms)), substract(1, reason))).toTex(),
34
+ ],
35
+ [
36
+ "",
37
+ "=",
38
+ multiply(firstValue, frac(substract(1, power(reason, nbTerms)).simplify({
39
+ calculatePowers: true,
40
+ }), substract(1, reason).simplify())).toTex(),
41
+ ],
42
+ ["", "=", getAnswer(identifiers)],
43
+ ])}`;
44
+ };
5
45
  const getInstruction = (identifiers) => {
6
46
  const { firstRank, firstValue, reason, nbTerms } = identifiers;
7
- return `Soit $u$ une suite géométrique de premier terme $u_${firstRank} = ${firstValue}$ et de raison $${reason}$. Calculer la somme des $${nbTerms}$ premiers termes de $u$.`;
47
+ return `Soit $u$ une suite géométrique de premier terme $u_${firstRank} = ${firstValue}$ et de raison $${reason}$.
48
+
49
+ Calculer la somme des $${nbTerms}$ premiers termes de $u$.`;
8
50
  };
9
51
  const getAnswer = (identifiers) => {
10
52
  const { firstRank, firstValue, reason, nbTerms } = identifiers;
@@ -22,12 +64,17 @@ const getGeometricFirstTermsGeneralSumQuestion = () => {
22
64
  reason,
23
65
  nbTerms,
24
66
  };
67
+ return getQuestionFromIdentifiers(identifiers);
68
+ };
69
+ const getQuestionFromIdentifiers = (identifiers) => {
25
70
  const question = {
26
71
  answer: getAnswer(identifiers),
27
72
  instruction: getInstruction(identifiers),
28
73
  keys: [],
29
74
  answerFormat: "tex",
30
75
  identifiers,
76
+ hint: getHint(identifiers),
77
+ correction: getCorrection(identifiers),
31
78
  };
32
79
  return question;
33
80
  };
@@ -50,9 +97,7 @@ export const geometricFirstTermsGeneralSum = {
50
97
  id: "geometricFirstTermsGeneralSum",
51
98
  connector: "=",
52
99
  label: "Somme des termes d'une suite géométrique (cas général)",
53
- levels: [],
54
100
  isSingleStep: true,
55
- sections: [],
56
101
  generator: (nb) => getDistinctQuestions(getGeometricFirstTermsGeneralSumQuestion, nb),
57
102
  qcmTimer: 60,
58
103
  freeTimer: 60,
@@ -61,4 +106,6 @@ export const geometricFirstTermsGeneralSum = {
61
106
  subject: "Mathématiques",
62
107
  getInstruction,
63
108
  getAnswer,
109
+ getQuestionFromIdentifiers,
110
+ hasHintAndCorrection: true,
64
111
  };
@@ -1 +1 @@
1
- {"version":3,"file":"geometricFirstTermsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFirstTermsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAwDF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
1
+ {"version":3,"file":"geometricFirstTermsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFirstTermsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA2FF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
@@ -2,6 +2,7 @@ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { randint } from "../../../../math/utils/random/randint.js";
4
4
  import { shuffle } from "../../../../utils/alea/shuffle.js";
5
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
5
6
  const getInstruction = (identifiers) => {
6
7
  const { raison, final } = identifiers;
7
8
  return `Calculer la somme suivante :
@@ -10,6 +11,31 @@ $$
10
11
  1 + ${raison} + ${raison}^2 + \\ldots + ${raison}^{${final}}
11
12
  $$`;
12
13
  };
14
+ const getHint = (identifiers) => {
15
+ return `On utilise la formule :
16
+
17
+ $$
18
+ 1 + q + q^2 + \\ldots + q^n = \\frac{1-q^{n+1}}{1-q}
19
+ $$`;
20
+ };
21
+ const getCorrection = (identifiers) => {
22
+ const { raison, final } = identifiers;
23
+ return `On utilise la formule :
24
+
25
+ $$
26
+ 1 + q + q^2 + \\ldots + q^n = \\frac{1-q^{n+1}}{1-q}
27
+ $$
28
+
29
+ Ici, $q = ${raison}$ et $n = ${final}$.
30
+
31
+ On a donc :
32
+
33
+ ${alignTex([
34
+ ["S", "=", `\\frac{1-${raison}^{${final}+1}}{1-${raison}}`],
35
+ ["", "=", `\\frac{${1 - raison ** (final + 1)}}{${1 - raison}}`],
36
+ ["", "=", getAnswer(identifiers)],
37
+ ])}`;
38
+ };
13
39
  const getAnswer = (identifiers) => {
14
40
  const { raison, final } = identifiers;
15
41
  const answer = (raison ** (final + 1) - 1) / (raison - 1) + "";
@@ -19,12 +45,17 @@ const getGeometricFirstTermsSumQuestion = () => {
19
45
  const raison = randint(2, 8);
20
46
  const final = randint(5, 10);
21
47
  const identifiers = { raison, final };
48
+ return getQuestionFromIdentifiers(identifiers);
49
+ };
50
+ const getQuestionFromIdentifiers = (identifiers) => {
22
51
  const question = {
23
52
  answer: getAnswer(identifiers),
24
53
  instruction: getInstruction(identifiers),
25
54
  keys: [],
26
55
  answerFormat: "tex",
27
56
  identifiers,
57
+ hint: getHint(identifiers),
58
+ correction: getCorrection(identifiers),
28
59
  };
29
60
  return question;
30
61
  };
@@ -55,4 +86,5 @@ export const geometricFirstTermsSum = {
55
86
  subject: "Mathématiques",
56
87
  getAnswer,
57
88
  getInstruction,
89
+ hasHintAndCorrection: true,
58
90
  };
@@ -1 +1 @@
1
- {"version":3,"file":"remarkableValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/remarkableValues.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,EACL,QAAQ,EAYT,MAAM,mBAAmB,CAAC;AA2C3B,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,EAAE,eAAe,CAAC;CACnC,CAAC;AAkDF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAgB1D,CAAC"}
1
+ {"version":3,"file":"remarkableValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/remarkableValues.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,EACL,QAAQ,EAaT,MAAM,mBAAmB,CAAC;AAmD3B,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IAEf,gBAAgB,EAAE,eAAe,CAAC;CACnC,CAAC;AAkDF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAgB1D,CAAC"}
@@ -20,6 +20,14 @@ const values = [
20
20
  "\\frac{1}{2}",
21
21
  "1",
22
22
  ];
23
+ // const rebuildIdentifiers: RebuildIdentifiers<Identifiers> = (oldIds)=>{
24
+ // if(oldIds.angleIdentifiers) return oldIds
25
+ // return {
26
+ // angleIdentifiers: ,
27
+ // isCos: oldIds.isCos,
28
+ // mainValue: oldIds.mainValue
29
+ // }
30
+ // }
23
31
  const getStatementNode = (identifiers) => {
24
32
  const { mainValue, isCos, angleIdentifiers } = identifiers;
25
33
  const angle = reifyAlgebraic(angleIdentifiers);
@@ -1 +1 @@
1
- {"version":3,"file":"trigonometry.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AASnD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAyJF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAmB9C,CAAC"}
1
+ {"version":3,"file":"trigonometry.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAYnD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAqOF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAoB9C,CAAC"}
@@ -7,11 +7,74 @@ import { LengthNode } from "../../../tree/nodes/geometry/lengthNode.js";
7
7
  import { FractionNode } from "../../../tree/nodes/operators/fractionNode.js";
8
8
  import { random } from "../../../utils/alea/random.js";
9
9
  import { shuffle } from "../../../utils/alea/shuffle.js";
10
+ const getHint = (identifiers) => {
11
+ return `On peut utiliser la formule :
12
+
13
+ $$
14
+ \\text{SOHCAHTOA}
15
+ $$
16
+
17
+ qui signifie :
18
+
19
+ $$
20
+ \\text{sinus} = \\frac{\\text{opposé}}{\\text{hypoténuse}}
21
+ $$
22
+
23
+ $$
24
+ \\text{cosinus} = \\frac{\\text{adjacent}}{\\text{hypoténuse}}
25
+ $$
26
+
27
+ $$
28
+ \\text{tangente} = \\frac{\\text{opposé}}{\\text{adjacent}}
29
+ $$`;
30
+ };
31
+ const getCorrection = (identifiers) => {
32
+ const { randAngle, triangleIdentifiers, randTrigo } = identifiers;
33
+ const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
34
+ const formules = [
35
+ "\\text{cosinus} = \\frac{\\text{adjacent}}{\\text{hypoténuse}}",
36
+ "\\text{sinus} = \\frac{\\text{opposé}}{\\text{hypoténuse}}",
37
+ "\\text{tangente} = \\frac{\\text{opposé}}{\\text{adjacent}}",
38
+ ];
39
+ const oppose = triangle.sides[randAngle];
40
+ const adjacent = triangle.sides[3 - randAngle];
41
+ const hypo = triangle.sides[0];
42
+ const angle = triangle.angles[randAngle];
43
+ const fct = ["\\cos", "\\sin", "\\tan"][randTrigo];
44
+ const fraction = [
45
+ [adjacent, hypo],
46
+ [oppose, hypo],
47
+ [oppose, adjacent],
48
+ ][randTrigo];
49
+ return `On utilise la formule :
50
+
51
+ $$
52
+ ${formules[randTrigo]}
53
+ $$
54
+
55
+ ${randTrigo !== 2
56
+ ? `L'hypoténuse du triangle est le côté $${hypo.toTex()}$.`
57
+ : ""}
58
+
59
+ ${randTrigo !== 0
60
+ ? `Le côté opposé à l'angle $${angle.toTex()}$ est le côté $${oppose.toTex()}$.`
61
+ : ""}
62
+
63
+ ${randTrigo !== 1
64
+ ? `Le côté adjacent à l'angle $${angle.toTex()}$ est le côté $${adjacent.toTex()}$.`
65
+ : ""}
66
+
67
+ Cela donne donc :
68
+
69
+ $$
70
+ ${fct}\\left(${angle.toTex()}\\right) = \\frac{${fraction[0].toInsideName()}}{${fraction[1].toInsideName()}}
71
+ $$
72
+ `;
73
+ };
10
74
  const getInstruction = (identifiers) => {
11
75
  const { randAngle, triangleIdentifiers, randTrigo } = identifiers;
12
76
  const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
13
77
  const trigo = ["le cosinus", "le sinus", "la tangente"];
14
- const angleSummit = triangle.points[randAngle].name;
15
78
  return `À quel quotient est égal ${trigo[randTrigo]} de l'angle $${triangle.angles[randAngle].toTex()}$ ?`;
16
79
  };
17
80
  const getAnswer = (identifiers) => {
@@ -78,6 +141,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
78
141
  ggbOptions: getGGBOptions(identifiers),
79
142
  answerFormat: "tex",
80
143
  identifiers,
144
+ hint: getHint(identifiers),
145
+ correction: getCorrection(identifiers),
81
146
  };
82
147
  };
83
148
  const getPropositions = (n, { answer, triangleIdentifiers }) => {
@@ -143,4 +208,5 @@ export const trigonometry = {
143
208
  getInstruction,
144
209
  getGGBOptions,
145
210
  getQuestionFromIdentifiers,
211
+ hasHintAndCorrection: true,
146
212
  };
@@ -1 +1 @@
1
- {"version":3,"file":"trigonometryAngleCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometryAngleCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAOnD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA+EF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAmBzD,CAAC"}
1
+ {"version":3,"file":"trigonometryAngleCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/trigonometryAngleCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAUnD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAqLF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAoBzD,CAAC"}
@@ -4,7 +4,10 @@ import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
4
4
  import { RightTriangleConstructor } from "../../../math/geometry/triangles/rightTriangle.js";
5
5
  import { randint } from "../../../math/utils/random/randint.js";
6
6
  import { round } from "../../../math/utils/round.js";
7
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
7
8
  import { shuffle } from "../../../utils/alea/shuffle.js";
9
+ import { alignTex } from "../../../utils/latex/alignTex.js";
10
+ import { approxOrEqual } from "../../../utils/latex/approxOrEqual.js";
8
11
  const getInstruction = (identifiers) => {
9
12
  const { randAngle, hiddenSide, triangleIdentifiers } = identifiers;
10
13
  const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
@@ -19,6 +22,89 @@ const getAnswer = (identifiers) => {
19
22
  const answer = round(triangle.angles[randAngle].evaluate(), 0);
20
23
  return answer + "^{\\circ}";
21
24
  };
25
+ const getHint = (identifiers) => {
26
+ const { randAngle, hiddenSide, triangleIdentifiers } = identifiers;
27
+ return `On peut utiliser la formule :
28
+
29
+ $$
30
+ \\text{SOHCAHTOA}
31
+ $$
32
+
33
+ qui signifie :
34
+
35
+ $$
36
+ \\text{sinus} = \\frac{\\text{opposé}}{\\text{hypoténuse}}
37
+ $$
38
+
39
+ $$
40
+ \\text{cosinus} = \\frac{\\text{adjacent}}{\\text{hypoténuse}}
41
+ $$
42
+
43
+ $$
44
+ \\text{tangente} = \\frac{\\text{opposé}}{\\text{adjacent}}
45
+ $$`;
46
+ };
47
+ const getCorrection = (identifiers) => {
48
+ const { randAngle, hiddenSide, triangleIdentifiers } = identifiers;
49
+ const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
50
+ const formules = [
51
+ "\\text{cosinus} = \\frac{\\text{adjacent}}{\\text{hypoténuse}}",
52
+ "\\text{sinus} = \\frac{\\text{opposé}}{\\text{hypoténuse}}",
53
+ "\\text{tangente} = \\frac{\\text{opposé}}{\\text{adjacent}}",
54
+ ];
55
+ const randTrigo = hiddenSide === 0 ? 2 : hiddenSide === randAngle ? 0 : 1;
56
+ const oppose = triangle.sides[randAngle];
57
+ const adjacent = triangle.sides[3 - randAngle];
58
+ const hypo = triangle.sides[0];
59
+ const angle = triangle.angles[randAngle];
60
+ const fct = ["\\cos", "\\sin", "\\tan"][randTrigo];
61
+ const fraction = [
62
+ [adjacent, hypo],
63
+ [oppose, hypo],
64
+ [oppose, adjacent],
65
+ ][randTrigo];
66
+ const fractionEvs = fraction.map((e) => e.getLengthNode());
67
+ const fractionEv = frac(fractionEvs[0], fractionEvs[1]);
68
+ const fractionEvApprox = fractionEv.evaluate();
69
+ return `On utilise la formule :
70
+
71
+ $$
72
+ ${formules[randTrigo]}
73
+ $$
74
+
75
+ ${randTrigo !== 2
76
+ ? `L'hypoténuse du triangle est le côté $${hypo.toTex()}$.`
77
+ : ""}
78
+
79
+ ${randTrigo !== 0
80
+ ? `Le côté opposé à l'angle $${angle.toTex()}$ est le côté $${oppose.toTex()}$.`
81
+ : ""}
82
+
83
+ ${randTrigo !== 1
84
+ ? `Le côté adjacent à l'angle $${angle.toTex()}$ est le côté $${adjacent.toTex()}$.`
85
+ : ""}
86
+
87
+ Cela donne donc :
88
+
89
+ ${alignTex([
90
+ [
91
+ `${fct}\\left(${angle.toTex()}\\right)`,
92
+ "=",
93
+ `\\frac{${fraction[0].toInsideName()}}{${fraction[1].toInsideName()}}`,
94
+ ],
95
+ ["", "=", fractionEv.toTex()],
96
+ ["", ...approxOrEqual(fractionEvApprox, 2)],
97
+ ])}
98
+
99
+ On utilise alors la fonction $${fct}^{-1}$ avec la calculatrice :
100
+
101
+ $$
102
+ ${fct}^{-1}\\left(${round(fractionEvApprox, 2).frenchify()}\\right) \\approx ${getAnswer(identifiers)}
103
+ $$
104
+
105
+ On en déduit que $${angle.toTex()} \\approx ${getAnswer(identifiers)}$.
106
+ `;
107
+ };
22
108
  const getGGBOptions = (identifiers) => {
23
109
  const { randAngle, hiddenSide, triangleIdentifiers } = identifiers;
24
110
  const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
@@ -55,6 +141,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
55
141
  ggbOptions: getGGBOptions(identifiers),
56
142
  answerFormat: "tex",
57
143
  identifiers,
144
+ hint: getHint(identifiers),
145
+ correction: getCorrection(identifiers),
58
146
  };
59
147
  };
60
148
  const getPropositions = (n, { answer }) => {
@@ -86,4 +174,5 @@ export const trigonometryAngleCalcul = {
86
174
  getInstruction,
87
175
  getGGBOptions,
88
176
  getQuestionFromIdentifiers,
177
+ hasHintAndCorrection: true,
89
178
  };
package/lib/index.d.ts CHANGED
@@ -29,6 +29,9 @@ declare const mathExercises: (Exercise<{
29
29
  }, {}> | Exercise<{
30
30
  nb: number;
31
31
  divisor: number;
32
+ }, {}> | Exercise<{
33
+ a: number;
34
+ b: number;
32
35
  }, {}> | Exercise<{
33
36
  integerFirst: boolean;
34
37
  integer: number;
@@ -1239,6 +1242,8 @@ declare const mathExercises: (Exercise<{
1239
1242
  startPointIndex: number;
1240
1243
  vectorPointsIndexes: number[];
1241
1244
  coeff: number;
1245
+ }, {}> | Exercise<{
1246
+ pointsIdentifiers: import("./math/geometry/point.js").PointIdentifiers[];
1242
1247
  }, {}> | Exercise<{
1243
1248
  trinom: number[];
1244
1249
  }, {}> | Exercise<{
@@ -1399,6 +1404,9 @@ declare const mathExercises: (Exercise<{
1399
1404
  }, {}> | Exercise<{
1400
1405
  cartesianCoeffs1: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1401
1406
  cartesianCoeffs2: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
1407
+ }, {}> | Exercise<{
1408
+ aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1409
+ bIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
1402
1410
  }, {}> | Exercise<{
1403
1411
  triangleIdentifiers: import("./math/geometry/triangles/triangle.js").TriangleIdentifiers;
1404
1412
  type: number;
@@ -1408,10 +1416,10 @@ declare const mathExercises: (Exercise<{
1408
1416
  angleAsked: number;
1409
1417
  }, {}> | Exercise<{
1410
1418
  coeffs: number[];
1411
- to: string;
1419
+ to: "+\\infty" | "-\\infty";
1412
1420
  }, {}> | Exercise<{
1413
1421
  coeffs: number[];
1414
- to: string;
1422
+ to: "+\\infty" | "-\\infty";
1415
1423
  }, {}> | Exercise<{
1416
1424
  numCoeffs: number[];
1417
1425
  denumCoeffs: number[];
@@ -1523,7 +1531,9 @@ declare const mathExercises: (Exercise<{
1523
1531
  a: number;
1524
1532
  b: number;
1525
1533
  c: number;
1526
- }, {}> | Exercise<{
1534
+ }, {
1535
+ useOnlyPowersOfTen: boolean;
1536
+ }> | Exercise<{
1527
1537
  randPower: number;
1528
1538
  }, {}> | Exercise<{
1529
1539
  a: number;
@@ -1547,6 +1557,12 @@ declare const mathExercises: (Exercise<{
1547
1557
  k: number;
1548
1558
  l: number;
1549
1559
  m: number;
1560
+ n: number | undefined;
1561
+ }, {}> | Exercise<{
1562
+ a: number;
1563
+ b: number;
1564
+ c: number;
1565
+ d: number;
1550
1566
  }, {}> | Exercise<{
1551
1567
  c: number;
1552
1568
  }, {}> | Exercise<{
@@ -2161,7 +2177,9 @@ declare const pcExercises: (Exercise<{
2161
2177
  a: number;
2162
2178
  b: number;
2163
2179
  c: number;
2164
- }, {}> | Exercise<{
2180
+ }, {
2181
+ useOnlyPowersOfTen: boolean;
2182
+ }> | Exercise<{
2165
2183
  randAngle: number;
2166
2184
  hiddenSide: number;
2167
2185
  triangleIdentifiers: import("./math/geometry/triangles/triangle.js").TriangleIdentifiers;