math-exercises 2.2.69 → 2.2.70

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 (196) hide show
  1. package/lib/exercises/math/calcul/arithmetics/divisorsList.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/arithmetics/divisorsList.js +2 -1
  3. package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +2 -1
  5. package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsOperations.js +1 -0
  7. package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
  8. package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.js +3 -6
  9. package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
  10. package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +3 -8
  11. package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
  12. package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +7 -9
  13. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
  14. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +6 -19
  15. package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts +8 -0
  16. package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts.map +1 -0
  17. package/lib/exercises/math/calculLitteral/factorisation/factoByX.js +146 -0
  18. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
  19. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  20. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
  21. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -1
  22. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +2 -5
  23. package/lib/exercises/math/functions/trinoms/coefficientsIdentification.js +3 -3
  24. package/lib/exercises/math/functions/trinoms/findSecondRoot.d.ts +2 -2
  25. package/lib/exercises/math/functions/trinoms/findSecondRoot.d.ts.map +1 -1
  26. package/lib/exercises/math/functions/trinoms/findSecondRoot.js +5 -5
  27. package/lib/exercises/math/functions/trinoms/rootsProduct.d.ts +2 -2
  28. package/lib/exercises/math/functions/trinoms/rootsProduct.d.ts.map +1 -1
  29. package/lib/exercises/math/functions/trinoms/rootsProduct.js +6 -6
  30. package/lib/exercises/math/functions/trinoms/rootsSum.d.ts +2 -2
  31. package/lib/exercises/math/functions/trinoms/rootsSum.d.ts.map +1 -1
  32. package/lib/exercises/math/functions/trinoms/rootsSum.js +7 -7
  33. package/lib/exercises/math/functions/trinoms/trinomSignFromRoots.js +6 -6
  34. package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts +3 -1
  35. package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
  36. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +10 -22
  37. package/lib/exercises/math/geometry/areas/triangleArea.d.ts +6 -1
  38. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  39. package/lib/exercises/math/geometry/areas/triangleArea.js +34 -48
  40. package/lib/exercises/math/geometry/index.d.ts +1 -0
  41. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  42. package/lib/exercises/math/geometry/index.js +1 -0
  43. package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
  44. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +0 -3
  45. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  46. package/lib/exercises/math/geometry/pythagore/pythagore.js +19 -25
  47. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +1 -2
  48. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  49. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +30 -65
  50. package/lib/exercises/math/geometry/quadrilaterals/index.d.ts +2 -0
  51. package/lib/exercises/math/geometry/quadrilaterals/index.d.ts.map +1 -0
  52. package/lib/exercises/math/geometry/quadrilaterals/index.js +17 -0
  53. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts +14 -0
  54. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -0
  55. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +221 -0
  56. package/lib/exercises/math/geometry/thales/index.d.ts.map +1 -1
  57. package/lib/exercises/math/geometry/thales/index.js +0 -1
  58. package/lib/exercises/math/geometry/thales/thales.js +2 -2
  59. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +3 -4
  60. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  61. package/lib/exercises/math/geometry/thales/thalesCalcul.js +69 -78
  62. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
  63. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +4 -3
  64. package/lib/exercises/math/geometry/volumes/sphereVolume.js +1 -1
  65. package/lib/exercises/math/trigonometry/trigonometry.d.ts +2 -3
  66. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  67. package/lib/exercises/math/trigonometry/trigonometry.js +32 -31
  68. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts +3 -2
  69. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  70. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +18 -28
  71. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts +5 -4
  72. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  73. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +60 -56
  74. package/lib/exercises/pc/index.d.ts +0 -4
  75. package/lib/exercises/pc/index.d.ts.map +1 -1
  76. package/lib/exercises/pc/index.js +6 -4
  77. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
  78. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
  79. package/lib/exercises/vea/equationVEA.d.ts +2 -0
  80. package/lib/exercises/vea/equationVEA.d.ts.map +1 -0
  81. package/lib/exercises/vea/equationVEA.js +24 -0
  82. package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
  83. package/lib/exercises/vea/sqrtVEA.d.ts +6 -0
  84. package/lib/exercises/vea/sqrtVEA.d.ts.map +1 -0
  85. package/lib/exercises/vea/sqrtVEA.js +30 -0
  86. package/lib/geogebra/geogebraConstructor.d.ts +2 -0
  87. package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
  88. package/lib/geogebra/geogebraConstructor.js +7 -0
  89. package/lib/index.d.ts +28 -46
  90. package/lib/index.d.ts.map +1 -1
  91. package/lib/math/complex/complex.d.ts +1 -1
  92. package/lib/math/geometry/angle.d.ts +26 -0
  93. package/lib/math/geometry/angle.d.ts.map +1 -0
  94. package/lib/math/geometry/angle.js +73 -0
  95. package/lib/math/geometry/line.d.ts +5 -1
  96. package/lib/math/geometry/line.d.ts.map +1 -1
  97. package/lib/math/geometry/line.js +17 -0
  98. package/lib/math/geometry/parallelogram.d.ts +23 -0
  99. package/lib/math/geometry/parallelogram.d.ts.map +1 -0
  100. package/lib/math/geometry/parallelogram.js +70 -0
  101. package/lib/math/geometry/point.d.ts +3 -0
  102. package/lib/math/geometry/point.d.ts.map +1 -1
  103. package/lib/math/geometry/point.js +16 -0
  104. package/lib/math/geometry/quadrilateral.d.ts +15 -0
  105. package/lib/math/geometry/quadrilateral.d.ts.map +1 -0
  106. package/lib/math/geometry/quadrilateral.js +38 -0
  107. package/lib/math/geometry/rectangle.d.ts +24 -0
  108. package/lib/math/geometry/rectangle.d.ts.map +1 -0
  109. package/lib/math/geometry/rectangle.js +64 -0
  110. package/lib/math/geometry/rhombus.d.ts +19 -0
  111. package/lib/math/geometry/rhombus.d.ts.map +1 -0
  112. package/lib/math/geometry/rhombus.js +46 -0
  113. package/lib/math/geometry/rightTriangle.d.ts +31 -0
  114. package/lib/math/geometry/rightTriangle.d.ts.map +1 -0
  115. package/lib/math/geometry/rightTriangle.js +113 -0
  116. package/lib/math/geometry/segment.d.ts +24 -6
  117. package/lib/math/geometry/segment.d.ts.map +1 -1
  118. package/lib/math/geometry/segment.js +70 -4
  119. package/lib/math/geometry/square.d.ts +22 -0
  120. package/lib/math/geometry/square.d.ts.map +1 -0
  121. package/lib/math/geometry/square.js +43 -0
  122. package/lib/math/geometry/triangle.d.ts +45 -45
  123. package/lib/math/geometry/triangle.d.ts.map +1 -1
  124. package/lib/math/geometry/triangle.js +159 -186
  125. package/lib/math/geometry/vector.d.ts +2 -2
  126. package/lib/math/geometry/vector.d.ts.map +1 -1
  127. package/lib/math/geometry/vector.js +18 -9
  128. package/lib/math/numbers/rationals/rational.d.ts +1 -1
  129. package/lib/math/numbers/reals/extendedRingElement.d.ts +1 -1
  130. package/lib/math/numbers/reals/real.d.ts.map +1 -1
  131. package/lib/math/numbers/reals/real.js +3 -0
  132. package/lib/math/polynomials/generalAffine.d.ts.map +1 -1
  133. package/lib/math/polynomials/generalAffine.js +1 -1
  134. package/lib/math/polynomials/polynomial.d.ts +1 -1
  135. package/lib/math/polynomials/trinom.d.ts +2 -2
  136. package/lib/math/utils/geometry/pythagoricianTriplets.d.ts +1 -0
  137. package/lib/math/utils/geometry/pythagoricianTriplets.d.ts.map +1 -1
  138. package/lib/math/utils/geometry/pythagoricianTriplets.js +14 -1
  139. package/lib/math/utils/random/randfloat.d.ts +1 -1
  140. package/lib/math/utils/random/randfloat.d.ts.map +1 -1
  141. package/lib/math/utils/random/randfloat.js +8 -1
  142. package/lib/math/utils/random/randint.d.ts +8 -1
  143. package/lib/math/utils/random/randint.d.ts.map +1 -1
  144. package/lib/math/utils/random/randint.js +6 -1
  145. package/lib/playground.d.ts.map +1 -1
  146. package/lib/playground.js +1 -8
  147. package/lib/tree/nodes/functions/absNode.d.ts +1 -1
  148. package/lib/tree/nodes/functions/functionNode.d.ts +2 -2
  149. package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
  150. package/lib/tree/nodes/functions/oppositeNode.d.ts +5 -5
  151. package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
  152. package/lib/tree/nodes/node.d.ts +3 -1
  153. package/lib/tree/nodes/node.d.ts.map +1 -1
  154. package/lib/tree/nodes/node.js +1 -0
  155. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  156. package/lib/tree/nodes/nodeConstructor.js +4 -0
  157. package/lib/tree/nodes/numbers/numberNode.d.ts +2 -0
  158. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  159. package/lib/tree/nodes/numbers/numberNode.js +6 -1
  160. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  161. package/lib/tree/nodes/operators/addNode.js +2 -1
  162. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  163. package/lib/tree/nodes/operators/multiplyNode.js +3 -3
  164. package/lib/tree/nodes/polynomials/trinomNode.d.ts +70 -0
  165. package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -0
  166. package/lib/tree/nodes/polynomials/trinomNode.js +156 -0
  167. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  168. package/lib/tree/nodes/variables/variableNode.js +1 -1
  169. package/lib/tree/parsers/affineParser.d.ts.map +1 -1
  170. package/lib/tree/parsers/affineParser.js +1 -0
  171. package/lib/tree/parsers/discreteSetParser.d.ts +3 -0
  172. package/lib/tree/parsers/discreteSetParser.d.ts.map +1 -0
  173. package/lib/tree/parsers/discreteSetParser.js +23 -0
  174. package/lib/tree/parsers/equationSolutionParser.d.ts +1 -1
  175. package/lib/tree/parsers/equationSolutionParser.d.ts.map +1 -1
  176. package/lib/tree/parsers/equationSolutionParser.js +15 -4
  177. package/lib/tree/parsers/latexParser.d.ts +5 -1
  178. package/lib/tree/parsers/latexParser.d.ts.map +1 -1
  179. package/lib/tree/parsers/latexParser.js +17 -3
  180. package/lib/tree/parsers/monomParser.js +2 -2
  181. package/lib/tree/parsers/powerParser.d.ts +1 -1
  182. package/lib/tree/parsers/rationalParser.d.ts +1 -1
  183. package/lib/tree/parsers/rationalParser.d.ts.map +1 -1
  184. package/lib/tree/parsers/rationalParser.js +28 -24
  185. package/lib/tree/parsers/sqrtParser.d.ts +9 -0
  186. package/lib/tree/parsers/sqrtParser.d.ts.map +1 -0
  187. package/lib/tree/parsers/sqrtParser.js +52 -0
  188. package/lib/tree/parsers/trinomParser.d.ts +1 -1
  189. package/lib/tree/parsers/trinomParser.d.ts.map +1 -1
  190. package/lib/tree/parsers/trinomParser.js +14 -2
  191. package/lib/tree/utilities/functionComposition.d.ts +1 -1
  192. package/lib/tree/utilities/functionComposition.d.ts.map +1 -1
  193. package/lib/utils/arrays/rotation.d.ts +8 -0
  194. package/lib/utils/arrays/rotation.d.ts.map +1 -0
  195. package/lib/utils/arrays/rotation.js +17 -0
  196. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"divisorsList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/divisorsList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAY9C,CAAC"}
1
+ {"version":3,"file":"divisorsList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/divisorsList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
@@ -51,10 +51,11 @@ exports.divisorsList = {
51
51
  levels: ["2nde"],
52
52
  isSingleStep: true,
53
53
  sections: ["Arithmétique"],
54
- generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDivisorsListQuestion, nb),
54
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDivisorsListQuestion, nb, 30),
55
55
  qcmTimer: 60,
56
56
  freeTimer: 60,
57
57
  getPropositions,
58
58
  isAnswerValid,
59
59
  subject: "Mathématiques",
60
+ maxAllowedQuestions: 30,
60
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"primeNumbers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/primeNumbers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAST,MAAM,mBAAmB,CAAC;AAoD3B,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAsDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAa9C,CAAC"}
1
+ {"version":3,"file":"primeNumbers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/primeNumbers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAST,MAAM,mBAAmB,CAAC;AAoD3B,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAsDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
@@ -96,10 +96,11 @@ exports.primeNumbers = {
96
96
  levels: ["5ème", "4ème", "3ème", "2nde"],
97
97
  sections: ["Arithmétique"],
98
98
  isSingleStep: false,
99
- generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPrimeNumbers, nb),
99
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPrimeNumbers, nb, 30),
100
100
  qcmTimer: 60,
101
101
  freeTimer: 60,
102
102
  getPropositions,
103
103
  isAnswerValid,
104
104
  subject: "Mathématiques",
105
+ maxAllowedQuestions: 30,
105
106
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsOperations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAS1C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AA6EF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
1
+ {"version":3,"file":"fractionsOperations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAS1C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AA8EF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
@@ -20,6 +20,7 @@ const getPropositions = (n, { answer }) => {
20
20
  return (0, exercise_1.shuffleProps)(propositions, n);
21
21
  };
22
22
  const getAnswer = (identifiers) => {
23
+ console.log(identifiers);
23
24
  const statement = nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.statementIdentifiers);
24
25
  return statement.simplify().toTex();
25
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"equationType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType1Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAalC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
1
+ {"version":3,"file":"equationType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType1Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAclC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA4DF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
@@ -6,13 +6,12 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
6
6
  const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
7
7
  const affine_1 = require("../../../../math/polynomials/affine");
8
8
  const randint_1 = require("../../../../math/utils/random/randint");
9
- const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
10
9
  const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
11
10
  const shuffle_1 = require("../../../../utils/alea/shuffle");
12
- const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
13
11
  const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
14
12
  const alignTex_1 = require("../../../../utils/latex/alignTex");
15
13
  const addNode_1 = require("../../../../tree/nodes/operators/addNode");
14
+ const equationVEA_1 = require("../../../../exercises/vea/equationVEA");
16
15
  const getEquationType1ExerciseQuestion = () => {
17
16
  const b = (0, randint_1.randint)(-10, 11);
18
17
  const a = (0, randint_1.randint)(-10, 11, [0]);
@@ -55,10 +54,8 @@ const getPropositions = (n, { answer, a, b }) => {
55
54
  return (0, shuffle_1.shuffle)(propositions);
56
55
  };
57
56
  const isAnswerValid = (ans, { a, b }) => {
58
- const solution = b - a;
59
- const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([new numberNode_1.NumberNode(solution)]));
60
- const validLatexs = answerTree.toAllValidTexs();
61
- return validLatexs.includes(ans);
57
+ const solution = (b - a).toTree().toTex();
58
+ return (0, equationVEA_1.equationVEA)(ans, solution);
62
59
  };
63
60
  exports.equationType1Exercise = {
64
61
  id: "equa1",
@@ -1 +1 @@
1
- {"version":3,"file":"equationType2Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType2Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAsBlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAK1C;;GAEG;AAGH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA+GF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAaF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBhE,CAAC"}
1
+ {"version":3,"file":"equationType2Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType2Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAsBlC,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAM1C;;GAEG;AAGH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA2GF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAaF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBhE,CAAC"}
@@ -6,9 +6,7 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
6
6
  const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
7
7
  const rational_1 = require("../../../../math/numbers/rationals/rational");
8
8
  const randint_1 = require("../../../../math/utils/random/randint");
9
- const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
10
9
  const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
11
- const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
12
10
  const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
13
11
  const shuffle_1 = require("../../../../utils/alea/shuffle");
14
12
  const alignTex_1 = require("../../../../utils/latex/alignTex");
@@ -19,6 +17,7 @@ const generalAffine_1 = require("../../../../math/polynomials/generalAffine");
19
17
  const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
20
18
  const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
21
19
  const addNode_1 = require("../../../../tree/nodes/operators/addNode");
20
+ const equationVEA_1 = require("../../../../exercises/vea/equationVEA");
22
21
  const rebuildIdentifiers = (oldIdentifiers) => {
23
22
  if (!!oldIdentifiers.numberType)
24
23
  return oldIdentifiers;
@@ -90,12 +89,8 @@ const getPropositions = (n, { answer, a, b }) => {
90
89
  const isAnswerValid = (ans, { a, b }) => {
91
90
  const aNode = nodeConstructor_1.NodeConstructor.fromIdentifiers(a);
92
91
  const bNode = nodeConstructor_1.NodeConstructor.fromIdentifiers(b);
93
- const solution = (0, fractionNode_1.frac)(bNode, aNode).simplify();
94
- const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([solution]), {
95
- opts: { allowFractionToDecimal: true, allowRawRightChildAsSolution: true },
96
- });
97
- const validLatexs = answerTree.toAllValidTexs();
98
- return validLatexs.includes(ans);
92
+ const solution = (0, fractionNode_1.frac)(bNode, aNode).simplify().toTex();
93
+ return (0, equationVEA_1.equationVEA)(ans, solution);
99
94
  };
100
95
  const options = [
101
96
  {
@@ -1 +1 @@
1
- {"version":3,"file":"equationType3Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType3Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAgBlC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
1
+ {"version":3,"file":"equationType3Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType3Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAsBlC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
@@ -7,14 +7,14 @@ const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
7
7
  const rational_1 = require("../../../../math/numbers/rationals/rational");
8
8
  const affine_1 = require("../../../../math/polynomials/affine");
9
9
  const randint_1 = require("../../../../math/utils/random/randint");
10
- const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
11
10
  const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
12
- const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
13
11
  const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
14
12
  const shuffle_1 = require("../../../../utils/alea/shuffle");
15
13
  const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
16
14
  const alignTex_1 = require("../../../../utils/latex/alignTex");
17
15
  const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
16
+ const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
17
+ const equationVEA_1 = require("../../../../exercises/vea/equationVEA");
18
18
  const getEquationType3ExerciseQuestion = () => {
19
19
  const b = (0, randint_1.randint)(-10, 11, [0]);
20
20
  const a = (0, randint_1.randint)(-10, 11, [0, 1]);
@@ -57,13 +57,11 @@ const getPropositions = (n, { answer, a, b, c }) => {
57
57
  }
58
58
  return (0, shuffle_1.shuffle)(propositions);
59
59
  };
60
- const isAnswerValid = (ans, { a, b, c }) => {
61
- const solution = new rational_1.Rational(c - b, a).simplify().toTree();
62
- const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([solution]), {
63
- opts: { allowFractionToDecimal: true, allowRawRightChildAsSolution: true },
64
- });
65
- const validLatexs = answerTree.toAllValidTexs();
66
- return validLatexs.includes(ans);
60
+ const isAnswerValid = (ans, { answer, a, b, c }) => {
61
+ const solution = (0, fractionNode_1.frac)(c - b, a)
62
+ .simplify()
63
+ .toTex();
64
+ return (0, equationVEA_1.equationVEA)(ans, solution);
67
65
  };
68
66
  exports.equationType3Exercise = {
69
67
  id: "equa3",
@@ -1 +1 @@
1
- {"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAgBlC;;GAEG;AAEH,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;AAwFF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAcvD,CAAC"}
1
+ {"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAkBlC;;GAEG;AAEH,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;AA0EF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAcvD,CAAC"}
@@ -7,11 +7,11 @@ const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
7
7
  const rational_1 = require("../../../../math/numbers/rationals/rational");
8
8
  const affine_1 = require("../../../../math/polynomials/affine");
9
9
  const randint_1 = require("../../../../math/utils/random/randint");
10
- const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
11
10
  const equalNode_1 = require("../../../../tree/nodes/equations/equalNode");
12
- const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
13
11
  const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
14
12
  const shuffle_1 = require("../../../../utils/alea/shuffle");
13
+ const equationVEA_1 = require("../../../../exercises/vea/equationVEA");
14
+ const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
15
15
  const getEquationType4ExerciseQuestion = () => {
16
16
  const a = (0, randint_1.randint)(-10, 11, [0, 1]);
17
17
  const b = (0, randint_1.randint)(-10, 11, [0]);
@@ -62,23 +62,10 @@ const getPropositions = (n, { answer, a, b, c, d }) => {
62
62
  return (0, shuffle_1.shuffle)(propositions);
63
63
  };
64
64
  const isAnswerValid = (ans, { a, b, c, d }) => {
65
- // try {
66
- // const parsed = equationSolutionParser(ans);
67
- // if (!parsed) return false;
68
- // const solution = new Rational(d - b, a - c).simplify().toTree();
69
- // const solutionTex = solution.toTex();
70
- // const decimal = round(solution.evaluate({}), 12).frenchify();
71
- // const parsedSolution = parsed.simplify().toTex();
72
- // return solutionTex === parsedSolution || decimal === parsedSolution;
73
- // } catch (err) {
74
- // return false;
75
- // }
76
- const solution = new rational_1.Rational(d - b, a - c).simplify().toTree();
77
- const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([solution]), {
78
- opts: { allowFractionToDecimal: true, allowRawRightChildAsSolution: true },
79
- });
80
- const validLatexs = answerTree.toAllValidTexs();
81
- return validLatexs.includes(ans);
65
+ const solution = (0, fractionNode_1.frac)(d - b, a - c)
66
+ .simplify()
67
+ .toTex();
68
+ return (0, equationVEA_1.equationVEA)(ans, solution);
82
69
  };
83
70
  exports.equationType4Exercise = {
84
71
  id: "equa4",
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ };
6
+ export declare const factoByX: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=factoByX.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factoByX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoByX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqJF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.factoByX = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const affine_1 = require("../../../../math/polynomials/affine");
7
+ const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
8
+ const randint_1 = require("../../../../math/utils/random/randint");
9
+ const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
10
+ const addNode_1 = require("../../../../tree/nodes/operators/addNode");
11
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
+ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
13
+ const latexParser_1 = require("../../../../tree/parsers/latexParser");
14
+ const alignTex_1 = require("../../../../utils/latex/alignTex");
15
+ const getPropositions = (n, { answer, ...identifiers }) => {
16
+ const propositions = [];
17
+ (0, exercise_1.addValidProp)(propositions, answer);
18
+ const { a, b } = identifiers;
19
+ let pgcd = (0, gcd_1.gcd)(a, b);
20
+ if (a < 0 && b < 0)
21
+ pgcd = -pgcd;
22
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)("x", (0, addNode_1.add)(a, b)).toTex());
23
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)("x", (0, addNode_1.add)((0, multiplyNode_1.multiply)(a / pgcd, "x").simplify(), b / pgcd)).toTex());
24
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)((0, multiplyNode_1.multiply)(pgcd, "x").simplify(), (0, addNode_1.add)((0, multiplyNode_1.multiply)(a, "x").simplify(), b / pgcd)).toTex());
25
+ while (propositions.length < n) {
26
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, multiplyNode_1.multiply)("x", affine_1.AffineConstructor.random().toTree()).toTex());
27
+ }
28
+ return (0, exercise_1.shuffleProps)(propositions, n);
29
+ };
30
+ const getAnswer = (identifiers) => {
31
+ const { a, b } = identifiers;
32
+ let pgcd = (0, gcd_1.gcd)(a, b);
33
+ if (a < 0 && b < 0)
34
+ pgcd = -pgcd;
35
+ const affine = (0, addNode_1.add)((0, multiplyNode_1.multiply)(a / pgcd, "x"), b / pgcd);
36
+ return (0, multiplyNode_1.multiply)((0, multiplyNode_1.multiply)(pgcd, "x"), affine).toTex();
37
+ };
38
+ const getStatementNode = (identifiers) => {
39
+ return (0, addNode_1.add)((0, multiplyNode_1.multiply)(identifiers.a, (0, powerNode_1.square)("x")), (0, multiplyNode_1.multiply)(identifiers.b, "x").simplify());
40
+ };
41
+ const getInstruction = (identifiers) => {
42
+ const statement = getStatementNode(identifiers);
43
+ return `Factoriser :
44
+
45
+ $$
46
+ ${statement.toTex()}
47
+ $$`;
48
+ };
49
+ const getHint = (identifiers) => {
50
+ const { a, b } = identifiers;
51
+ const aMonom = (0, multiplyNode_1.multiply)(a, (0, powerNode_1.square)("x")).toTex();
52
+ const bMonom = (0, multiplyNode_1.multiply)(b, "x").toTex();
53
+ return `Repère le facteur commun : c'est le terme qui apparaît à la fois dans $${aMonom}$ et dans $${bMonom}$.`;
54
+ };
55
+ const getCorrection = (identifiers) => {
56
+ const { a, b } = identifiers;
57
+ const answer = getAnswer(identifiers);
58
+ const aMonom = (0, multiplyNode_1.multiply)(a, (0, powerNode_1.square)("x"));
59
+ const bMonom = (0, multiplyNode_1.multiply)(b, "x");
60
+ const statement = (0, addNode_1.add)(aMonom, bMonom).toTex();
61
+ let pgcd = (0, gcd_1.gcd)(a, b);
62
+ if (a < 0 && b < 0)
63
+ pgcd = -pgcd;
64
+ // ne renvoit pas des négatifs : devrait ?
65
+ const xMonom = (0, multiplyNode_1.multiply)(pgcd, "x");
66
+ let common = pgcd === -1 ? (0, oppositeNode_1.opposite)("x") : "x".toTree();
67
+ let hasCommon = false;
68
+ if (Math.abs(a) === Math.abs(b)) {
69
+ hasCommon = true;
70
+ if (a === b)
71
+ common = (0, multiplyNode_1.multiply)(a, common);
72
+ else
73
+ common = (0, multiplyNode_1.multiply)(Math.abs(a), common);
74
+ }
75
+ const detailed = (0, addNode_1.add)((0, multiplyNode_1.multiply)(xMonom, (0, multiplyNode_1.multiply)(a / pgcd, "x").simplify(), {
76
+ toTexOptions: { forceTimesSign: true, noPropagation: true },
77
+ }), (0, multiplyNode_1.multiply)(xMonom, b / pgcd)).toTex();
78
+ return `Le terme $${common.toTex()}$ apparaît à la fois dans $${aMonom.toTex()}$ et dans $${bMonom.toTex()}$.
79
+
80
+ ${!hasCommon && pgcd !== 1 && pgcd !== -1
81
+ ? `D'autre part, on peut factoriser $${a}$ et $${b}$ par $${pgcd}$. En effet,
82
+
83
+ $${a} = ${a / pgcd}\\times ${pgcd}$ et $${b} = ${b / pgcd}\\times ${pgcd}$.`
84
+ : ""}
85
+
86
+ On peut donc factoriser l'expression par $${xMonom.toTex()}$ :
87
+
88
+ ${(0, alignTex_1.alignTex)([
89
+ ["", "", statement],
90
+ ["", "=", detailed],
91
+ ["", "=", answer],
92
+ ])}
93
+ `;
94
+ };
95
+ const getKeys = (identifiers) => {
96
+ return ["x"];
97
+ };
98
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
99
+ try {
100
+ const statement = getStatementNode(identifiers);
101
+ const parsed = (0, latexParser_1.parseAlgebraic)(ans);
102
+ if (!parsed || !(0, multiplyNode_1.isMultiplyNode)(parsed))
103
+ return false;
104
+ return (parsed
105
+ .simplify({ forbidFactorize: true, towardsDistribute: true })
106
+ .toTex() === statement.toTex());
107
+ }
108
+ catch (err) {
109
+ return false;
110
+ }
111
+ };
112
+ const getFactoByXQuestion = (ops) => {
113
+ const a = (0, randint_1.randint)(-10, 10, [0], { favor: { value: 1, proba: 0.3 } });
114
+ const b = (0, randint_1.randint)(-10, 10, [0], a !== 1 ? { favor: { value: 1, proba: 0.3 } } : undefined);
115
+ const identifiers = {
116
+ a,
117
+ b,
118
+ };
119
+ const question = {
120
+ answer: getAnswer(identifiers),
121
+ instruction: getInstruction(identifiers),
122
+ keys: getKeys(identifiers),
123
+ answerFormat: "tex",
124
+ identifiers,
125
+ hint: getHint(identifiers),
126
+ correction: getCorrection(identifiers),
127
+ };
128
+ return question;
129
+ };
130
+ exports.factoByX = {
131
+ id: "factoByX",
132
+ connector: "=",
133
+ label: "Factorisation du type $ax^2 + bx$",
134
+ isSingleStep: false,
135
+ generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getFactoByXQuestion(opts), nb),
136
+ qcmTimer: 60,
137
+ freeTimer: 60,
138
+ getPropositions,
139
+ isAnswerValid,
140
+ subject: "Mathématiques",
141
+ getInstruction,
142
+ getHint,
143
+ getCorrection,
144
+ getAnswer,
145
+ hasHintAndCorrection: true,
146
+ };
@@ -5,4 +5,5 @@ export * from "./factoType1Exercise";
5
5
  export * from "./factorizeCanonicalForm";
6
6
  export * from "./factorizeCanonicalFormWithSqrt";
7
7
  export * from "./factoType2";
8
+ export * from "./factoByX";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
@@ -21,3 +21,4 @@ __exportStar(require("./factoType1Exercise"), exports);
21
21
  __exportStar(require("./factorizeCanonicalForm"), exports);
22
22
  __exportStar(require("./factorizeCanonicalFormWithSqrt"), exports);
23
23
  __exportStar(require("./factoType2"), exports);
24
+ __exportStar(require("./factoByX"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"absolueValueAffineEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absolueValueAffineEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAM9C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,wBAAwB,CAAC;IACtC,YAAY,EAAE,wBAAwB,CAAC;CACxC,CAAC;AA4KF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
1
+ {"version":3,"file":"absolueValueAffineEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absolueValueAffineEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAM9C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,wBAAwB,CAAC;IACtC,YAAY,EAAE,wBAAwB,CAAC;CACxC,CAAC;AAyKF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
@@ -111,14 +111,11 @@ const getKeys = (identifiers) => {
111
111
  };
112
112
  const isAnswerValid = (ans, { answer, ...identifiers }) => {
113
113
  const parsedOu = ans.split("\\text{ ou }");
114
- console.log(parsedOu);
115
114
  try {
116
115
  const nodes = [];
117
116
  parsedOu.forEach((item) => {
118
- let formated = item
119
- .replaceAll("\\text{", "")
120
- .replaceAll("}", "")
121
- .replaceAll(" ", "");
117
+ //un eleve qui efface le ou peut se retrouver avec un texte vide
118
+ let formated = item.replaceAll("\\text{ }", "");
122
119
  const equalForm = formated.split("=");
123
120
  if (equalForm.length > 1 && equalForm[0] !== "x")
124
121
  throw Error("wrong answer");
@@ -4,7 +4,7 @@ exports.coefficientsIdentification = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const rational_1 = require("../../../../math/numbers/rationals/rational");
7
- const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
7
+ const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
8
8
  const randint_1 = require("../../../../math/utils/random/randint");
9
9
  const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
10
10
  const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
@@ -15,7 +15,7 @@ const random_1 = require("../../../../utils/alea/random");
15
15
  const getPropositions = (n, { answer, aIdentifiers, bIdentifiers, cIdentifiers, isAsking }) => {
16
16
  const propositions = [];
17
17
  (0, exercise_1.addValidProp)(propositions, answer);
18
- const trinom = new generalTrinom_1.GeneralTrinom(nodeConstructor_1.NodeConstructor.fromIdentifiers(aIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(bIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(cIdentifiers));
18
+ const trinom = new trinomNode_1.TrinomNode(nodeConstructor_1.NodeConstructor.fromIdentifiers(aIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(bIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(cIdentifiers));
19
19
  if (answer === "1") {
20
20
  (0, exercise_1.tryToAddWrongProp)(propositions, "0");
21
21
  }
@@ -50,7 +50,7 @@ const getAnswer = (identifiers) => {
50
50
  : nodeConstructor_1.NodeConstructor.fromIdentifiers(cIdentifiers).toTex();
51
51
  };
52
52
  const getInstruction = (identifiers) => {
53
- const trinom = new generalTrinom_1.GeneralTrinom(nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.aIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.bIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.cIdentifiers));
53
+ const trinom = new trinomNode_1.TrinomNode(nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.aIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.bIdentifiers), nodeConstructor_1.NodeConstructor.fromIdentifiers(identifiers.cIdentifiers));
54
54
  return `Soit $f$ la fonction polynôme de degré $2$ définie sur $\\mathbb{R}$ par :
55
55
 
56
56
  $$
@@ -1,8 +1,8 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
- import { GeneralTrinomIdentifiers } from "../../../../math/polynomials/generalTrinom";
2
+ import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
3
3
  import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor";
4
4
  type Identifiers = {
5
- trinomIdentifiers: GeneralTrinomIdentifiers;
5
+ trinomIdentifiers: TrinomNodeIdentifiers;
6
6
  firstRootIdentifiers: NodeIdentifiers;
7
7
  };
8
8
  export declare const findSecondRoot: Exercise<Identifiers>;
@@ -1 +1 @@
1
- {"version":3,"file":"findSecondRoot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/findSecondRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAI9C,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAO1C,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,wBAAwB,CAAC;IAC5C,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AAiHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAiBhD,CAAC"}
1
+ {"version":3,"file":"findSecondRoot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/findSecondRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAIjD,OAAO,EAEL,eAAe,EAChB,MAAM,kCAAkC,CAAC;AAO1C,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;IACzC,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AAiHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAiBhD,CAAC"}
@@ -4,7 +4,7 @@ exports.findSecondRoot = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
7
- const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
7
+ const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
8
8
  const randint_1 = require("../../../../math/utils/random/randint");
9
9
  const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
10
10
  const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
@@ -21,7 +21,7 @@ const getPropositions = (n, { answer }) => {
21
21
  };
22
22
  const getAnswer = (identifiers) => {
23
23
  const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
24
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
24
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
25
25
  const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
26
26
  const firstRootTex = firstRoot.toTex();
27
27
  const roots = trinom.getRoots().map((e) => e.toTex());
@@ -29,7 +29,7 @@ const getAnswer = (identifiers) => {
29
29
  };
30
30
  const getInstruction = (identifiers) => {
31
31
  const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
32
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
32
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
33
33
  const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
34
34
  const firstRootTex = firstRoot.toTex();
35
35
  return `Soit $f$ la fonction polynôme du second degré définie sur $\\mathbb{R}$ par :
@@ -54,7 +54,7 @@ En remplaçant les valeurs par celles données dans l'énoncé, on peut détermi
54
54
  };
55
55
  const getCorrection = (identifiers) => {
56
56
  const { trinomIdentifiers, firstRootIdentifiers } = identifiers;
57
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
57
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
58
58
  const firstRoot = nodeConstructor_1.NodeConstructor.fromIdentifiers(firstRootIdentifiers);
59
59
  const cOverA = (0, fractionNode_1.frac)(trinom.c, trinom.a).simplify();
60
60
  return `On sait que le produit des racines $x_1$ et $x_2$ de $f$ vaut :
@@ -95,7 +95,7 @@ const getFindSecondRootQuestion = (ops) => {
95
95
  //first*second = c/a
96
96
  const identifiers = {
97
97
  firstRootIdentifiers: firstRoot.toTree().toIdentifiers(),
98
- trinomIdentifiers: new generalTrinom_1.GeneralTrinom(a, b, c).toIdentifiers(),
98
+ trinomIdentifiers: new trinomNode_1.TrinomNode(a, b, c).toIdentifiers(),
99
99
  };
100
100
  const question = {
101
101
  answer: getAnswer(identifiers),
@@ -1,7 +1,7 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
- import { GeneralTrinomIdentifiers } from "../../../../math/polynomials/generalTrinom";
2
+ import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
3
3
  type Identifiers = {
4
- trinomIdentifiers: GeneralTrinomIdentifiers;
4
+ trinomIdentifiers: TrinomNodeIdentifiers;
5
5
  };
6
6
  export declare const rootsProduct: Exercise<Identifiers>;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"rootsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAO9C,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,wBAAwB,CAAC;CAC7C,CAAC;AA0GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
1
+ {"version":3,"file":"rootsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAOjD,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;CAC1C,CAAC;AA0GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
@@ -4,7 +4,7 @@ exports.rootsProduct = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const rationalVEA_1 = require("../../../../exercises/vea/rationalVEA");
7
- const generalTrinom_1 = require("../../../../math/polynomials/generalTrinom");
7
+ const trinomNode_1 = require("../../../../tree/nodes/polynomials/trinomNode");
8
8
  const randint_1 = require("../../../../math/utils/random/randint");
9
9
  const oppositeNode_1 = require("../../../../tree/nodes/functions/oppositeNode");
10
10
  const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
@@ -12,7 +12,7 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
12
  const getPropositions = (n, { answer, trinomIdentifiers }) => {
13
13
  const propositions = [];
14
14
  (0, exercise_1.addValidProp)(propositions, answer);
15
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
15
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
16
16
  (0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), trinom.a).simplify().toTex());
17
17
  (0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.c), trinom.a).simplify().toTex());
18
18
  (0, exercise_1.tryToAddWrongProp)(propositions, (0, fractionNode_1.frac)((0, oppositeNode_1.opposite)(trinom.b), (0, multiplyNode_1.multiply)(2, trinom.a)).simplify().toTex());
@@ -23,13 +23,13 @@ const getPropositions = (n, { answer, trinomIdentifiers }) => {
23
23
  };
24
24
  const getAnswer = (identifiers) => {
25
25
  const { trinomIdentifiers } = identifiers;
26
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
26
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
27
27
  const ans = (0, fractionNode_1.frac)(trinom.c, trinom.a).simplify().toTex();
28
28
  return ans;
29
29
  };
30
30
  const getInstruction = (identifiers) => {
31
31
  const { trinomIdentifiers } = identifiers;
32
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
32
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
33
33
  return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
34
34
 
35
35
  $$
@@ -49,7 +49,7 @@ $$`;
49
49
  };
50
50
  const getCorrection = (identifiers) => {
51
51
  const { trinomIdentifiers } = identifiers;
52
- const trinom = generalTrinom_1.GeneralTrinomConstructor.fromIdentifiers(trinomIdentifiers);
52
+ const trinom = trinomNode_1.TrinomNodeConstructor.fromIdentifiers(trinomIdentifiers);
53
53
  const aTex = trinom.a.toTex();
54
54
  const cTex = trinom.c.toTex();
55
55
  const ans = (0, fractionNode_1.frac)(trinom.c, trinom.a);
@@ -78,7 +78,7 @@ const getRootsProductQuestion = (ops) => {
78
78
  const a = (0, randint_1.randint)(-10, 10, [0]);
79
79
  const b = (0, randint_1.randint)(-10, 10);
80
80
  const c = (a / Math.abs(a)) * (0, randint_1.randint)(-10, 0, !b ? [0] : []);
81
- const trinom = new generalTrinom_1.GeneralTrinom(a, b, c);
81
+ const trinom = new trinomNode_1.TrinomNode(a, b, c);
82
82
  const identifiers = {
83
83
  trinomIdentifiers: trinom.toIdentifiers(),
84
84
  };
@@ -1,7 +1,7 @@
1
1
  import { Exercise } from "../../../../exercises/exercise";
2
- import { GeneralTrinomIdentifiers } from "../../../../math/polynomials/generalTrinom";
2
+ import { TrinomNodeIdentifiers } from "../../../../tree/nodes/polynomials/trinomNode";
3
3
  type Identifiers = {
4
- trinomIdentifiers: GeneralTrinomIdentifiers;
4
+ trinomIdentifiers: TrinomNodeIdentifiers;
5
5
  };
6
6
  export declare const rootsSum: Exercise<Identifiers>;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"rootsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAO9C,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,wBAAwB,CAAC;CAC7C,CAAC;AAoGF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}
1
+ {"version":3,"file":"rootsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/rootsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,qBAAqB,EACtB,MAAM,yCAAyC,CAAC;AAOjD,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,qBAAqB,CAAC;CAC1C,CAAC;AAoGF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAiB1C,CAAC"}