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 @@
1
+ {"version":3,"file":"coordsOfPointOnAffineFindY.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/coordsOfPointOnAffineFindY.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6GF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAc5D,CAAC"}
@@ -0,0 +1,100 @@
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 { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
7
+ const getInstruction = (identifiers) => {
8
+ const { xValue, coeffs } = identifiers;
9
+ const affine = AffineConstructor.fromCoeffs(coeffs);
10
+ return `Le point $M$ d'abscisse $${xValue}$ appartient à la courbe d'équation
11
+
12
+ $$
13
+ y=${affine.toTex()}
14
+ $$
15
+
16
+ Quelles sont les coordonnées de $M$ ?`;
17
+ };
18
+ const getAnswer = (identifiers) => {
19
+ const { xValue, coeffs } = identifiers;
20
+ const polynome = AffineConstructor.fromCoeffs(coeffs);
21
+ const yValue = polynome.calculate(xValue);
22
+ const answer = `(${xValue.frenchify()};${yValue.frenchify()})`;
23
+ return answer;
24
+ };
25
+ const getHint = (identifiers) => {
26
+ const { xValue, coeffs } = identifiers;
27
+ const affine = new Affine(coeffs[1], coeffs[0], "x_{M}");
28
+ return `Les coordonnées de $M$ vérifient:
29
+
30
+ $$
31
+ ${affine.toTex()} = y_{M}
32
+ $$
33
+
34
+ On doit calculer :
35
+
36
+ $$
37
+ y_{M} = ${coeffs[1].frenchify()} \\times ${xValue.frenchify()} + ${coeffs[0].frenchify()}
38
+ $$`;
39
+ };
40
+ const getCorrection = (identifiers) => {
41
+ const { xValue, coeffs } = identifiers;
42
+ const polynome = AffineConstructor.fromCoeffs(coeffs);
43
+ const yValue = polynome.calculate(xValue);
44
+ const answer = getAnswer(identifiers);
45
+ return `On calcule :
46
+
47
+ $$
48
+ y_{M} = ${coeffs[1].frenchify()} \\times ${xValue
49
+ .toTree()
50
+ .toTex({ explicitNumberWriting: true })} + ${coeffs[0].frenchify()}
51
+ $$
52
+
53
+ $$
54
+ y_{M} = ${yValue.frenchify()}
55
+ $$
56
+
57
+ Les coordonnées de $M$ sont donc $${answer}$.`;
58
+ };
59
+ const getPropositions = (n, { answer, coeffs, xValue }) => {
60
+ const [p, m] = coeffs;
61
+ const propositions = [];
62
+ addValidProp(propositions, answer);
63
+ const poly = AffineConstructor.fromCoeffs(coeffs);
64
+ tryToAddWrongProp(propositions, `(${m.frenchify()}, ${p.frenchify()})`);
65
+ tryToAddWrongProp(propositions, `(${p.frenchify()}, ${m.frenchify()})`);
66
+ tryToAddWrongProp(propositions, `(${xValue.frenchify()}, ${multiply(m, xValue).simplify().toTex()})`);
67
+ tryToAddWrongProp(propositions, `(${xValue.frenchify()}, ${poly.calculate(1).frenchify()})`);
68
+ return shuffleProps(propositions, n);
69
+ };
70
+ const getCoordsOfPointOnAffineFindYQuestion = () => {
71
+ const polynome1 = new Polynomial([randint(-9, 10), randint(-5, 6, [0])]);
72
+ const xValue = randint(-9, 10);
73
+ const identifiers = { coeffs: polynome1.coefficients, xValue };
74
+ return getQuestionFromIdentifiers(identifiers);
75
+ };
76
+ const getQuestionFromIdentifiers = (identifiers) => {
77
+ const question = {
78
+ instruction: getInstruction(identifiers),
79
+ answer: getAnswer(identifiers),
80
+ keys: [],
81
+ answerFormat: "tex",
82
+ identifiers,
83
+ hint: getHint(identifiers),
84
+ correction: getCorrection(identifiers),
85
+ };
86
+ return question;
87
+ };
88
+ export const coordsOfPointOnAffineFindY = {
89
+ id: "coordsOfPointOnAffineFindY",
90
+ getPropositions,
91
+ label: "Déterminer les coordonnées d'un point appartenant à une courbe et dont on connaît l'abscisse",
92
+ isSingleStep: true,
93
+ generator: (nb) => getDistinctQuestions(getCoordsOfPointOnAffineFindYQuestion, nb),
94
+ qcmTimer: 60,
95
+ freeTimer: 60,
96
+ subject: "Mathématiques",
97
+ getQuestionFromIdentifiers,
98
+ hasHintAndCorrection: true,
99
+ answerType: "QCU",
100
+ };
@@ -1,13 +1,13 @@
1
- import { isGGBLine } from "../../../../exercises/utils/geogebra/isGGBLine.js";
2
- import { isGGBPoint } from "../../../../exercises/utils/geogebra/isGGBPoint.js";
3
1
  import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
4
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
5
- import { deleteObjectNamesFromAnswer } from "../../../../geogebra/deleteObjectNamesFromAnswer.js";
6
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
7
- import { approxEqual } from "../../../../geogebra/parsers/approxEqual.js";
8
- import { Point } from "../../../../math/geometry/point.js";
9
4
  import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
10
5
  import { random } from "../../../../utils/alea/random.js";
6
+ import { isGGBLine } from "../../../../exercises/utils/geogebra/isGGBLine.js";
7
+ import { isGGBPoint } from "../../../../exercises/utils/geogebra/isGGBPoint.js";
8
+ import { deleteObjectNamesFromAnswer } from "../../../../geogebra/deleteObjectNamesFromAnswer.js";
9
+ import { approxEqual } from "../../../../geogebra/parsers/approxEqual.js";
10
+ import { Point } from "../../../../math/geometry/point.js";
11
11
  import { arrayEqual } from "../../../../utils/arrays/arrayEqual.js";
12
12
  const getInstruction = (identifiers) => {
13
13
  const { correctA, correctB, nameFunc } = identifiers;
@@ -0,0 +1,16 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { PointIdentifiers } from "../../../../math/geometry/point.js";
3
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
4
+ type Identifiers = {
5
+ pointIdsA: PointIdentifiers;
6
+ leadingCoeff: NodeIdentifiers;
7
+ numberType: string;
8
+ pointIdsB: PointIdentifiers;
9
+ funcName: string;
10
+ };
11
+ type Options = {
12
+ numberTypes: string[];
13
+ };
14
+ export declare const drawAffineFromPointAndLeadingCoeff: Exercise<Identifiers, Options>;
15
+ export {};
16
+ //# sourceMappingURL=drawAffineFromPointAndLeadingCoeff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawAffineFromPointAndLeadingCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA4FF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CACvD,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -0,0 +1,215 @@
1
+ import { GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
+ import { isGGBLine } from "../../../../exercises/utils/geogebra/isGGBLine.js";
3
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
4
+ import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
5
+ import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
6
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
7
+ import { random } from "../../../../utils/alea/random.js";
8
+ import { Line } from "../../../../math/geometry/line.js";
9
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
10
+ import { randint } from "../../../../math/utils/random/randint.js";
11
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
12
+ import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
13
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
14
+ const getHint = () => {
15
+ return `Si $f$ est une fonction telle que $f(x) = y$,
16
+ alors la droite représentative de f passe par le point de coordonnées $(x;y)$.
17
+ Si le coefficient directeur vaut $\\frac{v}{h}$ alors le point de coordonnées $(x+h;y+v)$
18
+ appartient aussi à la droite représentative de $f$.`;
19
+ };
20
+ const getCorrection = (identifiers) => {
21
+ const { pointIdsA, leadingCoeff, numberType, pointIdsB, funcName } = identifiers;
22
+ const pointA = PointConstructor.fromIdentifiers(pointIdsA);
23
+ const pointB = PointConstructor.fromIdentifiers(pointIdsB);
24
+ const coeff = NodeConstructor.fromIdentifiers(leadingCoeff);
25
+ const texCoeff = numberType === "Fraction" ? coeff.toTex() : coeff.evaluate().frenchify();
26
+ const offsetVert = coeff.leftChild.evaluate();
27
+ const isUp = Math.sign(offsetVert) >= 0;
28
+ const offsetHoriz = coeff.rightChild.evaluate();
29
+ return `La fonction $${funcName}$ est une fonction affine.
30
+ Sa représentation graphique est une droite, que l'on va nommer $d$.
31
+
32
+ On sait que $ ${funcName}(${pointA.x.toTex()}) = ${pointA.y.toTex()} $.
33
+ C'est-à-dire que le point $A$ de coordonnées $(${pointA.x.toTex()}; ${pointA.y.toTex()})$ appartient à $d$.
34
+
35
+ Comme le coefficient directeur est égal à $${texCoeff} = ${coeff.toTex({
36
+ allowMinusAnywhereInFraction: true,
37
+ explicitNumberWriting: true,
38
+ })}$
39
+ alors à partir de $A$, on se déplace verticalement de $${Math.abs(offsetVert).frenchify()}$ carreaux vers le ${isUp ? `haut` : `bas`}
40
+ quand on se déplace horizontalement de $${offsetHoriz.frenchify()}$ carreaux vers la droite.
41
+
42
+ C'est-à-dire que le point $B$ de coordonnées $(${pointB.x.toTex()}; ${pointB.y.toTex()})$ appartient à $d$.
43
+
44
+ On trace donc la droite passant $A(${pointA.x.toTex()}; ${pointA.y.toTex()})$ et $B(${pointB.x
45
+ .evaluate()
46
+ .frenchify()}; ${pointB.y.evaluate().frenchify()})$.`;
47
+ };
48
+ const getInstruction = (identifiers) => {
49
+ const { pointIdsA, leadingCoeff, numberType, funcName } = identifiers;
50
+ const pointA = PointConstructor.fromIdentifiers(pointIdsA);
51
+ const coeff = NodeConstructor.fromIdentifiers(leadingCoeff);
52
+ const texCoeff = numberType === "Fraction" ? coeff.toTex() : coeff.evaluate().frenchify();
53
+ return `La fonction $${funcName}$ est telle que $f(x)=${texCoeff}x+b$ avec b un nombre réel et
54
+ $ ${funcName}(${pointA.x.toTex()}) = ${pointA.y.toTex()} $.
55
+
56
+ Dans le repère, tracer la représentation graphique de la fonction $${funcName}$.`;
57
+ };
58
+ const getStudentGGBOptions = (identifiers) => {
59
+ const { pointIdsA, pointIdsB } = identifiers;
60
+ const pointA = PointConstructor.fromIdentifiers(pointIdsA);
61
+ const pointB = PointConstructor.fromIdentifiers(pointIdsB);
62
+ const studentGGB = new GeogebraConstructor({
63
+ isGridSimple: true,
64
+ customToolBar: toolBarConstructor({
65
+ join: true,
66
+ }),
67
+ });
68
+ const [xA, xB, yA, yB] = [pointA.x, pointB.x, pointA.y, pointB.y].map((node) => node.evaluate());
69
+ const [xMin, xMax, yMin, yMax] = [
70
+ Math.min(xA, xB),
71
+ Math.max(xA, xB),
72
+ Math.min(yA, yB),
73
+ Math.max(yA, yB),
74
+ ];
75
+ return studentGGB.getOptions({
76
+ coords: studentGGB.getAdaptedCoords({
77
+ xMin,
78
+ xMax,
79
+ yMax,
80
+ yMin,
81
+ forceShowAxes: true,
82
+ }),
83
+ });
84
+ };
85
+ const getGGBAnswer = (identifiers) => {
86
+ const { pointIdsA, pointIdsB } = identifiers;
87
+ const pointA = PointConstructor.fromIdentifiers(pointIdsA);
88
+ const pointB = PointConstructor.fromIdentifiers(pointIdsB);
89
+ return [
90
+ `(${pointA.x.evaluate()},${pointA.y.evaluate()})`,
91
+ `(${pointB.x.evaluate()},${pointB.y.evaluate()})`,
92
+ `Line[A, B]`,
93
+ ];
94
+ };
95
+ const isGGBAnswerValid = (ans, { pointIdsA, pointIdsB }) => {
96
+ try {
97
+ //parse la line (si +1, faux)
98
+ // parse le spoints de la line
99
+ //transformer en vrai droite
100
+ // checker si A et B sont sur la droite
101
+ const lines = ans.filter((s) => isGGBLine(s));
102
+ if (lines.length !== 1)
103
+ return false;
104
+ const pointNames = lines[0]
105
+ .split("Line")[1]
106
+ .replace("[", "")
107
+ .replace("]", "")
108
+ .replace(" ", "")
109
+ .split(",");
110
+ const pointCmds = ans.filter((s) => s.startsWith(pointNames[0] + "=") || s.startsWith(pointNames[1] + "="));
111
+ const pointsCoords = pointCmds.map((cmd) => cmd
112
+ .split("=")[1]
113
+ .replace("(", "")
114
+ .replace(")", "")
115
+ .split(",")
116
+ .map((n) => Number(n)));
117
+ const points = pointsCoords.map((coord) => new Point("A", coord[0], coord[1]));
118
+ const line = new Line(points[0], points[1]);
119
+ const A = PointConstructor.fromIdentifiers(pointIdsA);
120
+ const B = PointConstructor.fromIdentifiers(pointIdsB);
121
+ return line.includes(A, 0.5) && line.includes(B, 0.5);
122
+ }
123
+ catch (err) {
124
+ return handleVEAError(err);
125
+ }
126
+ };
127
+ const optsDefault = {
128
+ numberTypes: ["Entier", ".5", "Fraction"],
129
+ };
130
+ const options = [
131
+ {
132
+ id: "numberTypes",
133
+ label: "Type de coefficient directeur",
134
+ type: GeneratorOptionType.multiselect,
135
+ target: GeneratorOptionTarget.generation,
136
+ values: ["Entier", ".5", "Fraction"],
137
+ defaultValue: optsDefault.numberTypes,
138
+ },
139
+ ];
140
+ const getDrawAffineFromPointAndLeadingCoeffQuestion = (optsIn) => {
141
+ const opts = optsIn ?? optsDefault;
142
+ const numberType = random(opts.numberTypes);
143
+ let v;
144
+ let h;
145
+ switch (numberType) {
146
+ case ".5":
147
+ {
148
+ h = 2;
149
+ v = random([...Array(21).keys()].map((i) => i - 10).filter((v) => v % h !== 0));
150
+ }
151
+ break;
152
+ case "Fraction":
153
+ {
154
+ v = randint(-11, 11, [-11, 0]);
155
+ h = random([2, 3, 4, 5, 6, 7, 8, 9].filter((h) => v % h !== 0));
156
+ }
157
+ break;
158
+ default:
159
+ case "Entier":
160
+ {
161
+ v = randint(-11, 11, [-11]);
162
+ h = 1;
163
+ }
164
+ break;
165
+ }
166
+ const leadingCoeffNode = frac(v, h);
167
+ const availableCoordValues = [...Array(21).keys()].map((i) => i - 10);
168
+ const [xA, yA] = [0, 1].map((_) => random(availableCoordValues));
169
+ const xOffset = leadingCoeffNode.rightChild.evaluate();
170
+ const [xB, yB] = [
171
+ add(xA, xOffset),
172
+ add(yA, leadingCoeffNode.leftChild.evaluate()),
173
+ ];
174
+ const pointA = new Point("A", xA, yA);
175
+ const pointB = new Point("B", xB, yB);
176
+ const funcName = random(["f", "g"]);
177
+ const identifiers = {
178
+ pointIdsA: pointA.toIdentifiers(),
179
+ leadingCoeff: leadingCoeffNode.toIdentifiers(),
180
+ numberType: numberType,
181
+ pointIdsB: pointB.toIdentifiers(),
182
+ funcName,
183
+ };
184
+ return getQuestionFromIdentifiers(identifiers, opts);
185
+ };
186
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
187
+ const question = {
188
+ ggbAnswer: getGGBAnswer(identifiers),
189
+ instruction: getInstruction(identifiers),
190
+ keys: [],
191
+ answerFormat: "tex",
192
+ studentGgbOptions: getStudentGGBOptions(identifiers),
193
+ identifiers,
194
+ hint: getHint(identifiers),
195
+ correction: getCorrection(identifiers),
196
+ options: opts,
197
+ };
198
+ return question;
199
+ };
200
+ export const drawAffineFromPointAndLeadingCoeff = {
201
+ id: "drawAffineFromPointAndLeadingCoeff",
202
+ label: "Tracer la représentation graphique d'une fonction affine avec un point et le coefficient directeur",
203
+ isSingleStep: true,
204
+ answerType: "GGB",
205
+ generator: (nb, opts) => getDistinctQuestions(() => getDrawAffineFromPointAndLeadingCoeffQuestion(opts), nb),
206
+ options,
207
+ ggbTimer: 60,
208
+ isGGBAnswerValid,
209
+ subject: "Mathématiques",
210
+ getGGBAnswer,
211
+ getInstruction,
212
+ getStudentGGBOptions,
213
+ getQuestionFromIdentifiers,
214
+ hasHintAndCorrection: true,
215
+ };
@@ -0,0 +1,13 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { ProgCalcIdentifiers } from "../../../../math/progCalc/progCalc.js";
3
+ type Identifiers = {
4
+ progCalcIds: ProgCalcIdentifiers;
5
+ funcName: string;
6
+ };
7
+ type Options = {
8
+ nbSteps: Exclude<number, 0>;
9
+ isSingleUseOperators: boolean;
10
+ };
11
+ export declare const drawAffineFromProgCalc: Exercise<Identifiers, Options>;
12
+ export {};
13
+ //# sourceMappingURL=drawAffineFromProgCalc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawAffineFromProgCalc.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromProgCalc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,mBAAmB,EAEpB,MAAM,iCAAiC,CAAC;AAMzC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAgNF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAwBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBjE,CAAC"}
@@ -0,0 +1,206 @@
1
+ import { GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
+ import { isGGBLine } from "../../../../exercises/utils/geogebra/isGGBLine.js";
3
+ import { isGGBPoint } from "../../../../exercises/utils/geogebra/isGGBPoint.js";
4
+ import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
5
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
6
+ import { deleteObjectNamesFromAnswer } from "../../../../geogebra/deleteObjectNamesFromAnswer.js";
7
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
8
+ import { approxEqual } from "../../../../geogebra/parsers/approxEqual.js";
9
+ import { Point } from "../../../../math/geometry/point.js";
10
+ import { ProgCalcConstructor, } from "../../../../math/progCalc/progCalc.js";
11
+ import { randint } from "../../../../math/utils/random/randint.js";
12
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
13
+ import { random } from "../../../../utils/alea/random.js";
14
+ import { arrayEqual } from "../../../../utils/arrays/arrayEqual.js";
15
+ const getInstruction = (identifiers) => {
16
+ const { progCalcIds, funcName } = identifiers;
17
+ const progCalc = ProgCalcConstructor.fromIdentifiers(progCalcIds);
18
+ return `La fonction $ ${funcName} $ est définie par le programme de calcul suivant :
19
+
20
+ ${progCalc.getArrOfFrenchStrings().map((str) => `
21
+
22
+ ${str}
23
+ `)}
24
+
25
+ Dans le repère, tracer la représentation de la fonction $ ${funcName} $.`;
26
+ };
27
+ const getHint = (identifiers) => {
28
+ const { funcName } = identifiers;
29
+ return `
30
+ Exécute le programme de calcul en partant d'une valeur $x$ de ton choix.
31
+
32
+ Cela te donnera la valeur de $ ${funcName}(x) $.
33
+
34
+ Le point de coordonnées $ (x;${funcName}(x)) $ appartient à la droite qu'il faut tracer.
35
+ `;
36
+ };
37
+ const getCorrection = (identifiers) => {
38
+ const { progCalcIds, funcName } = identifiers;
39
+ const progCalc = ProgCalcConstructor.fromIdentifiers(progCalcIds);
40
+ const xA = 0;
41
+ const yA = progCalc.apply(xA.toTree()).evaluate();
42
+ const xB = 1;
43
+ const yB = progCalc.apply(xB.toTree()).evaluate();
44
+ return `
45
+ Toutes les fonctions dans le programme de calcul sont des fonctions affines,
46
+ la fonction $ ${funcName} $ est donc une fonction affine. On va donc tracer une droite.
47
+
48
+ Si on exécute le programme de calcul avec la valeur $ ${xA} $, on obtient $ ${yA} $.
49
+ La droite passe donc par le point de coordonnées $(${xA};${yA})$.
50
+
51
+ Si on exécute le programme de calcul avec la valeur $ ${xB} $, on obtient $ ${yB} $.
52
+ La droite passe donc par le point de coordonnées $(${xB};${yB})$.
53
+
54
+ On place donc les deux points de coordonnées $(${xA};${yA})$ et $(${xB};${yB})$,
55
+ puis on trace la droite passant par ces deux points.
56
+ `;
57
+ };
58
+ const getStudentGGBOptions = (identifiers) => {
59
+ const { progCalcIds } = identifiers;
60
+ const progCalc = ProgCalcConstructor.fromIdentifiers(progCalcIds);
61
+ const xMin = 0;
62
+ const xMax = 1;
63
+ const xA = xMin;
64
+ const yA = progCalc.apply(xA.toTree()).evaluate();
65
+ const xB = xMax;
66
+ const yB = progCalc.apply(xB.toTree()).evaluate();
67
+ const studentGGB = new GeogebraConstructor({
68
+ isGridSimple: true,
69
+ customToolBar: toolBarConstructor({
70
+ join: true,
71
+ }),
72
+ });
73
+ const yMax = Math.max(yA, yB, 0);
74
+ const yMin = Math.min(yA, yB, 0);
75
+ return studentGGB.getOptions({
76
+ coords: studentGGB.getAdaptedCoords({
77
+ xMin,
78
+ xMax,
79
+ yMin,
80
+ yMax,
81
+ }),
82
+ });
83
+ };
84
+ const getGGBAnswer = (identifiers) => {
85
+ const { progCalcIds } = identifiers;
86
+ const progCalc = ProgCalcConstructor.fromIdentifiers(progCalcIds);
87
+ const xA = 0;
88
+ const yA = progCalc.apply(xA.toTree()).evaluate();
89
+ const xB = 1;
90
+ const yB = progCalc.apply(xB.toTree()).evaluate();
91
+ return [`(${xA},${yA})`, `(${xB},${yB})`, `Line[A, B]`];
92
+ };
93
+ const isGGBAnswerValid = (ans, { ggbAnswer, progCalcIds }) => {
94
+ const studentAnswer = deleteObjectNamesFromAnswer(ans);
95
+ if (arrayEqual(studentAnswer, ggbAnswer))
96
+ return true;
97
+ if (studentAnswer.length !== 3)
98
+ return false;
99
+ if (!isGGBPoint(studentAnswer[0]) ||
100
+ !isGGBPoint(studentAnswer[1]) ||
101
+ !isGGBLine(studentAnswer[2]))
102
+ return false;
103
+ const A = getPoint(studentAnswer[0], "A");
104
+ const B = getPoint(studentAnswer[1], "B");
105
+ const a = (B.getYnumber() - A.getYnumber()) / (B.getXnumber() - A.getXnumber());
106
+ const b = A.getYnumber() - a * A.getXnumber();
107
+ const progCalc = ProgCalcConstructor.fromIdentifiers(progCalcIds);
108
+ const correctB = progCalc.apply((0).toTree()).evaluate();
109
+ const correctA = substract(progCalc.apply((1).toTree()), correctB).evaluate();
110
+ return approxEqual(a, correctA, 1) && approxEqual(b, correctB, 1);
111
+ };
112
+ const getPoint = (command, pointName) => {
113
+ const splitted = command.split(",");
114
+ const x = +splitted[0].replace("(", "");
115
+ const y = +splitted[1].replace(")", "");
116
+ return new Point(pointName, x.toTree(), y.toTree());
117
+ };
118
+ const getDrawAffineFromProgCalcQuestion = (opts) => {
119
+ const nbSteps = opts?.nbSteps ?? optsDefault.nbSteps;
120
+ const isSingleUseOperators = opts?.isSingleUseOperators ?? optsDefault.isSingleUseOperators;
121
+ const arrOpGenAddsub = [
122
+ {
123
+ operator: "add",
124
+ createParam: () => randint(-10, 11, [0]),
125
+ },
126
+ {
127
+ operator: "subtract",
128
+ createParam: () => randint(-10, 11, [0]),
129
+ },
130
+ ];
131
+ const arrOpGenMuldiv = [
132
+ {
133
+ operator: "opposite",
134
+ createParam: () => undefined,
135
+ },
136
+ {
137
+ operator: "multiply",
138
+ createParam: () => randint(-10, 11, [0, 1]),
139
+ },
140
+ {
141
+ operator: "divide",
142
+ createParam: () => randint(-10, 11, [0, 1]),
143
+ },
144
+ ];
145
+ const arrOpGenConfigAll = [...arrOpGenAddsub, ...arrOpGenMuldiv];
146
+ //ensure that there is at least 1 addsub and 1 muldiv operation
147
+ const opGenConfigAddsub = random(arrOpGenAddsub);
148
+ const opGenConfigMuldiv = random(arrOpGenMuldiv);
149
+ const arrOpGenConfigMandatory = [opGenConfigAddsub, opGenConfigMuldiv];
150
+ const progCalc = ProgCalcConstructor.randomWithMandatory(nbSteps, isSingleUseOperators, arrOpGenConfigMandatory, arrOpGenConfigAll);
151
+ const identifiers = {
152
+ progCalcIds: progCalc.toIdentifiers(),
153
+ funcName: random(["f", "g", "h"]),
154
+ };
155
+ return getQuestionFromIdentifiers(identifiers, opts);
156
+ };
157
+ const getQuestionFromIdentifiers = (identifiers) => {
158
+ return {
159
+ ggbAnswer: getGGBAnswer(identifiers),
160
+ instruction: getInstruction(identifiers),
161
+ studentGgbOptions: getStudentGGBOptions(identifiers),
162
+ identifiers,
163
+ hint: getHint(identifiers),
164
+ correction: getCorrection(identifiers),
165
+ };
166
+ };
167
+ const optsDefault = {
168
+ nbSteps: 2,
169
+ isSingleUseOperators: true,
170
+ };
171
+ const options = [
172
+ {
173
+ id: "nbSteps",
174
+ label: "Nombre d'étapes de transformation",
175
+ defaultValue: optsDefault.nbSteps,
176
+ values: [2, 3, 4, 5],
177
+ target: GeneratorOptionTarget.generation,
178
+ type: GeneratorOptionType.select,
179
+ },
180
+ {
181
+ id: "isSingleUseOperators",
182
+ label: "Opérateurs à usage unique",
183
+ defaultValue: optsDefault.isSingleUseOperators,
184
+ values: [true, false],
185
+ target: GeneratorOptionTarget.generation,
186
+ type: GeneratorOptionType.select,
187
+ },
188
+ ];
189
+ export const drawAffineFromProgCalc = {
190
+ id: "drawAffineFromProgCalc",
191
+ label: "Tracer la représentation graphique d'une fonction affine à partir d'un programme de calcul",
192
+ isSingleStep: true,
193
+ generator: (nb, opts) => getDistinctQuestions(() => getDrawAffineFromProgCalcQuestion(opts), nb),
194
+ options,
195
+ ggbTimer: 60,
196
+ isGGBAnswerValid,
197
+ subject: "Mathématiques",
198
+ getHint,
199
+ getInstruction,
200
+ getCorrection,
201
+ getGGBAnswer,
202
+ getStudentGGBOptions,
203
+ answerType: "GGB",
204
+ getQuestionFromIdentifiers,
205
+ hasHintAndCorrection: true,
206
+ };
@@ -12,7 +12,14 @@ export * from "./affineAdjustmentComplete.js";
12
12
  export * from "./affineMeanValue.js";
13
13
  export * from "./affineExpressionFromTwoImages.js";
14
14
  export * from "./affineFromExercise.js";
15
+ export * from "./drawAffineFromLitExp.js";
16
+ export * from "./recognizeExprAffine.js";
15
17
  export * from "./drawAffineFrom2Points.js";
16
18
  export * from "./recognizeAffineGraph.js";
17
19
  export * from "./drawAffineFromLitExp.js";
20
+ export * from "./coordsOfPointOnAffineFindX.js";
21
+ export * from "./coordsOfPointOnAffineFindY.js";
22
+ export * from "./representationOfAffine.js";
23
+ export * from "./drawAffineFromPointAndLeadingCoeff.js";
24
+ export * from "./drawAffineFromProgCalc.js";
18
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,6BAA6B,CAAC"}
@@ -12,6 +12,13 @@ export * from "./affineAdjustmentComplete.js";
12
12
  export * from "./affineMeanValue.js";
13
13
  export * from "./affineExpressionFromTwoImages.js";
14
14
  export * from "./affineFromExercise.js";
15
+ export * from "./drawAffineFromLitExp.js";
16
+ export * from "./recognizeExprAffine.js";
15
17
  export * from "./drawAffineFrom2Points.js";
16
18
  export * from "./recognizeAffineGraph.js";
17
19
  export * from "./drawAffineFromLitExp.js";
20
+ export * from "./coordsOfPointOnAffineFindX.js";
21
+ export * from "./coordsOfPointOnAffineFindY.js";
22
+ export * from "./representationOfAffine.js";
23
+ export * from "./drawAffineFromPointAndLeadingCoeff.js";
24
+ export * from "./drawAffineFromProgCalc.js";
@@ -0,0 +1,20 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type ItemType = {
3
+ fName: string;
4
+ tex: string;
5
+ fType: string;
6
+ a: number | undefined;
7
+ b: number | undefined;
8
+ };
9
+ type AskedType = "affine" | "linear";
10
+ type Identifiers = {
11
+ items: ItemType[];
12
+ askedType: AskedType;
13
+ };
14
+ type Options = {
15
+ askedType: AskedType;
16
+ };
17
+ export declare const recognizeExprAffine: Exercise<Identifiers, Options>;
18
+ export declare const recognizeExprLinear: Exercise<Identifiers, Options>;
19
+ export {};
20
+ //# sourceMappingURL=recognizeExprAffine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recognizeExprAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/recognizeExprAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AA2BrC,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AAEF,KAAK,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAkSF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAoB9D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAoB9D,CAAC"}