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
@@ -2,9 +2,19 @@ export * from "./tableReading.js";
2
2
  export * from "./barChartReading.js";
3
3
  export * from "./functionGraphReading.js";
4
4
  export * from "./pieChartReading.js";
5
+ export * from "./histogramReading.js";
5
6
  export * from "./boxPlotReadingPercentages.js";
6
7
  export * from "./boxPlotReading.js";
7
8
  export * from "./compareBoxPlot.js";
9
+ export * from "./barChartInterpreting.js";
10
+ export * from "./dataToGraphGraphToData.js";
11
+ export * from "./cartesianGraphExtremaReading.js";
12
+ export * from "./scatterPlotCommenting.js";
13
+ export * from "./boxPlotInterpreting.js";
14
+ export * from "./graphReading.js";
15
+ export * from "./plausibleGraph.js";
16
+ export * from "./halfPieChartReading.js";
17
+ export * from "./halfPieChartCommenting.js";
8
18
  // export * from "./testGen.js";
9
19
  // export * from "./testGenGGB.js";
10
20
  // export * from "./testGenStudentGGB.js";
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ indexSituation: number;
4
+ bigNumber: number;
5
+ values: number[];
6
+ };
7
+ export declare const plausibleGraph: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=plausibleGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plausibleGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/plausibleGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,QAAQ,EACT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA4JF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
@@ -0,0 +1,145 @@
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 { round } from "../../../math/utils/round.js";
5
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
6
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
7
+ import { random } from "../../../utils/alea/random.js";
8
+ import { shuffle } from "../../../utils/alea/shuffle.js";
9
+ const getProportions = (values) => {
10
+ const total = values.reduce((acc, x) => acc + x, 0);
11
+ return values.map((value) => frac(value, total));
12
+ };
13
+ const situations = [
14
+ {
15
+ createValues: (n) => {
16
+ return [n, n, n];
17
+ },
18
+ hint: (n) => {
19
+ return `$${n}$ est le tiers de $${n * 3}$.`;
20
+ },
21
+ tex: `Tous les secteurs du diagramme représentent strictement moins de $50\\%$ des effectifs`,
22
+ },
23
+ {
24
+ createValues: (n) => {
25
+ return [2.5 * n, n, 1.5 * n];
26
+ },
27
+ hint: (n) => {
28
+ return `$${n}$ est le cinquième de $${n * 5}$.`;
29
+ },
30
+ tex: `Un secteur représente une portion égale à $50\\%$ et un autre une portion égale à $20\\%$`,
31
+ },
32
+ {
33
+ createValues: (n) => {
34
+ return [2.5 * n, 1.25 * n, 1.25 * n];
35
+ },
36
+ hint: (n) => {
37
+ return `$${1.25 * n}$ est le quart de $${n * 5}$.`;
38
+ },
39
+ tex: `Un secteur représente une portion égale à $50\\%$ et un autre une portion égale à $25\\%$`,
40
+ },
41
+ {
42
+ createValues: (n) => {
43
+ return [6 * n, 3 * n, n];
44
+ },
45
+ hint: (n) => {
46
+ return `$${n}$ est le dixième de $${n * 10}$.`;
47
+ },
48
+ tex: `Un secteur représente une portion strictement supérieure à $50\\%$`,
49
+ },
50
+ ];
51
+ const getInstruction = (identifiers) => {
52
+ const { values } = identifiers;
53
+ const total = values.reduce((acc, x) => acc + x, 0);
54
+ return `Sur $${total.frenchify()}$ personnes, on distingue $3$ groupes :
55
+
56
+ groupe A : $${values[0].frenchify()}$ personnes
57
+
58
+ groupe B : $${values[1].frenchify()}$ personnes
59
+
60
+ groupe C : les autres.
61
+
62
+ Parmi les propositions ci-dessous, laquelle décrit cette situation représentée par un diagramme circulaire ?`;
63
+ };
64
+ const getPropositions = (_, { ...identifiers }) => {
65
+ const { indexSituation } = identifiers;
66
+ const propositions = [];
67
+ situations.forEach((situation, i) => {
68
+ if (i === indexSituation) {
69
+ addValidProp(propositions, situation.tex, "raw");
70
+ }
71
+ else {
72
+ tryToAddWrongProp(propositions, situation.tex, "raw");
73
+ }
74
+ });
75
+ return propositions;
76
+ };
77
+ const getHint = (identifiers) => {
78
+ const { indexSituation, bigNumber } = identifiers;
79
+ const situation = situations[indexSituation];
80
+ return situation.hint(bigNumber);
81
+ };
82
+ const getCorrection = (identifiers) => {
83
+ const { values } = identifiers;
84
+ const proportions = getProportions(values);
85
+ const approxs = proportions.map((proportion) => {
86
+ const simplified = proportion.simplify();
87
+ const times100 = multiply(100, simplified).simplify().evaluate();
88
+ const isApprox = !Number.isInteger(times100);
89
+ const percentage = round(times100, 0);
90
+ return {
91
+ isApprox,
92
+ percentage,
93
+ };
94
+ });
95
+ return `
96
+ Les proportions sont:
97
+
98
+ ${["A", "B", "C"]
99
+ .map((letter, i) => `
100
+ groupe ${letter} :
101
+
102
+ $$
103
+ ${proportions[i].toTex()} = ${proportions[i].simplify().toTex()} ${approxs[i].isApprox ? `\\approx` : "="} ${approxs[i].percentage}\\%
104
+ $$
105
+
106
+ `)
107
+ .join(``)}`;
108
+ };
109
+ const getPlausibleGraphQuestion = () => {
110
+ const indexSituation = randint(0, situations.length);
111
+ const bigNumber = random([
112
+ 100, 200, 300, 400, 500, 1_000, 2_000, 3_000, 4_000, 5_000, 10_000, 20_000,
113
+ ]);
114
+ const situation = situations[indexSituation];
115
+ const values = shuffle(situation.createValues(bigNumber));
116
+ return getQuestionFromIdentifiers({
117
+ indexSituation,
118
+ bigNumber,
119
+ values,
120
+ });
121
+ };
122
+ const getQuestionFromIdentifiers = (identifiers) => {
123
+ const question = {
124
+ instruction: getInstruction(identifiers),
125
+ keys: [],
126
+ answerFormat: "tex",
127
+ identifiers,
128
+ hint: getHint(identifiers),
129
+ correction: getCorrection(identifiers),
130
+ };
131
+ return question;
132
+ };
133
+ export const plausibleGraph = {
134
+ id: "plausibleGraph",
135
+ label: "Repérer le diagramme vraisemblable",
136
+ isSingleStep: true,
137
+ generator: (nb, opts) => getDistinctQuestions(() => getPlausibleGraphQuestion(opts), nb),
138
+ qcmTimer: 60,
139
+ freeTimer: 60,
140
+ getPropositions,
141
+ hasHintAndCorrection: true,
142
+ subject: "Mathématiques",
143
+ getQuestionFromIdentifiers,
144
+ answerType: "QCU",
145
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ import { CloudPointsIdentifiers } from "../../../math/geometry/CloudPoints.js";
3
+ type Identifiers = {
4
+ cloudPointsIdentifiers: CloudPointsIdentifiers;
5
+ evolutionType: string;
6
+ };
7
+ export declare const scatterPlotCommenting: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=scatterPlotCommenting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scatterPlotCommenting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/scatterPlotCommenting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAK5C,KAAK,WAAW,GAAG;IACjB,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAkZF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAiBvD,CAAC"}
@@ -0,0 +1,308 @@
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 { CloudPoints, CloudPointsConstructor, } from "../../../math/geometry/CloudPoints.js";
5
+ import { Point, PointConstructor } from "../../../math/geometry/point.js";
6
+ import { randint } from "../../../math/utils/random/randint.js";
7
+ import { random, randomMany } from "../../../utils/alea/random.js";
8
+ const countries = [
9
+ "Lusitalie",
10
+ "Franemagne",
11
+ "Esprèce",
12
+ "Belgarie",
13
+ "Slovégal",
14
+ "Finlange",
15
+ "Suénemark",
16
+ "Cromanie",
17
+ "Polgique",
18
+ "Maltonie",
19
+ ];
20
+ const getInstruction = () => {
21
+ return `Observe ce nuage de points.
22
+
23
+ Parmi les propositions suivantes, lesquelles sont vraies ?`;
24
+ };
25
+ const getHint = () => {
26
+ return `Regarde si les points semblent respecter une règle ou bien pas du tout.`;
27
+ };
28
+ const getCorrection = (identifiers) => {
29
+ const { evolutionType, cloudPointsIdentifiers } = identifiers;
30
+ const allValidProps = propsForEvolutionType[evolutionType];
31
+ const cloudPoints = CloudPointsConstructor.fromIdentifiers(cloudPointsIdentifiers);
32
+ return `Voici tout ce que l'on peut dire sur ce nuage de points :
33
+
34
+ ${allValidProps.join(`
35
+
36
+ `)}
37
+
38
+ ${(() => {
39
+ switch (evolutionType) {
40
+ case "increasing": {
41
+ const [pointLowX, pointHighX] = cloudPoints.points.toSorted((p1, p2) => p1.x.evaluate() - p2.x.evaluate());
42
+ return `En particulier :
43
+
44
+ Le pays ${pointLowX.name} a un faible taux de chômage et une faible croissance du PIB.
45
+
46
+ Le pays ${pointHighX.name} a un fort taux de chômage et une forte croissance du PIB.`;
47
+ }
48
+ case "decreasing": {
49
+ const [pointLowX, pointHighX] = cloudPoints.points.toSorted((p1, p2) => p1.x.evaluate() - p2.x.evaluate());
50
+ return `En particulier :
51
+
52
+ Le pays ${pointLowX.name} a un faible taux de chômage et une forte croissance du PIB.
53
+
54
+ Le pays ${pointHighX.name} a un fort taux de chômage et une faible croissance du PIB.`;
55
+ }
56
+ case "unpredictible": {
57
+ return `En effet,
58
+ il y a des pays avec un taux de chômage faible et une croissance faible,
59
+ il y a des pays avec un taux de chômage faible et une croissance forte,
60
+ il y a des pays avec un taux de chômage fort et une croissance faible,
61
+ il y a des pays avec un taux de chômage fort et une croissance forte.
62
+ `;
63
+ }
64
+ case "increasingThenDecreasing": {
65
+ const [pointLowX, pointHighX] = cloudPoints.points.toSorted((p1, p2) => p1.x.evaluate() - p2.x.evaluate());
66
+ return `En particulier :
67
+
68
+ Le pays ${pointLowX.name} a un faible taux de chômage et une faible croissance du PIB.
69
+
70
+ Le pays ${pointHighX.name} a un fort taux de chômage et une faible croissance du PIB.`;
71
+ }
72
+ case "decreasingThenIncreasing": {
73
+ const [pointLowX, pointHighX] = cloudPoints.points.toSorted((p1, p2) => p1.x.evaluate() - p2.x.evaluate());
74
+ return `En particulier :
75
+
76
+ Le pays ${pointLowX.name} a un faible taux de chômage et une forte croissance du PIB.
77
+
78
+ Le pays ${pointHighX.name} a un fort taux de chômage et une forte croissance du PIB.`;
79
+ }
80
+ default:
81
+ return ``;
82
+ }
83
+ })()}`;
84
+ };
85
+ const propsForEvolutionType = {
86
+ increasing: [
87
+ `Plus le taux de chômage est élevé et plus la croissance du PIB est élevée.`,
88
+ `Si le taux de chômage est faible alors la croissance du PIB est faible.`,
89
+ `Si le taux de chômage est élevé alors la croissance du PIB est élevée.`,
90
+ ],
91
+ decreasing: [
92
+ `Plus le taux de chômage est élevé et plus la croissance du PIB est faible.`,
93
+ `Si le taux de chômage est faible alors la croissance du PIB est élevée.`,
94
+ `Si le taux de chômage est élevé alors la croissance du PIB est faible.`,
95
+ ],
96
+ unpredictible: [
97
+ `Il n'y a aucun lien entre le taux de chômage et la croissance du PIB.`,
98
+ ],
99
+ increasingThenDecreasing: [
100
+ `Si le taux de chômage est faible alors la croissance du PIB est faible.`,
101
+ `Si le taux de chômage est élevé alors la croissance du PIB est faible.`,
102
+ ],
103
+ decreasingThenIncreasing: [
104
+ `Si le taux de chômage est faible alors la croissance du PIB est élevée.`,
105
+ `Si le taux de chômage est élevé alors la croissance du PIB est élevée.`,
106
+ ],
107
+ };
108
+ const getPropositions = (n, { evolutionType }) => {
109
+ const propositions = [];
110
+ const allValidProps = propsForEvolutionType[evolutionType];
111
+ const validPropsPicked = randomMany(propsForEvolutionType[evolutionType], randint(1, propsForEvolutionType[evolutionType].length + 1));
112
+ validPropsPicked.forEach((str) => {
113
+ addValidProp(propositions, str, "raw");
114
+ });
115
+ const invalidProps = [
116
+ ...Object.values(propsForEvolutionType).flatMap((props) => props),
117
+ ]
118
+ .filter((prop) => !allValidProps.includes(prop))
119
+ //prevent confusion
120
+ .filter((prop) => evolutionType === "increasingThenDecreasing" ||
121
+ evolutionType === "decreasingThenIncreasing"
122
+ ? prop !==
123
+ `Il n'y a aucun lien entre le taux de chômage et la croissance du PIB.`
124
+ : true);
125
+ invalidProps.forEach((str) => {
126
+ tryToAddWrongProp(propositions, str, "raw");
127
+ });
128
+ return shuffleProps(propositions, n);
129
+ };
130
+ const getGGBOptions = (identifiers) => {
131
+ const { cloudPointsIdentifiers } = identifiers;
132
+ const cloudPoints = new CloudPoints(cloudPointsIdentifiers.pointsIdentifiers.map((i) => PointConstructor.fromIdentifiers(i)));
133
+ const commands = cloudPoints.points.flatMap((point, i) => {
134
+ return [
135
+ `${point.name}=Point({${point.getXnumber()},${point.getYnumber()}})`,
136
+ `SetFixed(${point.name},true)`,
137
+ `Lbl_{${i}} = Text("\\tiny ${point.name}", (${point.x.toMathString()},${point.y.evaluate() + 0.7}), true, true, 0, 0)`,
138
+ `SetFixed(Lbl_{${i}},true)`,
139
+ ];
140
+ });
141
+ const ggb = new GeogebraConstructor({
142
+ commands,
143
+ hideAxes: false,
144
+ hideGrid: false,
145
+ xAxis: {
146
+ steps: 1,
147
+ label: "Chômage (%)",
148
+ },
149
+ yAxis: {
150
+ steps: 0.5,
151
+ label: "Croissance du PIB (%)",
152
+ },
153
+ fontSize: 15,
154
+ });
155
+ const xValues = cloudPoints.points.map((element) => {
156
+ return element.getXnumber();
157
+ });
158
+ const yValues = cloudPoints.points.map((element) => {
159
+ return element.getYnumber();
160
+ });
161
+ const xMin = Math.min(...xValues);
162
+ const xMax = Math.max(...xValues);
163
+ const yMin = Math.min(...yValues);
164
+ const yMax = Math.max(...yValues);
165
+ return ggb.getOptions({
166
+ coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
167
+ });
168
+ };
169
+ const getScatterPlotCommentingQuestion = () => {
170
+ const nbCountries = 6;
171
+ const countriesPicked = randomMany(countries, nbCountries);
172
+ const boxFull = { xMin: 3, xMax: 13, yMin: 0, yMax: 4 };
173
+ const evolutionType = random([
174
+ "increasing",
175
+ "decreasing",
176
+ "unpredictible",
177
+ "increasingThenDecreasing",
178
+ "decreasingThenIncreasing",
179
+ ]);
180
+ let cloudPointsWithEvoBoxed;
181
+ switch (evolutionType) {
182
+ case "increasing":
183
+ case "decreasing":
184
+ {
185
+ cloudPointsWithEvoBoxed =
186
+ CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountries, evolutionType), boxFull);
187
+ }
188
+ break;
189
+ case "unpredictible":
190
+ default:
191
+ {
192
+ const nbCountriesTop = Math.floor(nbCountries / 2);
193
+ const nbCountriesBottom = nbCountries - nbCountriesTop;
194
+ const cloudPointsTop = CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountriesTop, "scatter"), {
195
+ xMin: 0,
196
+ xMax: 1,
197
+ yMin: 0.7,
198
+ yMax: 1,
199
+ });
200
+ const cloudPointsBottom = CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountriesBottom, "scatter"), {
201
+ xMin: 0,
202
+ xMax: 1,
203
+ yMin: 0,
204
+ yMax: 0.3,
205
+ });
206
+ cloudPointsWithEvoBoxed =
207
+ CloudPointsConstructor.cloudPointsByReboxingCloudPoints(new CloudPoints([
208
+ ...cloudPointsTop.points,
209
+ ...cloudPointsBottom.points,
210
+ ]), boxFull);
211
+ }
212
+ break;
213
+ case "increasingThenDecreasing":
214
+ {
215
+ const nbCountriesIncr = Math.floor(nbCountries / 2);
216
+ const nbCountriesDecr = nbCountries - nbCountriesIncr;
217
+ const cloudPointsIncr = CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountriesIncr, "increasing"), {
218
+ xMin: 0,
219
+ xMax: 0.5,
220
+ yMin: 0,
221
+ yMax: 1,
222
+ });
223
+ const cloudPointsDecr = CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountriesDecr, "decreasing"), {
224
+ xMin: 0.5,
225
+ xMax: 1,
226
+ yMin: 0,
227
+ yMax: 1,
228
+ });
229
+ const boxLow = {
230
+ xMin: boxFull.xMin,
231
+ xMax: boxFull.xMax,
232
+ yMin: boxFull.yMin,
233
+ yMax: ((boxFull.yMin + boxFull.yMax) * 1) / 3,
234
+ };
235
+ cloudPointsWithEvoBoxed =
236
+ CloudPointsConstructor.cloudPointsByReboxingCloudPoints(new CloudPoints([
237
+ ...cloudPointsIncr.points,
238
+ ...cloudPointsDecr.points,
239
+ ]), boxLow);
240
+ }
241
+ break;
242
+ case "decreasingThenIncreasing":
243
+ {
244
+ const nbCountriesDecr = Math.floor(nbCountries / 2);
245
+ const nbCountriesIncr = nbCountries - nbCountriesDecr;
246
+ const cloudPointsDecr = CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountriesDecr, "decreasing"), {
247
+ xMin: 0,
248
+ xMax: 0.5,
249
+ yMin: 0,
250
+ yMax: 1,
251
+ });
252
+ const cloudPointsIncr = CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountriesIncr, "increasing"), {
253
+ xMin: 0.5,
254
+ xMax: 1,
255
+ yMin: 0,
256
+ yMax: 1,
257
+ });
258
+ const boxHigh = {
259
+ xMin: boxFull.xMin,
260
+ xMax: boxFull.xMax,
261
+ yMin: ((boxFull.yMin + boxFull.yMax) * 2) / 3,
262
+ yMax: boxFull.yMax,
263
+ };
264
+ cloudPointsWithEvoBoxed =
265
+ CloudPointsConstructor.cloudPointsByReboxingCloudPoints(new CloudPoints([
266
+ ...cloudPointsIncr.points,
267
+ ...cloudPointsDecr.points,
268
+ ]), boxHigh);
269
+ }
270
+ break;
271
+ }
272
+ const namedPoints = cloudPointsWithEvoBoxed.points.map((point, i) => new Point(countriesPicked[i], point.x, point.y));
273
+ const cloudPointsNamed = new CloudPoints(namedPoints);
274
+ const identifiers = {
275
+ cloudPointsIdentifiers: cloudPointsNamed.toIdentifiers(),
276
+ evolutionType,
277
+ };
278
+ return getQuestionFromIdentifiers(identifiers);
279
+ };
280
+ const getQuestionFromIdentifiers = (identifiers) => {
281
+ const question = {
282
+ instruction: getInstruction(identifiers),
283
+ hint: getHint(identifiers),
284
+ correction: getCorrection(identifiers),
285
+ ggbOptions: getGGBOptions(identifiers),
286
+ keys: [],
287
+ answerFormat: "raw",
288
+ identifiers,
289
+ };
290
+ return question;
291
+ };
292
+ export const scatterPlotCommenting = {
293
+ id: "scatterPlotCommenting",
294
+ label: "Commenter un nuage de points",
295
+ isSingleStep: true,
296
+ hasGeogebra: true,
297
+ generator: (nb) => getDistinctQuestions(getScatterPlotCommentingQuestion, nb),
298
+ qcmTimer: 60,
299
+ freeTimer: 60,
300
+ getPropositions,
301
+ getHint,
302
+ getCorrection,
303
+ subject: "Mathématiques",
304
+ getQuestionFromIdentifiers,
305
+ hasHintAndCorrection: true,
306
+ answerType: "QCM",
307
+ isQCM: true,
308
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"expDerivativeFour.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/exp/expDerivativeFour.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAmFF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAenD,CAAC"}
1
+ {"version":3,"file":"expDerivativeFour.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/derivation/derivative/exp/expDerivativeFour.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAyFF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAenD,CAAC"}
@@ -3,6 +3,7 @@ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinct
3
3
  import { Affine, AffineConstructor } from "../../../../../math/polynomials/affine.js";
4
4
  import { ExpNode } from "../../../../../tree/nodes/functions/expNode.js";
5
5
  import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
6
7
  import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
7
8
  import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
8
9
  const getInstruction = (identifiers) => {
@@ -18,12 +19,15 @@ f(x) = ${fct.toTex()}
18
19
  $$`;
19
20
  };
20
21
  const getAnswer = (identifiers) => {
22
+ return getAnswerNode(identifiers).toTex();
23
+ };
24
+ const getAnswerNode = (identifiers) => {
21
25
  const { affine1Coeffs, affine2Coeffs } = identifiers;
22
26
  const affine1 = new Affine(affine1Coeffs[1], affine1Coeffs[0]);
23
27
  const affine2 = new Affine(affine2Coeffs[1], affine2Coeffs[0]);
24
28
  const exp = new ExpNode(affine2.toTree());
25
29
  const deriv = new MultiplyNode(new Affine(affine2.a * affine1.a, affine1.a + affine2.a * affine1.b).toTree(), exp);
26
- return deriv.simplify().toTex();
30
+ return deriv.simplify();
27
31
  };
28
32
  const getExpDerivativeFourQuestion = () => {
29
33
  const affine1 = AffineConstructor.random();
@@ -53,12 +57,13 @@ const getPropositions = (n, { answer }) => {
53
57
  });
54
58
  return shuffleProps(propositions, n);
55
59
  };
56
- const isAnswerValid = (ans, { answer }) => {
60
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
57
61
  try {
58
- const parsed = parseAlgebraic(ans);
59
- if (!parsed)
62
+ const ansNode = parseAlgebraic(ans);
63
+ if (!ansNode)
60
64
  return false;
61
- return parsed.simplify().toTex() === answer;
65
+ const answerNode = getAnswerNode(identifiers);
66
+ return substract(ansNode, answerNode).simplify().evaluate() === 0;
62
67
  }
63
68
  catch (err) {
64
69
  return handleVEAError(err);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ coeffs: number[];
4
+ yValue: number;
5
+ };
6
+ export declare const coordsOfPointOnAffineFindX: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=coordsOfPointOnAffineFindX.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordsOfPointOnAffineFindX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/coordsOfPointOnAffineFindX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAuHF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAc5D,CAAC"}
@@ -0,0 +1,103 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
4
+ import { Polynomial } from "../../../../math/polynomials/polynomial.js";
5
+ import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { equationResolutionTex } from "../../../../tree/nodes/equations/equalNode.js";
7
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
8
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
9
+ const getInstruction = (identifiers) => {
10
+ const { yValue, coeffs } = identifiers;
11
+ const affine = AffineConstructor.fromCoeffs(coeffs);
12
+ return `Le point $M$ d'ordonnée $${yValue}$ appartient à la courbe d'équation
13
+
14
+ $$
15
+ y=${affine.toTex()}
16
+ $$
17
+
18
+ Quelles sont les coordonnées de $M$ ?`;
19
+ };
20
+ const getAnswer = (identifiers) => {
21
+ const { yValue, coeffs } = identifiers;
22
+ const polynome = AffineConstructor.fromCoeffs(coeffs);
23
+ const xValue = polynome.solve(yValue);
24
+ const answer = `(${xValue.toTex()};${yValue.frenchify()})`;
25
+ return answer;
26
+ };
27
+ const getHint = (identifiers) => {
28
+ const { yValue, coeffs } = identifiers;
29
+ const affine = new Affine(coeffs[1], coeffs[0], "x_{M}");
30
+ return `Les coordonnées de $M$ vérifient:
31
+
32
+ $$
33
+ ${affine.toTex()} = y_{M}
34
+ $$
35
+
36
+ On doit donc résoudre l'équation :
37
+
38
+ $$
39
+ ${affine.toTex()} = ${yValue}
40
+ $$`;
41
+ };
42
+ const getCorrection = (identifiers) => {
43
+ const { yValue, coeffs } = identifiers;
44
+ const affine = new Affine(coeffs[1], coeffs[0], "x_{M}");
45
+ const answer = getAnswer(identifiers);
46
+ return `On résout l'équation :
47
+
48
+ $$
49
+ ${affine.toTex()} = ${yValue}
50
+ $$
51
+
52
+ On obtient :
53
+
54
+ $$
55
+ ${equationResolutionTex(coeffs[1].toTree(), coeffs[0].toTree(), (0).toTree(), yValue.toTree(), "x_{M}")}
56
+ $$
57
+
58
+ Les coordonnées de $M$ sont donc $${answer}$.`;
59
+ };
60
+ const getPropositions = (n, { answer, coeffs, yValue }) => {
61
+ const [p, m] = coeffs;
62
+ const propositions = [];
63
+ addValidProp(propositions, answer);
64
+ const poly = AffineConstructor.fromCoeffs(coeffs);
65
+ tryToAddWrongProp(propositions, `(${yValue.frenchify()}, ${poly.calculate(yValue).frenchify()})`);
66
+ tryToAddWrongProp(propositions, `(${yValue}, ${AffineConstructor.fromCoeffs([p, -m])
67
+ .calculate(yValue)
68
+ .frenchify()})`);
69
+ tryToAddWrongProp(propositions, `(${frac(add(yValue, p), m).simplify().toTex()}, ${yValue.frenchify()})`);
70
+ return shuffleProps(propositions, n);
71
+ };
72
+ const getCoordsOfPointOnAffineFindXQuestion = () => {
73
+ const polynome1 = new Polynomial([randint(-9, 10), randint(-5, 6, [0])]);
74
+ const xValue = randint(-9, 10);
75
+ const y = polynome1.calculate(xValue);
76
+ const identifiers = { coeffs: polynome1.coefficients, yValue: y };
77
+ return getQuestionFromIdentifiers(identifiers);
78
+ };
79
+ const getQuestionFromIdentifiers = (identifiers) => {
80
+ const question = {
81
+ instruction: getInstruction(identifiers),
82
+ answer: getAnswer(identifiers),
83
+ keys: [],
84
+ answerFormat: "tex",
85
+ identifiers,
86
+ hint: getHint(identifiers),
87
+ correction: getCorrection(identifiers),
88
+ };
89
+ return question;
90
+ };
91
+ export const coordsOfPointOnAffineFindX = {
92
+ id: "coordsOfPointOnAffineFindX",
93
+ getPropositions,
94
+ label: "Déterminer les coordonnées d'un point appartenant à une courbe et dont on connaît l'ordonnée",
95
+ isSingleStep: true,
96
+ generator: (nb) => getDistinctQuestions(getCoordsOfPointOnAffineFindXQuestion, nb),
97
+ qcmTimer: 60,
98
+ freeTimer: 60,
99
+ subject: "Mathématiques",
100
+ getQuestionFromIdentifiers,
101
+ hasHintAndCorrection: true,
102
+ answerType: "QCU",
103
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ coeffs: number[];
4
+ xValue: number;
5
+ };
6
+ export declare const coordsOfPointOnAffineFindY: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=coordsOfPointOnAffineFindY.d.ts.map