math-exercises 3.0.124 → 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 (351) hide show
  1. package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts +1 -1
  2. package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +20 -14
  4. package/lib/exercises/math/calcul/fractions/fractionsMix.js +1 -1
  5. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +61 -1
  7. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +1 -0
  8. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/mentalCaluls/index.js +1 -0
  10. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +15 -0
  11. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -0
  12. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +217 -0
  13. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts +16 -0
  14. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -0
  15. package/lib/exercises/math/calcul/ordering/compareA10N.js +327 -0
  16. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts +8 -0
  17. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -0
  18. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +221 -0
  19. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +9 -0
  20. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -0
  21. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +135 -0
  22. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +29 -0
  23. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -0
  24. package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +367 -0
  25. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts +12 -0
  26. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts.map +1 -0
  27. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.js +164 -0
  28. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts +9 -0
  29. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -0
  30. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +140 -0
  31. package/lib/exercises/math/calcul/ordering/index.d.ts +6 -0
  32. package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/ordering/index.js +6 -0
  34. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts +9 -0
  35. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -0
  36. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +84 -0
  37. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts +8 -0
  38. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -0
  39. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +90 -0
  40. package/lib/exercises/math/calcul/rounding/index.d.ts +2 -0
  41. package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
  42. package/lib/exercises/math/calcul/rounding/index.js +2 -0
  43. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts +13 -0
  44. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -0
  45. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +414 -0
  46. package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
  47. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  48. package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
  49. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts +10 -0
  50. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts.map +1 -0
  51. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.js +70 -0
  52. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
  53. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  54. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
  55. package/lib/exercises/math/calculLitteral/index.d.ts +2 -0
  56. package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
  57. package/lib/exercises/math/calculLitteral/index.js +2 -0
  58. package/lib/exercises/math/calculLitteral/isolate/index.d.ts +2 -1
  59. package/lib/exercises/math/calculLitteral/isolate/index.d.ts.map +1 -1
  60. package/lib/exercises/math/calculLitteral/isolate/index.js +2 -1
  61. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts +8 -0
  62. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
  63. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +107 -0
  64. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts +7 -0
  65. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
  66. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.js +80 -0
  67. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts +10 -0
  68. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -0
  69. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +182 -0
  70. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts +9 -0
  71. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -0
  72. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +144 -0
  73. package/lib/exercises/math/calculLitteral/ordering/index.d.ts +3 -0
  74. package/lib/exercises/math/calculLitteral/ordering/index.d.ts.map +1 -0
  75. package/lib/exercises/math/calculLitteral/ordering/index.js +2 -0
  76. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts +11 -0
  77. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -0
  78. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +120 -0
  79. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts +8 -0
  80. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts.map +1 -0
  81. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.js +67 -0
  82. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts +11 -0
  83. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts.map +1 -0
  84. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.js +114 -0
  85. package/lib/exercises/math/calculLitteral/simplifying/index.d.ts +5 -0
  86. package/lib/exercises/math/calculLitteral/simplifying/index.d.ts.map +1 -1
  87. package/lib/exercises/math/calculLitteral/simplifying/index.js +5 -0
  88. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts +13 -0
  89. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts.map +1 -0
  90. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.js +125 -0
  91. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts +14 -0
  92. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts.map +1 -0
  93. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.js +148 -0
  94. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +5 -27
  95. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
  96. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +178 -241
  97. package/lib/exercises/math/conversion/index.d.ts +4 -0
  98. package/lib/exercises/math/conversion/index.d.ts.map +1 -1
  99. package/lib/exercises/math/conversion/index.js +4 -0
  100. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +8 -0
  101. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -0
  102. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +98 -0
  103. package/lib/exercises/math/conversion/minutesToHours.d.ts +10 -0
  104. package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -0
  105. package/lib/exercises/math/conversion/minutesToHours.js +150 -0
  106. package/lib/exercises/math/conversion/prefixToNumber.d.ts +15 -0
  107. package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -0
  108. package/lib/exercises/math/conversion/prefixToNumber.js +233 -0
  109. package/lib/exercises/math/conversion/secondsToHours.d.ts +10 -0
  110. package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -0
  111. package/lib/exercises/math/conversion/secondsToHours.js +150 -0
  112. package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
  113. package/lib/exercises/math/conversion/volumeConversion.js +7 -1
  114. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +50 -0
  115. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -0
  116. package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +517 -0
  117. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts +7 -0
  118. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts.map +1 -0
  119. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.js +223 -0
  120. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts +10 -0
  121. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -0
  122. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +139 -0
  123. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts +8 -0
  124. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -0
  125. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +133 -0
  126. package/lib/exercises/math/dataRepresentations/graphReading.d.ts +8 -0
  127. package/lib/exercises/math/dataRepresentations/graphReading.d.ts.map +1 -0
  128. package/lib/exercises/math/dataRepresentations/graphReading.js +136 -0
  129. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts +18 -0
  130. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -0
  131. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +228 -0
  132. package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts +8 -0
  133. package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts.map +1 -0
  134. package/lib/exercises/math/dataRepresentations/halfPieChartReading.js +213 -0
  135. package/lib/exercises/math/dataRepresentations/histogramReading.d.ts +9 -0
  136. package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -0
  137. package/lib/exercises/math/dataRepresentations/histogramReading.js +163 -0
  138. package/lib/exercises/math/dataRepresentations/index.d.ts +10 -0
  139. package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
  140. package/lib/exercises/math/dataRepresentations/index.js +10 -0
  141. package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts +9 -0
  142. package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -0
  143. package/lib/exercises/math/dataRepresentations/plausibleGraph.js +145 -0
  144. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts +9 -0
  145. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts.map +1 -0
  146. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.js +308 -0
  147. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
  148. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +10 -5
  149. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts +8 -0
  150. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -0
  151. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +103 -0
  152. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts +8 -0
  153. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -0
  154. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +100 -0
  155. package/lib/exercises/math/functions/affines/drawAffineFromLitExp.js +5 -5
  156. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts +16 -0
  157. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -0
  158. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +215 -0
  159. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts +13 -0
  160. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -0
  161. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +206 -0
  162. package/lib/exercises/math/functions/affines/index.d.ts +7 -0
  163. package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
  164. package/lib/exercises/math/functions/affines/index.js +7 -0
  165. package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts +20 -0
  166. package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts.map +1 -0
  167. package/lib/exercises/math/functions/affines/recognizeExprAffine.js +284 -0
  168. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +13 -0
  169. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -0
  170. package/lib/exercises/math/functions/affines/representationOfAffine.js +184 -0
  171. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts +14 -0
  172. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -0
  173. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +216 -0
  174. package/lib/exercises/math/functions/basics/findZeroesProductQuotient.d.ts.map +1 -1
  175. package/lib/exercises/math/functions/basics/findZeroesProductQuotient.js +29 -2
  176. package/lib/exercises/math/functions/basics/index.d.ts +1 -0
  177. package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
  178. package/lib/exercises/math/functions/basics/index.js +1 -0
  179. package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
  180. package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +72 -61
  181. package/lib/exercises/math/functions/composition/functionComposition.d.ts +8 -0
  182. package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -0
  183. package/lib/exercises/math/functions/composition/functionComposition.js +238 -0
  184. package/lib/exercises/math/functions/composition/index.d.ts +2 -0
  185. package/lib/exercises/math/functions/composition/index.d.ts.map +1 -0
  186. package/lib/exercises/math/functions/composition/index.js +1 -0
  187. package/lib/exercises/math/functions/index.d.ts +1 -0
  188. package/lib/exercises/math/functions/index.d.ts.map +1 -1
  189. package/lib/exercises/math/functions/index.js +1 -0
  190. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
  191. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +41 -16
  192. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
  193. package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +3 -2
  194. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts +1 -0
  195. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -1
  196. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +21 -13
  197. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts +23 -0
  198. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -0
  199. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +448 -0
  200. package/lib/exercises/math/geometry/angles/index.js +2 -0
  201. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts +23 -0
  202. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts.map +1 -0
  203. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.js +402 -0
  204. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +9 -6
  205. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
  206. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +140 -60
  207. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +1 -1
  208. package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
  209. package/lib/exercises/math/geometry/perimeters/circleCircumference.js +15 -7
  210. package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
  211. package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +5 -3
  212. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
  213. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +121 -104
  214. package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -1
  215. package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +3 -2
  216. package/lib/exercises/math/percent/evolutions/evolutionToCM.js +2 -2
  217. package/lib/exercises/math/percent/findProportion.d.ts +6 -1
  218. package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
  219. package/lib/exercises/math/percent/findProportion.js +162 -45
  220. package/lib/exercises/math/powers/calculateNegativePower.d.ts +5 -1
  221. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  222. package/lib/exercises/math/powers/calculateNegativePower.js +93 -29
  223. package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
  224. package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
  225. package/lib/exercises/math/probaStat/basicProbas/index.js +1 -0
  226. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts +0 -1
  227. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
  228. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +42 -80
  229. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts +9 -0
  230. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -0
  231. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +217 -0
  232. package/lib/exercises/math/probaStat/index.d.ts +2 -0
  233. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  234. package/lib/exercises/math/probaStat/index.js +2 -0
  235. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +30 -0
  236. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -0
  237. package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +548 -0
  238. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  239. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +10 -2
  240. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  241. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +2 -1
  242. package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
  243. package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
  244. package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
  245. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts +9 -0
  246. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -0
  247. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +90 -0
  248. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts +10 -0
  249. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -0
  250. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +151 -0
  251. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts +4 -1
  252. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  253. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +46 -27
  254. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
  255. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +14 -2
  256. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts +1 -0
  257. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
  258. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +43 -19
  259. package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -1
  260. package/lib/exercises/math/sequences/sequenceEvaluation.js +18 -1
  261. package/lib/exercises/pc/chemicalReactions/chemicalEquations.d.ts.map +1 -1
  262. package/lib/exercises/pc/chemicalReactions/chemicalEquations.js +17 -2
  263. package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts +7 -0
  264. package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts.map +1 -0
  265. package/lib/exercises/pc/electricity/calculateUEqualsRI.js +73 -0
  266. package/lib/exercises/pc/electricity/index.d.ts +1 -0
  267. package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
  268. package/lib/exercises/pc/electricity/index.js +1 -0
  269. package/lib/exercises/pc/index.d.ts +1 -0
  270. package/lib/exercises/pc/index.d.ts.map +1 -1
  271. package/lib/exercises/pc/index.js +1 -0
  272. package/lib/exercises/pc/mole/molarMass.d.ts.map +1 -1
  273. package/lib/exercises/pc/mole/molarMass.js +7 -1
  274. package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
  275. package/lib/exercises/pc/moleculeFormula.js +4 -3
  276. package/lib/exercises/pc/motion/averageSpeed.d.ts +9 -4
  277. package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
  278. package/lib/exercises/pc/motion/averageSpeed.js +132 -61
  279. package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -1
  280. package/lib/exercises/pc/motion/averageSpeedCalculation.js +10 -4
  281. package/lib/exercises/pc/optics/index.d.ts +2 -0
  282. package/lib/exercises/pc/optics/index.d.ts.map +1 -0
  283. package/lib/exercises/pc/optics/index.js +1 -0
  284. package/lib/exercises/pc/optics/lensFormula.d.ts +21 -0
  285. package/lib/exercises/pc/optics/lensFormula.d.ts.map +1 -0
  286. package/lib/exercises/pc/optics/lensFormula.js +415 -0
  287. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +2 -2
  288. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +15 -15
  289. package/lib/exercises/pc/weight/calculateWeight.d.ts +8 -1
  290. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
  291. package/lib/exercises/pc/weight/calculateWeight.js +113 -38
  292. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
  293. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  294. package/lib/exercises/utils/geogebra/toolBarConstructor.js +3 -1
  295. package/lib/geogebra/parsers/geogebraParser.d.ts +4 -0
  296. package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
  297. package/lib/geogebra/parsers/geogebraParser.js +17 -0
  298. package/lib/index.d.ts +392 -23
  299. package/lib/index.d.ts.map +1 -1
  300. package/lib/latexTester.d.ts.map +1 -1
  301. package/lib/latexTester.js +1 -0
  302. package/lib/math/geometry/CloudPoints.d.ts +10 -0
  303. package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
  304. package/lib/math/geometry/CloudPoints.js +119 -0
  305. package/lib/math/geometry/line.d.ts +1 -0
  306. package/lib/math/geometry/line.d.ts.map +1 -1
  307. package/lib/math/geometry/line.js +10 -2
  308. package/lib/math/geometry/vector.d.ts +1 -0
  309. package/lib/math/geometry/vector.d.ts.map +1 -1
  310. package/lib/math/geometry/vector.js +12 -0
  311. package/lib/math/progCalc/progCalc.d.ts +46 -0
  312. package/lib/math/progCalc/progCalc.d.ts.map +1 -0
  313. package/lib/math/progCalc/progCalc.js +239 -0
  314. package/lib/math/utils/latex/realize.d.ts +12 -0
  315. package/lib/math/utils/latex/realize.d.ts.map +1 -0
  316. package/lib/math/utils/latex/realize.js +43 -0
  317. package/lib/pc/constants/molecularChemistry/molecule.d.ts +2 -0
  318. package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -1
  319. package/lib/pc/constants/molecularChemistry/molecule.js +52 -0
  320. package/lib/pc/units/timeUnits.d.ts +5 -3
  321. package/lib/pc/units/timeUnits.d.ts.map +1 -1
  322. package/lib/pc/units/timeUnits.js +25 -19
  323. package/lib/tests/questionTest.d.ts.map +1 -1
  324. package/lib/tests/questionTest.js +1 -1
  325. package/lib/tests/singleExo.test.js +3 -3
  326. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  327. package/lib/tree/nodes/operators/addNode.d.ts +4 -2
  328. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  329. package/lib/tree/nodes/operators/addNode.js +8 -17
  330. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  331. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  332. package/lib/tree/nodes/operators/fractionNode.js +5 -1
  333. package/lib/tree/nodes/operators/multiplyNode.d.ts +4 -2
  334. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  335. package/lib/tree/nodes/operators/multiplyNode.js +8 -17
  336. package/lib/tree/nodes/operators/operatorNode.d.ts +3 -3
  337. package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
  338. package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
  339. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  340. package/lib/tree/utilities/nodeShuffler.d.ts +12 -0
  341. package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -0
  342. package/lib/tree/utilities/nodeShuffler.js +123 -0
  343. package/lib/utils/arrays/getAllPicks.d.ts +2 -0
  344. package/lib/utils/arrays/getAllPicks.d.ts.map +1 -0
  345. package/lib/utils/arrays/getAllPicks.js +17 -0
  346. package/lib/utils/errors/handleVEAError.d.ts +1 -1
  347. package/lib/utils/errors/handleVEAError.d.ts.map +1 -1
  348. package/lib/utils/strings/decapitalize.d.ts +2 -0
  349. package/lib/utils/strings/decapitalize.d.ts.map +1 -0
  350. package/lib/utils/strings/decapitalize.js +3 -0
  351. package/package.json +1 -1
@@ -32,7 +32,7 @@ $$
32
32
  1${isHausse ? "+" : "-"}\\frac{${Math.abs(evolution)}}{100} = ${CM}
33
33
  $$
34
34
 
35
- `;
35
+ `;
36
36
  };
37
37
  const getEvolutionToCmQuestion = () => {
38
38
  const evolution = randint(-99, 101, [0]);
@@ -43,7 +43,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
43
43
  const question = {
44
44
  answer: getAnswer(identifiers),
45
45
  instruction: getInstruction(identifiers),
46
- keys: ["percent"],
46
+ keys: [],
47
47
  answerFormat: "tex",
48
48
  identifiers,
49
49
  hint: getHint(identifiers),
@@ -1,8 +1,13 @@
1
1
  import { Exercise } from "../../../exercises/exercise.js";
2
2
  type Identifiers = {
3
+ indexSituation: number;
3
4
  total: number;
4
5
  lefties: number;
6
+ opts: Options;
5
7
  };
6
- export declare const findProportion: Exercise<Identifiers>;
8
+ type Options = {
9
+ isPercentSymbolRequired: boolean;
10
+ };
11
+ export declare const findProportion: Exercise<Identifiers, Options>;
7
12
  export {};
8
13
  //# sourceMappingURL=findProportion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"findProportion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findProportion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAgGF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
1
+ {"version":3,"file":"findProportion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findProportion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAwNF,KAAK,OAAO,GAAG;IACb,uBAAuB,EAAE,OAAO,CAAC;CAClC,CAAC;AAeF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBzD,CAAC"}
@@ -1,60 +1,143 @@
1
- import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
1
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
- import { rationalVEA } from "../../../exercises/vea/rationalVEA.js";
4
3
  import { randfloat } from "../../../math/utils/random/randfloat.js";
5
4
  import { randint } from "../../../math/utils/random/randint.js";
6
5
  import { round } from "../../../math/utils/round.js";
7
- import { frac } from "../../../tree/nodes/operators/fractionNode.js";
8
6
  import { percentParser } from "../../../tree/parsers/percentParser.js";
7
+ import { random } from "../../../utils/alea/random.js";
9
8
  import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
10
9
  import { approxOrEqual } from "../../../utils/latex/approxOrEqual.js";
11
- const getInstruction = (identifiers) => {
12
- const { total, lefties } = identifiers;
13
- return `Dans un lycée de $${total}$ élèves, $${lefties}$ sont gauchers. Quelle est la proportion de gauchers dans ce lycée, en pourcentage ? Arrondir au centième de pourcentage.`;
14
- };
15
- const getHint = () => {
16
- return `La proportion de gauchers en pourcentage s'obtient par la formule :
10
+ const situations = [
11
+ {
12
+ instruction: (total, lefties) => `${random([
13
+ `Dans un lycée de $${total}$ élèves, $${lefties}$ sont gauchers.`,
14
+ `Dans un lycée, $${lefties}$ élèves sont gauchers sur un total de $${total}$ élèves.`,
15
+ ])}
16
+ Quelle est la proportion de gauchers dans ce lycée, en pourcentage ?`,
17
+ hint: `La proportion de gauchers en pourcents s'obtient par la formule :
18
+
19
+ $$
20
+ \\frac{\\text{nombre de gauchers}}{\\text{nombre total d'élèves}}\\times 100
21
+ $$
22
+ `,
23
+ correction: `La proportion de gauchers en pourcentage dans ce lycée est de`,
24
+ randTotal: () => randint(500, 2000),
25
+ },
26
+ {
27
+ instruction: (total, lefties) => `${random([
28
+ `Dans une casse automobile, il y a $${total}$ voitures dont $${lefties}$ ont le volant à gauche.`,
29
+ `Dans une casse automobile, $${lefties}$ voitures ont le volant à gauche. Il y a au total $${total}$ voitures.`,
30
+ ])}
31
+ Quelle est la proportion de voitures avec le volant à gauche dans cette casse, en pourcentage ?`,
32
+ hint: `La proportion, en pourcents, de voitures avec le volant à gauche s'obtient par la formule :
33
+
34
+ $$
35
+ \\frac{\\text{nombre de voitures avec volant à gauche}}{\\text{nombre total de voitures}}\\times 100
36
+ $$
37
+ `,
38
+ correction: `La proportion, en pourcentage, de voitures avec le volant à gauche est de`,
39
+ randTotal: () => randint(100, 500),
40
+ },
41
+ {
42
+ instruction: (total, lefties) => `${random([
43
+ `Dans un restaurant italien, sur un total de $${total}$ clients, $${lefties}$ ont commandé des pâtes.`,
44
+ `Dans un restaurant italien, $${lefties}$ clients ont commandé des pâtes. Il y a au total $${total}$ clients.`,
45
+ ])}
46
+ Quelle est la proportion de clients qui ont commandé des pâtes, en pourcentage ?`,
47
+ hint: `La proportion en pourcents de clients qui ont commandé des pâtes s'obtient par la formule :
48
+
49
+ $$
50
+ \\frac{\\text{nombre de clients ayant commandé des pâtes}}{\\text{nombre total de clients}}\\times 100
51
+ $$
52
+ `,
53
+ correction: `La proportion en pourcentage de clients ayant commandé des pâtes est de`,
54
+ randTotal: () => randint(30, 200),
55
+ },
56
+ {
57
+ instruction: (total, lefties) => `${random([
58
+ `Dans une cagette de $${total}$ pommes, $${lefties}$ sont véreuses.`,
59
+ `Dans une cagette de pommes, $${lefties}$ sont véreuses. Il y a au total $${total}$ pommes.`,
60
+ ])}
61
+ Quelle est la proportion de pommes véreuses dans la cagette, en pourcentage ?`,
62
+ hint: `La proportion, en pourcents, de pommes véreuses s'obtient par la formule :
17
63
 
18
64
  $$
19
- \\frac{\\text{nombre de gauchers}}{\\text{nombre d'élèves}}\\times 100
65
+ \\frac{\\text{nombre de pommes véreuses}}{\\text{nombre total de pommes}}\\times 100
20
66
  $$
21
- `;
67
+ `,
68
+ correction: `La proportion, en pourcentage, de pommes véreuses est de`,
69
+ randTotal: () => randint(30, 100),
70
+ },
71
+ {
72
+ instruction: (total, lefties) => `${random([
73
+ `Dans un car scolaire transportant $${total}$ élèves, $${lefties}$ sont du côté gauche.`,
74
+ `Dans un car scolaire, $${lefties}$ élèves sont du côté gauche. Le car transporte $${total}$ élèves.`,
75
+ ])}
76
+ Quelle est la proportion d'élèves du côté gauche du car, en pourcentage ?`,
77
+ hint: `La proportion en pourcents d'élèves du gauche du car s'obtient par la formule :
78
+
79
+ $$
80
+ \\frac{\\text{nombre d'élèves du côté gauche}}{\\text{nombre d'élèves dans le car}}\\times 100
81
+ $$
82
+ `,
83
+ correction: `La proportion en pourcentage d'élèves du côté gauche est de`,
84
+ randTotal: () => randint(20, 40),
85
+ },
86
+ {
87
+ instruction: (total, lefties) => `${random([
88
+ `Dans un champ, au mois de septembre, sur $${total}$ champignons, $${lefties}$ sont vénéneux.`,
89
+ `Dans un champ, au mois de septembre, $${lefties}$ champignons sont vénéneux sur un total de $${total}$ champignons.`,
90
+ ])}
91
+ Quelle est la proportion de champignons vénéneux dans ce champ, en pourcentage ?`,
92
+ hint: `La proportion de champignons vénéneux dans ce champ, en pourcents, s'obtient par la formule :
93
+
94
+ $$
95
+ \\frac{\\text{nombre de champignons vénéneux}}{\\text{nombre total de champignons}}\\times 100
96
+ $$
97
+ `,
98
+ correction: `La proportion en pourcentage de champignons vénéneux dans ce champ est de`,
99
+ randTotal: () => randint(20, 400),
100
+ },
101
+ ];
102
+ const getInstruction = (identifiers) => {
103
+ const { indexSituation, total, lefties, opts } = identifiers;
104
+ const situation = situations[indexSituation];
105
+ return `${situation.instruction(total, lefties)}
106
+
107
+ Arrondir au centième de pourcent.
108
+ ${opts.isPercentSymbolRequired
109
+ ? `
110
+
111
+ Ne pas oublier le symbole $\\%$ à la fin.`
112
+ : ``}`;
113
+ };
114
+ const getHint = (identifiers) => {
115
+ const { indexSituation } = identifiers;
116
+ const situation = situations[indexSituation];
117
+ return situation.hint;
22
118
  };
23
119
  const getCorrection = (identifiers) => {
24
- const { total, lefties } = identifiers;
120
+ const { indexSituation, total, lefties, opts } = identifiers;
121
+ const situation = situations[indexSituation];
25
122
  const frac = (100 * lefties) / total;
26
- return `La proportion de gauchers en pourcentage dans ce lycée est de :
123
+ return `On a :
27
124
 
28
125
  $$
29
126
  \\frac{${lefties}}{${total}}\\times 100 ${approxOrEqual(frac, 2).join("")}
30
127
  $$
31
128
 
32
- Il y a donc $${getAnswer(identifiers)}$ de gauchers dans ce lycée.
33
- `;
129
+ ${situation.correction} $${getAnswer(identifiers)}$.
130
+ ${opts.isPercentSymbolRequired
131
+ ? `
132
+
133
+ Attention, ici le symbole "$\\%$" est requis à la fin.`
134
+ : ``}`;
34
135
  };
35
136
  const getAnswer = (identifiers) => {
36
137
  const { total, lefties } = identifiers;
37
138
  const answer = round((lefties / total) * 100, 2).frenchify() + "\\%";
38
139
  return answer;
39
140
  };
40
- const getFindProportionQuestion = () => {
41
- const total = randint(120, 200);
42
- const lefties = randint(30, 120);
43
- const identifiers = { total, lefties };
44
- return getQuestionFromIdentifiers(identifiers);
45
- };
46
- const getQuestionFromIdentifiers = (identifiers) => {
47
- const question = {
48
- answer: getAnswer(identifiers),
49
- instruction: getInstruction(identifiers),
50
- keys: ["percent"],
51
- answerFormat: "tex",
52
- identifiers,
53
- hint: getHint(identifiers),
54
- correction: getCorrection(identifiers),
55
- };
56
- return question;
57
- };
58
141
  const getPropositions = (n, { answer, total, lefties }) => {
59
142
  const propositions = [];
60
143
  addValidProp(propositions, answer);
@@ -64,32 +147,66 @@ const getPropositions = (n, { answer, total, lefties }) => {
64
147
  });
65
148
  return shuffleProps(propositions, n);
66
149
  };
67
- const isAnswerValid = (ans, { answer, lefties, total }) => {
150
+ const isAnswerValid = (ans, { answer, opts }) => {
68
151
  try {
69
- if (ans.includes("\\%")) {
70
- return percentParser(ans) === answer;
71
- }
72
- const nb = ans.unfrenchify();
73
- if (!isNaN(nb)) {
74
- const value = answer.replace("\\%", "").unfrenchify();
75
- return nb === value || nb === round(value / 100, 4);
152
+ if (opts.isPercentSymbolRequired) {
153
+ if (!ans.includes("\\%")) {
154
+ return false;
155
+ }
156
+ else {
157
+ return percentParser(ans) === answer;
158
+ }
76
159
  }
77
160
  else {
78
- return rationalVEA(ans, frac(lefties, total).simplify().toTex());
161
+ const texs = [answer, answer.replace("\\%", "")];
162
+ return texs.includes(ans);
79
163
  }
80
164
  }
81
165
  catch (err) {
82
166
  return handleVEAError(err);
83
167
  }
84
- const texs = [answer, answer.replace("\\%", "")];
85
- return texs.includes(ans);
86
168
  };
169
+ const getFindProportionQuestion = (optsIn) => {
170
+ const opts = optsIn ?? optsDefault;
171
+ const indexSituation = randint(0, situations.length);
172
+ const situation = situations[indexSituation];
173
+ const total = situation.randTotal();
174
+ const lefties = round(randfloat(0.1, 0.9) * total, 0);
175
+ return getQuestionFromIdentifiers({ indexSituation, total, lefties, opts });
176
+ };
177
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
178
+ const question = {
179
+ answer: getAnswer(identifiers),
180
+ instruction: getInstruction(identifiers),
181
+ keys: ["percent"],
182
+ answerFormat: "tex",
183
+ identifiers,
184
+ hint: getHint(identifiers),
185
+ correction: getCorrection(identifiers),
186
+ options: opts,
187
+ };
188
+ return question;
189
+ };
190
+ const optsDefault = {
191
+ isPercentSymbolRequired: false,
192
+ };
193
+ const options = [
194
+ {
195
+ id: "isPercentSymbolRequired",
196
+ label: "Symbole pourcent requis",
197
+ target: GeneratorOptionTarget.generation,
198
+ type: GeneratorOptionType.checkbox,
199
+ values: [false, true],
200
+ defaultValue: optsDefault.isPercentSymbolRequired,
201
+ },
202
+ ];
87
203
  export const findProportion = {
88
204
  id: "findProportion",
89
205
  connector: "=",
90
206
  label: "Calculer une proportion en pourcentage",
91
207
  isSingleStep: true,
92
- generator: (nb) => getDistinctQuestions(getFindProportionQuestion, nb),
208
+ generator: (nb, opts) => getDistinctQuestions(() => getFindProportionQuestion(opts), nb),
209
+ options,
93
210
  qcmTimer: 60,
94
211
  freeTimer: 60,
95
212
  getPropositions,
@@ -2,7 +2,11 @@ import { Exercise } from "../../../exercises/exercise.js";
2
2
  type Identifiers = {
3
3
  int: number;
4
4
  power: number;
5
+ opts: Options;
5
6
  };
6
- export declare const calculateNegativePower: Exercise<Identifiers>;
7
+ type Options = {
8
+ isPowerAllowed: boolean;
9
+ };
10
+ export declare const calculateNegativePower: Exercise<Identifiers, Options>;
7
11
  export {};
8
12
  //# sourceMappingURL=calculateNegativePower.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calculateNegativePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculateNegativePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA+GF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
1
+ {"version":3,"file":"calculateNegativePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculateNegativePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AA0CrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AA4JF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAeF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjE,CAAC"}
@@ -1,23 +1,47 @@
1
- import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
1
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { randint } from "../../../math/utils/random/randint.js";
4
+ import { isFunctionNode } from "../../../tree/nodes/functions/functionNode.js";
4
5
  import { isNumberNode, NumberNode, } from "../../../tree/nodes/numbers/numberNode.js";
5
6
  import { frac, isFractionNode, } from "../../../tree/nodes/operators/fractionNode.js";
7
+ import { isOperatorNode, OperatorIds, } from "../../../tree/nodes/operators/operatorNode.js";
6
8
  import { PowerNode } from "../../../tree/nodes/operators/powerNode.js";
7
9
  import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
8
10
  import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
11
+ const isNodeContainingOperatorId = (node, opId) => {
12
+ if (isFunctionNode(node)) {
13
+ return isNodeContainingOperatorId(node.child, opId);
14
+ }
15
+ else if (isOperatorNode(node)) {
16
+ if (node.id === opId) {
17
+ return true;
18
+ }
19
+ else {
20
+ return (isNodeContainingOperatorId(node.leftChild, opId) ||
21
+ isNodeContainingOperatorId(node.rightChild, opId));
22
+ }
23
+ }
24
+ else {
25
+ return false;
26
+ }
27
+ };
9
28
  const getInstruction = (identifiers) => {
10
- const { int, power } = identifiers;
29
+ const { int, power, opts } = identifiers;
11
30
  const statement = new PowerNode(new NumberNode(int), new NumberNode(power)).toTex();
12
31
  return `Calculer et donner le résultat sous la forme d'une fraction ou d'un entier :
13
32
 
14
33
  $$
15
34
  ${statement}
16
- $$`;
35
+ $$
36
+
37
+ ${opts.isPowerAllowed
38
+ ? `La réponse pourra comporter un exposant.`
39
+ : `La réponse ne devra comporter aucun exposant.`}`;
17
40
  };
18
41
  const getAnswer = (identifiers) => {
19
- const { int, power } = identifiers;
20
- const fraction = frac(1, new PowerNode(int.toTree(), Math.abs(power).toTree()));
42
+ const { int, power, opts } = identifiers;
43
+ const powerNode = new PowerNode(int.toTree(), Math.abs(power).toTree());
44
+ const fraction = frac(1, opts.isPowerAllowed ? powerNode : powerNode.evaluate().toTree());
21
45
  const answer = fraction.simplify();
22
46
  return answer.toTex();
23
47
  };
@@ -29,32 +53,35 @@ a^{-x} = \\frac{1}{a^x}
29
53
  $$`;
30
54
  };
31
55
  const getCorrection = (identifiers) => {
32
- const { int, power } = identifiers;
56
+ const { int, power, opts } = identifiers;
33
57
  const statement = new PowerNode(new NumberNode(int), new NumberNode(power)).toTex();
34
58
  const fraction = frac(1, new PowerNode(int.toTree(), Math.abs(power).toTree()));
59
+ const simplificationTex = fraction.toSimplificationTex();
35
60
  return `Puisque $a^{-x} = \\frac{1}{a^x}$, on a :
36
61
 
37
62
  $$
38
- ${statement} = ${fraction.toSimplificationTex()}
39
- $$`;
40
- };
41
- const getQuestionFromIdentifiers = (identifiers) => {
42
- const question = {
43
- answer: getAnswer(identifiers),
44
- instruction: getInstruction(identifiers),
45
- keys: [],
46
- answerFormat: "tex",
47
- identifiers,
48
- hint: getHint(identifiers),
49
- correction: getCorrection(identifiers),
50
- };
51
- return question;
52
- };
53
- const getCalculatePowerQuestion = () => {
54
- const int = randint(1, 11);
55
- const power = randint(-5, 0);
56
- const identifiers = { int, power };
57
- return getQuestionFromIdentifiers(identifiers);
63
+ ${statement} = ${simplificationTex}
64
+ $$
65
+
66
+ ${(() => {
67
+ if (!opts.isPowerAllowed) {
68
+ const fractionNoPower = frac(1, new PowerNode(int.toTree(), Math.abs(power).toTree()).evaluate().toTree());
69
+ const texNoPower = fractionNoPower.toTex();
70
+ return !simplificationTex.includes(texNoPower)
71
+ ? `
72
+
73
+ $$
74
+ ${statement} = ${texNoPower}
75
+ $$
76
+
77
+ `
78
+ : ``;
79
+ }
80
+ else {
81
+ return ``;
82
+ }
83
+ })()}
84
+ `;
58
85
  };
59
86
  const getPropositions = (n, { answer, int, power }) => {
60
87
  const propositions = [];
@@ -78,10 +105,13 @@ const getPropositions = (n, { answer, int, power }) => {
78
105
  });
79
106
  return shuffleProps(propositions, n);
80
107
  };
81
- const isAnswerValid = (ans, { answer }) => {
108
+ const isAnswerValid = (ans, { answer, opts }) => {
82
109
  try {
83
110
  const parsed = parseAlgebraic(ans);
84
- if (!isNumberNode(parsed) && !isFractionNode(parsed)) {
111
+ if (!isNumberNode(parsed) &&
112
+ !(isFractionNode(parsed) &&
113
+ (opts.isPowerAllowed ||
114
+ !isNodeContainingOperatorId(parsed, OperatorIds.power)))) {
85
115
  return false;
86
116
  }
87
117
  return parsed.simplify().toTex() === answer;
@@ -90,12 +120,46 @@ const isAnswerValid = (ans, { answer }) => {
90
120
  return handleVEAError(err);
91
121
  }
92
122
  };
123
+ const getCalculatePowerQuestion = (optsIn) => {
124
+ const opts = optsIn ?? optsDefault;
125
+ const int = randint(1, 11);
126
+ const power = randint(-5, 0);
127
+ const identifiers = { int, power, opts };
128
+ return getQuestionFromIdentifiers(identifiers, opts);
129
+ };
130
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
131
+ const question = {
132
+ answer: getAnswer(identifiers),
133
+ instruction: getInstruction(identifiers),
134
+ keys: [],
135
+ answerFormat: "tex",
136
+ identifiers,
137
+ hint: getHint(identifiers),
138
+ correction: getCorrection(identifiers),
139
+ options: opts,
140
+ };
141
+ return question;
142
+ };
143
+ const optsDefault = {
144
+ isPowerAllowed: true,
145
+ };
146
+ const options = [
147
+ {
148
+ id: "isPowerAllowed",
149
+ label: "Exposant accepté dans la réponse",
150
+ target: GeneratorOptionTarget.generation,
151
+ type: GeneratorOptionType.checkbox,
152
+ values: [true, false],
153
+ defaultValue: optsDefault.isPowerAllowed,
154
+ },
155
+ ];
93
156
  export const calculateNegativePower = {
94
157
  id: "calculateNegativePower",
95
158
  connector: "=",
96
159
  label: "Calculer une puissance négative",
97
160
  isSingleStep: true,
98
- generator: (nb) => getDistinctQuestions(getCalculatePowerQuestion, nb),
161
+ generator: (nb, opts) => getDistinctQuestions(() => getCalculatePowerQuestion(opts), nb),
162
+ options,
99
163
  qcmTimer: 60,
100
164
  freeTimer: 60,
101
165
  getPropositions,
@@ -5,4 +5,5 @@ export * from "./getComplementaryProbability.js";
5
5
  export * from "./getMissingProbabilityValue.js";
6
6
  export * from "./mostLeastProbable.js";
7
7
  export * from "./rouletteProbas.js";
8
+ export * from "./possibleValuesForProba.js";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC"}
@@ -5,3 +5,4 @@ export * from "./getComplementaryProbability.js";
5
5
  export * from "./getMissingProbabilityValue.js";
6
6
  export * from "./mostLeastProbable.js";
7
7
  export * from "./rouletteProbas.js";
8
+ export * from "./possibleValuesForProba.js";
@@ -6,7 +6,6 @@ type Identifiers = {
6
6
  };
7
7
  type Options = {
8
8
  numberTypes: string[];
9
- nbValues: number;
10
9
  };
11
10
  export declare const possibleValuesForProba: Exercise<Identifiers, Options>;
12
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"possibleValuesForProba.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/possibleValuesForProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAa7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,eAAe,EAAE,CAAC;IAClC,qBAAqB,EAAE,OAAO,CAAC;CAChC,CAAC;AAkHF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAgNF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjE,CAAC"}
1
+ {"version":3,"file":"possibleValuesForProba.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/possibleValuesForProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAW7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,eAAe,EAAE,CAAC;IAClC,qBAAqB,EAAE,OAAO,CAAC;CAChC,CAAC;AA2EF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAwMF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjE,CAAC"}