math-exercises 3.0.52 → 3.0.54

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 (238) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +0 -2
  3. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +0 -2
  5. package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsDivision.js +0 -2
  7. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/fractions/fractionsSum.js +0 -2
  9. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +3 -17
  11. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.js +0 -12
  13. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.js +0 -13
  15. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +0 -2
  17. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts +8 -3
  18. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +53 -30
  20. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/equation/equa4.js +0 -2
  22. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  23. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +3 -0
  24. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +4 -4
  26. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  27. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +0 -2
  28. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
  29. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.js +0 -2
  30. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts +2 -2
  31. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
  32. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +52 -25
  33. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts +2 -2
  34. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
  35. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +50 -33
  36. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts +2 -1
  37. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
  38. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +37 -17
  39. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
  40. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +0 -2
  41. package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
  42. package/lib/exercises/math/functions/affines/affineExpressionReading.js +3 -2
  43. package/lib/exercises/math/functions/affines/interceptReading.d.ts.map +1 -1
  44. package/lib/exercises/math/functions/affines/interceptReading.js +47 -18
  45. package/lib/exercises/math/functions/affines/leadingCoefficientCalculV2.d.ts.map +1 -1
  46. package/lib/exercises/math/functions/affines/leadingCoefficientCalculV2.js +46 -13
  47. package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -1
  48. package/lib/exercises/math/geometry/angles/recognizeAngleType.js +33 -12
  49. package/lib/exercises/math/geometry/areas/circleArea.d.ts.map +1 -1
  50. package/lib/exercises/math/geometry/areas/circleArea.js +45 -2
  51. package/lib/exercises/math/geometry/areas/squareArea.d.ts.map +1 -1
  52. package/lib/exercises/math/geometry/areas/squareArea.js +40 -7
  53. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  54. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
  55. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +52 -7
  56. package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.d.ts +9 -0
  57. package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.d.ts.map +1 -0
  58. package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.js +162 -0
  59. package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.d.ts +10 -0
  60. package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.d.ts.map +1 -0
  61. package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.js +161 -0
  62. package/lib/exercises/math/geometry/cartesian/directionVector.d.ts +4 -2
  63. package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -1
  64. package/lib/exercises/math/geometry/cartesian/directionVector.js +110 -79
  65. package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
  66. package/lib/exercises/math/geometry/cartesian/directionVectorEquation.js +55 -11
  67. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -1
  68. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +18 -2
  69. package/lib/exercises/math/geometry/cartesian/index.d.ts +2 -0
  70. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  71. package/lib/exercises/math/geometry/cartesian/index.js +2 -0
  72. package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
  73. package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +0 -2
  74. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -1
  75. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.js +0 -2
  76. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts.map +1 -1
  77. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.js +0 -2
  78. package/lib/exercises/math/geometry/lines/aAndBFromReductEquation.d.ts +9 -0
  79. package/lib/exercises/math/geometry/lines/aAndBFromReductEquation.d.ts.map +1 -0
  80. package/lib/exercises/math/geometry/lines/aAndBFromReductEquation.js +108 -0
  81. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
  82. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +20 -1
  83. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts +9 -0
  84. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -0
  85. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +115 -0
  86. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.d.ts +9 -0
  87. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.d.ts.map +1 -0
  88. package/lib/exercises/math/geometry/lines/directorVectorFromAnother.js +122 -0
  89. package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.d.ts +9 -0
  90. package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.d.ts.map +1 -0
  91. package/lib/exercises/math/geometry/lines/directorVectorFromReductEquation.js +121 -0
  92. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts +10 -0
  93. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -0
  94. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +124 -0
  95. package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.d.ts +10 -0
  96. package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.d.ts.map +1 -0
  97. package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.js +123 -0
  98. package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts +12 -0
  99. package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts.map +1 -0
  100. package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.js +130 -0
  101. package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts +10 -0
  102. package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts.map +1 -0
  103. package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.js +109 -0
  104. package/lib/exercises/math/geometry/lines/index.d.ts +10 -0
  105. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  106. package/lib/exercises/math/geometry/lines/index.js +10 -0
  107. package/lib/exercises/math/geometry/lines/reductEquationFindY.d.ts +10 -0
  108. package/lib/exercises/math/geometry/lines/reductEquationFindY.d.ts.map +1 -0
  109. package/lib/exercises/math/geometry/lines/reductEquationFindY.js +105 -0
  110. package/lib/exercises/math/geometry/lines/reductEquationFromTwoPoints.d.ts +10 -0
  111. package/lib/exercises/math/geometry/lines/reductEquationFromTwoPoints.d.ts.map +1 -0
  112. package/lib/exercises/math/geometry/lines/reductEquationFromTwoPoints.js +149 -0
  113. package/lib/exercises/math/geometry/lines/reductEquationReading.d.ts +8 -0
  114. package/lib/exercises/math/geometry/lines/reductEquationReading.d.ts.map +1 -0
  115. package/lib/exercises/math/geometry/lines/reductEquationReading.js +142 -0
  116. package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
  117. package/lib/exercises/math/geometry/perimeters/circleCircumference.js +58 -9
  118. package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.d.ts.map +1 -1
  119. package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.js +39 -6
  120. package/lib/exercises/math/geometry/perimeters/squarePerimeter.d.ts.map +1 -1
  121. package/lib/exercises/math/geometry/perimeters/squarePerimeter.js +40 -7
  122. package/lib/exercises/math/geometry/perimeters/trianglePerimeter.d.ts.map +1 -1
  123. package/lib/exercises/math/geometry/perimeters/trianglePerimeter.js +34 -7
  124. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  125. package/lib/exercises/math/geometry/pythagore/pythagore.js +51 -15
  126. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  127. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +109 -19
  128. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  129. package/lib/exercises/math/geometry/thales/thales.js +36 -5
  130. package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -1
  131. package/lib/exercises/math/geometry/triangles/triangleNature.js +45 -14
  132. package/lib/exercises/math/geometry/vectors/alignementViaColinearity.d.ts.map +1 -1
  133. package/lib/exercises/math/geometry/vectors/alignementViaColinearity.js +78 -15
  134. package/lib/exercises/math/geometry/vectors/colinearity.d.ts +5 -4
  135. package/lib/exercises/math/geometry/vectors/colinearity.d.ts.map +1 -1
  136. package/lib/exercises/math/geometry/vectors/colinearity.js +82 -21
  137. package/lib/exercises/math/geometry/vectors/determinant.js +1 -1
  138. package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts +2 -0
  139. package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts.map +1 -0
  140. package/lib/exercises/math/geometry/vectors/findCoordForAligment.js +92 -0
  141. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.d.ts.map +1 -1
  142. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.js +117 -76
  143. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +1 -1
  144. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  145. package/lib/exercises/math/powers/calculateNegativePower.js +0 -2
  146. package/lib/exercises/math/powers/calculatePower.d.ts.map +1 -1
  147. package/lib/exercises/math/powers/calculatePower.js +63 -8
  148. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  149. package/lib/exercises/math/powers/decimalToScientific.js +0 -15
  150. package/lib/exercises/math/powers/powerDefinition.d.ts.map +1 -1
  151. package/lib/exercises/math/powers/powerDefinition.js +39 -8
  152. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  153. package/lib/exercises/math/powers/powersOfTenToDecimal.js +2 -1
  154. package/lib/exercises/math/powers/powersPower.d.ts +5 -2
  155. package/lib/exercises/math/powers/powersPower.d.ts.map +1 -1
  156. package/lib/exercises/math/powers/powersPower.js +59 -28
  157. package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
  158. package/lib/exercises/math/powers/scientificToDecimal.js +0 -15
  159. package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
  160. package/lib/exercises/math/probaStat/index.d.ts +1 -0
  161. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  162. package/lib/exercises/math/probaStat/index.js +1 -0
  163. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +5 -0
  164. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -0
  165. package/lib/exercises/math/probaStat/randomVariable/index.js +4 -0
  166. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts +10 -0
  167. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts.map +1 -0
  168. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.js +81 -0
  169. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.d.ts +9 -0
  170. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.d.ts.map +1 -0
  171. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.js +95 -0
  172. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.d.ts +9 -0
  173. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.d.ts.map +1 -0
  174. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +106 -0
  175. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.d.ts +9 -0
  176. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.d.ts.map +1 -0
  177. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.js +105 -0
  178. package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
  179. package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +21 -0
  180. package/lib/exercises/math/trigonometry/mainRemarkableValues.d.ts.map +1 -1
  181. package/lib/exercises/math/trigonometry/mainRemarkableValues.js +1 -1
  182. package/lib/exercises/math/trigonometry/remarkableValues.d.ts.map +1 -1
  183. package/lib/exercises/math/trigonometry/remarkableValues.js +3 -0
  184. package/lib/index.d.ts +76 -15
  185. package/lib/index.d.ts.map +1 -1
  186. package/lib/math/geometry/angle.d.ts.map +1 -1
  187. package/lib/math/geometry/angle.js +12 -7
  188. package/lib/math/geometry/line.d.ts +5 -10
  189. package/lib/math/geometry/line.d.ts.map +1 -1
  190. package/lib/math/geometry/line.js +71 -37
  191. package/lib/math/geometry/point.d.ts +2 -1
  192. package/lib/math/geometry/point.d.ts.map +1 -1
  193. package/lib/math/geometry/point.js +3 -0
  194. package/lib/math/geometry/segment.js +1 -1
  195. package/lib/math/geometry/triangles/triangle.d.ts.map +1 -1
  196. package/lib/math/geometry/triangles/triangle.js +11 -11
  197. package/lib/math/geometry/vector.d.ts +6 -0
  198. package/lib/math/geometry/vector.d.ts.map +1 -1
  199. package/lib/math/geometry/vector.js +30 -4
  200. package/lib/math/probability/randomVariable.d.ts +15 -0
  201. package/lib/math/probability/randomVariable.d.ts.map +1 -0
  202. package/lib/math/probability/randomVariable.js +56 -0
  203. package/lib/math/systems/generalSystem.d.ts +12 -1
  204. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  205. package/lib/math/systems/generalSystem.js +92 -55
  206. package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
  207. package/lib/math/trigonometry/remarkableValue.js +1 -1
  208. package/lib/playground.d.ts.map +1 -1
  209. package/lib/playground.js +1 -8
  210. package/lib/server.js +1 -1
  211. package/lib/tree/nodes/algebraicNode.d.ts +0 -1
  212. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  213. package/lib/tree/nodes/equations/equalNode.d.ts +3 -3
  214. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  215. package/lib/tree/nodes/equations/equalNode.js +3 -3
  216. package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
  217. package/lib/tree/nodes/functions/cosNode.js +11 -5
  218. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  219. package/lib/tree/nodes/functions/sinNode.js +11 -5
  220. package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
  221. package/lib/tree/nodes/functions/tanNode.js +11 -5
  222. package/lib/tree/nodes/node.d.ts +9 -8
  223. package/lib/tree/nodes/node.d.ts.map +1 -1
  224. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  225. package/lib/tree/nodes/nodeConstructor.js +1 -1
  226. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  227. package/lib/tree/nodes/numbers/numberNode.js +6 -2
  228. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +2 -1
  229. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
  230. package/lib/tree/nodes/operators/binomialCoefficientNode.js +7 -2
  231. package/lib/tree/nodes/operators/fractionNode.js +2 -2
  232. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  233. package/lib/tree/nodes/operators/powerNode.d.ts +4 -4
  234. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  235. package/lib/tree/nodes/operators/powerNode.js +5 -5
  236. package/lib/tree/parsers/latexParser.d.ts.map +1 -1
  237. package/lib/tree/parsers/latexParser.js +6 -0
  238. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"fractionAndIntegerDivision.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionAndIntegerDivision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAiKF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAmB5D,CAAC"}
1
+ {"version":3,"file":"fractionAndIntegerDivision.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionAndIntegerDivision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAiKF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
@@ -133,9 +133,7 @@ export const fractionAndIntegerDivision = {
133
133
  id: "fractionAndIntegerDivision",
134
134
  connector: "=",
135
135
  label: "Division d'un entier par une fraction et vice-versa",
136
- levels: ["4ème", "3ème", "2nde", "2ndPro", "1rePro", "CAP"],
137
136
  isSingleStep: false,
138
- sections: ["Fractions"],
139
137
  generator: (nb) => getDistinctQuestions(getFractionAndIntegerDivision, nb),
140
138
  qcmTimer: 60,
141
139
  freeTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"fractionAndIntegerProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionAndIntegerProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AA2IF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqBpE,CAAC"}
1
+ {"version":3,"file":"fractionAndIntegerProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionAndIntegerProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AA2IF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBpE,CAAC"}
@@ -115,9 +115,7 @@ export const fractionAndIntegerProduct = {
115
115
  id: "fractionAndIntegerProduct",
116
116
  connector: "=",
117
117
  label: "Produit d'un entier par une fraction",
118
- levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro"],
119
118
  isSingleStep: false,
120
- sections: ["Fractions"],
121
119
  generator: (nb, opts) => getDistinctQuestions(() => getFractionAndIntegerProduct(opts), nb),
122
120
  qcmTimer: 60,
123
121
  freeTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsDivision.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsDivision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAkFrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,CAAC;AAgDF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAgBnD,CAAC"}
1
+ {"version":3,"file":"fractionsDivision.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsDivision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAkFrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,CAAC;AAgDF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAcnD,CAAC"}
@@ -93,8 +93,6 @@ export const fractionsDivision = {
93
93
  id: "fractionsDivision",
94
94
  connector: "=",
95
95
  label: "Divisions de fractions",
96
- levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro"],
97
- sections: ["Fractions"],
98
96
  isSingleStep: false,
99
97
  generator: (nb, opts) => getDistinctQuestions(() => getFractionsDivision(opts), nb),
100
98
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAyGF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBvD,CAAC"}
1
+ {"version":3,"file":"fractionsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAyGF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAcvD,CAAC"}
@@ -82,8 +82,6 @@ export const fractionsSum = {
82
82
  id: "fractionsSum",
83
83
  connector: "=",
84
84
  label: "Sommes de fractions",
85
- levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro"],
86
- sections: ["Fractions"],
87
85
  isSingleStep: false,
88
86
  generator: (nb, opts) => getDistinctQuestions(() => getFractionsSum(opts), nb),
89
87
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"mentalAddAndSub.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalAddAndSub.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAkEF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAuBjD,CAAC"}
1
+ {"version":3,"file":"mentalAddAndSub.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalAddAndSub.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA8DF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAWjD,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
3
4
  import { randint } from "../../../../math/utils/random/randint.js";
4
5
  import { round } from "../../../../math/utils/round.js";
5
6
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
@@ -50,28 +51,13 @@ const getPropositions = (n, { answer, numbers }) => {
50
51
  }
51
52
  return shuffle(propositions);
52
53
  };
53
- const isAnswerValid = (studentAns, { numbers }) => {
54
- const sum = numbers.reduce((acc, curr) => acc + curr);
55
- const answerTree = new NumberNode(round(sum, 2));
56
- const texs = answerTree.toAllValidTexs();
57
- return texs.includes(studentAns);
54
+ const isAnswerValid = (ans, { answer, numbers }) => {
55
+ return numberVEA(ans, answer);
58
56
  };
59
57
  export const mentalAddAndSub = {
60
58
  id: "mentalAddAndSub",
61
59
  connector: "=",
62
60
  label: "Additions et soustractions avec des décimaux",
63
- levels: [
64
- "6ème",
65
- "5ème",
66
- "4ème",
67
- "3ème",
68
- "2nde",
69
- "1reESM",
70
- "CAP",
71
- "2ndPro",
72
- "1rePro",
73
- ],
74
- sections: ["Calculs"],
75
61
  isSingleStep: true,
76
62
  generator: (nb) => getDistinctQuestions(getMentalAddAndSub, nb),
77
63
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"mentalMultiplications.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalMultiplications.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA6EF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAuBvD,CAAC"}
1
+ {"version":3,"file":"mentalMultiplications.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalMultiplications.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA6EF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAWvD,CAAC"}
@@ -68,18 +68,6 @@ export const mentalMultiplications = {
68
68
  id: "mentalMultiplications",
69
69
  connector: "=",
70
70
  label: "Multiplications avec des décimaux",
71
- levels: [
72
- "6ème",
73
- "5ème",
74
- "4ème",
75
- "3ème",
76
- "2nde",
77
- "1reESM",
78
- "CAP",
79
- "2ndPro",
80
- "1rePro",
81
- ],
82
- sections: ["Calculs"],
83
71
  isSingleStep: true,
84
72
  generator: (nb) => getDistinctQuestions(getMentalMultiplications, nb),
85
73
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"mentalPercentage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalPercentage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AA0ErC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAwBlD,CAAC"}
1
+ {"version":3,"file":"mentalPercentage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/mentalCaluls/mentalPercentage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AA0ErC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAWlD,CAAC"}
@@ -113,19 +113,6 @@ export const mentalPercentage = {
113
113
  id: "mentalPercentage",
114
114
  connector: "=",
115
115
  label: "Effectuer mentalement des calculs de pourcentages simples",
116
- levels: [
117
- "6ème",
118
- "5ème",
119
- "4ème",
120
- "3ème",
121
- "2nde",
122
- "1reESM",
123
- "CAP",
124
- "2ndPro",
125
- "1rePro",
126
- "TermPro",
127
- ],
128
- sections: ["Pourcentages"],
129
116
  isSingleStep: true,
130
117
  generator: (nb) => getDistinctQuestions(getMentalPercentage, nb),
131
118
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"operationsPrioritiesParenthesis.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/operationsPrioritiesParenthesis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAsHF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAcjE,CAAC"}
1
+ {"version":3,"file":"operationsPrioritiesParenthesis.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/operationsPrioritiesParenthesis.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,GAAG,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAsHF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAYjE,CAAC"}
@@ -97,9 +97,7 @@ export const operationsPrioritiesParenthesis = {
97
97
  id: "operationsPrioritiesParenthesis",
98
98
  connector: "=",
99
99
  label: "Priorités opératoires avec parenthèses",
100
- levels: [],
101
100
  isSingleStep: true,
102
- sections: [],
103
101
  generator: (nb) => getDistinctQuestions(getOperationsPrioritiesParenthesisQuestion, nb),
104
102
  qcmTimer: 60,
105
103
  freeTimer: 60,
@@ -1,8 +1,13 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { EqualNodeIdentifiers } from "../../../../tree/nodes/equations/equalNode.js";
3
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
2
4
  type Identifiers = {
3
- solutionNodeIds: any;
4
- equationNodeIds: any;
5
+ solutionNodeIds: NodeIdentifiers;
6
+ equationNodeIds: EqualNodeIdentifiers;
5
7
  };
6
- export declare const binomialsTrinomialsProposedSolutions: Exercise<Identifiers>;
8
+ type Options = {
9
+ degree: string;
10
+ };
11
+ export declare const binomialsTrinomialsProposedSolutions: Exercise<Identifiers, Options>;
7
12
  export {};
8
13
  //# sourceMappingURL=binomialsTrinomialsProposedSolutions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"binomialsTrinomialsProposedSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,GAAG,CAAC;IACrB,eAAe,EAAE,GAAG,CAAC;CACtB,CAAC;AA0EF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CActE,CAAC"}
1
+ {"version":3,"file":"binomialsTrinomialsProposedSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,oBAAoB,EACrB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAW7C,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,eAAe,CAAC;IACjC,eAAe,EAAE,oBAAoB,CAAC;CACvC,CAAC;AA2FF,KAAK,OAAO,GAAG;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAYF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CACzD,WAAW,EACX,OAAO,CAiBR,CAAC"}
@@ -1,12 +1,21 @@
1
- import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
1
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { Affine } from "../../../../math/polynomials/affine.js";
4
4
  import { Trinom } from "../../../../math/polynomials/trinom.js";
5
5
  import { randint } from "../../../../math/utils/random/randint.js";
6
- import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
6
+ import { EqualNode, } from "../../../../tree/nodes/equations/equalNode.js";
7
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
8
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
7
9
  import { FractionNode } from "../../../../tree/nodes/operators/fractionNode.js";
8
- import { SubstractNode } from "../../../../tree/nodes/operators/substractNode.js";
10
+ import { substract, SubstractNode, } from "../../../../tree/nodes/operators/substractNode.js";
9
11
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
12
+ import { random } from "../../../../utils/alea/random.js";
13
+ const getInstruction = (identifiers) => {
14
+ const { solutionNodeIds, equationNodeIds } = identifiers;
15
+ const solution = reifyAlgebraic(solutionNodeIds, true);
16
+ const equation = reifyAlgebraic(equationNodeIds, true);
17
+ return `Le nombre $${solution.toTex()}$ est-il une solution de l'équation $${equation.toTex()}$ ?`;
18
+ };
10
19
  function generateTrinomialFromRoot(root, constante) {
11
20
  const a = randint(1, 5);
12
21
  const r2 = randint(-10, 10, [0]);
@@ -14,63 +23,77 @@ function generateTrinomialFromRoot(root, constante) {
14
23
  const c = root * r2;
15
24
  return new Trinom(a, a * b, a * c + constante);
16
25
  }
17
- const getBinomialsTrinomialsProposedSolutionsQuestion = () => {
18
- const degree = coinFlip();
26
+ const getBinomialsTrinomialsProposedSolutionsQuestion = (opts) => {
27
+ const degree = opts?.degree === "Second degré"
28
+ ? 2
29
+ : opts?.degree === "Premier degré"
30
+ ? 1
31
+ : random([1, 2]);
19
32
  const constante = randint(-10, 10);
20
33
  const root = randint(-10, 10, [0]);
21
34
  const trinomial = generateTrinomialFromRoot(root, constante);
22
35
  const a1 = randint(-10, 10, [0]);
23
36
  const b1 = randint(-10, 10);
24
- let a2;
25
- do {
26
- a2 = randint(-10, 10, [0]);
27
- } while (a2 === a1);
37
+ const a2 = randint(-10, 10, [0, a1]);
28
38
  const b2 = randint(-10, 10);
29
39
  const binomial1 = new Affine(a1, b1);
30
40
  const binomial2 = new Affine(a2, b2);
31
- const equation = degree
41
+ const equation = degree === 2
32
42
  ? new EqualNode(trinomial.toTree(), constante.toTree())
33
43
  : new EqualNode(binomial1.toTree(), binomial2.toTree());
34
- const ans = degree
44
+ const ans = degree === 2
35
45
  ? root.toTree()
36
46
  : new FractionNode(new SubstractNode(binomial2.b.toTree(), binomial1.b.toTree()), new SubstractNode(binomial1.a.toTree(), binomial2.a.toTree())).simplify();
37
- const answertype = coinFlip();
38
- const solution = answertype ? ans : randint(-10, 10).toTree();
39
- const answer = answertype ? "Oui" : "Non";
47
+ const isSol = coinFlip();
48
+ const solution = isSol ? ans : add(ans, randint(-2, 3, [0])).simplify();
49
+ const identifiers = {
50
+ equationNodeIds: equation.toIdentifiers(),
51
+ solutionNodeIds: solution.toIdentifiers(),
52
+ };
53
+ return getQuestionFromIdentifiers(identifiers, opts);
54
+ };
55
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
40
56
  const question = {
41
- answer: answer,
42
- instruction: `Le nombre $${solution.toTex()}$ est-il une solution de l'équation $${equation.toTex()}$ ?`,
43
- keys: [],
57
+ instruction: getInstruction(identifiers, opts),
44
58
  answerFormat: "raw",
45
- identifiers: {
46
- equationNodeIds: equation.toIdentifiers(),
47
- solutionNodeIds: solution.toIdentifiers(),
48
- },
59
+ identifiers,
49
60
  };
50
61
  return question;
51
62
  };
52
- const getPropositions = (n, { answer }) => {
63
+ const getPropositions = (n, { answer, ...identifiers }, opts) => {
53
64
  const propositions = [];
54
- addValidProp(propositions, answer, "raw");
65
+ const { solutionNodeIds, equationNodeIds } = identifiers;
66
+ const solution = reifyAlgebraic(solutionNodeIds, true);
67
+ const equation = reifyAlgebraic(equationNodeIds, true);
68
+ const allLeft = substract(equation.leftChild, equation.rightChild);
69
+ const ev = allLeft.toDetailedEvaluation({ x: solution }).simplify();
70
+ const isSol = ev.evaluate() === 0;
71
+ addValidProp(propositions, isSol ? "Oui" : "Non", "raw");
55
72
  tryToAddWrongProp(propositions, "Oui", "raw");
56
73
  tryToAddWrongProp(propositions, "Non", "raw");
57
74
  tryToAddWrongProp(propositions, "On ne peut pas savoir", "raw");
58
75
  return shuffleProps(propositions, n);
59
76
  };
60
- const isAnswerValid = (ans, { answer }) => {
61
- return ans === answer;
62
- };
77
+ const options = [
78
+ {
79
+ id: "degree",
80
+ label: "Degré de l'équation",
81
+ target: GeneratorOptionTarget.generation,
82
+ type: GeneratorOptionType.select,
83
+ defaultValue: "Les deux",
84
+ values: ["Premier degré", "Second degré", "Les deux"],
85
+ },
86
+ ];
63
87
  export const binomialsTrinomialsProposedSolutions = {
64
88
  id: "binomialsTrinomialsProposedSolutions",
65
89
  label: "Vérifier si un nombre est solution d'une équation",
66
- levels: ["1rePro"],
67
90
  isSingleStep: true,
68
- sections: ["Équations"],
69
- generator: (nb) => getDistinctQuestions(getBinomialsTrinomialsProposedSolutionsQuestion, nb),
91
+ generator: (nb, opts) => getDistinctQuestions(() => getBinomialsTrinomialsProposedSolutionsQuestion(opts), nb),
70
92
  answerType: "QCU",
71
93
  qcmTimer: 60,
72
94
  freeTimer: 60,
73
95
  getPropositions,
74
- isAnswerValid,
75
96
  subject: "Mathématiques",
97
+ getQuestionFromIdentifiers,
98
+ options,
76
99
  };
@@ -1 +1 @@
1
- {"version":3,"file":"equa4.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equa4.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAkBrC;;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;AAkGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAoBvD,CAAC"}
1
+ {"version":3,"file":"equa4.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equa4.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAkBrC;;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;AAkGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAkBvD,CAAC"}
@@ -88,8 +88,6 @@ export const equationType4Exercise = {
88
88
  id: "equa4",
89
89
  connector: "\\iff",
90
90
  label: "Résoudre une équation du type $ax+b=cx+d$",
91
- levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
92
- sections: ["Équations"],
93
91
  isSingleStep: false,
94
92
  generator: (nb) => getDistinctQuestions(getEquationType4ExerciseQuestion, nb),
95
93
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAarC,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;AAwHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
1
+ {"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAarC,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;AA8HF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
@@ -67,6 +67,9 @@ const getMultiplicationEquation = () => {
67
67
  d = randint(-9, 10, [0]);
68
68
  } while (a / c === b / d);
69
69
  const identifiers = { a, b, c, d };
70
+ return getQuestionFromIdentifiers(identifiers);
71
+ };
72
+ const getQuestionFromIdentifiers = (identifiers) => {
70
73
  const question = {
71
74
  instruction: getInstruction(identifiers),
72
75
  startStatement: getStartStatement(identifiers),
@@ -1 +1 @@
1
- {"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAsBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+HF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
1
+ {"version":3,"file":"factoIdRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoIdRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAsBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiIF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
@@ -89,16 +89,16 @@ const getPropositions = (n, { answer, a, b }) => {
89
89
  }
90
90
  return shuffle(propositions);
91
91
  };
92
- const isAnswerValid = (ans, { answer, a, b }) => {
92
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
93
93
  try {
94
94
  const parsed = parseAlgebraic(ans);
95
- if (!parsed)
96
- return false;
97
95
  if (!isMultiplyNode(parsed) &&
98
96
  !isSquareNode(parsed) &&
99
97
  !isPowerNode(parsed))
100
98
  return false;
101
- return parsed.simplify().toTex() === answer;
99
+ return (parsed
100
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
101
+ .toTex() === getStartStatement(identifiers));
102
102
  }
103
103
  catch (err) {
104
104
  return handleVEAError(err);
@@ -1 +1 @@
1
- {"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAuBrC;;;GAGG;AACH,KAAK,WAAW,GAAG;IAEjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAIlB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAoKF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
1
+ {"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAuBrC;;;GAGG;AACH,KAAK,WAAW,GAAG;IAEjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAIlB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAoKF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAapD,CAAC"}
@@ -130,8 +130,6 @@ export const factoType1Exercise = {
130
130
  connector: "=",
131
131
  isSingleStep: false,
132
132
  label: "Factorisation du type $(ax+b)(cx+d) \\pm (ax+b)(ex+f)$",
133
- levels: ["3ème", "2nde"],
134
- sections: ["Calcul littéral"],
135
133
  generator: (nb) => getDistinctQuestions(getFactoType1Question, nb),
136
134
  qcmTimer: 60,
137
135
  freeTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"evaluateExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/evaluateExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAoFF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAkBpD,CAAC"}
1
+ {"version":3,"file":"evaluateExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/evaluateExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAoFF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAgBpD,CAAC"}
@@ -84,8 +84,6 @@ export const evaluateExpression = {
84
84
  id: "evaluateExpression",
85
85
  connector: "=",
86
86
  label: "Évaluer une expression",
87
- levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro"],
88
- sections: ["Calcul littéral"],
89
87
  isSingleStep: true,
90
88
  generator: (nb) => getDistinctQuestions(getEvaluateExpression, nb),
91
89
  qcmTimer: 60,
@@ -1,7 +1,7 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
2
3
  type Identifiers = {
3
- coeffs: number[][];
4
- isXAsked: boolean;
4
+ coeffsIds: NodeIdentifiers[][];
5
5
  };
6
6
  export declare const basicNiceValuesSystemResolution: Exercise<Identifiers>;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"basicNiceValuesSystemResolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAgDF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAcjE,CAAC"}
1
+ {"version":3,"file":"basicNiceValuesSystemResolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAKtE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,EAAE,EAAE,CAAC;CAIhC,CAAC;AA2EF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAgBjE,CAAC"}
@@ -1,44 +1,69 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
- import { System, SystemConstructor } from "../../../../math/systems/system.js";
4
- import { randint } from "../../../../math/utils/random/randint.js";
5
- import { coinFlip } from "../../../../utils/alea/coinFlip.js";
3
+ import { Point, PointConstructor } from "../../../../math/geometry/point.js";
4
+ import { GeneralSystemConstructor, } from "../../../../math/systems/generalSystem.js";
5
+ import { pointParser } from "../../../../tree/parsers/pointParser.js";
6
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
6
7
  //{ a1x + b1y = c1 , a2x + b2y = c2}
7
- const getBasicNiceValuesSystemResolutionQuestion = () => {
8
- //need a1/b1 != a2/b2
9
- const sys = SystemConstructor.niceValues();
10
- const { x, y } = sys.solve();
11
- const isXAsked = coinFlip();
12
- const variable = isXAsked ? "x" : "y";
13
- const answer = isXAsked ? x.toTex() : y.toTex();
14
- const question = {
15
- answer,
16
- instruction: `Soit le système d'équations suivant :
17
-
8
+ const rebuildIdentifiers = (oldIds) => {
9
+ if (oldIds?.coeffsIds?.length)
10
+ return oldIds;
11
+ return {
12
+ coeffsIds: oldIds.coeffs.map((row) => row.map((e) => e.toTree())),
13
+ };
14
+ };
15
+ const getInstruction = (identifiers) => {
16
+ const sys = GeneralSystemConstructor.fromIdentifiers(identifiers);
17
+ return `Résoudre le système d'équations suivant :
18
+
18
19
  $$
19
20
  ${sys.toTex()}
20
21
  $$
21
-
22
- Que vaut $${variable}$ ?`,
22
+
23
+ *Donner le couple solution sous la forme $\\left(x;y\\right)$ : par exemple, si la solution est $x=2$ et $y=3$, alors on écrira $\\left(2;3\\right)$.*`;
24
+ };
25
+ const getAnswer = (identifiers) => {
26
+ const sys = GeneralSystemConstructor.fromIdentifiers(identifiers);
27
+ const { x, y } = sys.solve();
28
+ return new Point("A", x, y).toCoords();
29
+ };
30
+ const getBasicSystemResolutionQuestion = () => {
31
+ const sys = GeneralSystemConstructor.niceValues();
32
+ const identifiers = {
33
+ coeffsIds: sys.toIdentifiers().coeffsIds,
34
+ };
35
+ return getQuestionFromIdentifiers(identifiers);
36
+ };
37
+ const getQuestionFromIdentifiers = (identifiers) => {
38
+ const question = {
39
+ answer: getAnswer(identifiers),
40
+ instruction: getInstruction(identifiers),
23
41
  keys: [],
24
42
  answerFormat: "tex",
25
- identifiers: { coeffs: sys.coeffs, isXAsked },
43
+ identifiers,
26
44
  };
27
45
  return question;
28
46
  };
29
- const getPropositions = (n, { answer, coeffs, isXAsked }) => {
47
+ const getPropositions = (n, { answer, ...identifiers }) => {
30
48
  const propositions = [];
31
- const sys = new System(coeffs);
32
- const { x, y } = sys.solve();
33
49
  addValidProp(propositions, answer);
34
- tryToAddWrongProp(propositions, isXAsked ? y.toTex() : x.toTex());
50
+ // tryToAddWrongProp(propositions, isXAsked ? y.toTex() : x.toTex());
35
51
  while (propositions.length < n) {
36
- tryToAddWrongProp(propositions, randint(-10, 11) + "");
52
+ const point = PointConstructor.random("A");
53
+ tryToAddWrongProp(propositions, point.toCoords());
37
54
  }
38
55
  return shuffleProps(propositions, n);
39
56
  };
40
- const isAnswerValid = (ans, { answer, coeffs, isXAsked }) => {
41
- return ans === answer;
57
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
58
+ try {
59
+ const parsed = pointParser(ans);
60
+ if (!parsed)
61
+ return false;
62
+ return parsed.simplify().toCoords() === answer;
63
+ }
64
+ catch (err) {
65
+ return handleVEAError(err);
66
+ }
42
67
  };
43
68
  export const basicNiceValuesSystemResolution = {
44
69
  id: "basicNiceValuesSystemResolution",
@@ -47,10 +72,12 @@ export const basicNiceValuesSystemResolution = {
47
72
  levels: ["2nde", "1reSpé"],
48
73
  isSingleStep: true,
49
74
  sections: ["Systèmes"],
50
- generator: (nb) => getDistinctQuestions(getBasicNiceValuesSystemResolutionQuestion, nb),
75
+ generator: (nb) => getDistinctQuestions(getBasicSystemResolutionQuestion, nb),
51
76
  qcmTimer: 60,
52
77
  freeTimer: 60,
53
78
  getPropositions,
54
79
  isAnswerValid,
55
80
  subject: "Mathématiques",
81
+ getQuestionFromIdentifiers,
82
+ rebuildIdentifiers,
56
83
  };
@@ -1,7 +1,7 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
2
3
  type Identifiers = {
3
- coeffs: number[][];
4
- isXAsked: boolean;
4
+ coeffsIds: NodeIdentifiers[][];
5
5
  };
6
6
  export declare const basicSystemResolution: Exercise<Identifiers>;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"basicSystemResolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/basicSystemResolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AA8DF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAcvD,CAAC"}
1
+ {"version":3,"file":"basicSystemResolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/basicSystemResolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAKtE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,EAAE,EAAE,CAAC;CAIhC,CAAC;AA6EF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}