math-exercises 3.0.125 → 3.0.126

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 (291) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +61 -1
  3. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +1 -0
  4. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/mentalCaluls/index.js +1 -0
  6. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +15 -0
  7. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -0
  8. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +217 -0
  9. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts +16 -0
  10. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -0
  11. package/lib/exercises/math/calcul/ordering/compareA10N.js +327 -0
  12. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts +8 -0
  13. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -0
  14. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +221 -0
  15. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +9 -0
  16. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -0
  17. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +135 -0
  18. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +29 -0
  19. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -0
  20. package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +367 -0
  21. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts +12 -0
  22. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts.map +1 -0
  23. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.js +164 -0
  24. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts +9 -0
  25. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -0
  26. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +140 -0
  27. package/lib/exercises/math/calcul/ordering/index.d.ts +6 -0
  28. package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
  29. package/lib/exercises/math/calcul/ordering/index.js +6 -0
  30. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts +9 -0
  31. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -0
  32. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +84 -0
  33. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts +8 -0
  34. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -0
  35. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +90 -0
  36. package/lib/exercises/math/calcul/rounding/index.d.ts +2 -0
  37. package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
  38. package/lib/exercises/math/calcul/rounding/index.js +2 -0
  39. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts +13 -0
  40. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -0
  41. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +414 -0
  42. package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
  43. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  44. package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
  45. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts +10 -0
  46. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts.map +1 -0
  47. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.js +70 -0
  48. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
  49. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  50. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
  51. package/lib/exercises/math/calculLitteral/index.d.ts +2 -0
  52. package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
  53. package/lib/exercises/math/calculLitteral/index.js +2 -0
  54. package/lib/exercises/math/calculLitteral/isolate/index.d.ts +2 -1
  55. package/lib/exercises/math/calculLitteral/isolate/index.d.ts.map +1 -1
  56. package/lib/exercises/math/calculLitteral/isolate/index.js +2 -1
  57. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts +8 -0
  58. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
  59. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +107 -0
  60. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts +7 -0
  61. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
  62. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.js +80 -0
  63. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts +10 -0
  64. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -0
  65. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +182 -0
  66. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts +9 -0
  67. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -0
  68. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +144 -0
  69. package/lib/exercises/math/calculLitteral/ordering/index.d.ts +3 -0
  70. package/lib/exercises/math/calculLitteral/ordering/index.d.ts.map +1 -0
  71. package/lib/exercises/math/calculLitteral/ordering/index.js +2 -0
  72. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts +11 -0
  73. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -0
  74. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +120 -0
  75. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts +8 -0
  76. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts.map +1 -0
  77. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.js +67 -0
  78. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts +11 -0
  79. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts.map +1 -0
  80. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.js +114 -0
  81. package/lib/exercises/math/calculLitteral/simplifying/index.d.ts +5 -0
  82. package/lib/exercises/math/calculLitteral/simplifying/index.d.ts.map +1 -1
  83. package/lib/exercises/math/calculLitteral/simplifying/index.js +5 -0
  84. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts +13 -0
  85. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts.map +1 -0
  86. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.js +125 -0
  87. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts +14 -0
  88. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts.map +1 -0
  89. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.js +148 -0
  90. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +5 -27
  91. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
  92. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +178 -241
  93. package/lib/exercises/math/conversion/index.d.ts +4 -0
  94. package/lib/exercises/math/conversion/index.d.ts.map +1 -1
  95. package/lib/exercises/math/conversion/index.js +4 -0
  96. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +8 -0
  97. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -0
  98. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +98 -0
  99. package/lib/exercises/math/conversion/minutesToHours.d.ts +10 -0
  100. package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -0
  101. package/lib/exercises/math/conversion/minutesToHours.js +150 -0
  102. package/lib/exercises/math/conversion/prefixToNumber.d.ts +15 -0
  103. package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -0
  104. package/lib/exercises/math/conversion/prefixToNumber.js +233 -0
  105. package/lib/exercises/math/conversion/secondsToHours.d.ts +10 -0
  106. package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -0
  107. package/lib/exercises/math/conversion/secondsToHours.js +150 -0
  108. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +50 -0
  109. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -0
  110. package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +517 -0
  111. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts +7 -0
  112. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts.map +1 -0
  113. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.js +223 -0
  114. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts +10 -0
  115. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -0
  116. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +139 -0
  117. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts +8 -0
  118. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -0
  119. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +133 -0
  120. package/lib/exercises/math/dataRepresentations/graphReading.d.ts +8 -0
  121. package/lib/exercises/math/dataRepresentations/graphReading.d.ts.map +1 -0
  122. package/lib/exercises/math/dataRepresentations/graphReading.js +136 -0
  123. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts +18 -0
  124. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -0
  125. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +228 -0
  126. package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts +8 -0
  127. package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts.map +1 -0
  128. package/lib/exercises/math/dataRepresentations/halfPieChartReading.js +213 -0
  129. package/lib/exercises/math/dataRepresentations/histogramReading.d.ts +9 -0
  130. package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -0
  131. package/lib/exercises/math/dataRepresentations/histogramReading.js +163 -0
  132. package/lib/exercises/math/dataRepresentations/index.d.ts +10 -0
  133. package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
  134. package/lib/exercises/math/dataRepresentations/index.js +10 -0
  135. package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts +9 -0
  136. package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -0
  137. package/lib/exercises/math/dataRepresentations/plausibleGraph.js +145 -0
  138. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts +9 -0
  139. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts.map +1 -0
  140. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.js +308 -0
  141. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
  142. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +5 -6
  143. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts +8 -0
  144. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -0
  145. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +103 -0
  146. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts +8 -0
  147. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -0
  148. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +100 -0
  149. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts +16 -0
  150. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -0
  151. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +215 -0
  152. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts +13 -0
  153. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -0
  154. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +206 -0
  155. package/lib/exercises/math/functions/affines/index.d.ts +7 -0
  156. package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
  157. package/lib/exercises/math/functions/affines/index.js +7 -0
  158. package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts +20 -0
  159. package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts.map +1 -0
  160. package/lib/exercises/math/functions/affines/recognizeExprAffine.js +284 -0
  161. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +13 -0
  162. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -0
  163. package/lib/exercises/math/functions/affines/representationOfAffine.js +184 -0
  164. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts +14 -0
  165. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -0
  166. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +216 -0
  167. package/lib/exercises/math/functions/basics/index.d.ts +1 -0
  168. package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
  169. package/lib/exercises/math/functions/basics/index.js +1 -0
  170. package/lib/exercises/math/functions/composition/functionComposition.d.ts +8 -0
  171. package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -0
  172. package/lib/exercises/math/functions/composition/functionComposition.js +238 -0
  173. package/lib/exercises/math/functions/composition/index.d.ts +2 -0
  174. package/lib/exercises/math/functions/composition/index.d.ts.map +1 -0
  175. package/lib/exercises/math/functions/composition/index.js +1 -0
  176. package/lib/exercises/math/functions/index.d.ts +1 -0
  177. package/lib/exercises/math/functions/index.d.ts.map +1 -1
  178. package/lib/exercises/math/functions/index.js +1 -0
  179. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts +23 -0
  180. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -0
  181. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +448 -0
  182. package/lib/exercises/math/geometry/angles/index.js +2 -0
  183. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts +23 -0
  184. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts.map +1 -0
  185. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.js +402 -0
  186. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +9 -6
  187. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
  188. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +140 -60
  189. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +1 -1
  190. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
  191. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +121 -104
  192. package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -1
  193. package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +3 -2
  194. package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
  195. package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
  196. package/lib/exercises/math/probaStat/basicProbas/index.js +1 -0
  197. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts +0 -1
  198. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
  199. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +42 -80
  200. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts +9 -0
  201. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -0
  202. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +217 -0
  203. package/lib/exercises/math/probaStat/index.d.ts +2 -0
  204. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  205. package/lib/exercises/math/probaStat/index.js +2 -0
  206. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +30 -0
  207. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -0
  208. package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +548 -0
  209. package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
  210. package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
  211. package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
  212. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts +9 -0
  213. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -0
  214. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +90 -0
  215. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts +10 -0
  216. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -0
  217. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +151 -0
  218. package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts +7 -0
  219. package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts.map +1 -0
  220. package/lib/exercises/pc/electricity/calculateUEqualsRI.js +73 -0
  221. package/lib/exercises/pc/electricity/index.d.ts +1 -0
  222. package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
  223. package/lib/exercises/pc/electricity/index.js +1 -0
  224. package/lib/exercises/pc/index.d.ts +1 -0
  225. package/lib/exercises/pc/index.d.ts.map +1 -1
  226. package/lib/exercises/pc/index.js +1 -0
  227. package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
  228. package/lib/exercises/pc/moleculeFormula.js +4 -3
  229. package/lib/exercises/pc/optics/index.d.ts +2 -0
  230. package/lib/exercises/pc/optics/index.d.ts.map +1 -0
  231. package/lib/exercises/pc/optics/index.js +1 -0
  232. package/lib/exercises/pc/optics/lensFormula.d.ts +21 -0
  233. package/lib/exercises/pc/optics/lensFormula.d.ts.map +1 -0
  234. package/lib/exercises/pc/optics/lensFormula.js +415 -0
  235. package/lib/exercises/pc/weight/calculateWeight.d.ts +8 -1
  236. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
  237. package/lib/exercises/pc/weight/calculateWeight.js +113 -38
  238. package/lib/geogebra/parsers/geogebraParser.d.ts +4 -0
  239. package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
  240. package/lib/geogebra/parsers/geogebraParser.js +17 -0
  241. package/lib/index.d.ts +346 -12
  242. package/lib/index.d.ts.map +1 -1
  243. package/lib/latexTester.d.ts.map +1 -1
  244. package/lib/latexTester.js +1 -0
  245. package/lib/math/geometry/CloudPoints.d.ts +10 -0
  246. package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
  247. package/lib/math/geometry/CloudPoints.js +119 -0
  248. package/lib/math/geometry/line.d.ts +1 -0
  249. package/lib/math/geometry/line.d.ts.map +1 -1
  250. package/lib/math/geometry/line.js +10 -2
  251. package/lib/math/geometry/vector.d.ts +1 -0
  252. package/lib/math/geometry/vector.d.ts.map +1 -1
  253. package/lib/math/geometry/vector.js +12 -0
  254. package/lib/math/progCalc/progCalc.d.ts +46 -0
  255. package/lib/math/progCalc/progCalc.d.ts.map +1 -0
  256. package/lib/math/progCalc/progCalc.js +239 -0
  257. package/lib/math/utils/latex/realize.d.ts +12 -0
  258. package/lib/math/utils/latex/realize.d.ts.map +1 -0
  259. package/lib/math/utils/latex/realize.js +43 -0
  260. package/lib/pc/constants/molecularChemistry/molecule.d.ts +2 -0
  261. package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -1
  262. package/lib/pc/constants/molecularChemistry/molecule.js +52 -0
  263. package/lib/tests/questionTest.d.ts.map +1 -1
  264. package/lib/tests/questionTest.js +1 -1
  265. package/lib/tests/singleExo.test.js +3 -3
  266. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  267. package/lib/tree/nodes/operators/addNode.d.ts +4 -2
  268. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  269. package/lib/tree/nodes/operators/addNode.js +8 -17
  270. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  271. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  272. package/lib/tree/nodes/operators/fractionNode.js +5 -1
  273. package/lib/tree/nodes/operators/multiplyNode.d.ts +4 -2
  274. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  275. package/lib/tree/nodes/operators/multiplyNode.js +8 -17
  276. package/lib/tree/nodes/operators/operatorNode.d.ts +3 -3
  277. package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
  278. package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
  279. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  280. package/lib/tree/utilities/nodeShuffler.d.ts +12 -0
  281. package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -0
  282. package/lib/tree/utilities/nodeShuffler.js +123 -0
  283. package/lib/utils/arrays/getAllPicks.d.ts +2 -0
  284. package/lib/utils/arrays/getAllPicks.d.ts.map +1 -0
  285. package/lib/utils/arrays/getAllPicks.js +17 -0
  286. package/lib/utils/errors/handleVEAError.d.ts +1 -1
  287. package/lib/utils/errors/handleVEAError.d.ts.map +1 -1
  288. package/lib/utils/strings/decapitalize.d.ts +2 -0
  289. package/lib/utils/strings/decapitalize.d.ts.map +1 -0
  290. package/lib/utils/strings/decapitalize.js +3 -0
  291. package/package.json +1 -1
@@ -0,0 +1,414 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
4
+ import { randint } from "../../../../math/utils/random/randint.js";
5
+ import { round } from "../../../../math/utils/round.js";
6
+ import { EqualNode, isEqualNode, } from "../../../../tree/nodes/equations/equalNode.js";
7
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
8
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
9
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
10
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
11
+ import { random, randomMany } from "../../../../utils/alea/random.js";
12
+ import { isOperatorNode, OperatorIds, } from "../../../../tree/nodes/operators/operatorNode.js";
13
+ import { parseLatex } from "../../../../tree/parsers/latexParser.js";
14
+ class ProblemConstructor {
15
+ static byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays) {
16
+ const shuffleFuncs = shuffleArrays.map((shuffleArray) => {
17
+ return (array) => {
18
+ return array.map((_, i) => array[shuffleArray[i]]);
19
+ };
20
+ });
21
+ const groups = Object.fromEntries(Object.entries(skeleton.groups).map(([gpName, gp]) => {
22
+ const vars = Object.fromEntries(Object.entries(gp.vars).map(([varName, varSkeleton]) => {
23
+ const node = groupNameToVarNameToValue[gpName][varName];
24
+ return [varName, new ProblemVar(varSkeleton, node)];
25
+ }));
26
+ return [gpName, new ProblemVarGroup(gp, vars)];
27
+ }));
28
+ const [mysteryGroupName, mysteryVarNameInGroup] = mysteryVarPath.split(".");
29
+ const mysteryGroup = groups[mysteryGroupName];
30
+ const mysteryVar = mysteryGroup.vars[mysteryVarNameInGroup];
31
+ return new Problem(skeleton, groups, mysteryGroup, mysteryVar, shuffleFuncs);
32
+ }
33
+ }
34
+ class Problem {
35
+ skeleton;
36
+ groups;
37
+ mysteryGroup;
38
+ mysteryVar;
39
+ shuffleFuncs;
40
+ equalNode;
41
+ frenchStr;
42
+ constructor(skeleton, groups, mysteryGroup, mysteryVar, shuffleFuncs) {
43
+ this.skeleton = skeleton;
44
+ this.groups = groups;
45
+ this.mysteryGroup = mysteryGroup;
46
+ this.mysteryVar = mysteryVar;
47
+ this.shuffleFuncs = shuffleFuncs;
48
+ this.equalNode = this.skeleton.equalNodeFunc(mysteryGroup, mysteryVar, groups, shuffleFuncs);
49
+ this.frenchStr = this.skeleton.strFunc(mysteryGroup, mysteryVar, groups, shuffleFuncs);
50
+ //populate computed groups
51
+ Object.values(groups)
52
+ .filter((group) => group.skeleton.isComputed)
53
+ .forEach((group) => {
54
+ Object.values(group.vars).forEach((problemVar) => {
55
+ if (problemVar.value === undefined) {
56
+ problemVar.value = group.getNode(mysteryVar, groups, shuffleFuncs);
57
+ }
58
+ });
59
+ });
60
+ }
61
+ getArrayOfUsefulVarNames() {
62
+ return [this.mysteryVar.skeleton.varName];
63
+ }
64
+ getArrayOfUsefulNodes() {
65
+ return Object.values(this.groups).flatMap((group) => {
66
+ return Object.values(group.vars)
67
+ .flatMap((problemVar) => problemVar === this.mysteryVar
68
+ ? problemVar.getVarNode()
69
+ : problemVar.getValueNode())
70
+ .filter((node) => !!node);
71
+ });
72
+ }
73
+ }
74
+ class ProblemVarGroup {
75
+ skeleton;
76
+ vars;
77
+ constructor(skeleton, vars) {
78
+ this.skeleton = skeleton;
79
+ this.vars = vars;
80
+ }
81
+ toTex(mysteryVar) {
82
+ return this.skeleton.strFunc(this, mysteryVar);
83
+ }
84
+ getNode(mysteryVar, groups, shuffleFuncs) {
85
+ return this.skeleton.nodeFunc(this, mysteryVar, groups, shuffleFuncs);
86
+ }
87
+ }
88
+ class ProblemVar {
89
+ skeleton;
90
+ value;
91
+ constructor(skeleton, value) {
92
+ this.skeleton = skeleton;
93
+ this.value = value;
94
+ }
95
+ getVarNode() {
96
+ return this.skeleton.varName.toTree();
97
+ }
98
+ getValueNode() {
99
+ return this.value;
100
+ }
101
+ }
102
+ class ProblemVarSkeletonGroup {
103
+ vars;
104
+ strFunc;
105
+ nodeFunc;
106
+ isCanBeMysteryGroup;
107
+ isComputed;
108
+ constructor(vars, strFunc, nodeFunc, isCanBeMysteryGroup, isComputed) {
109
+ this.vars = vars;
110
+ this.strFunc = strFunc;
111
+ this.nodeFunc = nodeFunc;
112
+ this.isCanBeMysteryGroup = isCanBeMysteryGroup;
113
+ this.isComputed = isComputed;
114
+ }
115
+ createRandomValuesDict() {
116
+ return Object.fromEntries(Object.entries(this.vars)
117
+ .filter(([_, varSkeleton]) => !!varSkeleton.randNode)
118
+ .map(([varName, varSkeleton]) => {
119
+ return [varName, varSkeleton.randNode()];
120
+ }));
121
+ }
122
+ }
123
+ class ProblemSkeleton {
124
+ sampleStr;
125
+ strFunc;
126
+ equalNodeFunc;
127
+ groups;
128
+ swappableGroups;
129
+ constructor(sampleStr, strFunc, equalNodeFunc, groups, swappableGroups) {
130
+ this.sampleStr = sampleStr;
131
+ this.strFunc = strFunc;
132
+ this.equalNodeFunc = equalNodeFunc;
133
+ this.groups = groups;
134
+ this.swappableGroups = swappableGroups;
135
+ }
136
+ createRandomValuesDict() {
137
+ return Object.fromEntries(Object.entries(this.groups).map(([gpName, gp]) => {
138
+ return [gpName, gp.createRandomValuesDict()];
139
+ }));
140
+ }
141
+ createRandomMysteryVarPath() {
142
+ const [groupName, group] = random(Object.entries(this.groups).filter(([_, group]) => group.isCanBeMysteryGroup));
143
+ const [groupVarNameInGroup, _] = random(Object.entries(group.vars));
144
+ return `${groupName}.${groupVarNameInGroup}`;
145
+ }
146
+ createRandomShuffleArrays() {
147
+ return this.swappableGroups.map((arrayOfGroupNames) => {
148
+ return randomMany([...Array(arrayOfGroupNames.length).keys()], arrayOfGroupNames.length);
149
+ });
150
+ }
151
+ }
152
+ const skeletons = [
153
+ new ProblemSkeleton(`Clara a acheté des ingrédients pour réaliser des pizzas.
154
+ Elle a pris trois pâtes à pizza à 1,95 € l’unité et deux pots de sauce tomate.
155
+ Elle a payé au total 8,37 €.
156
+ Quel est le prix, noté a, d'un pot de sauce ?`, (_group, mysteryVar, groups, shuffleFuncs) => {
157
+ const { pizza, sauce, total } = groups;
158
+ const [gp1, gp2] = shuffleFuncs[0]([pizza, sauce]);
159
+ return `Clara a acheté des ingrédients pour réaliser des pizzas.
160
+ Elle a pris ${gp1.toTex(mysteryVar)} et, dans un autre rayon, ${gp2.toTex(mysteryVar)}.
161
+ Elle a payé au total $${total
162
+ .getNode(mysteryVar, groups, shuffleFuncs)
163
+ .toTex()}$ €.
164
+ ${mysteryVar.skeleton.question}`;
165
+ }, (_group, mysteryVar, groups, shuffleFuncs) => {
166
+ const { pizza, sauce } = groups;
167
+ const [gp1, gp2] = shuffleFuncs[0]([pizza, sauce]);
168
+ return new EqualNode(add(gp1.getNode(mysteryVar), gp2.getNode(mysteryVar)), groups.total.getNode(mysteryVar, groups, shuffleFuncs));
169
+ }, {
170
+ pizza: new ProblemVarSkeletonGroup({
171
+ count: {
172
+ varName: "n",
173
+ str: "le nombre de pâtes à pizza",
174
+ question: `Quel est le nombre, noté $n$, de pâtes à pizza ?`,
175
+ randNode() {
176
+ return randint(1, 11, []).toTree();
177
+ },
178
+ },
179
+ price: {
180
+ varName: "p",
181
+ str: "le prix d'une pâte à pizza",
182
+ question: `Quel est le prix, noté $p$, d'une pâte à pizza ?`,
183
+ randNode() {
184
+ return randfloat(0.5, 4, 2, []).toTree();
185
+ },
186
+ },
187
+ }, (group, mysteryVar) => {
188
+ switch (mysteryVar?.skeleton.varName) {
189
+ case "n":
190
+ return `des pâtes à pizza à $${group.vars.price.value.toTex()}$ € l’unité`;
191
+ case "p": {
192
+ const isPlural = group.vars.count.value.evaluate() >= 2;
193
+ return `$${group.vars.count.value.toTex()}$ ${"pâte" + (isPlural ? "s" : "")} à pizza`;
194
+ }
195
+ default: {
196
+ const isPlural = group.vars.count.value.evaluate() >= 2;
197
+ return `$${group.vars.count.value.toTex()}$ ${"pâte" + (isPlural ? "s" : "")} à pizza à $${group.vars.price.value.toTex()}$ € l’unité`;
198
+ }
199
+ }
200
+ }, (group, mysteryVar) => {
201
+ const varCount = group.vars.count;
202
+ const varPrice = group.vars.price;
203
+ return multiply(varCount === mysteryVar
204
+ ? varCount.getVarNode()
205
+ : varCount.getValueNode(), varPrice === mysteryVar
206
+ ? varPrice.getVarNode()
207
+ : varPrice.getValueNode());
208
+ }, true, false),
209
+ sauce: new ProblemVarSkeletonGroup({
210
+ count: {
211
+ varName: "m",
212
+ str: "le nombre de boîtes de sauce tomate",
213
+ question: `Quel est le nombre, noté $m$, de boîtes de sauce tomate ?`,
214
+ randNode() {
215
+ return randint(1, 11, []).toTree();
216
+ },
217
+ },
218
+ price: {
219
+ varName: "s",
220
+ str: "le prix d'une boîte de sauce",
221
+ question: `Quel est le prix, noté $s$, d'une boîte de sauce tomate ?`,
222
+ randNode() {
223
+ return randfloat(0.5, 4, 2, []).toTree();
224
+ },
225
+ },
226
+ }, (group, mysteryVar) => {
227
+ switch (mysteryVar?.skeleton.varName) {
228
+ case "m":
229
+ return `des boîtes de sauce tomate à $${group.vars.price.value.toTex()}$ € l’unité`;
230
+ case "s": {
231
+ const isPlural = group.vars.count.value.evaluate() >= 2;
232
+ return `$${group.vars.count.value.toTex()}$ ${"boîte" + (isPlural ? "s" : "")} de sauce tomate`;
233
+ }
234
+ default: {
235
+ const isPlural = group.vars.count.value.evaluate() >= 2;
236
+ return `$${group.vars.count.value.toTex()}$ ${"boîte" + (isPlural ? "s" : "")} de sauce tomate à $${group.vars.price.value.toTex()}$ € l’unité`;
237
+ }
238
+ }
239
+ }, (group, mysteryVar) => {
240
+ const varCount = group.vars.count;
241
+ const varPrice = group.vars.price;
242
+ return multiply(varCount === mysteryVar
243
+ ? varCount.getVarNode()
244
+ : varCount.getValueNode(), varPrice === mysteryVar
245
+ ? varPrice.getVarNode()
246
+ : varPrice.getValueNode());
247
+ }, true, false),
248
+ total: new ProblemVarSkeletonGroup({
249
+ total: {
250
+ varName: "t",
251
+ str: "le coût total",
252
+ question: `Quel est le coût total, noté $t$, de ses achats ?`,
253
+ },
254
+ }, () => {
255
+ return "le coût total";
256
+ }, (_group, _mysteryVar, groups, shuffleFuncs) => {
257
+ const { pizza, sauce } = groups;
258
+ const orderedNodes = shuffleFuncs[0]([pizza, sauce]).map((group) => group.getNode());
259
+ // console.log(
260
+ // "orderedNodes[0].leftChild",
261
+ // (orderedNodes[0] as MultiplyNode).leftChild,
262
+ // );
263
+ // console.log(
264
+ // "isAlgebraicNode((orderedNodes[0] as MultiplyNode).leftChild)",
265
+ // isAlgebraicNode((orderedNodes[0] as MultiplyNode).leftChild),
266
+ // );
267
+ // console.log(
268
+ // "orderedNodes[0].leftChild.evaluate",
269
+ // (orderedNodes[0] as MultiplyNode).leftChild.evaluate,
270
+ // );
271
+ // console.log("orderedNodes[0].evaluate()", orderedNodes[0].evaluate());
272
+ // console.log("orderedNodes[1].evaluate()", orderedNodes[1].evaluate());
273
+ return round(add(orderedNodes[0], orderedNodes[1]).evaluate(), 2).toTree();
274
+ }, false, true),
275
+ }, [["pizza", "sauce"]]),
276
+ ];
277
+ const getInstruction = (identifiers) => {
278
+ const { problemSkeletonIndex, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays, } = identifiers;
279
+ const skeleton = skeletons[problemSkeletonIndex];
280
+ const problem = ProblemConstructor.byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays);
281
+ return `Traduire par une équation le problème suivant :
282
+ ${problem.frenchStr}`;
283
+ };
284
+ const getAnswerNode = (identifiers) => {
285
+ console.log("getAnswerNode", identifiers);
286
+ const { problemSkeletonIndex, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays, } = identifiers;
287
+ const skeleton = skeletons[problemSkeletonIndex];
288
+ const problem = ProblemConstructor.byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays);
289
+ return problem.equalNode;
290
+ };
291
+ const getAnswer = (identifiers) => {
292
+ return getAnswerNode(identifiers).toTex();
293
+ };
294
+ const getKeys = (identifiers) => {
295
+ const { problemSkeletonIndex, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays, } = identifiers;
296
+ const skeleton = skeletons[problemSkeletonIndex];
297
+ const problem = ProblemConstructor.byHydratingSkeleton(skeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays);
298
+ const arrayOfNodes = problem.getArrayOfUsefulNodes();
299
+ return [
300
+ "equal",
301
+ ...arrayOfNodes.map((node) => {
302
+ const tex = node.toTex();
303
+ return {
304
+ id: "custom",
305
+ label: tex,
306
+ labelType: "tex",
307
+ mathfieldInstructions: {
308
+ method: "write",
309
+ content: tex,
310
+ },
311
+ };
312
+ }),
313
+ ];
314
+ };
315
+ const getEquationFromSentenceExerciseQuestion = () => {
316
+ const problemSkeletonIndex = random([...Array(skeletons.length).keys()]);
317
+ const problemSkeleton = skeletons[problemSkeletonIndex];
318
+ const groupNameToVarNameToValue = problemSkeleton.createRandomValuesDict();
319
+ const mysteryVarPath = problemSkeleton.createRandomMysteryVarPath();
320
+ const shuffleArrays = problemSkeleton.createRandomShuffleArrays();
321
+ const problem = ProblemConstructor.byHydratingSkeleton(problemSkeleton, groupNameToVarNameToValue, mysteryVarPath, shuffleArrays);
322
+ const equalNodeIds = problem.equalNode.toIdentifiers();
323
+ const identifiers = {
324
+ problemSkeletonIndex,
325
+ groupNameToVarNameToValue,
326
+ mysteryVarPath,
327
+ shuffleArrays,
328
+ equalNodeIds,
329
+ };
330
+ return getQuestionFromIdentifiers(identifiers);
331
+ };
332
+ const getQuestionFromIdentifiers = (identifiers) => {
333
+ const question = {
334
+ answer: getAnswer(identifiers),
335
+ instruction: getInstruction(identifiers),
336
+ keys: getKeys(identifiers),
337
+ answerFormat: "tex",
338
+ identifiers,
339
+ };
340
+ return question;
341
+ };
342
+ const getPropositions = (n, { answer, ...identifiers }) => {
343
+ const propositions = [];
344
+ addValidProp(propositions, answer);
345
+ const answerNode = getAnswerNode(identifiers);
346
+ function nodeByReplacingOperations(node, replacementDict) {
347
+ if (isOperatorNode(node)) {
348
+ const leftChild = nodeByReplacingOperations(node.leftChild, replacementDict);
349
+ const rightChild = nodeByReplacingOperations(node.rightChild, replacementDict);
350
+ const targetOperatorId = replacementDict[+node.id] ?? node.id;
351
+ switch (+targetOperatorId) {
352
+ case OperatorIds.add:
353
+ return add(leftChild, rightChild);
354
+ case OperatorIds.substract:
355
+ return substract(leftChild, rightChild);
356
+ case OperatorIds.multiply:
357
+ return multiply(leftChild, rightChild);
358
+ case OperatorIds.divide:
359
+ return frac(leftChild, rightChild);
360
+ default:
361
+ return add(leftChild, rightChild);
362
+ }
363
+ }
364
+ else if (isEqualNode(node)) {
365
+ const leftChild = nodeByReplacingOperations(node.leftChild, replacementDict);
366
+ const rightChild = nodeByReplacingOperations(node.rightChild, replacementDict);
367
+ return new EqualNode(leftChild, rightChild);
368
+ }
369
+ else {
370
+ return node;
371
+ }
372
+ }
373
+ //add everywhere
374
+ {
375
+ const wrongEqualNode = nodeByReplacingOperations(answerNode, {
376
+ [OperatorIds.multiply]: OperatorIds.add,
377
+ [OperatorIds.substract]: OperatorIds.add,
378
+ [OperatorIds.divide]: OperatorIds.add,
379
+ });
380
+ tryToAddWrongProp(propositions, wrongEqualNode.toTex());
381
+ }
382
+ //multiply becomes frac
383
+ {
384
+ const wrongEqualNode = nodeByReplacingOperations(answerNode, {
385
+ [OperatorIds.multiply]: OperatorIds.divide,
386
+ });
387
+ tryToAddWrongProp(propositions, wrongEqualNode.toTex());
388
+ }
389
+ //l*r = a becomes l = r
390
+ {
391
+ const leftChild = answerNode.leftChild;
392
+ const wrongEqualNode = new EqualNode(leftChild.leftChild, leftChild.rightChild);
393
+ tryToAddWrongProp(propositions, wrongEqualNode.toTex());
394
+ }
395
+ return shuffleProps(propositions, n);
396
+ };
397
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
398
+ const answerNode = getAnswerNode(identifiers); //!TODO: this call crashes but it's a mystery
399
+ const ansNode = parseLatex(ans);
400
+ return substract(ansNode, answerNode).evaluate() === 0;
401
+ };
402
+ export const equationFromProblem = {
403
+ id: "equationFromProblem",
404
+ label: "Traduire un problème en une équation mathématique",
405
+ isSingleStep: true,
406
+ generator: (nb) => getDistinctQuestions(getEquationFromSentenceExerciseQuestion, nb),
407
+ qcmTimer: 60,
408
+ freeTimer: 60,
409
+ getPropositions,
410
+ isAnswerValid,
411
+ subject: "Mathématiques",
412
+ getQuestionFromIdentifiers,
413
+ answerType: "QCU",
414
+ };
@@ -14,4 +14,5 @@ export * from "./binomialsTrinomialsProposedSolutions.js";
14
14
  export * from "./equationWithDistributivity.js";
15
15
  export * from "./choseOperationToSolveEquation.js";
16
16
  export * from "./factorizeEquation.js";
17
+ export * from "./equationFromProblem.js";
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
@@ -14,3 +14,4 @@ export * from "./binomialsTrinomialsProposedSolutions.js";
14
14
  export * from "./equationWithDistributivity.js";
15
15
  export * from "./choseOperationToSolveEquation.js";
16
16
  export * from "./factorizeEquation.js";
17
+ export * from "./equationFromProblem.js";
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ isAdd: boolean;
6
+ varName: string;
7
+ };
8
+ export declare const factorizeAX2PlusBX: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=factorizeAX2PlusBX.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factorizeAX2PlusBX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAmFF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { primes } from "../../../../math/numbers/integer/primes.js";
4
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
5
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
7
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
8
+ import { random, randomMany } from "../../../../utils/alea/random.js";
9
+ const getInstruction = (identifiers) => {
10
+ const { a, b, isAdd, varName } = identifiers;
11
+ const x = varName;
12
+ return `Laquelle de ces propositions est la forme factorisée de $${a}${x}^2 ${isAdd ? "+" : "-"} ${b}${x}$ ?`;
13
+ };
14
+ const getHint = (identifiers) => {
15
+ const { varName } = identifiers;
16
+ return `$${varName}$ semble être le facteur commun.`;
17
+ };
18
+ const getCorrection = (identifiers) => {
19
+ const { a, b, isAdd, varName } = identifiers;
20
+ const x = varName;
21
+ return `Si on factorise par $${x}$ on obtient :
22
+
23
+ $$
24
+ ${a}${x}^2 ${isAdd ? "+" : "-"} ${b}${x} = ${x}(${a}${x}${isAdd ? "+" : "-"}${b})
25
+ $$
26
+
27
+ `;
28
+ };
29
+ const getPropositions = (n, { answer, ...identifiers }) => {
30
+ const { a, b, isAdd, varName } = identifiers;
31
+ const x = varName;
32
+ const addSub = isAdd ? add : substract;
33
+ const propositions = [];
34
+ addValidProp(propositions, `${x}(${a}${x}${isAdd ? "+" : "-"}${b})`, "tex");
35
+ tryToAddWrongProp(propositions, `(${multiply(a.toTree(), b.toTree()).toTex()})${x}^3`, "tex");
36
+ tryToAddWrongProp(propositions, `(${addSub(a.toTree(), b.toTree()).toTex()})${x}`, "tex");
37
+ tryToAddWrongProp(propositions, `(${a}${x}^2${isAdd ? "+" : "-"}${b}${x})${x}^2`, "tex");
38
+ return shuffleProps(propositions, n);
39
+ };
40
+ const getFactorizeAX2PlusBXQuestion = () => {
41
+ const [a, b] = randomMany(primes, 2);
42
+ const varName = random(["x", "y", "z", "t"]);
43
+ const isAdd = coinFlip();
44
+ return getQuestionFromIdentifiers({ a, b, isAdd, varName });
45
+ };
46
+ const getQuestionFromIdentifiers = (identifiers) => {
47
+ const question = {
48
+ instruction: getInstruction(identifiers),
49
+ keys: [],
50
+ answerFormat: "tex",
51
+ identifiers,
52
+ hint: getHint(identifiers),
53
+ correction: getCorrection(identifiers),
54
+ };
55
+ return question;
56
+ };
57
+ export const factorizeAX2PlusBX = {
58
+ id: "factorizeAX2PlusBX",
59
+ label: "Factoriser $ax^2 + bx$",
60
+ isSingleStep: true,
61
+ generator: (nb) => getDistinctQuestions(() => getFactorizeAX2PlusBXQuestion(), nb, 30),
62
+ qcmTimer: 60,
63
+ freeTimer: 60,
64
+ getPropositions,
65
+ subject: "Mathématiques",
66
+ maxAllowedQuestions: 30,
67
+ getQuestionFromIdentifiers,
68
+ answerType: "QCU",
69
+ hasHintAndCorrection: true,
70
+ };
@@ -6,4 +6,5 @@ export * from "./factorizeCanonicalForm.js";
6
6
  export * from "./factorizeCanonicalFormWithSqrt.js";
7
7
  export * from "./factoType2.js";
8
8
  export * from "./factoByX.js";
9
+ export * from "./factorizeAX2PlusBX.js";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC"}
@@ -6,3 +6,4 @@ export * from "./factorizeCanonicalForm.js";
6
6
  export * from "./factorizeCanonicalFormWithSqrt.js";
7
7
  export * from "./factoType2.js";
8
8
  export * from "./factoByX.js";
9
+ export * from "./factorizeAX2PlusBX.js";
@@ -5,5 +5,7 @@ export * from "./inequations/index.js";
5
5
  export * from "./simplifying/index.js";
6
6
  export * from "./systems/index.js";
7
7
  export * from "./isolate/index.js";
8
+ export * from "./writing/index.js";
8
9
  export * from "./formulas/index.js";
10
+ export * from "./ordering/index.js";
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/calculLitteral/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/calculLitteral/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
@@ -5,4 +5,6 @@ export * from "./inequations/index.js";
5
5
  export * from "./simplifying/index.js";
6
6
  export * from "./systems/index.js";
7
7
  export * from "./isolate/index.js";
8
+ export * from "./writing/index.js";
8
9
  export * from "./formulas/index.js";
10
+ export * from "./ordering/index.js";
@@ -1,2 +1,3 @@
1
- export {};
1
+ export * from "./isolateXInInvXPlusInvYEqualsInvU.js";
2
+ export * from "./isolateUInInvXPlusInvYEqualsInvU.js";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/isolate/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/isolate/index.ts"],"names":[],"mappings":"AACA,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC"}
@@ -1,2 +1,3 @@
1
- export {};
2
1
  // export * from "./isolateVariable.js";
2
+ export * from "./isolateXInInvXPlusInvYEqualsInvU.js";
3
+ export * from "./isolateUInInvXPlusInvYEqualsInvU.js";
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ varNames: string[];
4
+ };
5
+ export declare const isolateUInInvXPlusInvYEqualsInvU: Exercise<Identifiers>;
6
+ export declare const isolateRInInvR1PlusInvR2EqualsInvR: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=isolateUInInvXPlusInvYEqualsInvU.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isolateUInInvXPlusInvYEqualsInvU.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA2FF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAmBlE,CAAC;AAUF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,WAAW,CAoBpE,CAAC"}