math-exercises 3.0.57 → 3.0.59

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 (256) hide show
  1. package/lib/exercises/exercise.d.ts +1 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +46 -17
  5. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +8 -2
  7. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +15 -11
  9. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +4 -5
  11. package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/fractions/fractionAndIntegerSum.js +4 -2
  13. package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/fractions/fractionSquare.js +0 -4
  15. package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts +6 -3
  16. package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
  17. package/lib/exercises/math/calcul/fractions/fractionsDivision.js +63 -28
  18. package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
  19. package/lib/exercises/math/calcul/fractions/fractionsOperations.js +0 -4
  20. package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
  21. package/lib/exercises/math/calcul/fractions/fractionsProduct.js +0 -4
  22. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts.map +1 -1
  23. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +0 -4
  24. package/lib/exercises/math/calcul/fractions/fractionsSum.d.ts.map +1 -1
  25. package/lib/exercises/math/calcul/fractions/fractionsSum.js +33 -12
  26. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +2 -0
  27. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
  28. package/lib/exercises/math/calcul/operations/operationsPriorities.js +46 -36
  29. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  30. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -4
  31. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts +16 -0
  32. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts.map +1 -0
  33. package/lib/exercises/math/calculLitteral/factorisation/facto1.js +184 -0
  34. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -1
  35. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  36. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -1
  37. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts +8 -0
  38. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -0
  39. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +102 -0
  40. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts +7 -0
  41. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts.map +1 -0
  42. package/lib/exercises/math/derivation/convexity/convexityTrinomials.js +52 -0
  43. package/lib/exercises/math/derivation/convexity/index.d.ts +4 -0
  44. package/lib/exercises/math/derivation/convexity/index.d.ts.map +1 -0
  45. package/lib/exercises/math/derivation/convexity/index.js +3 -0
  46. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts +7 -0
  47. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts.map +1 -0
  48. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +134 -0
  49. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts +8 -0
  50. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -0
  51. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +79 -0
  52. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts +8 -0
  53. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -0
  54. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +85 -0
  55. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts +8 -0
  56. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -0
  57. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +86 -0
  58. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts +8 -0
  59. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -0
  60. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +76 -0
  61. package/lib/exercises/math/derivation/derivative/exp/index.d.ts +6 -0
  62. package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -0
  63. package/lib/exercises/math/derivation/derivative/exp/index.js +5 -0
  64. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts +7 -0
  65. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts.map +1 -0
  66. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +84 -0
  67. package/lib/exercises/math/derivation/derivative/index.d.ts +6 -27
  68. package/lib/exercises/math/derivation/derivative/index.d.ts.map +1 -1
  69. package/lib/exercises/math/derivation/derivative/index.js +6 -27
  70. package/lib/exercises/math/derivation/derivative/ln/index.d.ts +4 -0
  71. package/lib/exercises/math/derivation/derivative/ln/index.d.ts.map +1 -0
  72. package/lib/exercises/math/derivation/derivative/ln/index.js +3 -0
  73. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts +8 -0
  74. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts.map +1 -0
  75. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.js +81 -0
  76. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts +8 -0
  77. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts.map +1 -0
  78. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.js +103 -0
  79. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts +8 -0
  80. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts.map +1 -0
  81. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.js +77 -0
  82. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts +10 -0
  83. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts.map +1 -0
  84. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.js +71 -0
  85. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts +11 -0
  86. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts.map +1 -0
  87. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +88 -0
  88. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts +8 -0
  89. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts.map +1 -0
  90. package/lib/exercises/math/derivation/derivative/polynomial/index.js +7 -0
  91. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts +10 -0
  92. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts.map +1 -0
  93. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +115 -0
  94. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts +10 -0
  95. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts.map +1 -0
  96. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.js +80 -0
  97. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts +9 -0
  98. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts.map +1 -0
  99. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.js +67 -0
  100. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts +10 -0
  101. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts.map +1 -0
  102. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +134 -0
  103. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts +11 -0
  104. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts.map +1 -0
  105. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.js +97 -0
  106. package/lib/exercises/math/derivation/derivative/power/index.d.ts +3 -0
  107. package/lib/exercises/math/derivation/derivative/power/index.d.ts.map +1 -0
  108. package/lib/exercises/math/derivation/derivative/power/index.js +2 -0
  109. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts +9 -0
  110. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts.map +1 -0
  111. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.js +122 -0
  112. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts +8 -0
  113. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts.map +1 -0
  114. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.js +118 -0
  115. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts +3 -0
  116. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts.map +1 -0
  117. package/lib/exercises/math/derivation/derivative/sqrt/index.js +3 -0
  118. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts +7 -0
  119. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts.map +1 -0
  120. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.js +115 -0
  121. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts +8 -0
  122. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -0
  123. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +77 -0
  124. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts +8 -0
  125. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts.map +1 -0
  126. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.js +85 -0
  127. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts +8 -0
  128. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts.map +1 -0
  129. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.js +81 -0
  130. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts +7 -0
  131. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts.map +1 -0
  132. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.js +103 -0
  133. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts +5 -0
  134. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts.map +1 -0
  135. package/lib/exercises/math/derivation/derivative/trigo/index.js +4 -0
  136. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts +8 -0
  137. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts.map +1 -0
  138. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.js +70 -0
  139. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts +7 -0
  140. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts.map +1 -0
  141. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.js +91 -0
  142. package/lib/exercises/math/derivation/derivativeNumberCalcul.d.ts.map +1 -1
  143. package/lib/exercises/math/derivation/derivativeNumberCalcul.js +4 -2
  144. package/lib/exercises/math/derivation/index.d.ts +2 -0
  145. package/lib/exercises/math/derivation/index.d.ts.map +1 -1
  146. package/lib/exercises/math/derivation/index.js +2 -0
  147. package/lib/exercises/math/derivation/variations/index.d.ts +2 -0
  148. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -0
  149. package/lib/exercises/math/derivation/variations/index.js +1 -0
  150. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts +11 -0
  151. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts.map +1 -0
  152. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.js +168 -0
  153. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
  154. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +39 -22
  155. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  156. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +7 -1
  157. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
  158. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +38 -15
  159. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -1
  160. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.js +29 -8
  161. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts +8 -0
  162. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -0
  163. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +86 -0
  164. package/lib/exercises/math/equaDiff/index.d.ts +1 -1
  165. package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
  166. package/lib/exercises/math/equaDiff/index.js +1 -1
  167. package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
  168. package/lib/exercises/math/functions/exponential/expEquation.js +3 -0
  169. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
  170. package/lib/exercises/math/functions/exponential/expFactorization.js +3 -0
  171. package/lib/exercises/math/functions/exponential/expSimplifiying.d.ts.map +1 -1
  172. package/lib/exercises/math/functions/exponential/expSimplifiying.js +83 -45
  173. package/lib/exercises/math/geometry/areas/circleArea.js +1 -1
  174. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts +2 -0
  175. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts.map +1 -0
  176. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.js +63 -0
  177. package/lib/exercises/math/percent/findProportion.js +1 -1
  178. package/lib/exercises/math/percent/findTVA.js +1 -1
  179. package/lib/exercises/math/percent/htToTTC.js +1 -1
  180. package/lib/exercises/math/percent/reciprocalPercentage.js +1 -1
  181. package/lib/exercises/math/percent/ttcToHT.js +1 -1
  182. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  183. package/lib/exercises/math/powers/powersOfTenToDecimal.js +1 -0
  184. package/lib/exercises/math/primitive/klogUPrimitive.js +1 -1
  185. package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
  186. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
  187. package/lib/exercises/math/probaStat/stats1var/averageList.js +4 -4
  188. package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
  189. package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +42 -11
  190. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
  191. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +8 -20
  192. package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
  193. package/lib/exercises/math/probaStat/stats1var/etendueList.js +4 -6
  194. package/lib/exercises/math/probaStat/stats1var/interquartilesList.d.ts.map +1 -1
  195. package/lib/exercises/math/probaStat/stats1var/interquartilesList.js +4 -4
  196. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
  197. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +4 -4
  198. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  199. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +13 -9
  200. package/lib/exercises/math/probaStat/stats1var/median.d.ts.map +1 -1
  201. package/lib/exercises/math/probaStat/stats1var/median.js +19 -14
  202. package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
  203. package/lib/exercises/math/probaStat/stats1var/medianList.js +3 -0
  204. package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
  205. package/lib/exercises/math/probaStat/stats1var/quartiles.js +16 -11
  206. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  207. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +18 -14
  208. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.d.ts.map +1 -1
  209. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.js +4 -4
  210. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
  211. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +4 -4
  212. package/lib/exercises/math/probaStat/stats1var/varianceList.d.ts.map +1 -1
  213. package/lib/exercises/math/probaStat/stats1var/varianceList.js +4 -4
  214. package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
  215. package/lib/exercises/math/probaStat/stats1var/varianceTable.js +4 -4
  216. package/lib/exercises/math/squareRoots/simpifySquareRoot.d.ts.map +1 -1
  217. package/lib/exercises/math/squareRoots/simpifySquareRoot.js +4 -4
  218. package/lib/exercises/math/squareRoots/squareRootEquation.d.ts.map +1 -1
  219. package/lib/exercises/math/squareRoots/squareRootEquation.js +4 -4
  220. package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts +1 -0
  221. package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts.map +1 -1
  222. package/lib/exercises/math/squareRoots/squareRootIdentities.js +64 -40
  223. package/lib/exercises/math/squareRoots/squareRootsDistributivity.d.ts.map +1 -1
  224. package/lib/exercises/math/squareRoots/squareRootsDistributivity.js +36 -23
  225. package/lib/exercises/math/squareRoots/squareRootsFractions.d.ts.map +1 -1
  226. package/lib/exercises/math/squareRoots/squareRootsFractions.js +4 -1
  227. package/lib/exercises/math/squareRoots/squareRootsProducts.d.ts.map +1 -1
  228. package/lib/exercises/math/squareRoots/squareRootsProducts.js +4 -1
  229. package/lib/exercises/math/squareRoots/squareRootsSum.d.ts.map +1 -1
  230. package/lib/exercises/math/squareRoots/squareRootsSum.js +4 -2
  231. package/lib/exercises/math/squareRoots/squareRootsToSquare.d.ts.map +1 -1
  232. package/lib/exercises/math/squareRoots/squareRootsToSquare.js +4 -2
  233. package/lib/exercises/math/trigonometry/arcValue.d.ts.map +1 -1
  234. package/lib/exercises/math/trigonometry/arcValue.js +67 -31
  235. package/lib/exercises/math/trigonometry/associatePoint.d.ts.map +1 -1
  236. package/lib/exercises/math/trigonometry/associatePoint.js +33 -16
  237. package/lib/exercises/math/trigonometry/basicEquationSin.js +6 -6
  238. package/lib/exercises/math/trigonometry/equationSinOnRandomInterval.js +3 -3
  239. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  240. package/lib/exercises/math/trigonometry/trigonometry.js +0 -5
  241. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  242. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +0 -5
  243. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  244. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +0 -5
  245. package/lib/exercises/pc/index.d.ts +5 -5
  246. package/lib/exercises/pc/index.d.ts.map +1 -1
  247. package/lib/exercises/pc/index.js +5 -5
  248. package/lib/index.d.ts +48 -44
  249. package/lib/index.d.ts.map +1 -1
  250. package/lib/tree/nodes/functions/logNode.js +2 -4
  251. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  252. package/lib/tree/nodes/operators/fractionNode.js +4 -0
  253. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  254. package/lib/tree/nodes/operators/multiplyNode.js +4 -3
  255. package/lib/tree/parsers/latexParser.js +6 -2
  256. package/package.json +1 -1
@@ -131,6 +131,7 @@ export interface Exercise<TIdentifiers = {}, TOptions = {}> {
131
131
  maxAllowedQuestions?: number;
132
132
  answerType?: "GGB" | "QCM" | "free" | "QCU";
133
133
  isQCM?: boolean;
134
+ shouldHaveCalculator?: boolean;
134
135
  qcmTimer?: number;
135
136
  freeTimer?: number;
136
137
  ggbTimer?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD,eAAO,MAAM,SAAS,iBACN,WAAW,EAAE,KACxB,MAAM,WACA,MAAM,IAAI,SAQpB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,iBAAiB,UACrB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAUtB,CAAC;AAEF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,KACjB,MAAM,sBACW,MAAM,kBAQ3B,CAAC;AAEF,oBAAY,qBAAqB;IAC/B,UAAU,eAAe;IACzB,GAAG,QA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S,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,8BAA8B,GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,oBAAoB,GACpB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"multiplyDecimalByNegativeTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AA6DF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAe/D,CAAC"}
1
+ {"version":3,"file":"multiplyDecimalByNegativeTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AA8FF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAe/D,CAAC"}
@@ -1,31 +1,60 @@
1
1
  import { addValidProp, shuffleProps, 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 { Decimal, DecimalConstructor, } from "../../../../math/numbers/decimals/decimal.js";
4
5
  import { randint } from "../../../../math/utils/random/randint.js";
5
6
  import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
6
7
  import { pluralize } from "../../../../utils/strings/pluralize.js";
7
- const getMultiplyDecimalByNegativeTensQuestion = () => {
8
- const dec = DecimalConstructor.random(1, 200, randint(1, 5));
9
- const pow = -randint(1, 4);
8
+ const getInstruction = (identifiers) => {
9
+ const { dec, pow } = identifiers;
10
+ const factor = Math.pow(10, pow);
11
+ const statement = new MultiplyNode(dec.toTree(), factor.toTree());
12
+ return `Calculer :
13
+
14
+ $$
15
+ ${statement.toTex()}
16
+ $$`;
17
+ };
18
+ const getAnswer = (identifiers) => {
19
+ const { dec, pow } = identifiers;
20
+ const decimal = new Decimal(dec);
21
+ const answer = decimal.multiplyByPowerOfTen(pow).toTree().toTex();
22
+ return answer;
23
+ };
24
+ const getHint = (identifiers) => {
25
+ const { dec, pow } = identifiers;
26
+ const factor = Math.pow(10, pow);
27
+ return `Multiplier par $${factor.frenchify()}$ revient à déplacer la virgule de $${-pow}$ ${pluralize("position", -pow)} vers la gauche.`;
28
+ };
29
+ const getCorrection = (identifiers) => {
30
+ const { dec, pow } = identifiers;
10
31
  const factor = Math.pow(10, pow);
11
- const answer = dec.multiplyByPowerOfTen(pow).toTree().toTex();
12
32
  const statement = new MultiplyNode(dec.toTree(), factor.toTree());
33
+ return `On déplace la virgule de $${-pow}$ ${pluralize("position", -pow)} vers la gauche :
34
+
35
+ $$
36
+ ${statement.toTex()} = ${getAnswer(identifiers)}
37
+ $$
38
+ `;
39
+ };
40
+ const getQuestionFromIdentifiers = (identifiers) => {
13
41
  const question = {
14
- answer,
15
- instruction: `Calculer : $${statement.toTex()}$`,
42
+ answer: getAnswer(identifiers),
43
+ instruction: getInstruction(identifiers),
16
44
  keys: [],
17
45
  answerFormat: "tex",
18
- identifiers: { dec: dec.value, pow },
19
- hint: `Multiplier par $${factor.frenchify()}$ revient à déplacer la virgule de $${-pow}$ ${pluralize("position", -pow)} vers la gauche.`,
20
- correction: `On déplace la virgule de $${-pow}$ ${pluralize("position", -pow)} vers la gauche :
21
-
22
- $$
23
- ${statement.toTex()} = ${answer}
24
- $$
25
- `,
46
+ identifiers,
47
+ hint: getHint(identifiers),
48
+ correction: getCorrection(identifiers),
26
49
  };
27
50
  return question;
28
51
  };
52
+ const getMultiplyDecimalByNegativeTensQuestion = () => {
53
+ const dec = DecimalConstructor.random(1, 200, randint(1, 5));
54
+ const pow = -randint(1, 4);
55
+ const identifiers = { dec: dec.value, pow };
56
+ return getQuestionFromIdentifiers(identifiers);
57
+ };
29
58
  const getPropositions = (n, { answer, dec, pow }) => {
30
59
  const propositions = [];
31
60
  addValidProp(propositions, answer);
@@ -40,15 +69,13 @@ const getPropositions = (n, { answer, dec, pow }) => {
40
69
  return shuffleProps(propositions, n);
41
70
  };
42
71
  const isAnswerValid = (ans, { answer }) => {
43
- return ans === answer;
72
+ return numberVEA(ans, answer);
44
73
  };
45
74
  export const multiplyDecimalByNegativeTens = {
46
75
  id: "multiplyDecimalByNegativeTens",
47
76
  connector: "=",
48
77
  label: "Multiplier un décimal par $0,1$, par $0,01$ ou par $0,001$",
49
- levels: [],
50
78
  isSingleStep: true,
51
- sections: [],
52
79
  generator: (nb) => getDistinctQuestions(getMultiplyDecimalByNegativeTensQuestion, nb),
53
80
  qcmTimer: 60,
54
81
  freeTimer: 60,
@@ -56,4 +83,6 @@ export const multiplyDecimalByNegativeTens = {
56
83
  isAnswerValid,
57
84
  subject: "Mathématiques",
58
85
  hasHintAndCorrection: true,
86
+ getQuestionFromIdentifiers,
87
+ shouldHaveCalculator: false,
59
88
  };
@@ -1 +1 @@
1
- {"version":3,"file":"multiplyDecimalByTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAmGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAmBvD,CAAC"}
1
+ {"version":3,"file":"multiplyDecimalByTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAuGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAoBvD,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, shuffleProps, 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 { Decimal, DecimalConstructor, } from "../../../../math/numbers/decimals/decimal.js";
4
5
  import { randint } from "../../../../math/utils/random/randint.js";
5
6
  import { DivideNode } from "../../../../tree/nodes/operators/divideNode.js";
@@ -10,7 +11,11 @@ const getInstruction = (identifiers) => {
10
11
  const { dec, pow, isDivide } = identifiers;
11
12
  const factor = Math.pow(10, pow);
12
13
  const statement = new (isDivide ? DivideNode : MultiplyNode)(dec.toTree(), factor.toTree());
13
- return `Calculer : $${statement.toTex()}$`;
14
+ return `Calculer :
15
+
16
+ $$
17
+ ${statement.toTex()}
18
+ $$`;
14
19
  };
15
20
  const getHint = (identifiers) => {
16
21
  const { dec, pow, isDivide } = identifiers;
@@ -71,7 +76,7 @@ const getPropositions = (n, { answer, dec, isDivide, pow }) => {
71
76
  return shuffleProps(propositions, n);
72
77
  };
73
78
  const isAnswerValid = (ans, { answer }) => {
74
- return ans === answer;
79
+ return numberVEA(ans, answer);
75
80
  };
76
81
  export const multiplyDecimalByTens = {
77
82
  id: "multiplyDecimalByTens",
@@ -91,4 +96,5 @@ export const multiplyDecimalByTens = {
91
96
  getCorrection,
92
97
  getHint,
93
98
  getAnswer,
99
+ shouldHaveCalculator: false,
94
100
  };
@@ -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,CAiB5D,CAAC"}
1
+ {"version":3,"file":"fractionAndIntegerDivision.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionAndIntegerDivision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAyKF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAc5D,CAAC"}
@@ -3,7 +3,8 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { Integer } from "../../../../math/numbers/integer/integer.js";
4
4
  import { Rational, RationalConstructor, } from "../../../../math/numbers/rationals/rational.js";
5
5
  import { randint } from "../../../../math/utils/random/randint.js";
6
- import { DivideNode } from "../../../../tree/nodes/operators/divideNode.js";
6
+ import { divide, DivideNode } from "../../../../tree/nodes/operators/divideNode.js";
7
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
7
8
  import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
8
9
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
9
10
  const getAnswer = (identifiers) => {
@@ -38,8 +39,7 @@ const getCorrection = (identifiers) => {
38
39
  ? new Rational(integer * rationalObj.denum, rationalObj.num)
39
40
  : new Rational(rationalObj.num, rationalObj.denum * integer);
40
41
  const answerTex = getAnswer(identifiers);
41
- return `
42
- On écrit $${integer}$ sous forme de fraction :
42
+ return `On écrit $${integer}$ sous forme de fraction :
43
43
 
44
44
  $$
45
45
  ${integer} = \\frac{${integer}}{1}
@@ -77,23 +77,30 @@ $$
77
77
  Ainsi, le résultat attendu est $${answerTex}$.
78
78
  `;
79
79
  };
80
+ const getStartStatement = (identifiers) => {
81
+ const { integerFirst, integer, rational } = identifiers;
82
+ const statementTree = integerFirst
83
+ ? divide(integer, frac(rational[0], rational[1]))
84
+ : divide(frac(rational[0], rational[1]), integer);
85
+ return statementTree.toTex();
86
+ };
80
87
  const getFractionAndIntegerDivision = () => {
81
88
  const rational = RationalConstructor.randomIrreductible();
82
89
  const integerFirst = coinFlip();
83
90
  const integer = integerFirst
84
91
  ? new Integer(randint(-10, 11, [0]))
85
92
  : new Integer(randint(-10, 11, [0, 1]));
86
- const statementTree = integerFirst
87
- ? new DivideNode(integer.toTree(), rational.toTree())
88
- : new DivideNode(rational.toTree(), integer.toTree());
89
93
  const identifiers = {
90
94
  integerFirst,
91
95
  integer: integer.value,
92
96
  rational: [rational.num, rational.denum],
93
97
  };
98
+ return getQuestionFromIdentifiers(identifiers);
99
+ };
100
+ const getQuestionFromIdentifiers = (identifiers) => {
94
101
  const question = {
95
102
  instruction: getInstruction(identifiers),
96
- startStatement: statementTree.toTex(),
103
+ startStatement: getStartStatement(identifiers),
97
104
  answer: getAnswer(identifiers),
98
105
  keys: [],
99
106
  hint: getHint(identifiers),
@@ -141,8 +148,5 @@ export const fractionAndIntegerDivision = {
141
148
  isAnswerValid,
142
149
  subject: "Mathématiques",
143
150
  hasHintAndCorrection: true,
144
- getAnswer,
145
- getInstruction,
146
- getHint,
147
- getCorrection,
151
+ getQuestionFromIdentifiers,
148
152
  };
@@ -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,CAmBpE,CAAC"}
1
+ {"version":3,"file":"fractionAndIntegerProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionAndIntegerProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,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;AAiJF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAepE,CAAC"}
@@ -71,6 +71,9 @@ const getFractionAndIntegerProduct = (opts) => {
71
71
  rational: [rational.num, rational.denum],
72
72
  integerFirst,
73
73
  };
74
+ return getQuestionFromIdentifiers(identifiers, opts);
75
+ };
76
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
74
77
  const question = {
75
78
  instruction: getInstruction(identifiers, opts),
76
79
  startStatement: getStartStatement(identifiers),
@@ -123,10 +126,6 @@ export const fractionAndIntegerProduct = {
123
126
  isAnswerValid,
124
127
  hasHintAndCorrection: true,
125
128
  subject: "Mathématiques",
126
- getHint,
127
- getCorrection,
128
- getInstruction,
129
- getAnswer,
130
- getStartStatement,
129
+ getQuestionFromIdentifiers,
131
130
  options,
132
131
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fractionAndIntegerSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionAndIntegerSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B,CAAC;AA+FF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAcF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBhE,CAAC"}
1
+ {"version":3,"file":"fractionAndIntegerSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionAndIntegerSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B,CAAC;AAqGF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAcF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAehE,CAAC"}
@@ -48,6 +48,9 @@ const getFractionAndIntegerSum = (opts) => {
48
48
  rational: [rational.num, rational.denum],
49
49
  isIntegerFirst,
50
50
  };
51
+ return getQuestionFromIdentifiers(identifiers, opts);
52
+ };
53
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
51
54
  const question = {
52
55
  instruction: getInstruction(identifiers, opts),
53
56
  startStatement: getStatementNode(identifiers).toTex(),
@@ -91,7 +94,6 @@ export const fractionAndIntegerSum = {
91
94
  isAnswerValid,
92
95
  subject: "Mathématiques",
93
96
  options,
94
- getAnswer,
95
- getInstruction,
96
97
  rebuildIdentifiers,
98
+ getQuestionFromIdentifiers,
97
99
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fractionSquare.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiGF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
1
+ {"version":3,"file":"fractionSquare.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiGF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
@@ -99,10 +99,6 @@ export const fractionSquare = {
99
99
  getPropositions,
100
100
  isAnswerValid,
101
101
  subject: "Mathématiques",
102
- getInstruction,
103
- getHint,
104
- getCorrection,
105
- getAnswer,
106
102
  hasHintAndCorrection: true,
107
103
  getQuestionFromIdentifiers,
108
104
  };
@@ -1,8 +1,11 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
2
  type Identifiers = {
3
- rationalNum: [number, number];
4
- rationalDenum: [number, number];
3
+ rationalNum: number[];
4
+ rationalDenum: number[];
5
5
  };
6
- export declare const fractionsDivision: Exercise<Identifiers>;
6
+ type Options = {
7
+ allowNonIrreductible?: boolean;
8
+ };
9
+ export declare const fractionsDivision: Exercise<Identifiers, Options>;
7
10
  export {};
8
11
  //# sourceMappingURL=fractionsDivision.d.ts.map
@@ -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,CAcnD,CAAC"}
1
+ {"version":3,"file":"fractionsDivision.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsDivision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAsKF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe5D,CAAC"}
@@ -6,34 +6,45 @@ import { DivideNode } from "../../../../tree/nodes/operators/divideNode.js";
6
6
  import { rationalParser } from "../../../../tree/parsers/rationalParser.js";
7
7
  import { shuffle } from "../../../../utils/alea/shuffle.js";
8
8
  const options = [allowNonIrreductibleOption];
9
- const getFractionsDivision = (opts) => {
10
- const rational = RationalConstructor.randomIrreductible();
11
- const rational2 = RationalConstructor.randomIrreductible();
9
+ const getInstruction = (identifiers, opts) => {
10
+ const { rationalNum, rationalDenum } = identifiers;
11
+ const rational = new Rational(rationalNum[0], rationalNum[1]);
12
+ const rational2 = new Rational(rationalDenum[0], rationalDenum[1]);
12
13
  const statementTree = new DivideNode(rational.toTree(), rational2.toTree());
14
+ return `Calculer ${opts?.allowNonIrreductible
15
+ ? ""
16
+ : "et donner le résultat sous la forme la plus simplifiée possible"} :
17
+
18
+ $$
19
+ ${statementTree.toTex()}
20
+ $$`;
21
+ };
22
+ const getAnswer = (identifiers, opts) => {
23
+ const { rationalNum, rationalDenum } = identifiers;
24
+ const rational = new Rational(rationalNum[0], rationalNum[1]);
25
+ const rational2 = new Rational(rationalDenum[0], rationalDenum[1]);
13
26
  const answerTree = rational.divide(rational2).toTree();
14
27
  const answer = answerTree.toTex();
28
+ return answer;
29
+ };
30
+ const getHint = (identifiers, opts) => {
31
+ return "Pour diviser par une fraction, il faut multiplier la première fraction par l'inverse de la deuxième. Simplifie ensuite la fraction obtenue si nécessaire.";
32
+ };
33
+ const getCorrection = (identifiers, opts) => {
34
+ const { rationalNum, rationalDenum } = identifiers;
35
+ const rational = new Rational(rationalNum[0], rationalNum[1]);
36
+ const rational2 = new Rational(rationalDenum[0], rationalDenum[1]);
37
+ const statementTree = new DivideNode(rational.toTree(), rational2.toTree());
15
38
  const beforeSimplification = new Rational(rational.num * rational2.denum, rational.denum * rational2.num);
16
39
  const isSimplifiable = !beforeSimplification.isIrreductible();
17
- const question = {
18
- instruction: `Calculer ${opts?.allowNonIrreductible
19
- ? ""
20
- : "et donner le résultat sous la forme la plus simplifiée possible"} :
21
-
22
- $$
23
- ${statementTree.toTex()}
24
- $$`,
25
- startStatement: statementTree.toTex(),
26
- answer,
27
- keys: [],
28
- answerFormat: "tex",
29
- hint: "Pour diviser par une fraction, il faut multiplier la première fraction par l'inverse de la deuxième. Simplifie ensuite la fraction obtenue si nécessaire.",
30
- correction: `On multiplie la première fraction par l'inverse de la deuxième :
40
+ const answer = getAnswer(identifiers);
41
+ return `On multiplie la première fraction par l'inverse de la deuxième :
31
42
 
32
43
  $$
33
44
  ${statementTree.toTex()} = ${rational.toTree().toTex()}\\times ${rational2
34
- .reverse(false)
35
- .toTree()
36
- .toTex()}
45
+ .reverse(false)
46
+ .toTree()
47
+ .toTex()}
37
48
  $$
38
49
 
39
50
  Multiplions les fractions :
@@ -43,23 +54,46 @@ $$
43
54
  $$
44
55
 
45
56
  ${isSimplifiable
46
- ? `On peut alors simplifier cette fraction :
57
+ ? `On peut alors simplifier cette fraction :
47
58
 
48
59
  $$
49
60
  ${beforeSimplification.toTree().toTex()} = ${answer}
50
61
  $$`
51
- : "Cette fraction est déjà simplifiée."}
62
+ : "Cette fraction est déjà simplifiée."}
52
63
 
53
64
  Ainsi, le résultat attendu est $${answer}$.
54
- `,
55
- identifiers: {
56
- rationalNum: [rational.num, rational.denum],
57
- rationalDenum: [rational2.num, rational2.denum],
58
- },
65
+ `;
66
+ };
67
+ const getStartStatement = (identifiers, opts) => {
68
+ const { rationalDenum, rationalNum } = identifiers;
69
+ const rational = new Rational(rationalNum[0], rationalNum[1]);
70
+ const rational2 = new Rational(rationalDenum[0], rationalDenum[1]);
71
+ const statementTree = new DivideNode(rational.toTree(), rational2.toTree());
72
+ return statementTree.toTex();
73
+ };
74
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
75
+ const question = {
76
+ instruction: getInstruction(identifiers, opts),
77
+ startStatement: getStartStatement(identifiers, opts),
78
+ answer: getAnswer(identifiers, opts),
79
+ keys: [],
80
+ answerFormat: "tex",
81
+ hint: getHint(identifiers, opts),
82
+ correction: getCorrection(identifiers, opts),
83
+ identifiers,
59
84
  };
60
85
  return question;
61
86
  };
62
- const getPropositions = (n, { answer, rationalNum, rationalDenum }) => {
87
+ const getFractionsDivision = (opts) => {
88
+ const rational = RationalConstructor.randomIrreductible();
89
+ const rational2 = RationalConstructor.randomIrreductible();
90
+ const identifiers = {
91
+ rationalNum: [rational.num, rational.denum],
92
+ rationalDenum: [rational2.num, rational2.denum],
93
+ };
94
+ return getQuestionFromIdentifiers(identifiers, opts);
95
+ };
96
+ const getPropositions = (n, { answer, rationalNum, rationalDenum }, opts) => {
63
97
  const propositions = [];
64
98
  addValidProp(propositions, answer);
65
99
  const rational = new Rational(rationalNum[0], rationalNum[1]);
@@ -102,4 +136,5 @@ export const fractionsDivision = {
102
136
  subject: "Mathématiques",
103
137
  hasHintAndCorrection: true,
104
138
  options,
139
+ getQuestionFromIdentifiers,
105
140
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsOperations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AA2FF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
1
+ {"version":3,"file":"fractionsOperations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AA2FF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAarD,CAAC"}
@@ -83,9 +83,5 @@ export const fractionsOperations = {
83
83
  getPropositions,
84
84
  isAnswerValid,
85
85
  subject: "Mathématiques",
86
- getInstruction,
87
- // getHint,
88
- // getCorrection,
89
- getAnswer,
90
86
  getQuestionFromIdentifiers,
91
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAiIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmB3D,CAAC"}
1
+ {"version":3,"file":"fractionsProduct.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAiIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe3D,CAAC"}
@@ -117,9 +117,5 @@ export const fractionsProduct = {
117
117
  subject: "Mathématiques",
118
118
  hasHintAndCorrection: true,
119
119
  options,
120
- getInstruction,
121
- getAnswer,
122
- getHint,
123
- getCorrection,
124
120
  getQuestionFromIdentifiers,
125
121
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsSubstraction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSubstraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AA8GF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBhE,CAAC"}
1
+ {"version":3,"file":"fractionsSubstraction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSubstraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AA8GF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAchE,CAAC"}
@@ -97,10 +97,6 @@ export const fractionsSubstraction = {
97
97
  getPropositions,
98
98
  isAnswerValid,
99
99
  subject: "Mathématiques",
100
- getInstruction,
101
- // getHint,
102
- // getCorrection,
103
- getAnswer,
104
100
  options,
105
101
  getQuestionFromIdentifiers,
106
102
  };
@@ -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,CAcvD,CAAC"}
1
+ {"version":3,"file":"fractionsSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,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;AA0IF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAcvD,CAAC"}
@@ -18,26 +18,47 @@ $$
18
18
  ${statementTree.toTex()}
19
19
  $$`;
20
20
  };
21
- const getFractionsSum = (opts) => {
22
- const rational = RationalConstructor.randomIrreductible();
23
- const rational2 = RationalConstructor.randomIrreductible();
24
- const statementTree = new AddNode(rational.toTree(), rational2.toTree());
25
- const answerTree = rational.add(rational2).toTree();
21
+ const getAnswer = (identifiers, opts) => {
22
+ const { rational, rational2 } = identifiers;
23
+ const rationalObj = new Rational(rational[0], rational[1]);
24
+ const rationalObj2 = new Rational(rational2[0], rational2[1]);
25
+ const answerTree = rationalObj.add(rationalObj2).toTree();
26
26
  const answer = answerTree.toTex();
27
- const identifiers = {
28
- rational: [rational.num, rational.denum],
29
- rational2: [rational2.num, rational2.denum],
30
- };
27
+ return answer;
28
+ };
29
+ const getHint = (identifiers, opts) => {
30
+ return ``;
31
+ };
32
+ const getCorrection = (identifiers, opts) => {
33
+ return ``;
34
+ };
35
+ const getStartStatement = (identifiers) => {
36
+ const { rational, rational2 } = identifiers;
37
+ const rationalObj = new Rational(rational[0], rational[1]);
38
+ const rationalObj2 = new Rational(rational2[0], rational2[1]);
39
+ const statementTree = new AddNode(rationalObj.toTree(), rationalObj2.toTree());
40
+ return statementTree.toTex();
41
+ };
42
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
31
43
  const question = {
32
44
  instruction: getInstruction(identifiers, opts),
33
- startStatement: statementTree.toTex(),
34
- answer,
45
+ startStatement: getStartStatement(identifiers, opts),
46
+ answer: getAnswer(identifiers),
35
47
  keys: [],
36
48
  answerFormat: "tex",
37
49
  identifiers,
38
50
  };
39
51
  return question;
40
52
  };
53
+ const getFractionsSum = (opts) => {
54
+ const rational = RationalConstructor.randomIrreductible();
55
+ const rational2 = RationalConstructor.randomIrreductible();
56
+ const identifiers = {
57
+ rational: [rational.num, rational.denum],
58
+ rational2: [rational2.num, rational2.denum],
59
+ };
60
+ return getQuestionFromIdentifiers(identifiers, opts);
61
+ };
41
62
  const getPropositions = (n, { answer, rational, rational2 }) => {
42
63
  const propositions = [];
43
64
  addValidProp(propositions, answer);
@@ -90,5 +111,5 @@ export const fractionsSum = {
90
111
  isAnswerValid,
91
112
  subject: "Mathématiques",
92
113
  options,
93
- getInstruction,
114
+ getQuestionFromIdentifiers,
94
115
  };
@@ -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"}