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
@@ -1,31 +1,9 @@
1
- import { Exercise } from '../../../../exercises/exercise.js';
2
- type UnaryOperator = {
3
- outputName: "Opposite" | "Inverse";
4
- arity: 1;
5
- };
6
- type BinaryOperator = {
7
- outputName: "Sum" | "Difference" | "Product" | "Quotient";
8
- arity: 2;
9
- };
10
- type UnaryOperation = {
11
- operator: UnaryOperator;
12
- operands: {
13
- a: string;
14
- };
15
- };
16
- type BinaryOperation = {
17
- operator: BinaryOperator;
18
- operands: {
19
- a: number;
20
- b: string;
21
- } | {
22
- a: string;
23
- b: number;
24
- };
25
- };
26
- type Operation = UnaryOperation | BinaryOperation;
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Operator = "opposite" | "inverse" | "add" | "subtract" | "multiply" | "divide";
27
3
  type Identifiers = {
28
- operation: Operation;
4
+ operatorName: Operator;
5
+ a: number | string;
6
+ b: number | string | undefined;
29
7
  isUsingFrenchFactorNouns: boolean;
30
8
  };
31
9
  export declare const writeLitExprFromFrench: Exercise<Identifiers>;
@@ -1 +1 @@
1
- {"version":3,"file":"writeLitExpFromFrenchExp.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AA6BrC,KAAK,aAAa,GAAI;IACpB,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;IACnC,KAAK,EAAG,CAAC,CAAA;CACV,CAAC;AACF,KAAK,cAAc,GAAG;IACpB,UAAU,EAAE,KAAK,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,CAAC;IAC1D,KAAK,EAAG,CAAC,CAAA;CACV,CAAC;AAcF,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE;QAAE,CAAC,EAAG,MAAM,CAAA;KAAE,CAAC;CAC1B,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE;QAAE,CAAC,EAAG,MAAM,CAAC;QAAC,CAAC,EAAG,MAAM,CAAA;KAAE,GAAI;QAAC,CAAC,EAAG,MAAM,CAAC;QAAC,CAAC,EAAG,MAAM,CAAA;KAAE,CAAC;CACnE,CAAA;AAED,KAAK,SAAS,GAAG,cAAc,GAAG,eAAe,CAAC;AAIlD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,wBAAwB,EAAE,OAAO,CAAC;CACnC,CAAC;AA8WF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAgBxD,CAAC"}
1
+ {"version":3,"file":"writeLitExpFromFrenchExp.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAmCrC,KAAK,QAAQ,GACT,UAAU,GACV,SAAS,GACT,KAAK,GACL,UAAU,GACV,UAAU,GACV,QAAQ,CAAC;AAoEb,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,QAAQ,CAAC;IACvB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC;CACnC,CAAC;AAyNF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAkBxD,CAAC"}
@@ -1,62 +1,18 @@
1
- import { addValidProp, shuffleProps, tryToAddWrongProp, } from '../../../../exercises/exercise.js';
2
- import { getDistinctQuestions } from '../../../../exercises/utils/getDistinctQuestions.js';
3
- import { randint } from '../../../../math/utils/random/randint.js';
4
- import { opposite } from '../../../../tree/nodes/functions/oppositeNode.js';
5
- import { add } from '../../../../tree/nodes/operators/addNode.js';
6
- import { divide } from '../../../../tree/nodes/operators/divideNode.js';
7
- import { frac } from '../../../../tree/nodes/operators/fractionNode.js';
8
- import { multiply } from '../../../../tree/nodes/operators/multiplyNode.js';
9
- import { substract } from '../../../../tree/nodes/operators/substractNode.js';
10
- import { parseAlgebraic } from '../../../../tree/parsers/latexParser.js';
11
- import { coinFlip } from '../../../../utils/alea/coinFlip.js';
12
- import { random } from '../../../../utils/alea/random.js';
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../math/utils/random/randint.js";
4
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
5
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
6
+ import { divide } from "../../../../tree/nodes/operators/divideNode.js";
7
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
8
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
9
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
10
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
11
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
12
+ import { random } from "../../../../utils/alea/random.js";
13
13
  import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
14
- const capitalize = (str) => {
15
- if (!str)
16
- return ''; // Handle empty strings
17
- return str.charAt(0).toUpperCase() + str.slice(1);
18
- };
19
- const arr_operator = [
20
- { outputName: "Opposite", arity: 1 },
21
- { outputName: "Inverse", arity: 1 },
22
- { outputName: "Sum", arity: 2 },
23
- { outputName: "Difference", arity: 2 },
24
- { outputName: "Product", arity: 2 },
25
- { outputName: "Quotient", arity: 2 },
26
- ];
27
- const getNodeFromOperation = (operation) => {
28
- let outNode;
29
- if (!("b" in operation.operands)) {
30
- const { a } = operation.operands;
31
- switch (operation.operator.outputName) {
32
- case "Opposite":
33
- outNode = opposite(a);
34
- break;
35
- case "Inverse":
36
- outNode = frac(1, a);
37
- break;
38
- }
39
- }
40
- else {
41
- const { a, b } = operation.operands;
42
- switch (operation.operator.outputName) {
43
- case "Sum":
44
- outNode = add(a, b);
45
- break;
46
- case "Difference":
47
- outNode = substract(a, b);
48
- break;
49
- case "Product":
50
- outNode = multiply(a, b);
51
- break;
52
- case "Quotient":
53
- outNode = frac(a, b);
54
- break;
55
- }
56
- }
57
- return outNode;
58
- };
59
- const dict_texFactor_to_frenchFactor = {
14
+ import { capitalize } from "../../../../utils/strings/capitalize.js";
15
+ const dictTexFactorToFrenchFactor = {
60
16
  [frac(1, 2).toTex()]: "la moitié",
61
17
  [frac(1, 3).toTex()]: "le tiers",
62
18
  [frac(1, 4).toTex()]: "le quart",
@@ -69,253 +25,234 @@ const dict_texFactor_to_frenchFactor = {
69
25
  [(4).frenchify()]: "le quadruple",
70
26
  [(5).frenchify()]: "le quintuple",
71
27
  };
72
- const buildFactorFrenchString = (tex__factor) => {
73
- const str__french = dict_texFactor_to_frenchFactor[tex__factor];
74
- return str__french;
75
- };
76
- const buildFrenchString = (identifiers) => {
77
- const { operation, isUsingFrenchFactorNouns } = identifiers;
78
- let str__french = "";
79
- if (!("b" in operation.operands)) {
80
- const { a } = operation.operands;
81
- switch (operation.operator.outputName) {
82
- case "Opposite":
83
- str__french = `L'opposé de $ ${a} $`;
84
- break;
85
- case "Inverse":
86
- str__french = `L'inverse de $ ${a} $`;
87
- break;
88
- }
89
- }
90
- else {
91
- const { a, b } = operation.operands;
92
- switch (operation.operator.outputName) {
93
- case "Sum":
94
- str__french = `La somme de $ ${a} $ et de $ ${b} $`;
95
- break;
96
- case "Difference":
97
- str__french = `La différence entre $ ${a} $ et $ ${b} $`;
98
- break;
99
- case "Product":
100
- {
101
- str__french = `Le produit de $ ${a} $ par $ ${b} $`;
102
- if (typeof b == 'string' && isUsingFrenchFactorNouns) {
103
- //"le double de x"
104
- const str__a__french = buildFactorFrenchString(a.frenchify());
105
- if (str__a__french) {
106
- str__french = `${str__a__french} de $ ${b} $`;
107
- }
108
- }
109
- }
110
- break;
111
- case "Quotient":
112
- {
113
- str__french = `Le quotient de $ ${a} $ par $ ${b} $`;
114
- if (typeof a == 'string' && isUsingFrenchFactorNouns) {
115
- //"le tiers de x"
116
- const oneOverB = frac(1, b);
117
- const str__oneOverB__french = buildFactorFrenchString(oneOverB.toTex());
118
- if (str__oneOverB__french) {
119
- str__french = `${str__oneOverB__french} de $ ${a} $`;
120
- }
121
- }
122
- }
123
- break;
28
+ const arrOperator = [
29
+ "opposite",
30
+ "inverse",
31
+ "add",
32
+ "subtract",
33
+ "multiply",
34
+ "divide",
35
+ ];
36
+ class ExpressionConstructor {
37
+ static fromIdentifiers(identifiers) {
38
+ const { operatorName, a, b, isUsingFrenchFactorNouns } = identifiers;
39
+ switch (operatorName) {
40
+ case "opposite":
41
+ return {
42
+ node: opposite(a),
43
+ str__french: `L'opposé de $ ${a} $`,
44
+ };
45
+ case "inverse":
46
+ return {
47
+ node: frac(1, a),
48
+ str__french: `L'inverse de $ ${a} $`,
49
+ };
50
+ case "add":
51
+ return {
52
+ node: add(a, b),
53
+ str__french: `La somme de $ ${a} $ et de $ ${b} $`,
54
+ };
55
+ case "subtract":
56
+ return {
57
+ node: substract(a, b),
58
+ str__french: `La différence entre $ ${a} $ et $ ${b} $`,
59
+ };
60
+ case "multiply":
61
+ return {
62
+ node: multiply(a, b),
63
+ str__french: typeof b === "string" && isUsingFrenchFactorNouns
64
+ ? dictTexFactorToFrenchFactor[a.frenchify()]
65
+ ? `${dictTexFactorToFrenchFactor[a.frenchify()]} de $ ${b} $`
66
+ : `Le produit de $ ${a} $ par $ ${b} $`
67
+ : `Le produit de $ ${a} $ par $ ${b} $`,
68
+ };
69
+ case "divide":
70
+ return {
71
+ node: frac(a, b),
72
+ str__french: typeof a === "string" && isUsingFrenchFactorNouns
73
+ ? dictTexFactorToFrenchFactor[frac(1, b).toTex()]
74
+ ? `${dictTexFactorToFrenchFactor[frac(1, b).toTex()]} de $ ${a} $`
75
+ : `Le quotient de $ ${a} $ par $ ${b} $`
76
+ : `Le quotient de $ ${a} $ par $ ${b} $`,
77
+ };
124
78
  }
125
79
  }
126
- return str__french;
127
- };
128
- const getPropositions = (n, { answer, operation, isUsingFrenchFactorNouns }) => {
80
+ }
81
+ const getPropositions = (n, { answer, operatorName, a, b }) => {
129
82
  const propositions = [];
130
- if (!("b" in operation.operands)) {
131
- const { a } = operation.operands;
132
- switch (operation.operator.outputName) {
133
- case "Opposite":
83
+ switch (operatorName) {
84
+ case "opposite":
85
+ addValidProp(propositions, answer);
86
+ tryToAddWrongProp(propositions, add(a, 1).toTex());
87
+ tryToAddWrongProp(propositions, frac(1, a).toTex());
88
+ tryToAddWrongProp(propositions, substract(1, a).toTex());
89
+ break;
90
+ case "inverse":
91
+ if (coinFlip()) {
134
92
  addValidProp(propositions, answer);
135
- tryToAddWrongProp(propositions, add(a, 1).toTex());
136
- tryToAddWrongProp(propositions, frac(1, a).toTex());
137
- tryToAddWrongProp(propositions, substract(1, a).toTex());
138
- break;
139
- case "Inverse":
140
- if (coinFlip()) {
141
- addValidProp(propositions, answer);
142
- }
143
- else {
144
- addValidProp(propositions, divide(1, a).toTex());
145
- }
146
- tryToAddWrongProp(propositions, add(a, 1).toTex());
147
- tryToAddWrongProp(propositions, opposite(a).toTex());
148
- tryToAddWrongProp(propositions, frac(0, a).toTex());
149
- break;
150
- }
151
- }
152
- else {
153
- const { a, b } = operation.operands;
154
- switch (operation.operator.outputName) {
155
- case "Sum":
156
- if (coinFlip()) {
157
- addValidProp(propositions, answer);
158
- }
159
- else {
160
- addValidProp(propositions, add(b, a).toTex());
161
- }
162
- tryToAddWrongProp(propositions, multiply(a, b).toTex());
163
- tryToAddWrongProp(propositions, substract(a, b).toTex());
164
- tryToAddWrongProp(propositions, frac(a, b).toTex());
165
- break;
166
- case "Difference":
93
+ }
94
+ else {
95
+ addValidProp(propositions, divide(1, a).toTex());
96
+ }
97
+ tryToAddWrongProp(propositions, add(a, 1).toTex());
98
+ tryToAddWrongProp(propositions, opposite(a).toTex());
99
+ tryToAddWrongProp(propositions, frac(0, a).toTex());
100
+ break;
101
+ case "add":
102
+ if (coinFlip()) {
167
103
  addValidProp(propositions, answer);
168
- tryToAddWrongProp(propositions, substract(b, a).toTex());
169
- tryToAddWrongProp(propositions, frac(a, b).toTex());
170
- tryToAddWrongProp(propositions, frac(b, a).toTex());
171
- break;
172
- case "Product":
173
- if (coinFlip()) {
174
- addValidProp(propositions, answer);
175
- }
176
- else {
177
- addValidProp(propositions, multiply(b, a).toTex());
178
- }
179
- tryToAddWrongProp(propositions, frac(a, b).toTex());
180
- tryToAddWrongProp(propositions, substract(a, b).toTex());
181
- tryToAddWrongProp(propositions, add(a, b).toTex());
182
- break;
183
- case "Quotient":
184
- if (coinFlip()) {
185
- addValidProp(propositions, answer);
186
- }
187
- else {
188
- addValidProp(propositions, divide(a, b).toTex());
189
- }
190
- tryToAddWrongProp(propositions, frac(b, a).toTex());
191
- tryToAddWrongProp(propositions, substract(a, b).toTex());
192
- tryToAddWrongProp(propositions, multiply(a, b).toTex());
193
- break;
194
- }
104
+ }
105
+ else {
106
+ addValidProp(propositions, add(b, a).toTex());
107
+ }
108
+ tryToAddWrongProp(propositions, multiply(a, b).toTex());
109
+ tryToAddWrongProp(propositions, substract(a, b).toTex());
110
+ tryToAddWrongProp(propositions, frac(a, b).toTex());
111
+ break;
112
+ case "subtract":
113
+ addValidProp(propositions, answer);
114
+ tryToAddWrongProp(propositions, substract(b, a).toTex());
115
+ tryToAddWrongProp(propositions, frac(a, b).toTex());
116
+ tryToAddWrongProp(propositions, frac(b, a).toTex());
117
+ break;
118
+ case "multiply":
119
+ if (coinFlip()) {
120
+ addValidProp(propositions, answer);
121
+ }
122
+ else {
123
+ addValidProp(propositions, multiply(b, a).toTex());
124
+ }
125
+ tryToAddWrongProp(propositions, frac(a, b).toTex());
126
+ tryToAddWrongProp(propositions, substract(a, b).toTex());
127
+ tryToAddWrongProp(propositions, add(a, b).toTex());
128
+ break;
129
+ case "divide":
130
+ if (coinFlip()) {
131
+ addValidProp(propositions, answer);
132
+ }
133
+ else {
134
+ addValidProp(propositions, divide(a, b).toTex());
135
+ }
136
+ tryToAddWrongProp(propositions, frac(b, a).toTex());
137
+ tryToAddWrongProp(propositions, substract(a, b).toTex());
138
+ tryToAddWrongProp(propositions, multiply(a, b).toTex());
139
+ break;
195
140
  }
196
141
  return shuffleProps(propositions, n);
197
142
  };
198
143
  const getAnswer = (identifiers) => {
199
- const { operation, isUsingFrenchFactorNouns } = identifiers;
200
- const node = getNodeFromOperation(operation).simplify();
144
+ const node = ExpressionConstructor.fromIdentifiers(identifiers).node.simplify();
201
145
  return node.toTex();
202
146
  };
203
147
  const getInstruction = (identifiers) => {
204
- const statementString = buildFrenchString(identifiers);
148
+ const statementString = ExpressionConstructor.fromIdentifiers(identifiers).str__french;
205
149
  return `Écrire l'expression littérale pour :
206
150
 
207
151
  ${statementString}
208
152
  `;
209
153
  };
210
154
  const getHint = (identifiers) => {
211
- const { operation } = identifiers;
212
- switch (operation.operator.outputName) {
213
- case "Opposite":
214
- //return `L'opposé de $ ${"a".toTree().toTex()} $, c'est $ ${(0).frenchify()} $ moins $ ${"a".toTree().toTex()} $ (l'0pposé)`
215
- return `L'opposé d'un nombre $x$ est $-x$.`;
216
- case "Inverse":
217
- //return `L'inverse de $ ${"a".toTree().toTex()} $, c'est $ ${(1).frenchify()} $ sur $ ${"a".toTree().toTex()} $ (l'1verse)`
218
- return `L'inverse d'un nombre $x$ (différent de $0$) est $\\frac{1}{x}$.`;
219
- case "Sum":
220
- return `La somme est le résultat de l'addition de deux nombres ($ + $).`;
221
- case "Difference":
222
- return `La différence est le résultat de la soustraction d'un nombre à un autre ($ - $).`;
223
- case "Product":
224
- return `Le produit est le résultat de la multiplication de deux nombres ($ \\times $).`;
225
- case "Quotient":
226
- return `Le quotient est le résultat de la division d'un nombre par un autre ($ \\div $).`;
155
+ const { operatorName } = identifiers;
156
+ switch (operatorName) {
157
+ case "opposite":
158
+ return `La somme d'un nombre et de son opposé donne $0$.`;
159
+ case "inverse":
160
+ return `L'inverse de $8$ est $0.25$.`;
161
+ case "add":
162
+ return `La somme de $8457$ et de $6567$ est $${8457 + 6567}$.`;
163
+ case "subtract":
164
+ return `La différence entre $8457$ est $6567$ est $${8457 - 6567}$.`;
165
+ case "multiply":
166
+ return `Le produit de $8457$ par $6567$ est $${8457 * 6567}$ .`;
167
+ case "divide":
168
+ return `Le quotient de $200$ par $8$ est $25$.`;
227
169
  }
228
170
  };
229
171
  const getCorrection = (identifiers) => {
230
- const statementString = buildFrenchString(identifiers);
172
+ const expression = ExpressionConstructor.fromIdentifiers(identifiers);
173
+ const statementString = expression.str__french;
231
174
  let outString = `${capitalize(statementString)} est $ ${getAnswer(identifiers)} $.`;
232
175
  //explain rewriting if needed
233
- const { operation, isUsingFrenchFactorNouns } = identifiers;
234
- const node__raw = getNodeFromOperation(operation);
235
- const node__refined = node__raw.simplify();
236
- const tex__raw = node__raw.toTex({
176
+ const nodeRaw = expression.node;
177
+ const nodeRefined = nodeRaw.simplify();
178
+ const texRaw = nodeRaw.toTex({
237
179
  allowDoubleMinus: true,
238
180
  forceTimesSign: true,
239
181
  forceParenthesis: true,
240
182
  forceNoSimplification: true,
241
183
  allowMinusAnywhereInFraction: true,
242
184
  });
243
- const tex__refined = node__refined.toTex();
244
- if (tex__raw != tex__refined) {
185
+ const texRefined = nodeRefined.toTex();
186
+ if (texRaw !== texRefined) {
245
187
  outString += `
246
188
 
247
189
  En effet,
190
+
248
191
  $$
249
- ${tex__raw}
192
+ ${texRaw}
250
193
  $$
194
+
251
195
  peut se réécrire :
196
+
252
197
  $$
253
- ${tex__refined}
198
+ ${texRefined}
254
199
  $$
255
200
  `;
256
201
  }
257
202
  return outString;
258
203
  };
259
204
  const getKeys = (identifiers) => {
260
- const { operation } = identifiers;
261
- const arr_operands = [operation.operands.a];
262
- if ("b" in operation.operands) {
263
- arr_operands.push(operation.operands.b);
205
+ const { a, b } = identifiers;
206
+ const operands = [a];
207
+ if (b) {
208
+ operands.push(b);
264
209
  }
265
- return arr_operands.filter(elt => typeof elt === "string").map(elt => elt);
210
+ return operands
211
+ .filter((elt) => typeof elt === "string")
212
+ .map((elt) => elt);
266
213
  };
267
214
  const isAnswerValid = (ans, { answer }) => {
268
215
  //return LitExpVEA(ans, answer);
269
216
  try {
270
217
  const parsed = parseAlgebraic(ans);
271
- return (parsed
272
- .simplify()
273
- .toTex() === answer);
218
+ return parsed.simplify().toTex() === answer;
274
219
  }
275
220
  catch (err) {
276
221
  return handleVEAError(err);
277
222
  }
278
223
  };
279
- const getWriteLitExprFromFrenchQuestion = (ops) => {
280
- const operator = random(arr_operator);
224
+ const getWriteLitExprFromFrenchQuestion = () => {
225
+ const operatorName = random(arrOperator);
281
226
  const isUsingFrenchFactorNouns = coinFlip();
282
- const str__var = random(["x", "y", "z", "t"]);
227
+ const strVar = random(["x", "y", "z", "t"]);
283
228
  let a = "";
284
229
  let b = undefined;
285
230
  if (coinFlip()) {
286
- a = str__var;
287
- if (operator.outputName === "Quotient" && isUsingFrenchFactorNouns) {
288
- const arr_fr = [2, 3, 4, 5, 10, 100, 1_000];
289
- b = random([randint(-10, 21, [-1, 0, 1]), random(arr_fr)]);
231
+ a = strVar;
232
+ if (operatorName === "divide" && isUsingFrenchFactorNouns) {
233
+ const arrFr = [2, 3, 4, 5, 10, 100, 1_000];
234
+ b = random(arrFr);
290
235
  }
291
236
  else {
292
237
  b = randint(-10, 11, [-1, 0, 1]);
293
238
  }
294
239
  }
295
240
  else {
296
- b = str__var;
297
- if (operator.outputName === "Product" && isUsingFrenchFactorNouns) {
298
- const arr_fr = [2, 3, 4, 5];
299
- a = random([randint(-10, 21, [-1, 0, 1]), random(arr_fr)]);
241
+ b = strVar;
242
+ if (operatorName === "multiply" && isUsingFrenchFactorNouns) {
243
+ const arrFr = [2, 3, 4, 5];
244
+ a = random(arrFr);
300
245
  }
301
246
  else {
302
247
  a = randint(-10, 11, [-1, 0, 1]);
303
248
  }
304
249
  }
305
- let operands;
306
- switch (operator.arity) {
307
- case 1:
308
- operands = { a };
309
- break;
310
- case 2:
311
- operands = { a, b };
312
- break;
313
- }
314
- const operation = {
315
- operator: operator,
316
- operands: operands,
250
+ const identifiers = {
251
+ operatorName,
252
+ a,
253
+ b,
254
+ isUsingFrenchFactorNouns,
317
255
  };
318
- const identifiers = { operation, isUsingFrenchFactorNouns };
319
256
  return getQuestionFromIdentifiers(identifiers);
320
257
  };
321
258
  const getQuestionFromIdentifiers = (identifiers) => {
@@ -323,15 +260,15 @@ const getQuestionFromIdentifiers = (identifiers) => {
323
260
  answer: getAnswer(identifiers),
324
261
  instruction: getInstruction(identifiers),
325
262
  keys: getKeys(identifiers),
326
- answerFormat: 'tex',
263
+ answerFormat: "tex",
327
264
  identifiers,
328
265
  hint: getHint(identifiers),
329
- correction: getCorrection(identifiers)
266
+ correction: getCorrection(identifiers),
330
267
  };
331
268
  };
332
269
  export const writeLitExprFromFrench = {
333
- id: 'writeLitExprFromFrench',
334
- label: "Ecrire une expression littérale à partir d'une expression en français",
270
+ id: "writeLitExprFromFrench",
271
+ label: "Écrire une expression littérale à partir d'une expression en français",
335
272
  isSingleStep: true,
336
273
  generator: (nb, opts) => getDistinctQuestions(() => getWriteLitExprFromFrenchQuestion(opts), nb),
337
274
  qcmTimer: 60,
@@ -344,5 +281,5 @@ export const writeLitExprFromFrench = {
344
281
  getCorrection,
345
282
  getAnswer,
346
283
  getQuestionFromIdentifiers,
347
- hasHintAndCorrection: true
284
+ hasHintAndCorrection: true,
348
285
  };
@@ -6,4 +6,8 @@ export * from "./volumeCapacityConversion.js";
6
6
  export * from "./volumeConversion.js";
7
7
  export * from "./hoursToDecimal.js";
8
8
  export * from "./hoursToSecond.js";
9
+ export * from "./minutesToHours.js";
10
+ export * from "./kmPerMinToKmPerHourConversion.js";
11
+ export * from "./secondsToHours.js";
12
+ export * from "./prefixToNumber.js";
9
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
@@ -6,3 +6,7 @@ export * from "./volumeCapacityConversion.js";
6
6
  export * from "./volumeConversion.js";
7
7
  export * from "./hoursToDecimal.js";
8
8
  export * from "./hoursToSecond.js";
9
+ export * from "./minutesToHours.js";
10
+ export * from "./kmPerMinToKmPerHourConversion.js";
11
+ export * from "./secondsToHours.js";
12
+ export * from "./prefixToNumber.js";
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ distance: number;
4
+ minutes: number;
5
+ };
6
+ export declare const kmPerMinToKmPerHourConversion: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=kmPerMinToKmPerHourConversion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kmPerMinToKmPerHourConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/kmPerMinToKmPerHourConversion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAkHF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAiB/D,CAAC"}