math-exercises 3.0.56 → 3.0.58

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 (286) hide show
  1. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +2 -0
  2. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/operations/operationsPriorities.js +46 -36
  4. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts.map +1 -1
  5. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +65 -13
  6. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  7. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -4
  8. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts +16 -0
  9. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts.map +1 -0
  10. package/lib/exercises/math/calculLitteral/factorisation/facto1.js +184 -0
  11. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  12. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +43 -0
  13. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -1
  14. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  15. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -1
  16. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
  17. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +23 -0
  18. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +23 -0
  20. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +49 -0
  22. package/lib/exercises/math/conversion/capacityConversion.d.ts.map +1 -1
  23. package/lib/exercises/math/conversion/capacityConversion.js +68 -12
  24. package/lib/exercises/math/conversion/hoursToDecimal.d.ts.map +1 -1
  25. package/lib/exercises/math/conversion/hoursToDecimal.js +73 -15
  26. package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
  27. package/lib/exercises/math/conversion/lengthConversion.js +55 -6
  28. package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
  29. package/lib/exercises/math/conversion/massConversion.js +72 -16
  30. package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
  31. package/lib/exercises/math/conversion/volumeConversion.js +72 -12
  32. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts +8 -0
  33. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -0
  34. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +102 -0
  35. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts +7 -0
  36. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts.map +1 -0
  37. package/lib/exercises/math/derivation/convexity/convexityTrinomials.js +52 -0
  38. package/lib/exercises/math/derivation/convexity/index.d.ts +4 -0
  39. package/lib/exercises/math/derivation/convexity/index.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/convexity/index.js +3 -0
  41. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts +7 -0
  42. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts.map +1 -0
  43. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +134 -0
  44. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts +8 -0
  45. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -0
  46. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +79 -0
  47. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts +8 -0
  48. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -0
  49. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +85 -0
  50. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts +8 -0
  51. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -0
  52. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +86 -0
  53. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts +8 -0
  54. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -0
  55. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +76 -0
  56. package/lib/exercises/math/derivation/derivative/exp/index.d.ts +6 -0
  57. package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -0
  58. package/lib/exercises/math/derivation/derivative/exp/index.js +5 -0
  59. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts +7 -0
  60. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts.map +1 -0
  61. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +84 -0
  62. package/lib/exercises/math/derivation/derivative/index.d.ts +6 -27
  63. package/lib/exercises/math/derivation/derivative/index.d.ts.map +1 -1
  64. package/lib/exercises/math/derivation/derivative/index.js +6 -27
  65. package/lib/exercises/math/derivation/derivative/ln/index.d.ts +4 -0
  66. package/lib/exercises/math/derivation/derivative/ln/index.d.ts.map +1 -0
  67. package/lib/exercises/math/derivation/derivative/ln/index.js +3 -0
  68. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts +8 -0
  69. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts.map +1 -0
  70. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.js +81 -0
  71. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts +8 -0
  72. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts.map +1 -0
  73. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.js +103 -0
  74. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts +8 -0
  75. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts.map +1 -0
  76. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.js +77 -0
  77. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts +10 -0
  78. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts.map +1 -0
  79. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.js +71 -0
  80. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts +11 -0
  81. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts.map +1 -0
  82. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +88 -0
  83. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts +8 -0
  84. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts.map +1 -0
  85. package/lib/exercises/math/derivation/derivative/polynomial/index.js +7 -0
  86. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts +10 -0
  87. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts.map +1 -0
  88. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +115 -0
  89. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts +10 -0
  90. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts.map +1 -0
  91. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.js +80 -0
  92. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts +9 -0
  93. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts.map +1 -0
  94. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.js +67 -0
  95. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts +10 -0
  96. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts.map +1 -0
  97. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +134 -0
  98. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts +11 -0
  99. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts.map +1 -0
  100. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.js +97 -0
  101. package/lib/exercises/math/derivation/derivative/power/index.d.ts +3 -0
  102. package/lib/exercises/math/derivation/derivative/power/index.d.ts.map +1 -0
  103. package/lib/exercises/math/derivation/derivative/power/index.js +2 -0
  104. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts +9 -0
  105. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts.map +1 -0
  106. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.js +122 -0
  107. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts +8 -0
  108. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts.map +1 -0
  109. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.js +118 -0
  110. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts +3 -0
  111. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts.map +1 -0
  112. package/lib/exercises/math/derivation/derivative/sqrt/index.js +3 -0
  113. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts +7 -0
  114. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts.map +1 -0
  115. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.js +115 -0
  116. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts +8 -0
  117. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -0
  118. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +77 -0
  119. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts +8 -0
  120. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts.map +1 -0
  121. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.js +85 -0
  122. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts +8 -0
  123. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts.map +1 -0
  124. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.js +81 -0
  125. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts +7 -0
  126. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts.map +1 -0
  127. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.js +103 -0
  128. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts +5 -0
  129. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts.map +1 -0
  130. package/lib/exercises/math/derivation/derivative/trigo/index.js +4 -0
  131. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts +8 -0
  132. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts.map +1 -0
  133. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.js +70 -0
  134. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts +7 -0
  135. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts.map +1 -0
  136. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.js +91 -0
  137. package/lib/exercises/math/derivation/derivativeNumberCalcul.d.ts.map +1 -1
  138. package/lib/exercises/math/derivation/derivativeNumberCalcul.js +4 -2
  139. package/lib/exercises/math/derivation/index.d.ts +2 -0
  140. package/lib/exercises/math/derivation/index.d.ts.map +1 -1
  141. package/lib/exercises/math/derivation/index.js +2 -0
  142. package/lib/exercises/math/derivation/variations/index.d.ts +2 -0
  143. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -0
  144. package/lib/exercises/math/derivation/variations/index.js +1 -0
  145. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts +11 -0
  146. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts.map +1 -0
  147. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.js +168 -0
  148. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
  149. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +39 -22
  150. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  151. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +7 -1
  152. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
  153. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +38 -15
  154. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -1
  155. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.js +29 -8
  156. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts +8 -0
  157. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -0
  158. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +86 -0
  159. package/lib/exercises/math/equaDiff/index.d.ts +1 -1
  160. package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
  161. package/lib/exercises/math/equaDiff/index.js +1 -1
  162. package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
  163. package/lib/exercises/math/functions/affines/signFunction.js +23 -11
  164. package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
  165. package/lib/exercises/math/functions/exponential/expEquation.js +3 -0
  166. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
  167. package/lib/exercises/math/functions/exponential/expFactorization.js +3 -0
  168. package/lib/exercises/math/functions/exponential/expSimplifiying.d.ts.map +1 -1
  169. package/lib/exercises/math/functions/exponential/expSimplifiying.js +83 -45
  170. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
  171. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +12 -5
  172. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts +2 -0
  173. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts.map +1 -0
  174. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.js +63 -0
  175. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
  176. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +68 -29
  177. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -1
  178. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +56 -4
  179. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -1
  180. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +71 -25
  181. package/lib/exercises/math/limits/polynomLimit.d.ts +1 -1
  182. package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
  183. package/lib/exercises/math/limits/polynomLimit.js +28 -9
  184. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts +1 -1
  185. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts.map +1 -1
  186. package/lib/exercises/math/limits/polynomLimitNoFI.js +29 -10
  187. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  188. package/lib/exercises/math/powers/calculateNegativePower.js +59 -16
  189. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  190. package/lib/exercises/math/powers/decimalToScientific.js +55 -11
  191. package/lib/exercises/math/powers/index.d.ts +1 -0
  192. package/lib/exercises/math/powers/index.d.ts.map +1 -1
  193. package/lib/exercises/math/powers/index.js +1 -0
  194. package/lib/exercises/math/powers/powersDivision.d.ts +5 -2
  195. package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
  196. package/lib/exercises/math/powers/powersDivision.js +68 -53
  197. package/lib/exercises/math/powers/powersMixOperations.d.ts +1 -0
  198. package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
  199. package/lib/exercises/math/powers/powersMixOperations.js +88 -17
  200. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts +10 -0
  201. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts.map +1 -0
  202. package/lib/exercises/math/powers/powersOfTenMixOperations.js +129 -0
  203. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  204. package/lib/exercises/math/powers/powersOfTenToDecimal.js +32 -3
  205. package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
  206. package/lib/exercises/math/powers/powersProduct.js +1 -0
  207. package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
  208. package/lib/exercises/math/powers/scientificToDecimal.js +50 -10
  209. package/lib/exercises/math/primitive/klogUPrimitive.js +1 -1
  210. package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
  211. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  212. package/lib/exercises/math/primitive/polynomialPrimitive.js +1 -0
  213. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
  214. package/lib/exercises/math/probaStat/stats1var/averageList.js +4 -4
  215. package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
  216. package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +42 -11
  217. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
  218. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +8 -20
  219. package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
  220. package/lib/exercises/math/probaStat/stats1var/etendueList.js +4 -6
  221. package/lib/exercises/math/probaStat/stats1var/interquartilesList.d.ts.map +1 -1
  222. package/lib/exercises/math/probaStat/stats1var/interquartilesList.js +4 -4
  223. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
  224. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +4 -4
  225. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  226. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +13 -9
  227. package/lib/exercises/math/probaStat/stats1var/median.d.ts.map +1 -1
  228. package/lib/exercises/math/probaStat/stats1var/median.js +19 -14
  229. package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
  230. package/lib/exercises/math/probaStat/stats1var/medianList.js +3 -0
  231. package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
  232. package/lib/exercises/math/probaStat/stats1var/quartiles.js +16 -11
  233. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  234. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +18 -14
  235. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.d.ts.map +1 -1
  236. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.js +4 -4
  237. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
  238. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +4 -4
  239. package/lib/exercises/math/probaStat/stats1var/varianceList.d.ts.map +1 -1
  240. package/lib/exercises/math/probaStat/stats1var/varianceList.js +4 -4
  241. package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
  242. package/lib/exercises/math/probaStat/stats1var/varianceTable.js +4 -4
  243. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -1
  244. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +40 -2
  245. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
  246. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.js +32 -0
  247. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  248. package/lib/exercises/math/trigonometry/trigonometry.js +67 -1
  249. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  250. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +89 -0
  251. package/lib/exercises/pc/index.d.ts +5 -5
  252. package/lib/exercises/pc/index.d.ts.map +1 -1
  253. package/lib/exercises/pc/index.js +5 -5
  254. package/lib/index.d.ts +56 -45
  255. package/lib/index.d.ts.map +1 -1
  256. package/lib/math/geometry/angle.d.ts.map +1 -1
  257. package/lib/math/geometry/angle.js +0 -5
  258. package/lib/math/geometry/vector.d.ts +1 -0
  259. package/lib/math/geometry/vector.d.ts.map +1 -1
  260. package/lib/math/geometry/vector.js +19 -0
  261. package/lib/math/numbers/decimals/decimal.d.ts +1 -0
  262. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  263. package/lib/math/numbers/decimals/decimal.js +2 -0
  264. package/lib/math/systems/generalSystem.d.ts +6 -1
  265. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  266. package/lib/math/systems/generalSystem.js +137 -0
  267. package/lib/math/utils/arithmetic/lcm.js +1 -1
  268. package/lib/playground.d.ts.map +1 -1
  269. package/lib/playground.js +4 -34
  270. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  271. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  272. package/lib/tree/nodes/equations/equalNode.d.ts +7 -1
  273. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  274. package/lib/tree/nodes/equations/equalNode.js +17 -9
  275. package/lib/tree/nodes/functions/logNode.js +2 -4
  276. package/lib/tree/nodes/operators/addNode.js +1 -1
  277. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  278. package/lib/tree/nodes/operators/fractionNode.js +35 -11
  279. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  280. package/lib/tree/nodes/operators/multiplyNode.js +4 -3
  281. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  282. package/lib/tree/nodes/operators/powerNode.js +5 -0
  283. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  284. package/lib/tree/nodes/sets/intervalNode.js +3 -1
  285. package/lib/tree/parsers/latexParser.js +6 -2
  286. package/package.json +1 -1
@@ -6,12 +6,14 @@
6
6
  * a/b ± c*d
7
7
  */
8
8
  import { Exercise } from "../../../../exercises/exercise.js";
9
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
9
10
  type Identifiers = {
10
11
  type: number;
11
12
  a: number;
12
13
  b: number;
13
14
  c: number;
14
15
  d: number | undefined;
16
+ statementIds: NodeIdentifiers;
15
17
  };
16
18
  export declare const operationsPriorities: Exercise<Identifiers>;
17
19
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"operationsPriorities.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/operationsPriorities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AAkJF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
1
+ {"version":3,"file":"operationsPriorities.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/operationsPriorities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEtB,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA6JF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAYtD,CAAC"}
@@ -7,17 +7,49 @@
7
7
  */
8
8
  import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
9
9
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
10
+ import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
10
11
  import { randint } from "../../../../math/utils/random/randint.js";
12
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
11
13
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
12
14
  import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
13
15
  import { DivideNode } from "../../../../tree/nodes/operators/divideNode.js";
14
16
  import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
15
17
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
16
18
  import { shuffle } from "../../../../utils/alea/shuffle.js";
19
+ const getStartStatement = (identifiers) => {
20
+ const { statementIds } = identifiers;
21
+ return reifyAlgebraic(statementIds).toTex();
22
+ };
23
+ const getInstruction = (identifiers) => {
24
+ return `Calculer :
25
+
26
+ $$
27
+ ${getStartStatement(identifiers)}
28
+ $$`;
29
+ };
30
+ const getAnswer = (identifiers) => {
31
+ const { statementIds } = identifiers;
32
+ return reifyAlgebraic(statementIds).simplify().toTex();
33
+ };
34
+ const getHint = (identifiers) => {
35
+ return ``;
36
+ };
37
+ const getCorrection = (identifiers) => {
38
+ return ``;
39
+ };
40
+ const getQuestionFromIdentifiers = (identifiers) => {
41
+ const question = {
42
+ instruction: getInstruction(identifiers),
43
+ startStatement: getStartStatement(identifiers),
44
+ answer: getAnswer(identifiers),
45
+ keys: [],
46
+ answerFormat: "tex",
47
+ identifiers,
48
+ };
49
+ return question;
50
+ };
17
51
  const getPriorityQuestions = () => {
18
52
  const type = randint(1, 9);
19
- let startStatement = "";
20
- let answer = "";
21
53
  let a, b, c, d;
22
54
  let statement;
23
55
  switch (type) {
@@ -30,8 +62,6 @@ const getPriorityQuestions = () => {
30
62
  : //a*b middle
31
63
  new AddNode(new AddNode(new NumberNode(c), new MultiplyNode(new NumberNode(a), new NumberNode(b))), new NumberNode(d));
32
64
  statement = statement.shuffle();
33
- startStatement = statement.toTex();
34
- answer = (a * b + c + d).toString();
35
65
  break;
36
66
  case 2: // a/b ±c±d
37
67
  [b, c, d] = [1, 2, 3].map((el) => randint(-10, 11, [0]));
@@ -42,67 +72,50 @@ const getPriorityQuestions = () => {
42
72
  : //a/b middle
43
73
  new AddNode(new AddNode(new NumberNode(c), new DivideNode(new NumberNode(a), new NumberNode(b))), new NumberNode(d));
44
74
  statement = statement.shuffle();
45
- startStatement = statement.toTex();
46
- answer = (a / b + c + d).toString();
47
75
  break;
48
76
  case 3: // a*b ± c*d
49
77
  [a, b, c, d] = [1, 2, 3, 4].map((el) => randint(-10, 11));
50
78
  statement = new AddNode(new MultiplyNode(new NumberNode(a), new NumberNode(b)), new MultiplyNode(new NumberNode(c), new NumberNode(d)));
51
- startStatement = statement.toTex();
52
- answer = (a * b + c * d).toString();
53
79
  break;
54
80
  case 4: // a*b ± c/d
55
81
  [a, b] = [1, 2].map((el) => randint(-10, 11));
56
82
  d = randint(-10, 11, [0]);
57
83
  c = d * randint(0, 11);
58
84
  statement = new AddNode(new MultiplyNode(new NumberNode(a), new NumberNode(b)), new DivideNode(new NumberNode(c), new NumberNode(d)));
59
- statement = statement.shuffle();
60
- startStatement = statement.toTex();
61
- answer = (a * b + c / d).toString();
62
85
  break;
63
86
  case 5: // a/b ± c/d
64
87
  [b, d] = [1, 2].map((el) => randint(-10, 11, [0]));
65
88
  a = b * randint(0, 11);
66
89
  c = d * randint(0, 11);
67
90
  statement = new AddNode(new DivideNode(new NumberNode(a), new NumberNode(b)), new DivideNode(new NumberNode(c), new NumberNode(d)));
68
- startStatement = statement.toTex();
69
- answer = (a / b + c / d).toString();
70
91
  break;
71
92
  case 6: // a*b*c ± d
72
93
  [a, b, c, d] = [1, 2, 3, 4].map((el) => randint(-10, 11, [0]));
73
94
  statement = new AddNode(new MultiplyNode(new MultiplyNode(new NumberNode(a), new NumberNode(b)), new NumberNode(c)), new NumberNode(d));
74
- statement = statement.shuffle();
75
- startStatement = statement.toTex();
76
- answer = (a * b * c + d).toString();
77
95
  break;
78
96
  case 7: //a/b*c et c*a/b
79
97
  b = randint(2, 10);
80
98
  a = b * randint(2, 10);
81
99
  c = randint(2, 10);
82
100
  statement = new MultiplyNode(new DivideNode(a.toTree(), b.toTree()), c.toTree()).shuffle();
83
- answer = ((a / b) * c).frenchify();
84
- startStatement = statement.toTex();
85
101
  break;
86
102
  case 8: //a+-b+-c
103
+ default:
87
104
  a = randint(-15, 15);
88
105
  b = randint(-10, 10);
89
106
  c = b > 0 ? randint(-10, 0) : randint(-10, 10);
90
107
  statement = new AddNode(new AddNode(a.toTree(), b.toTree()), c.toTree());
91
- answer = (a + b + c).frenchify();
92
- startStatement = statement.toTex();
93
108
  break;
94
- default:
95
- throw Error("impossible");
96
109
  }
97
- const question = {
98
- instruction: `Calculer : $${startStatement}$`,
99
- startStatement,
100
- answer,
101
- keys: [],
102
- answerFormat: "tex",
103
- identifiers: { type, a, b, c, d },
110
+ const identifiers = {
111
+ type,
112
+ a,
113
+ b,
114
+ c,
115
+ d,
116
+ statementIds: statement.toIdentifiers(),
104
117
  };
105
- return question;
118
+ return getQuestionFromIdentifiers(identifiers);
106
119
  };
107
120
  const getPropositions = (n, { answer }) => {
108
121
  const propositions = [];
@@ -112,17 +125,13 @@ const getPropositions = (n, { answer }) => {
112
125
  }
113
126
  return shuffle(propositions);
114
127
  };
115
- const isAnswerValid = (studentAns, { answer }) => {
116
- const answerTree = new NumberNode(Number(answer));
117
- const texs = answerTree.toAllValidTexs();
118
- return texs.includes(studentAns);
128
+ const isAnswerValid = (ans, { answer }) => {
129
+ return numberVEA(ans, answer);
119
130
  };
120
131
  export const operationsPriorities = {
121
132
  id: "operationsPriorities",
122
133
  connector: "=",
123
134
  label: "Priorités opératoires",
124
- levels: ["5ème", "4ème"],
125
- sections: ["Calculs"],
126
135
  isSingleStep: true,
127
136
  generator: (nb) => getDistinctQuestions(getPriorityQuestions, nb),
128
137
  qcmTimer: 60,
@@ -130,4 +139,5 @@ export const operationsPriorities = {
130
139
  getPropositions,
131
140
  isAnswerValid,
132
141
  subject: "Mathématiques",
142
+ getQuestionFromIdentifiers,
133
143
  };
@@ -1 +1 @@
1
- {"version":3,"file":"choseOperationToSolveEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAuJF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAoB/D,CAAC"}
1
+ {"version":3,"file":"choseOperationToSolveEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA6MF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAoB/D,CAAC"}
@@ -77,17 +77,6 @@ $$
77
77
  il faut d'abord effectuer :
78
78
  `;
79
79
  };
80
- // const getHint: GetHint<Identifiers> = (identifiers) => {
81
- // };
82
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
83
- // return ``
84
- // };
85
- const getKeys = (identifiers) => {
86
- return [];
87
- };
88
- const isAnswerValid = (ans, { answer }) => {
89
- throw Error("VEA not implemented");
90
- };
91
80
  const getChoseOperationToSolveEquationQuestion = (opts) => {
92
81
  //ax=b avec a entier, ax+b = c tout entier, x/a = b tout entier, x+-a = b entiers ,
93
82
  let a;
@@ -132,13 +121,76 @@ const getChoseOperationToSolveEquationQuestion = (opts) => {
132
121
  const identifiers = { type, a, b, c };
133
122
  return getQuestionFromIdentifiers(identifiers);
134
123
  };
124
+ const getHint = (identifiers) => {
125
+ const { type } = identifiers;
126
+ switch (type) {
127
+ case 1:
128
+ //ax = b tous entiers
129
+ return `L'écriture $ax$ signifie $a$ multiplié par $x$.
130
+
131
+ Quelle opération permet d'annuler une multiplication ?`;
132
+ case 2:
133
+ // ax + b = c tous entiers
134
+ return `Quelle opération permet d'annuler une addition ?`;
135
+ case 3:
136
+ //ax-b = c tous entiers
137
+ return `Quelle opération permet d'annuler une soustraction ?`;
138
+ case 4:
139
+ //x/a = b tous entiers
140
+ return `Quelle opération permet d'annuler une division ?`;
141
+ case 5:
142
+ //x+a = b
143
+ return `Quelle opération permet d'annuler une addition ?`;
144
+ case 6:
145
+ default:
146
+ //x-a = b
147
+ return `Quelle opération permet d'annuler une soustraction ?`;
148
+ }
149
+ };
150
+ const getCorrection = (identifiers) => {
151
+ const { type, a, b, c } = identifiers;
152
+ switch (type) {
153
+ case 1:
154
+ //ax = b tous entiers
155
+ return `$${multiply(a, "x").toTex()}$ est une multiplication de $${a}$ par $x$.
156
+
157
+ Pour isoler $x$, il faut donc diviser par $${a}$.`;
158
+ case 2:
159
+ // ax + b = c tous entiers
160
+ return `Pour isoler $x$, on commence par passer $${b}$ à droite de l'équation.
161
+
162
+ Pour cela, il faut soustraire par $${b}$.`;
163
+ case 3:
164
+ //ax-b = c tous entiers
165
+ return `Pour isoler $x$, on commence par passer $${-b}$ à droite de l'équation.
166
+
167
+ Pour cela, il faut additionner par $${b}$.`;
168
+ case 4:
169
+ //x/a = b tous entiers
170
+ return `Pour isoler $x$, on doit "annuler" la division par $${a}$.
171
+
172
+ Pour cela, on multiplie par $${a}$.`;
173
+ case 5:
174
+ //x+a = b
175
+ return `Pour isoler $x$, il faut faire passer $${a}$ à droite de l'équation.
176
+
177
+ Pour cela, il faut soustraire par $${a}$.`;
178
+ case 6:
179
+ default:
180
+ //x-a = b
181
+ return `Pour isoler $x$, il faut faire passer $${-a}$ à droite de l'équation.
182
+
183
+ Pour cela, il faut additionner par $${a}$.`;
184
+ }
185
+ };
135
186
  const getQuestionFromIdentifiers = (identifiers) => {
136
187
  const question = {
137
188
  answer: getAnswer(identifiers),
138
189
  instruction: getInstruction(identifiers),
139
- keys: getKeys(identifiers),
140
190
  answerFormat: "tex",
141
191
  identifiers,
192
+ hint: getHint(identifiers),
193
+ correction: getCorrection(identifiers),
142
194
  };
143
195
  return question;
144
196
  };
@@ -151,10 +203,10 @@ export const choseOperationToSolveEquation = {
151
203
  qcmTimer: 60,
152
204
  freeTimer: 60,
153
205
  getPropositions,
154
- isAnswerValid,
155
206
  subject: "Mathématiques",
156
207
  getInstruction,
157
208
  getAnswer,
158
209
  answerType: "QCU",
159
210
  getQuestionFromIdentifiers,
211
+ hasHintAndCorrection: true,
160
212
  };
@@ -1 +1 @@
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"}
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,CAcxD,CAAC"}
@@ -123,8 +123,5 @@ export const multiplicationEquation = {
123
123
  isAnswerValid,
124
124
  subject: "Mathématiques",
125
125
  hasHintAndCorrection: true,
126
- getInstruction,
127
- getAnswer,
128
- getCorrection,
129
- getHint,
126
+ getQuestionFromIdentifiers,
130
127
  };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * type (ax+b)(cx+d) ± (ax+b)(ex+f)
3
+ */
4
+ import { Exercise } from "../../../../exercises/exercise.js";
5
+ /**
6
+ * facto du type (ax+b)(cx+d) ± (ax+b)(ex+f)
7
+ * b, d, f non nuls
8
+ */
9
+ type Identifiers = {
10
+ affinesCoeffs: number[][];
11
+ operation: string;
12
+ affinesOrder: number[];
13
+ };
14
+ export declare const factoType1Exercise: Exercise<Identifiers>;
15
+ export {};
16
+ //# sourceMappingURL=facto1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facto1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/facto1.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAwBrC;;;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;AA4NF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
@@ -0,0 +1,184 @@
1
+ /**
2
+ * type (ax+b)(cx+d) ± (ax+b)(ex+f)
3
+ */
4
+ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
5
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
6
+ import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
7
+ import { randint } from "../../../../math/utils/random/randint.js";
8
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
9
+ import { MultiplyNode, isMultiplyNode, multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
10
+ import { isPowerNode, isSquareNode, } from "../../../../tree/nodes/operators/powerNode.js";
11
+ import { substract, } from "../../../../tree/nodes/operators/substractNode.js";
12
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
13
+ import { random } from "../../../../utils/alea/random.js";
14
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
15
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
16
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
17
+ const getStatementNode = (identifiers) => {
18
+ const { affinesCoeffs, operation, affinesOrder } = identifiers;
19
+ const affines = affinesCoeffs.map((coeffs) => new Affine(coeffs[1], coeffs[0]));
20
+ const order = [[], []];
21
+ order[0][affinesOrder[0]] = affines[1];
22
+ order[1][affinesOrder[1]] = affines[2];
23
+ order[0][1 - affinesOrder[0]] = affines[0];
24
+ order[1][1 - affinesOrder[1]] = affines[0];
25
+ const statementTree = (operation === "add" ? add : substract)(new MultiplyNode(order[0][0].toTree(), order[0][1].toTree()), new MultiplyNode(order[1][0].toTree(), order[1][1].toTree()));
26
+ return statementTree;
27
+ };
28
+ const getInstruction = (identifiers) => {
29
+ const { affinesCoeffs, operation } = identifiers;
30
+ return `Factoriser et réduire :
31
+
32
+ $$
33
+ ${getStatementNode(identifiers).toTex()}
34
+ $$`;
35
+ };
36
+ const getAnswerNode = (identifiers) => {
37
+ const { affinesCoeffs, operation } = identifiers;
38
+ const factor = new Affine(affinesCoeffs[0][1], affinesCoeffs[0][0]);
39
+ const affine2 = new Affine(affinesCoeffs[2][1], affinesCoeffs[2][0]);
40
+ const affine1 = new Affine(affinesCoeffs[1][1], affinesCoeffs[1][0]);
41
+ const secondTerm = (operation === "add"
42
+ ? add(affine1.toTree(), affine2.toTree())
43
+ : substract(affine1.toTree(), affine2.toTree())).simplify({ forbidFactorize: true, towardsDistribute: true });
44
+ const sol = multiply(factor.toTree(), secondTerm).simplify({});
45
+ return sol;
46
+ };
47
+ const getAnswer = (identifiers) => {
48
+ return getAnswerNode(identifiers).toTex();
49
+ };
50
+ const getFactoType1Question = () => {
51
+ const a = randint(-9, 10, [0]);
52
+ const b = randint(-9, 10, [0]);
53
+ let operation = random(["add", "substract"]);
54
+ let c, d;
55
+ let e, f;
56
+ do {
57
+ c = randint(-9, 10, [0]);
58
+ d = randint(-9, 10, [0]);
59
+ e = randint(-9, 10, [0]);
60
+ f = randint(-9, 10, [0]);
61
+ } while (c / a === d / b ||
62
+ e / a === f / b ||
63
+ //éviter un multiple +-1
64
+ (operation === "add" && f === -d && Math.abs(e + c) === 1) ||
65
+ (operation === "substract" && f === d && Math.abs(e - c) === 1));
66
+ const identifiers = {
67
+ affinesCoeffs: [
68
+ [a, b],
69
+ [c, d],
70
+ [e, f],
71
+ ],
72
+ operation,
73
+ affinesOrder: [random([0, 1]), random([0, 1])],
74
+ };
75
+ return getQuestionFromIdentifiers(identifiers);
76
+ };
77
+ const getQuestionFromIdentifiers = (identifiers) => {
78
+ const question = {
79
+ instruction: getInstruction(identifiers),
80
+ startStatement: getStatementNode(identifiers).toTex(),
81
+ answer: getAnswer(identifiers),
82
+ keys: ["x"],
83
+ answerFormat: "tex",
84
+ identifiers,
85
+ hint: getHint(identifiers),
86
+ correction: getCorrection(identifiers),
87
+ };
88
+ return question;
89
+ };
90
+ const getHint = (identifiers) => {
91
+ return `On repère le facteur commun dans les deux termes de l'expression.
92
+
93
+ On utilise ensuite la propriété :
94
+
95
+ $$
96
+ k\\times a + k \\times b = k\\times (a+b)
97
+ $$`;
98
+ };
99
+ const getCorrection = (identifiers) => {
100
+ const { affinesCoeffs, operation, affinesOrder } = identifiers;
101
+ const affines = affinesCoeffs.map((coeffs) => new Affine(coeffs[1], coeffs[0]));
102
+ const order = [[], []];
103
+ order[0][affinesOrder[0]] = affines[1];
104
+ order[1][affinesOrder[1]] = affines[2];
105
+ order[0][1 - affinesOrder[0]] = affines[0];
106
+ order[1][1 - affinesOrder[1]] = affines[0];
107
+ const statementTree = (operation === "add" ? add : substract)(new MultiplyNode(order[0][0].toTree(), order[0][1].toTree()), new MultiplyNode(order[1][0].toTree(), order[1][1].toTree()));
108
+ return `On repère que le facteur commun dans les deux termes est :
109
+
110
+ $$
111
+ ${affines[0].toTree().toTex()}
112
+ $$
113
+
114
+ On a donc :
115
+
116
+ ${alignTex([
117
+ ["", statementTree.toTex()],
118
+ [
119
+ "=",
120
+ multiply(affines[0].toTree(), (operation === "add" ? add : substract)(affines[1].toTree(), affines[2].toTree())).toTex(),
121
+ ],
122
+ ["=", getAnswer(identifiers)],
123
+ ])}`;
124
+ };
125
+ const getPropositions = (n, { answer, affinesCoeffs, operation }) => {
126
+ const propositions = [];
127
+ addValidProp(propositions, answer);
128
+ const affines = affinesCoeffs.map((coeffs) => new Affine(coeffs[1], coeffs[0]));
129
+ tryToAddWrongProp(propositions, new MultiplyNode(affines[0].toTree(), affines[1]
130
+ .add(operation !== "add" ? affines[2] : affines[2].opposite())
131
+ .toTree()).toTex());
132
+ tryToAddWrongProp(propositions, new MultiplyNode(affines[1].toTree(), affines[0]
133
+ .add(operation === "add" ? affines[2] : affines[2].opposite())
134
+ .toTree()).toTex());
135
+ tryToAddWrongProp(propositions, new MultiplyNode(affines[2].toTree(), affines[0]
136
+ .add(operation === "add" ? affines[2] : affines[2].opposite())
137
+ .toTree()).toTex());
138
+ while (propositions.length < n) {
139
+ const wrongAnswer = new MultiplyNode(affines[0].toTree(), affines[1].add(AffineConstructor.differentRandoms(1)[0]).toTree());
140
+ tryToAddWrongProp(propositions, wrongAnswer.toTex());
141
+ }
142
+ return shuffle(propositions);
143
+ };
144
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
145
+ try {
146
+ const parsed = parseAlgebraic(ans);
147
+ if (!parsed)
148
+ return false;
149
+ if (answer !== "0" &&
150
+ !isMultiplyNode(parsed) &&
151
+ !isSquareNode(parsed) &&
152
+ !isPowerNode(parsed))
153
+ return false;
154
+ const simp = parsed.simplify({
155
+ forbidFactorize: true,
156
+ towardsDistribute: true,
157
+ });
158
+ const answerSimp = getAnswerNode(identifiers).simplify({
159
+ towardsDistribute: true,
160
+ forbidFactorize: true,
161
+ });
162
+ // const simp = parsed.simplify({});
163
+ return simp.toTex() === answerSimp.toTex();
164
+ }
165
+ catch (err) {
166
+ return handleVEAError(err);
167
+ }
168
+ };
169
+ export const factoType1Exercise = {
170
+ id: "facto1",
171
+ connector: "=",
172
+ isSingleStep: false,
173
+ label: "Factorisation du type $(ax+b)(cx+d) \\pm (ax+b)(ex+f)$",
174
+ generator: (nb) => getDistinctQuestions(getFactoType1Question, nb),
175
+ qcmTimer: 60,
176
+ freeTimer: 60,
177
+ getPropositions,
178
+ isAnswerValid,
179
+ subject: "Mathématiques",
180
+ getInstruction,
181
+ getAnswer,
182
+ getQuestionFromIdentifiers,
183
+ hasHintAndCorrection: true,
184
+ };
@@ -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,CAapD,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,EAaT,MAAM,6BAA6B,CAAC;AAwBrC;;;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;AA4NF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
@@ -13,6 +13,7 @@ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
13
13
  import { random } from "../../../../utils/alea/random.js";
14
14
  import { shuffle } from "../../../../utils/alea/shuffle.js";
15
15
  import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
16
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
16
17
  const getStatementNode = (identifiers) => {
17
18
  const { affinesCoeffs, operation, affinesOrder } = identifiers;
18
19
  const affines = affinesCoeffs.map((coeffs) => new Affine(coeffs[1], coeffs[0]));
@@ -71,6 +72,9 @@ const getFactoType1Question = () => {
71
72
  operation,
72
73
  affinesOrder: [random([0, 1]), random([0, 1])],
73
74
  };
75
+ return getQuestionFromIdentifiers(identifiers);
76
+ };
77
+ const getQuestionFromIdentifiers = (identifiers) => {
74
78
  const question = {
75
79
  instruction: getInstruction(identifiers),
76
80
  startStatement: getStatementNode(identifiers).toTex(),
@@ -78,9 +82,46 @@ const getFactoType1Question = () => {
78
82
  keys: ["x"],
79
83
  answerFormat: "tex",
80
84
  identifiers,
85
+ hint: getHint(identifiers),
86
+ correction: getCorrection(identifiers),
81
87
  };
82
88
  return question;
83
89
  };
90
+ const getHint = (identifiers) => {
91
+ return `On repère le facteur commun dans les deux termes de l'expression.
92
+
93
+ On utilise ensuite la propriété :
94
+
95
+ $$
96
+ k\\times a + k \\times b = k\\times (a+b)
97
+ $$`;
98
+ };
99
+ const getCorrection = (identifiers) => {
100
+ const { affinesCoeffs, operation, affinesOrder } = identifiers;
101
+ const affines = affinesCoeffs.map((coeffs) => new Affine(coeffs[1], coeffs[0]));
102
+ const order = [[], []];
103
+ order[0][affinesOrder[0]] = affines[1];
104
+ order[1][affinesOrder[1]] = affines[2];
105
+ order[0][1 - affinesOrder[0]] = affines[0];
106
+ order[1][1 - affinesOrder[1]] = affines[0];
107
+ const statementTree = (operation === "add" ? add : substract)(new MultiplyNode(order[0][0].toTree(), order[0][1].toTree()), new MultiplyNode(order[1][0].toTree(), order[1][1].toTree()));
108
+ return `On repère que le facteur commun dans les deux termes est :
109
+
110
+ $$
111
+ ${affines[0].toTree().toTex()}
112
+ $$
113
+
114
+ On a donc :
115
+
116
+ ${alignTex([
117
+ ["", statementTree.toTex()],
118
+ [
119
+ "=",
120
+ multiply(affines[0].toTree(), (operation === "add" ? add : substract)(affines[1].toTree(), affines[2].toTree())).toTex(),
121
+ ],
122
+ ["=", getAnswer(identifiers)],
123
+ ])}`;
124
+ };
84
125
  const getPropositions = (n, { answer, affinesCoeffs, operation }) => {
85
126
  const propositions = [];
86
127
  addValidProp(propositions, answer);
@@ -138,4 +179,6 @@ export const factoType1Exercise = {
138
179
  subject: "Mathématiques",
139
180
  getInstruction,
140
181
  getAnswer,
182
+ getQuestionFromIdentifiers,
183
+ hasHintAndCorrection: true,
141
184
  };
@@ -1,7 +1,7 @@
1
1
  export * from "./factoIdRmq1.js";
2
2
  export * from "./factoIdRmq2.js";
3
3
  export * from "./factoIdRmq3.js";
4
- export * from "./factoType1Exercise.js";
4
+ export * from "./facto1.js";
5
5
  export * from "./factorizeCanonicalForm.js";
6
6
  export * from "./factorizeCanonicalFormWithSqrt.js";
7
7
  export * from "./factoType2.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
@@ -1,7 +1,7 @@
1
1
  export * from "./factoIdRmq1.js";
2
2
  export * from "./factoIdRmq2.js";
3
3
  export * from "./factoIdRmq3.js";
4
- export * from "./factoType1Exercise.js";
4
+ export * from "./facto1.js";
5
5
  export * from "./factorizeCanonicalForm.js";
6
6
  export * from "./factorizeCanonicalFormWithSqrt.js";
7
7
  export * from "./factoType2.js";
@@ -1 +1 @@
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
+ {"version":3,"file":"basicNiceValuesSystemResolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAKtE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,EAAE,EAAE,CAAC;CAIhC,CAAC;AAkGF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAiBjE,CAAC"}
@@ -22,6 +22,26 @@ $$
22
22
 
23
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
24
  };
25
+ const getHint = (identifiers) => {
26
+ return `On peut utilise la méthode par substitution ou bien celle par combinaison :
27
+
28
+ - Si une des variables est facile à isoler dans une des équations, alors on utilise la méthode par substitution : on isole cette variable, puis on injecte le résultat obtenu dans l'autre équation.
29
+
30
+ - Sinon, on utilise la méthode par combinaison : on multiple une (ou les deux) équation(s) par un nombre, afin que lorsqu'on additionne les deux équations, une des variables disparaisse.`;
31
+ };
32
+ const getCorrection = (identifiers) => {
33
+ const sys = GeneralSystemConstructor.fromIdentifiers(identifiers);
34
+ let corr = "";
35
+ corr += sys.toCorrectionTex();
36
+ corr += `
37
+
38
+ La solution du système est donc le couple :
39
+
40
+ $$
41
+ ${getAnswer(identifiers)}
42
+ $$`;
43
+ return corr;
44
+ };
25
45
  const getAnswer = (identifiers) => {
26
46
  const sys = GeneralSystemConstructor.fromIdentifiers(identifiers);
27
47
  const { x, y } = sys.solve();
@@ -41,6 +61,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
41
61
  keys: [],
42
62
  answerFormat: "tex",
43
63
  identifiers,
64
+ hint: getHint(identifiers),
65
+ correction: getCorrection(identifiers),
44
66
  };
45
67
  return question;
46
68
  };
@@ -80,4 +102,5 @@ export const basicNiceValuesSystemResolution = {
80
102
  subject: "Mathématiques",
81
103
  getQuestionFromIdentifiers,
82
104
  rebuildIdentifiers,
105
+ hasHintAndCorrection: true,
83
106
  };