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
@@ -1 +1 @@
1
- {"version":3,"file":"basicSystemResolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/basicSystemResolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAKtE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,EAAE,EAAE,CAAC;CAIhC,CAAC;AA6EF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
1
+ {"version":3,"file":"basicSystemResolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/basicSystemResolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAMtE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,eAAe,EAAE,EAAE,CAAC;CAIhC,CAAC;AAoGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAiBvD,CAAC"}
@@ -34,6 +34,26 @@ const getBasicSystemResolutionQuestion = () => {
34
34
  };
35
35
  return getQuestionFromIdentifiers(identifiers);
36
36
  };
37
+ const getHint = (identifiers) => {
38
+ return `On peut utilise la méthode par substitution ou bien celle par combinaison :
39
+
40
+ - 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.
41
+
42
+ - 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.`;
43
+ };
44
+ const getCorrection = (identifiers) => {
45
+ const sys = GeneralSystemConstructor.fromIdentifiers(identifiers);
46
+ let corr = "";
47
+ corr += sys.toCorrectionTex();
48
+ corr += `
49
+
50
+ La solution du système est donc le couple :
51
+
52
+ $$
53
+ ${getAnswer(identifiers)}
54
+ $$`;
55
+ return corr;
56
+ };
37
57
  const getQuestionFromIdentifiers = (identifiers) => {
38
58
  const question = {
39
59
  answer: getAnswer(identifiers),
@@ -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
  };
@@ -82,4 +104,5 @@ export const basicSystemResolution = {
82
104
  subject: "Mathématiques",
83
105
  getQuestionFromIdentifiers,
84
106
  rebuildIdentifiers,
107
+ hasHintAndCorrection: true,
85
108
  };
@@ -1 +1 @@
1
- {"version":3,"file":"verifySystemSolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/verifySystemSolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IAGjB,MAAM,EAAE,wBAAwB,CAAC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
1
+ {"version":3,"file":"verifySystemSolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/systems/verifySystemSolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IAGjB,MAAM,EAAE,wBAAwB,CAAC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkIF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAgBtD,CAAC"}
@@ -44,11 +44,59 @@ const getVerifySystemSolutionQuestion = () => {
44
44
  const identifiers = { sysIds: sys.toIdentifiers(), x, y };
45
45
  return getQuestionFromIdentifiers(identifiers);
46
46
  };
47
+ const getHint = (identifiers) => {
48
+ return `On remplace $x$ par $${identifiers.x}$ et $y$ par $${identifiers.y}$ dans les deux équations.
49
+
50
+ Si les deux égalités sont vraies, alors le couple est bien une solution du système. Sinon, ce n'en est pas une.`;
51
+ };
52
+ const getCorrection = (identifiers) => {
53
+ const { sysIds, x, y } = identifiers;
54
+ const sys = GeneralSystemConstructor.fromIdentifiers(sysIds);
55
+ const equas = sys.getEqualNodes();
56
+ const equasDetailed = equas.map((e) => e.toDetailedEvaluation({
57
+ x: x.toTree(),
58
+ y: y.toTree(),
59
+ }));
60
+ const equasDetailedSimp = equasDetailed.map((e) => e.simplify());
61
+ const firstIsTrue = equasDetailedSimp[0].isVerified();
62
+ const secondIsTrue = equasDetailedSimp[1].isVerified();
63
+ return `On remplace $x$ par $${x}$ et $y$ par $${y}$ dans les deux équations :
64
+
65
+ $$
66
+ ${equasDetailed[0].leftChild.toTex()} = ${equasDetailedSimp[0].leftChild.toTex()}
67
+ $$
68
+
69
+ ${firstIsTrue
70
+ ? "La première équation est donc bien vérifiée."
71
+ : "La première équation n'est donc pas vérifiée : le couple n'est donc pas une solution du système."}
72
+
73
+ ${firstIsTrue
74
+ ? `
75
+
76
+ On vérifie maintenant la deuxième équation :
77
+
78
+ $$
79
+ ${equasDetailed[1].leftChild.toTex()} = ${equasDetailedSimp[1].leftChild.toTex()}
80
+ $$
81
+
82
+ ${secondIsTrue
83
+ ? "La deuxième équation est donc bien vérifiée."
84
+ : "La deuxième équation n'est donc pas vérifiée : le couple n'est donc pas une solution du système."}
85
+ `
86
+ : ""}
87
+
88
+ ${firstIsTrue && secondIsTrue
89
+ ? "Les deux équations sont donc bien vérifiées : le couple est bien une solution du système."
90
+ : ""}
91
+ `;
92
+ };
47
93
  const getQuestionFromIdentifiers = (identifiers) => {
48
94
  const question = {
49
95
  instruction: getInstruction(identifiers),
50
96
  answerFormat: "raw",
51
97
  identifiers,
98
+ hint: getHint(identifiers),
99
+ correction: getCorrection(identifiers),
52
100
  };
53
101
  return question;
54
102
  };
@@ -77,4 +125,5 @@ export const verifySystemSolution = {
77
125
  answerType: "QCU",
78
126
  getQuestionFromIdentifiers,
79
127
  rebuildIdentifiers,
128
+ hasHintAndCorrection: true,
80
129
  };
@@ -1 +1 @@
1
- {"version":3,"file":"capacityConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/capacityConversion.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,QAAQ,EAQT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA0DF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
1
+ {"version":3,"file":"capacityConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/capacityConversion.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,QAAQ,EAaT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA0HF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
@@ -1,7 +1,10 @@
1
1
  import { Decimal, DecimalConstructor, } from "../../../math/numbers/decimals/decimal.js";
2
2
  import { randint } from "../../../math/utils/random/randint.js";
3
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
4
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
3
5
  import { shuffle } from "../../../utils/alea/shuffle.js";
4
6
  import { doWhile } from "../../../utils/doWhile.js";
7
+ import { alignTex } from "../../../utils/latex/alignTex.js";
5
8
  import { addValidProp, tryToAddWrongProp, } from "../../exercise.js";
6
9
  import { getDistinctQuestions } from "../../utils/getDistinctQuestions.js";
7
10
  const units = ["mL", "cL", "dL", "L", "daL", "hL", "kL"];
@@ -9,19 +12,72 @@ const getCapacityConversion = () => {
9
12
  const randomUnitIndex = randint(0, 7);
10
13
  const randomUnitInstructionIndex = randint(0, 7, [randomUnitIndex]);
11
14
  const randomCapacity = doWhile(() => DecimalConstructor.random(0, 1000, randint(0, 4)), (x) => x.value === 0);
12
- const answer = (randomCapacity.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + "").replace(".", ",");
15
+ const identifiers = {
16
+ randomCapacity: randomCapacity.value,
17
+ randomUnitIndex,
18
+ randomUnitInstructionIndex,
19
+ };
20
+ return getQuestionFromIdentifiers(identifiers);
21
+ };
22
+ const getInstruction = (identifiers) => {
23
+ const { randomCapacity, randomUnitIndex, randomUnitInstructionIndex } = identifiers;
24
+ return `Compléter :
25
+
26
+ $$
27
+ ${randomCapacity.frenchify()} \\textrm{${units[randomUnitIndex]}} = \\ldots \\textrm{${units[randomUnitInstructionIndex]}}
28
+ $$`;
29
+ };
30
+ const getAnswer = (identifiers) => {
31
+ const { randomCapacity, randomUnitIndex, randomUnitInstructionIndex } = identifiers;
32
+ const answer = new Decimal(randomCapacity)
33
+ .multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex)
34
+ .value.frenchify();
35
+ return answer;
36
+ };
37
+ const getHint = (identifiers) => {
38
+ const { randomUnitIndex, randomUnitInstructionIndex } = identifiers;
39
+ const unit = units[randomUnitIndex];
40
+ const target = units[randomUnitInstructionIndex];
41
+ const space = randomUnitIndex - randomUnitInstructionIndex;
42
+ return `On rappelle que :
43
+
44
+ $$
45
+ 1 \\ \\textrm{${unit}} = ${space > 0 ? Math.pow(10, space) : frac(1, Math.pow(10, -space)).toTex()} \\ \\textrm{${target}}
46
+ $$`;
47
+ };
48
+ const getCorrection = (identifiers) => {
49
+ const { randomCapacity, randomUnitIndex, randomUnitInstructionIndex } = identifiers;
50
+ const unit = units[randomUnitIndex];
51
+ const target = units[randomUnitInstructionIndex];
52
+ const space = randomUnitIndex - randomUnitInstructionIndex;
53
+ const coeff = space > 0 ? Math.pow(10, space).toTree() : frac(1, Math.pow(10, -space));
54
+ return `On sait que :
55
+
56
+ $$
57
+ 1 \\ \\textrm{${unit}} = ${coeff.toTex()} \\ \\textrm{${target}}
58
+ $$
59
+
60
+ Il suffit alors de multiplier $${randomCapacity.frenchify()}$ par $${coeff.toTex()}$ :
61
+
62
+ ${alignTex([
63
+ [
64
+ `${randomCapacity.frenchify()} \\textrm{${unit}} `,
65
+ "=",
66
+ `${multiply(coeff, randomCapacity).toTex()}\\ \\textrm{${target}}`,
67
+ ],
68
+ ["", "=", `${getAnswer(identifiers)}\\ \\textrm{${target}}`],
69
+ ])}
70
+ `;
71
+ };
72
+ const getQuestionFromIdentifiers = (identifiers) => {
13
73
  const question = {
14
- instruction: `Compléter : $${randomCapacity.value
15
- .toString()
16
- .replace(".", ",")} \\textrm{${units[randomUnitIndex]}} = \\ldots \\textrm{${units[randomUnitInstructionIndex]}}$`,
17
- answer,
74
+ instruction: getInstruction(identifiers),
75
+ answer: getAnswer(identifiers),
18
76
  keys: [],
19
77
  answerFormat: "tex",
20
- identifiers: {
21
- randomCapacity: randomCapacity.value,
22
- randomUnitIndex,
23
- randomUnitInstructionIndex,
24
- },
78
+ identifiers,
79
+ hint: getHint(identifiers),
80
+ correction: getCorrection(identifiers),
25
81
  };
26
82
  return question;
27
83
  };
@@ -46,12 +102,12 @@ export const capacityConversion = {
46
102
  connector: "=",
47
103
  getPropositions,
48
104
  label: "Conversion de capacités",
49
- levels: ["6ème", "5ème", "CAP", "2ndPro"],
50
- sections: ["Conversions"],
51
105
  isSingleStep: true,
52
106
  generator: (nb) => getDistinctQuestions(getCapacityConversion, nb),
53
107
  qcmTimer: 60,
54
108
  freeTimer: 60,
55
109
  isAnswerValid,
56
110
  subject: "Mathématiques",
111
+ getQuestionFromIdentifiers,
112
+ hasHintAndCorrection: true,
57
113
  };
@@ -1 +1 @@
1
- {"version":3,"file":"hoursToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/hoursToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAwEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
1
+ {"version":3,"file":"hoursToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/hoursToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAwIF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
@@ -3,28 +3,88 @@ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuesti
3
3
  import { DecimalConstructor, } from "../../../math/numbers/decimals/decimal.js";
4
4
  import { randint } from "../../../math/utils/random/randint.js";
5
5
  import { round } from "../../../math/utils/round.js";
6
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
7
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
6
8
  import { coinFlip } from "../../../utils/alea/coinFlip.js";
7
- const getHoursToDecimalQuestion = () => {
8
- const isDecimalToHours = coinFlip();
9
- const dec = DecimalConstructor.random(0, 3, 2);
10
- const hours = Math.floor(dec.value);
11
- const mins = round((dec.value - hours) * 100 * 0.6, 0);
12
- const decTex = dec.toTree().toTex();
9
+ import { approxOrEqual } from "../../../utils/latex/approxOrEqual.js";
10
+ const getInstruction = (identifiers) => {
11
+ const { dec, isDecimalToHours } = identifiers;
12
+ const hours = Math.floor(dec);
13
+ const mins = round((dec - hours) * 100 * 0.6, 0);
14
+ const decTex = dec.frenchify();
13
15
  const durationTex = isDecimalToHours
14
- ? decTex + "\\text{h}"
15
- : `${hours}\\text{h}${mins}\\text{min}`;
16
+ ? decTex + "\\ \\textrm{h}"
17
+ : `${hours}\\ \\textrm{h}\\ ${mins}\\ \\textrm{min}`;
18
+ return `Convertir la durée suivante en ${isDecimalToHours ? "heures et minutes" : "$\\ \\textrm{h}$ (nombre décimal)"} :
19
+
20
+ $$
21
+ ${durationTex}
22
+ $$
23
+
24
+ Arrondir ${isDecimalToHours ? "à la minute près" : "au centième près"}.`;
25
+ };
26
+ const getAnswer = (identifiers) => {
27
+ const { dec, isDecimalToHours } = identifiers;
28
+ const hours = Math.floor(dec);
29
+ const mins = round((dec - hours) * 100 * 0.6, 0);
16
30
  const answer = isDecimalToHours
17
31
  ? `${hours}\\text{h}${mins}\\text{min}`
18
32
  : `${hours},${round((mins / 60) * 100, 0)}\\text{h}`;
33
+ return answer;
34
+ };
35
+ const getHint = (identifiers) => {
36
+ const { dec, isDecimalToHours } = identifiers;
37
+ const hours = Math.floor(dec);
38
+ const mins = round((dec - hours) * 100 * 0.6, 0);
39
+ if (isDecimalToHours) {
40
+ return `Dans $1\\ \\text{h}$, il y a $60$ minutes. Un calcul de proportionnalité permet donc de déterminer combien y a-t-il de minutes dans $${dec.frenchify()} \\text{h}$.`;
41
+ }
42
+ return `$60$ minutes correspondent à $1 \\ \\text{h}$. Un calcul de proportionnalité permet donc de convertir $${mins} \\ \\text{min}$ en heures.`;
43
+ };
44
+ const getCorrection = (identifiers) => {
45
+ const { dec, isDecimalToHours } = identifiers;
46
+ const hours = Math.floor(dec);
47
+ const mins = round((dec - hours) * 100 * 0.6, 0);
48
+ const fracDec = round(dec - Math.floor(dec), 2);
49
+ if (isDecimalToHours) {
50
+ return `Dans $1\\ \\text{h}$, il y a $60$ minutes. Un calcul de proportionnalité permet donc de déterminer combien y a-t-il de minutes dans $${fracDec.frenchify()} \\text{h}$ :
51
+
52
+ $$
53
+ ${multiply(fracDec, 60).toTex()} ${approxOrEqual(fracDec * 60, 0).join("")}
54
+ $$
55
+
56
+ $${dec.frenchify()}\\ \\text{h}$ correspond donc à $${getAnswer(identifiers)}$.`;
57
+ }
58
+ return `$60$ minutes correspondent à $1 \\ \\text{h}$. Un calcul de proportionnalité permet donc de convertir $${mins} \\ \\text{min}$ en heures :
59
+
60
+ $$
61
+ ${frac(mins, 60).toTex()} ${approxOrEqual(mins / 60, 2).join("")}
62
+ $$
63
+
64
+ Le résultat attendu est donc :
65
+
66
+ $$
67
+ ${getAnswer(identifiers)}
68
+ $$`;
69
+ };
70
+ const getQuestionFromIdentifiers = (identifiers) => {
19
71
  const question = {
20
- answer,
21
- instruction: `Convertir la durée suivante en ${isDecimalToHours ? "heures et minutes" : "$\\text{h}$ (nombre décimal)"} : $${durationTex}$ (arrondir ${isDecimalToHours ? "à la minute près" : "au centième près"})`,
72
+ answer: getAnswer(identifiers),
73
+ instruction: getInstruction(identifiers),
22
74
  keys: ["hours", "minutes"],
23
75
  answerFormat: "tex",
24
- identifiers: { isDecimalToHours, dec: dec.value },
76
+ identifiers,
77
+ hint: getHint(identifiers),
78
+ correction: getCorrection(identifiers),
25
79
  };
26
80
  return question;
27
81
  };
82
+ const getHoursToDecimalQuestion = () => {
83
+ const isDecimalToHours = coinFlip();
84
+ const dec = DecimalConstructor.random(0, 3, 2);
85
+ const identifiers = { isDecimalToHours, dec: dec.value };
86
+ return getQuestionFromIdentifiers(identifiers);
87
+ };
28
88
  const getPropositions = (n, { answer, isDecimalToHours, dec }) => {
29
89
  const propositions = [];
30
90
  addValidProp(propositions, answer);
@@ -49,8 +109,6 @@ const getPropositions = (n, { answer, isDecimalToHours, dec }) => {
49
109
  const isAnswerValid = (ans, { answer, isDecimalToHours, dec }) => {
50
110
  if (isDecimalToHours)
51
111
  return ans === answer;
52
- // const hours = Math.floor(dec);
53
- // const mins = round((dec - hours) * 100 * 0.6, 0);
54
112
  const texs = [answer, answer.replace("\\text{h}", "")];
55
113
  return texs.includes(ans);
56
114
  };
@@ -58,13 +116,13 @@ export const hoursToDecimal = {
58
116
  id: "hoursToDecimal",
59
117
  connector: "=",
60
118
  label: "Convertir une durée en nombre décimal et inversement",
61
- levels: ["2nde", "2ndPro", "3ème"],
62
119
  isSingleStep: true,
63
- sections: ["Conversions"],
64
120
  generator: (nb) => getDistinctQuestions(getHoursToDecimalQuestion, nb),
65
121
  qcmTimer: 60,
66
122
  freeTimer: 60,
67
123
  getPropositions,
68
124
  isAnswerValid,
69
125
  subject: "Mathématiques",
126
+ getQuestionFromIdentifiers,
127
+ hasHintAndCorrection: true,
70
128
  };
@@ -1 +1 @@
1
- {"version":3,"file":"lengthConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/lengthConversion.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,QAAQ,EAaT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAuHF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgB3D,CAAC"}
1
+ {"version":3,"file":"lengthConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/lengthConversion.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,QAAQ,EAgBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AA2KF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB3D,CAAC"}
@@ -3,9 +3,12 @@ import { Decimal, DecimalConstructor, } from "../../../math/numbers/decimals/dec
3
3
  import { randint } from "../../../math/utils/random/randint.js";
4
4
  import { Measure } from "../../../pc/measure/measure.js";
5
5
  import { DistanceUnit } from "../../../pc/units/distanceUnits.js";
6
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
7
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
6
8
  import { random } from "../../../utils/alea/random.js";
7
9
  import { shuffle } from "../../../utils/alea/shuffle.js";
8
10
  import { doWhile } from "../../../utils/doWhile.js";
11
+ import { alignTex } from "../../../utils/latex/alignTex.js";
9
12
  import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, tryToAddWrongProp, } from "../../exercise.js";
10
13
  import { getDistinctQuestions } from "../../utils/getDistinctQuestions.js";
11
14
  const units = ["mm", "cm", "dm", "m", "dam", "hm", "km"];
@@ -18,11 +21,50 @@ const unitsObj = [
18
21
  DistanceUnit.hm,
19
22
  DistanceUnit.km,
20
23
  ];
24
+ const getHint = (identifiers) => {
25
+ const { randomUnitIndex, randomUnitInstructionIndex } = identifiers;
26
+ const unit = units[randomUnitIndex];
27
+ const target = units[randomUnitInstructionIndex];
28
+ const space = randomUnitIndex - randomUnitInstructionIndex;
29
+ return `On rappelle que :
30
+
31
+ $$
32
+ 1 \\ \\textrm{${unit}} = ${space > 0 ? Math.pow(10, space) : frac(1, Math.pow(10, -space)).toTex()} \\ \\textrm{${target}}
33
+ $$`;
34
+ };
35
+ const getCorrection = (identifiers) => {
36
+ const { randomLength, randomUnitIndex, randomUnitInstructionIndex } = identifiers;
37
+ const unit = units[randomUnitIndex];
38
+ const target = units[randomUnitInstructionIndex];
39
+ const space = randomUnitIndex - randomUnitInstructionIndex;
40
+ const coeff = space > 0 ? Math.pow(10, space).toTree() : frac(1, Math.pow(10, -space));
41
+ return `On sait que :
42
+
43
+ $$
44
+ 1 \\ \\textrm{${unit}} = ${coeff.toTex()} \\ \\textrm{${target}}
45
+ $$
46
+
47
+ Il suffit alors de multiplier $${randomLength.frenchify()}$ par $${coeff.toTex()}$ :
48
+
49
+ ${alignTex([
50
+ [
51
+ `${randomLength.frenchify()} \\textrm{${unit}} `,
52
+ "=",
53
+ `${multiply(coeff, randomLength).toTex()}\\ \\textrm{${target}}`,
54
+ ],
55
+ ["", "=", `${getAnswer(identifiers)}\\ \\textrm{${target}}`],
56
+ ])}
57
+ `;
58
+ };
21
59
  const getInstruction = (identifiers, options) => {
22
60
  const measure = new Measure(identifiers.randomLength, 0, unitsObj[identifiers.randomUnitIndex]);
23
- return `Compléter : $${measure.toTex({
61
+ return `Compléter :
62
+
63
+ $$
64
+ ${measure.toTex({
24
65
  notScientific: true,
25
- })} = \\ldots ${unitsObj[identifiers.randomUnitInstructionIndex].toTex()}$`;
66
+ })} = \\ldots ${unitsObj[identifiers.randomUnitInstructionIndex].toTex()}
67
+ $$`;
26
68
  };
27
69
  const getAnswer = (identifiers, options) => {
28
70
  const measure = new Measure(identifiers.randomLength, 0, unitsObj[identifiers.randomUnitIndex]);
@@ -31,12 +73,12 @@ const getAnswer = (identifiers, options) => {
31
73
  .toTex({ notScientific: true, hideUnit: true });
32
74
  return answer;
33
75
  };
34
- const getLengthConversion = (options) => {
76
+ const getLengthConversion = (opts) => {
35
77
  // if (options && !validateOptions(options).valid)
36
78
  // throw Error("options invalides, gen lengthConversion");
37
79
  const availableUnitsIndexes = units
38
80
  .map((e, i) => i)
39
- .filter((i) => !options?.units?.length || options.units.includes(units[i]));
81
+ .filter((i) => !opts?.units?.length || opts.units.includes(units[i]));
40
82
  const randomUnitIndex = random(availableUnitsIndexes);
41
83
  const randomUnitInstructionIndex = random(availableUnitsIndexes, [
42
84
  randomUnitIndex,
@@ -47,12 +89,17 @@ const getLengthConversion = (options) => {
47
89
  randomUnitIndex,
48
90
  randomUnitInstructionIndex,
49
91
  };
92
+ return getQuestionFromIdentifiers(identifiers, opts);
93
+ };
94
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
50
95
  const question = {
51
- instruction: getInstruction(identifiers, options),
52
- answer: getAnswer(identifiers, options),
96
+ instruction: getInstruction(identifiers, opts),
97
+ answer: getAnswer(identifiers, opts),
53
98
  keys: [],
54
99
  answerFormat: "tex",
55
100
  identifiers,
101
+ hint: getHint(identifiers),
102
+ correction: getCorrection(identifiers),
56
103
  };
57
104
  return question;
58
105
  };
@@ -107,4 +154,6 @@ export const lengthConversion = {
107
154
  getInstruction,
108
155
  options,
109
156
  validateOptions,
157
+ hasHintAndCorrection: true,
158
+ getQuestionFromIdentifiers,
110
159
  };
@@ -1 +1 @@
1
- {"version":3,"file":"massConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/massConversion.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,QAAQ,EAQT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA8DF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
1
+ {"version":3,"file":"massConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/massConversion.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,QAAQ,EAaT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA6HF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
@@ -1,31 +1,87 @@
1
1
  import { Decimal, DecimalConstructor, } from "../../../math/numbers/decimals/decimal.js";
2
2
  import { randint } from "../../../math/utils/random/randint.js";
3
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
4
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
3
5
  import { numberParser } from "../../../tree/parsers/numberParser.js";
4
6
  import { shuffle } from "../../../utils/alea/shuffle.js";
5
7
  import { doWhile } from "../../../utils/doWhile.js";
8
+ import { alignTex } from "../../../utils/latex/alignTex.js";
6
9
  import { addValidProp, tryToAddWrongProp, } from "../../exercise.js";
7
10
  import { getDistinctQuestions } from "../../utils/getDistinctQuestions.js";
8
11
  const units = ["mg", "cg", "dg", "g", "dag", "hg", "kg"];
9
- const getMassConversion = () => {
10
- const randomUnitIndex = randint(0, 7);
11
- const randomUnitInstructionIndex = randint(0, 7, [randomUnitIndex]);
12
- const randomMass = doWhile(() => DecimalConstructor.random(0, 1000, randint(0, 4)), (x) => x.value === 0);
13
- const answer = (randomMass.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + "").replace(".", ",");
12
+ const getHint = (identifiers) => {
13
+ const { randomUnitIndex, randomUnitInstructionIndex } = identifiers;
14
+ const unit = units[randomUnitIndex];
15
+ const target = units[randomUnitInstructionIndex];
16
+ const space = randomUnitIndex - randomUnitInstructionIndex;
17
+ return `On rappelle que :
18
+
19
+ $$
20
+ 1 \\ \\textrm{${unit}} = ${space > 0 ? Math.pow(10, space) : frac(1, Math.pow(10, -space)).toTex()} \\ \\textrm{${target}}
21
+ $$`;
22
+ };
23
+ const getCorrection = (identifiers) => {
24
+ const { randomMass, randomUnitIndex, randomUnitInstructionIndex } = identifiers;
25
+ const unit = units[randomUnitIndex];
26
+ const target = units[randomUnitInstructionIndex];
27
+ const space = randomUnitIndex - randomUnitInstructionIndex;
28
+ const coeff = space > 0 ? Math.pow(10, space).toTree() : frac(1, Math.pow(10, -space));
29
+ return `On sait que :
30
+
31
+ $$
32
+ 1 \\ \\textrm{${unit}} = ${coeff.toTex()} \\ \\textrm{${target}}
33
+ $$
34
+
35
+ Il suffit alors de multiplier $${randomMass.frenchify()}$ par $${coeff.toTex()}$ :
36
+
37
+ ${alignTex([
38
+ [
39
+ `${randomMass.frenchify()} \\textrm{${unit}} `,
40
+ "=",
41
+ `${multiply(coeff, randomMass).toTex()}\\ \\textrm{${target}}`,
42
+ ],
43
+ ["", "=", `${getAnswer(identifiers)}\\ \\textrm{${target}}`],
44
+ ])}
45
+ `;
46
+ };
47
+ const getInstruction = (identifiers) => {
48
+ const { randomMass, randomUnitIndex, randomUnitInstructionIndex } = identifiers;
49
+ return `Compléter :
50
+
51
+ $$
52
+ ${randomMass.frenchify()} \\textrm{${units[randomUnitIndex]}} = \\ldots \\textrm{${units[randomUnitInstructionIndex]}}
53
+ $$`;
54
+ };
55
+ const getAnswer = (identifiers) => {
56
+ const { randomMass, randomUnitIndex, randomUnitInstructionIndex } = identifiers;
57
+ const answer = new Decimal(randomMass)
58
+ .multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex)
59
+ .value.frenchify();
60
+ return answer;
61
+ };
62
+ const getQuestionFromIdentifiers = (identifiers) => {
14
63
  const question = {
15
- instruction: `Compléter : $${randomMass.value
16
- .toString()
17
- .replace(".", ",")} \\textrm{${units[randomUnitIndex]}} = \\ldots \\textrm{${units[randomUnitInstructionIndex]}}$`,
18
- answer,
64
+ instruction: getInstruction(identifiers),
65
+ answer: getAnswer(identifiers),
19
66
  keys: [],
20
67
  answerFormat: "tex",
21
- identifiers: {
22
- randomMass: randomMass.value,
23
- randomUnitIndex,
24
- randomUnitInstructionIndex,
25
- },
68
+ identifiers,
69
+ hint: getHint(identifiers),
70
+ correction: getCorrection(identifiers),
26
71
  };
27
72
  return question;
28
73
  };
74
+ const getMassConversion = () => {
75
+ const randomUnitIndex = randint(0, 7);
76
+ const randomUnitInstructionIndex = randint(0, 7, [randomUnitIndex]);
77
+ const randomMass = doWhile(() => DecimalConstructor.random(0, 1000, randint(0, 4)), (x) => x.value === 0);
78
+ const identifiers = {
79
+ randomMass: randomMass.value,
80
+ randomUnitIndex,
81
+ randomUnitInstructionIndex,
82
+ };
83
+ return getQuestionFromIdentifiers(identifiers);
84
+ };
29
85
  const getPropositions = (n, { answer, randomMass, randomUnitIndex, randomUnitInstructionIndex }) => {
30
86
  const propositions = [];
31
87
  addValidProp(propositions, answer);
@@ -49,8 +105,6 @@ export const massConversion = {
49
105
  id: "massConversion",
50
106
  connector: "=",
51
107
  label: "Conversion de masses",
52
- levels: ["6ème", "5ème", "CAP", "2ndPro"],
53
- sections: ["Conversions"],
54
108
  isSingleStep: true,
55
109
  generator: (nb) => getDistinctQuestions(getMassConversion, nb),
56
110
  getPropositions,
@@ -58,4 +112,6 @@ export const massConversion = {
58
112
  qcmTimer: 60,
59
113
  freeTimer: 60,
60
114
  subject: "Mathématiques",
115
+ getQuestionFromIdentifiers,
116
+ hasHintAndCorrection: true,
61
117
  };
@@ -1 +1 @@
1
- {"version":3,"file":"volumeConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/volumeConversion.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,QAAQ,EAQT,MAAM,mBAAmB,CAAC;AAE3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AA+DF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
1
+ {"version":3,"file":"volumeConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/volumeConversion.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,QAAQ,EAaT,MAAM,mBAAmB,CAAC;AAE3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAgIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}