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
@@ -0,0 +1,223 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
4
+ import { randint } from "../../../math/utils/random/randint.js";
5
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
6
+ import { substract } from "../../../tree/nodes/operators/substractNode.js";
7
+ import { coinFlip } from "../../../utils/alea/coinFlip.js";
8
+ import { randomMany } from "../../../utils/alea/random.js";
9
+ import { getAllPicks } from "../../../utils/arrays/getAllPicks.js";
10
+ const getAvailableQuestionObjs = (quartiles) => {
11
+ const [q0, q1, _, q3, q4] = quartiles;
12
+ const arrQuartileIndexAvailable = [
13
+ 0,
14
+ ...(q0 !== q1 ? [1] : []),
15
+ 2,
16
+ ...(q3 !== q4 ? [3] : []),
17
+ 4,
18
+ ];
19
+ return getAllPicks(arrQuartileIndexAvailable)
20
+ .filter((quartileIndexesPicked) => quartileIndexesPicked.length === 2)
21
+ .flatMap((quartileIndexesPicked) => {
22
+ return [
23
+ ...(quartileIndexesPicked[0] === 0 ? ["below"] : []),
24
+ "between",
25
+ ...(quartileIndexesPicked[1] === 4 ? ["above"] : []),
26
+ ].map((typeQ) => {
27
+ return {
28
+ typeQ: typeQ,
29
+ quartileIndexes: quartileIndexesPicked,
30
+ };
31
+ });
32
+ });
33
+ };
34
+ const getPercentageNode = (quartileIndexes) => {
35
+ return multiply(substract(quartileIndexes[1], quartileIndexes[0]), 25).simplify();
36
+ };
37
+ const getFrenchStringForPercentage = (n) => {
38
+ switch (n) {
39
+ case 25:
40
+ return `Un quart des`;
41
+ case 50:
42
+ return `La moitié des`;
43
+ case 75:
44
+ return `Trois quarts des`;
45
+ case 100:
46
+ return `Tous les`;
47
+ default:
48
+ return "";
49
+ }
50
+ };
51
+ const getTexPercentage = (n) => {
52
+ return coinFlip()
53
+ ? `$${n.frenchify()}\\%$ des`
54
+ : getFrenchStringForPercentage(n);
55
+ };
56
+ const getValidProp = (quartiles, questionObj) => {
57
+ const { typeQ, quartileIndexes } = questionObj;
58
+ const percentageNode = getPercentageNode(quartileIndexes);
59
+ const texPercentage = getTexPercentage(percentageNode.evaluate());
60
+ switch (typeQ) {
61
+ case "below":
62
+ return `${texPercentage} élèves ont eu $${quartiles[quartileIndexes[1]]}$ ou moins.`;
63
+ case "between":
64
+ return `${texPercentage} élèves ont eu entre $${quartiles[quartileIndexes[0]]}$ et $${quartiles[quartileIndexes[1]]}$.`;
65
+ case "above":
66
+ return `${texPercentage} élèves ont eu $${quartiles[quartileIndexes[0]]}$ ou plus.`;
67
+ }
68
+ };
69
+ const getInvalidProps = (quartiles, questionObj) => {
70
+ const { typeQ, quartileIndexes } = questionObj;
71
+ const validPercentageNode = getPercentageNode(quartileIndexes);
72
+ const validPercentage = validPercentageNode.evaluate();
73
+ const invalidPercentages = [0, 25, 50, 75, 100].filter((n) => n > validPercentage);
74
+ switch (typeQ) {
75
+ case "below":
76
+ return invalidPercentages.map((n) => `${getTexPercentage(n)} élèves ont eu $${quartiles[quartileIndexes[1]]}$ ou moins.`);
77
+ case "between":
78
+ return invalidPercentages.map((n) => `${getTexPercentage(n)} élèves ont eu entre $${quartiles[quartileIndexes[0]]}$ et $${quartiles[quartileIndexes[1]]}$.`);
79
+ case "above":
80
+ return invalidPercentages.map((n) => `${getTexPercentage(n)} élèves ont eu $${quartiles[quartileIndexes[0]]}$ ou plus.`);
81
+ }
82
+ };
83
+ const getInstruction = (identifiers) => {
84
+ const { quartiles } = identifiers;
85
+ return `Voici la boîtes à moustaches correspondant aux notes du bac en mathématiques.
86
+
87
+ On observe que $Q1 = ${quartiles[1].frenchify()}$, que la médiane vaut $${quartiles[2].frenchify()}$
88
+ et que $Q3 = ${quartiles[3].frenchify()}$.
89
+
90
+ On peut alors en déduire que :
91
+ `;
92
+ };
93
+ const getHint = () => {
94
+ return `Il y a autant d'élèves qui ont eu la médiane ou plus que d'élèves qui ont eu la médiane ou moins.
95
+
96
+ Au moins $25\\%$ des élèves ont eu $Q1$ ou moins que $Q1$.
97
+
98
+ Au moins $75\\%$ des élèves ont eu $Q3$ ou moins que $Q3$.`;
99
+ };
100
+ const getCorrection = (identifiers) => {
101
+ const { quartiles } = identifiers;
102
+ const [q0, q1, _, q3, q4] = quartiles;
103
+ const questionObjs = [
104
+ { typeQ: "below", quartileIndexes: [0, 1] },
105
+ ...(q0 !== q1
106
+ ? [{ typeQ: "between", quartileIndexes: [1, 2] }]
107
+ : [{ typeQ: "between", quartileIndexes: [0, 2] }]),
108
+ ...(q3 !== q4
109
+ ? [{ typeQ: "between", quartileIndexes: [2, 3] }]
110
+ : [{ typeQ: "between", quartileIndexes: [2, 4] }]),
111
+ { typeQ: "above", quartileIndexes: [3, 4] },
112
+ ];
113
+ const validProps = questionObjs.map((questionObj) => getValidProp(quartiles, questionObj));
114
+ return `Voici quelques commentaires sur la répartition des notes des élèves :
115
+
116
+ ${validProps.join(`
117
+
118
+ `)}`;
119
+ };
120
+ const getPropositions = (n, { quartiles }) => {
121
+ const propositions = [];
122
+ const questionObjs = getAvailableQuestionObjs(quartiles);
123
+ const nbValid = randint(1, 4);
124
+ const allValidProps = [
125
+ ...questionObjs.map((questionObj) => getValidProp(quartiles, questionObj)),
126
+ `Aucun élève n'a eu en dessous de $${quartiles[0]}$`,
127
+ `Aucun élève n'a eu au dessus de $${quartiles[4]}$`,
128
+ ];
129
+ const validProps = randomMany(allValidProps, nbValid);
130
+ validProps.forEach((validProp) => {
131
+ addValidProp(propositions, validProp, "raw");
132
+ });
133
+ const nbInvalid = n - nbValid;
134
+ const allInvalidProps = [
135
+ ...questionObjs.flatMap((questionObj) => getInvalidProps(quartiles, questionObj)),
136
+ `Aucun élève n'a eu en dessous de $${quartiles[2]}$`,
137
+ `Aucun élève n'a eu au dessus de $${quartiles[2]}$`,
138
+ ];
139
+ const invalidProps = randomMany(allInvalidProps, nbInvalid);
140
+ invalidProps.forEach((invalidProp) => {
141
+ tryToAddWrongProp(propositions, invalidProp, "raw");
142
+ });
143
+ return shuffleProps(propositions, n);
144
+ };
145
+ const getGGBOptions = (identifiers) => {
146
+ const { quartiles } = identifiers;
147
+ const [q0, q1, q2, q3, q4] = quartiles;
148
+ const yOffset = 2;
149
+ const yScale = 0.8;
150
+ const commands = [
151
+ `BM = BoxPlot(${yOffset}, ${yScale}, ${q0}, ${q1}, ${q2}, ${q3}, ${q4})`,
152
+ `ShowLabel(BM, false)`,
153
+ ];
154
+ const ggb = new GeogebraConstructor({
155
+ commands,
156
+ forbidShiftDragZoom: false,
157
+ lockedAxesRatio: false,
158
+ // gridDistance: [0.5, 1],
159
+ xAxis: {
160
+ hideNumbers: false,
161
+ steps: 1,
162
+ },
163
+ yAxis: {
164
+ hidden: true,
165
+ },
166
+ maxHeight: 100,
167
+ fontSize: 20,
168
+ });
169
+ return ggb.getOptions({
170
+ coords: ggb.getAdaptedCoords({
171
+ xMin: q0,
172
+ xMax: q4,
173
+ yMin: -2,
174
+ yMax: 5,
175
+ }),
176
+ });
177
+ };
178
+ const getBoxInterpretingQuestion = () => {
179
+ const arrBounds = [
180
+ { min: 0, max: 8 },
181
+ { min: 12, max: 20 },
182
+ ];
183
+ const [q0, q1] = [0, 1]
184
+ .map((_) => randint(arrBounds[0].min, arrBounds[0].max))
185
+ .toSorted((i1, i2) => i1 - i2);
186
+ const [q3, q4] = [0, 1]
187
+ .map((_) => randint(arrBounds[1].min, arrBounds[1].max))
188
+ .toSorted((i1, i2) => i1 - i2);
189
+ const q2 = randint(q1, q3, [q1]); //we prevent q2 from being equal to q1 or q3
190
+ const quartiles = [q0, q1, q2, q3, q4];
191
+ const identifiers = { quartiles };
192
+ return getQuestionFromIdentifiers(identifiers);
193
+ };
194
+ const getQuestionFromIdentifiers = (identifiers) => {
195
+ return {
196
+ instruction: getInstruction(identifiers),
197
+ keys: [],
198
+ answerFormat: "tex",
199
+ identifiers,
200
+ hint: getHint(identifiers),
201
+ correction: getCorrection(identifiers),
202
+ ggbOptions: getGGBOptions(identifiers),
203
+ };
204
+ };
205
+ export const boxPlotInterpreting = {
206
+ id: "boxPlotInterpreting",
207
+ label: "Interpréter une boite à moustaches",
208
+ isSingleStep: true,
209
+ generator: (nb, opts) => getDistinctQuestions(() => getBoxInterpretingQuestion(opts), nb),
210
+ qcmTimer: 60,
211
+ freeTimer: 60,
212
+ getPropositions,
213
+ subject: "Mathématiques",
214
+ getHint,
215
+ getCorrection,
216
+ getInstruction,
217
+ getGGBOptions,
218
+ hasGeogebra: true,
219
+ getQuestionFromIdentifiers,
220
+ hasHintAndCorrection: true,
221
+ answerType: "QCM",
222
+ isQCM: true,
223
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ xValues: number[];
4
+ yValues: number[];
5
+ answerIndex: number;
6
+ isLess: boolean;
7
+ };
8
+ export declare const cartesianGraphExtremaReading: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=cartesianGraphExtremaReading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cartesianGraphExtremaReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/cartesianGraphExtremaReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAuJF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAsB9D,CAAC"}
@@ -0,0 +1,139 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
4
+ import { randint } from "../../../math/utils/random/randint.js";
5
+ import { coinFlip } from "../../../utils/alea/coinFlip.js";
6
+ import { random } from "../../../utils/alea/random.js";
7
+ import { shuffle } from "../../../utils/alea/shuffle.js";
8
+ const getPropositions = (n, { xValues, answerIndex }) => {
9
+ const propositions = [];
10
+ const xAnswer = xValues[answerIndex];
11
+ [
12
+ xAnswer,
13
+ ...shuffle(xValues.filter((xValue) => xValue !== xAnswer)).slice(0, n - 1),
14
+ ]
15
+ .toSorted((x1, x2) => x1 - x2)
16
+ .forEach((xValue) => {
17
+ const tex = `en $${xValue.frenchify()}$`;
18
+ if (xValue === xAnswer) {
19
+ addValidProp(propositions, tex, "raw");
20
+ }
21
+ else {
22
+ tryToAddWrongProp(propositions, tex, "raw");
23
+ }
24
+ });
25
+ return propositions;
26
+ };
27
+ const getAnswer = (identifiers) => {
28
+ const { answerIndex, xValues } = identifiers;
29
+ return xValues[answerIndex].frenchify();
30
+ };
31
+ const getInstruction = (identifiers) => {
32
+ const { isLess } = identifiers;
33
+ return `Ce diagramme cartésien représente le nombre de naissance (en milliers) entre $2003$ et $2011$.
34
+ Durant cette période, en quelle année y a-t-il eu le ${isLess ? `moins` : `plus`} de naissances ?`;
35
+ };
36
+ const getHint = (identifiers) => {
37
+ const { isLess } = identifiers;
38
+ return `Observe quand la courbe est la plus ${isLess ? `basse` : `haute`}.`;
39
+ };
40
+ const getCorrection = (identifiers) => {
41
+ const { isLess } = identifiers;
42
+ const answer = getAnswer(identifiers);
43
+ return `La courbe est la plus ${isLess ? `basse` : `haute`} en $${answer}$.
44
+ Donc c'est en $${answer}$ qu'il y a eu le ${isLess ? `moins` : `plus`} de naissances en France.
45
+ `;
46
+ };
47
+ const getGGBOptions = (identifiers) => {
48
+ const { xValues, yValues } = identifiers;
49
+ const commands = [
50
+ `LG = LineGraph({${xValues.join(",")}}, {${yValues.join(",")}})`,
51
+ ];
52
+ const ggb = new GeogebraConstructor({
53
+ commands,
54
+ // forbidShiftDragZoom: false,
55
+ lockedAxesRatio: (xValues.length / (840 - 760)) * 0.5,
56
+ gridDistance: [1, 1],
57
+ xAxis: {
58
+ hideNumbers: false,
59
+ steps: 1,
60
+ label: "Année",
61
+ },
62
+ yAxis: {
63
+ hideNumbers: false,
64
+ steps: 10,
65
+ label: "Nombre de naissances (en milliers)",
66
+ },
67
+ maxHeight: 200,
68
+ fontSize: 15,
69
+ });
70
+ return ggb.getOptions({
71
+ // coords: ggb.getAdaptedCoords({
72
+ // xMin: xValues[0] - 1,
73
+ // xMax: xValues[xValues.length - 1] + 1,
74
+ // yMin: 760,
75
+ // yMax: 840,
76
+ // }),
77
+ coords: [xValues[0] - 1, xValues[xValues.length - 1] + 1, 760, 840],
78
+ });
79
+ };
80
+ const getCartesianGraphExtremaReadingQuestion = () => {
81
+ const isLess = coinFlip();
82
+ const nbYears = 9;
83
+ const yMin = 770;
84
+ const yMax = 830;
85
+ const xValues = [...Array(nbYears).keys()].map((i) => i + 2003);
86
+ const indexExtremum = random([...Array(nbYears).keys()]);
87
+ const yExtremum = isLess
88
+ ? randint(yMin, 0.4 * yMin + 0.6 * yMax)
89
+ : randint(0.4 * yMin + 0.6 * yMax, yMax + 1);
90
+ const yReadabilityOffset = 10;
91
+ const yMinForPick = isLess ? yExtremum + yReadabilityOffset : yMin;
92
+ const yMaxForPick = isLess ? yMax : yExtremum - yReadabilityOffset;
93
+ const yValues = [...Array(nbYears).keys()].map((i) => {
94
+ if (i === indexExtremum) {
95
+ return yExtremum;
96
+ }
97
+ else {
98
+ return randint(yMinForPick, yMaxForPick + 1);
99
+ }
100
+ });
101
+ const answerIndex = yValues
102
+ .map((yValue, i) => {
103
+ return { value: yValue, index: i };
104
+ })
105
+ .toSorted(({ value: y1 }, { value: y2 }) => isLess ? y1 - y2 : y2 - y1)[0].index;
106
+ const identifiers = { xValues, yValues, isLess, answerIndex };
107
+ return getQuestionFromIdentifiers(identifiers);
108
+ };
109
+ const getQuestionFromIdentifiers = (identifiers) => {
110
+ return {
111
+ answer: getAnswer(identifiers),
112
+ instruction: getInstruction(identifiers),
113
+ keys: [],
114
+ answerFormat: "tex",
115
+ identifiers,
116
+ hint: getHint(identifiers),
117
+ correction: getCorrection(identifiers),
118
+ ggbOptions: getGGBOptions(identifiers),
119
+ };
120
+ };
121
+ export const cartesianGraphExtremaReading = {
122
+ id: "cartesianGraphExtremaReading",
123
+ label: "Commenter un diagramme cartésien",
124
+ isSingleStep: true,
125
+ generator: (nb, opts) => getDistinctQuestions(() => getCartesianGraphExtremaReadingQuestion(opts), nb),
126
+ qcmTimer: 60,
127
+ freeTimer: 60,
128
+ getPropositions,
129
+ subject: "Mathématiques",
130
+ getHint,
131
+ getCorrection,
132
+ getInstruction,
133
+ getAnswer,
134
+ getGGBOptions,
135
+ hasGeogebra: true,
136
+ getQuestionFromIdentifiers,
137
+ hasHintAndCorrection: true,
138
+ answerType: "QCU",
139
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ indexSituation: number;
4
+ bigNumber: number;
5
+ };
6
+ export declare const dataToGraphGraphToData: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=dataToGraphGraphToData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataToGraphGraphToData.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/dataToGraphGraphToData.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,QAAQ,EACT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4JF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
@@ -0,0 +1,133 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../math/utils/random/randint.js";
4
+ import { random } from "../../../utils/alea/random.js";
5
+ const situations = [
6
+ {
7
+ description: (n) => `Sur $${n * 3}$ personnes :
8
+ $${n}$ ont moins de $18$ ans;
9
+ $${n}$ ont entre $18$ et $65$ ans
10
+ et les autres ont plus de $65$ ans.`,
11
+ answer: "a",
12
+ hint: (n) => `$${n}$ est le tiers de $${n * 3}$.`,
13
+ correction: (n) => `Comme $${n}$ est le tiers de $${n * 3}$
14
+ alors seul le graphiques $a$ convient, car c'est le seul à contenir un tiers de disque.`,
15
+ },
16
+ {
17
+ description: (n) => `Sur $${n * 5}$ personnes :
18
+ $${n * 2.5}$ ont moins de $18$ ans,
19
+ $${n}$ ont entre $18$ et $65$ ans
20
+ et les autres ont plus de $65$ ans.`,
21
+ answer: "b",
22
+ hint: (n) => `$${n * 2.5}$ est la moitié de $${n * 5}$.`,
23
+ correction: (n) => `Comme $${n * 2.5}$ est la moitié de $${n * 5}$
24
+ alors seuls les graphiques $b$ et $d$ conviennent.
25
+ De plus comme le quart de $${n * 5}$ vaut $${(n * 5) / 4}$
26
+ et que $${n}<${(n * 5) / 4}$ alors seul le graphique $b$ convient.`,
27
+ },
28
+ {
29
+ description: (n) => `Sur $${n * 10}$ personnes :
30
+ $${n * 3}$ ont moins de $18$ ans,
31
+ $${n}$ ont entre $18$ et $65$ ans
32
+ et les autres ont plus de $65$ ans.`,
33
+ answer: "c",
34
+ hint: (n) => `$${n}$ est le dixième de $${n * 10}$.`,
35
+ correction: (n) => `Comme $${n}$ est le dixième de $${n * 10}$
36
+ alors seuls le graphique $c$ convient.`,
37
+ },
38
+ {
39
+ description: (n) => `Sur $${n * 5}$ personnes :
40
+ $${n * 2.5}$ ont moins de $18$ ans,
41
+ $${(n * 5) / 4}$ ont entre $18$ et $65$ ans
42
+ et les autres ont plus de $65$ ans.`,
43
+ answer: "d",
44
+ hint: (n) => `$${n * 2.5}$ est la moitié de $${n * 5}$.`,
45
+ correction: (n) => `Comme $${n * 2.5}$ est la moitié de $${n * 5}$
46
+ alors seuls les graphiques $b$ et $d$ conviennent.
47
+ De plus comme le quart de $${n * 5}$ vaut $${(n * 5) / 4}$
48
+ et que $${n}<${(n * 5) / 4}$ alors seul le graphique $d$ convient.`,
49
+ },
50
+ ];
51
+ const getInstruction = (identifiers) => {
52
+ const { indexSituation, bigNumber } = identifiers;
53
+ const situation = situations[indexSituation];
54
+ return `${situation.description(bigNumber)}
55
+
56
+ Parmi les représentations suivantes, laquelle décrit cette situation ?
57
+ ![](https://heureuxhasarddocsbucket.s3-eu-west-3.amazonaws.com/mathlive/tps/teacherImgUpload/c2b24209-5075-4c0f-953a-55dabcedc61f.jpeg)`;
58
+ };
59
+ const getAnswer = (identifiers) => {
60
+ const { indexSituation } = identifiers;
61
+ const situation = situations[indexSituation];
62
+ return situation.answer;
63
+ };
64
+ const getPropositions = (_, { answer, ...identifiers }) => {
65
+ const { indexSituation } = identifiers;
66
+ const situation = situations[indexSituation];
67
+ const propObjs = [
68
+ { tex: situation.answer, isValid: true },
69
+ ...["a", "b", "c", "d"]
70
+ .filter((letter) => letter !== situation.answer)
71
+ .map((letter) => {
72
+ return { tex: letter, isValid: false };
73
+ }),
74
+ ];
75
+ const propositions = [];
76
+ propObjs
77
+ .toSorted(({ tex: l1 }, { tex: l2 }) => l1.localeCompare(l2))
78
+ .forEach(({ tex, isValid }) => {
79
+ if (isValid) {
80
+ addValidProp(propositions, tex, "raw");
81
+ }
82
+ else {
83
+ tryToAddWrongProp(propositions, tex, "raw");
84
+ }
85
+ });
86
+ return propositions;
87
+ };
88
+ const getHint = (identifiers) => {
89
+ const { indexSituation, bigNumber } = identifiers;
90
+ const situation = situations[indexSituation];
91
+ return situation.hint(bigNumber);
92
+ };
93
+ const getCorrection = (identifiers) => {
94
+ const { indexSituation, bigNumber } = identifiers;
95
+ const situation = situations[indexSituation];
96
+ return situation.correction(bigNumber);
97
+ };
98
+ const getDataToGraphGraphToDataQuestion = () => {
99
+ const indexSituation = randint(0, situations.length);
100
+ const bigNumber = random([
101
+ 100, 200, 300, 400, 500, 1_000, 2_000, 3_000, 4_000, 5_000, 10_000, 20_000,
102
+ ]);
103
+ return getQuestionFromIdentifiers({
104
+ indexSituation,
105
+ bigNumber,
106
+ });
107
+ };
108
+ const getQuestionFromIdentifiers = (identifiers) => {
109
+ const question = {
110
+ answer: getAnswer(identifiers),
111
+ instruction: getInstruction(identifiers),
112
+ keys: [],
113
+ answerFormat: "tex",
114
+ identifiers,
115
+ hint: getHint(identifiers),
116
+ correction: getCorrection(identifiers),
117
+ };
118
+ return question;
119
+ };
120
+ export const dataToGraphGraphToData = {
121
+ id: "dataToGraphGraphToData",
122
+ label: "Passer du graphique aux données et vice-versa",
123
+ isSingleStep: true,
124
+ generator: (nb, opts) => getDistinctQuestions(() => getDataToGraphGraphToDataQuestion(opts), nb),
125
+ qcmTimer: 60,
126
+ freeTimer: 60,
127
+ getPropositions,
128
+ hasHintAndCorrection: true,
129
+ subject: "Mathématiques",
130
+ getQuestionFromIdentifiers,
131
+ answerType: "QCM",
132
+ isQCM: true,
133
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ indexSituation: number;
4
+ maxOrScam: number;
5
+ };
6
+ export declare const graphReading: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=graphReading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/graphReading.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,QAAQ,EACT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoKF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
@@ -0,0 +1,136 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../math/utils/random/randint.js";
4
+ import { coinFlip } from "../../../utils/alea/coinFlip.js";
5
+ import { random } from "../../../utils/alea/random.js";
6
+ const propositionFuncs = [
7
+ (interval) => `Le nombre de naissances n'a pas cessé de croitre entre $${interval.min}$ et $${interval.max}$.`,
8
+ (interval) => `Le nombre de naissances n'a pas eu une variation monotone entre $${interval.min}$ et $${interval.max}$.`,
9
+ (interval) => `Le nombre de naissances a augmenté puis diminué entre $${interval.min}$ et $${interval.max}$.`,
10
+ (interval, maxOrScam) => `Le nombre de naissances a toujours été inférieur ou égal à $${maxOrScam}$ entre $${interval.min}$ et $${interval.max}$.`,
11
+ ];
12
+ const situations = [
13
+ {
14
+ interval: { min: 2003, max: 2006 },
15
+ maxValue: 830_000,
16
+ answerIndexes: [0],
17
+ hint: `Observe les variations du graphiques entre $2003$ et $2006$. Monotone signifie "que croissant" ou "que décroissant".`,
18
+ correction: `Comme la courbe monte entre $2003$ et $2006$ alors le nombre de naissances n'a pas cessé de croitre entre $2003$ et $2006$.`,
19
+ },
20
+ {
21
+ interval: { min: 2003, max: 2007 },
22
+ maxValue: 830_000,
23
+ answerIndexes: [1, 2],
24
+ hint: `Observe les variations du graphiques entre $2003$ et $2007$. Monotone signifie "que croissant" ou "que décroissant".`,
25
+ correction: `Comme la courbe monte entre $2003$ et $2006$, puis descend entre $2006$ et $2007$ alors le nombre de naissances a augmenté puis diminué entre $2003$ et $2007$.`,
26
+ },
27
+ {
28
+ interval: { min: 2007, max: 2008 },
29
+ maxValue: 828_000,
30
+ answerIndexes: [0],
31
+ hint: `Observe les variations du graphiques entre $2007$ et $2008$. Monotone signifie "que croissant" ou "que décroissant".`,
32
+ correction: `Comme la courbe monte entre $2007$ et $2008$ alors le nombre de naissances n'a pas cessé de croitre entre $2007$ et $2008$.`,
33
+ },
34
+ {
35
+ interval: { min: 2006, max: 2008 },
36
+ maxValue: 830_000,
37
+ answerIndexes: [1],
38
+ hint: `Observe les variations du graphiques entre $2006$ et $2008$. Monotone signifie "que croissant" ou "que décroissant".`,
39
+ correction: `Comme la courbe descend entre $2006$ et $2007$ puis monte entre $2007$ et $2008$ alors le nombre de naissances a augmenté puis diminué entre $2006$ et $2008$.`,
40
+ },
41
+ {
42
+ interval: { min: 2008, max: 2009 },
43
+ maxValue: 828_000,
44
+ answerIndexes: [],
45
+ hint: `Observe les variations du graphiques entre $2008$ et $2009$. Monotone signifie "que croissant" ou "que décroissant".`,
46
+ correction: `Comme la courbe monte descend entre $2008$ et $2009$ alors le nombre de naissances a diminué entre $2008$ et $2009$.`,
47
+ },
48
+ {
49
+ interval: { min: 2009, max: 2011 },
50
+ maxValue: 833_000,
51
+ answerIndexes: [1, 2],
52
+ hint: `Observe les variations du graphiques entre $2009$ et $2011$. Monotone signifie "que croissant" ou "que décroissant".`,
53
+ correction: `Comme la courbe monte entre $2009$ et $2010$, puis descend entre $2010$ et $2011$ alors le nombre de naissances a augmenté puis diminué entre $2009$ et $2011$.`,
54
+ },
55
+ ];
56
+ const getInstruction = (identifiers) => {
57
+ const { indexSituation } = identifiers;
58
+ const situation = situations[indexSituation];
59
+ return `Sur le graphique ci dessous :
60
+
61
+ ![](https://heureuxhasarddocsbucket.s3-eu-west-3.amazonaws.com/mathlive/tps/teacherImgUpload/354be741-9335-4496-a9c4-84f0e17a85c0.jpeg)
62
+
63
+ Que peut-on dire du nombre de naissances entre $${situation.interval.min}$ et $${situation.interval.max}$ ?`;
64
+ };
65
+ const getPropositions = (_, { answer, ...identifiers }) => {
66
+ const { indexSituation, maxOrScam } = identifiers;
67
+ const situation = situations[indexSituation];
68
+ const propositions = [];
69
+ propositionFuncs.map((propositionFunc, i) => {
70
+ let isValid = situation.answerIndexes.includes(i);
71
+ if (i === 3 && situation.maxValue <= maxOrScam) {
72
+ isValid = true;
73
+ }
74
+ const tex = propositionFunc(situation.interval, maxOrScam);
75
+ if (isValid) {
76
+ addValidProp(propositions, tex, "raw");
77
+ }
78
+ else {
79
+ tryToAddWrongProp(propositions, tex, "raw");
80
+ }
81
+ });
82
+ return propositions;
83
+ };
84
+ const getHint = (identifiers) => {
85
+ const { indexSituation } = identifiers;
86
+ const situation = situations[indexSituation];
87
+ return situation.hint;
88
+ };
89
+ const getCorrection = (identifiers) => {
90
+ const { indexSituation, maxOrScam } = identifiers;
91
+ const situation = situations[indexSituation];
92
+ const isScam = maxOrScam < 1000;
93
+ return `${situation.correction}
94
+
95
+ ${isScam
96
+ ? `Attention, $${maxOrScam}$ n'est pas du tout égal à $${maxOrScam * 1000}$.
97
+ Il faut aussi bien regarder les unités sur un graphique.`
98
+ : ``}`;
99
+ };
100
+ const getGraphReadingQuestion = () => {
101
+ const indexSituation = randint(0, situations.length);
102
+ const situation = situations[indexSituation];
103
+ const isScam = coinFlip();
104
+ const maxOrScam = situation.answerIndexes.length === 0 //guarantee one valid proposition
105
+ ? 840_000
106
+ : random([820, 830, 840]) * (isScam ? 1 : 1000);
107
+ return getQuestionFromIdentifiers({
108
+ indexSituation,
109
+ maxOrScam,
110
+ });
111
+ };
112
+ const getQuestionFromIdentifiers = (identifiers) => {
113
+ const question = {
114
+ instruction: getInstruction(identifiers),
115
+ keys: [],
116
+ answerFormat: "tex",
117
+ identifiers,
118
+ hint: getHint(identifiers),
119
+ correction: getCorrection(identifiers),
120
+ };
121
+ return question;
122
+ };
123
+ export const graphReading = {
124
+ id: "graphReading",
125
+ label: "Lire un graphique",
126
+ isSingleStep: true,
127
+ generator: (nb, opts) => getDistinctQuestions(() => getGraphReadingQuestion(opts), nb),
128
+ qcmTimer: 60,
129
+ freeTimer: 60,
130
+ getPropositions,
131
+ hasHintAndCorrection: true,
132
+ subject: "Mathématiques",
133
+ getQuestionFromIdentifiers,
134
+ answerType: "QCM",
135
+ isQCM: true,
136
+ };