math-exercises 3.0.64 → 3.0.66

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 (338) hide show
  1. package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +4 -6
  3. package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.js +4 -5
  5. package/lib/exercises/math/calcul/arithmetics/divisorsList.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/arithmetics/divisorsList.js +18 -7
  7. package/lib/exercises/math/calcul/arithmetics/euclideanDivision.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/arithmetics/euclideanDivision.js +18 -7
  9. package/lib/exercises/math/calcul/arithmetics/paritySumsAndProducts.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/arithmetics/paritySumsAndProducts.js +56 -47
  11. package/lib/exercises/math/calcul/arithmetics/pgcdCalcul.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/arithmetics/pgcdCalcul.js +4 -4
  13. package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.js +0 -4
  15. package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +4 -3
  17. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +2 -2
  18. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -1
  19. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +6 -8
  20. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  21. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +2 -5
  22. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +1 -1
  23. package/lib/exercises/math/calcul/fractions/simplifyFraction.js +2 -2
  24. package/lib/exercises/math/calcul/operations/index.d.ts +1 -0
  25. package/lib/exercises/math/calcul/operations/index.d.ts.map +1 -1
  26. package/lib/exercises/math/calcul/operations/index.js +1 -0
  27. package/lib/exercises/math/calcul/operations/numberInverse.d.ts +8 -0
  28. package/lib/exercises/math/calcul/operations/numberInverse.d.ts.map +1 -0
  29. package/lib/exercises/math/calcul/operations/numberInverse.js +113 -0
  30. package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.d.ts.map +1 -1
  31. package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.js +4 -2
  32. package/lib/exercises/math/calcul/proportionality/scaleCalculation.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/proportionality/scaleCalculation.js +65 -35
  34. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +2 -2
  35. package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.js +1 -1
  36. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +17 -17
  37. package/lib/exercises/math/calculLitteral/equation/equa1.js +1 -1
  38. package/lib/exercises/math/calculLitteral/equation/equa2.js +1 -1
  39. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -1
  40. package/lib/exercises/math/calculLitteral/equation/equa3.js +2 -4
  41. package/lib/exercises/math/calculLitteral/equation/equa4.js +1 -1
  42. package/lib/exercises/math/calculLitteral/equation/equationFromSentenceExercise.d.ts.map +1 -1
  43. package/lib/exercises/math/calculLitteral/equation/equationFromSentenceExercise.js +78 -63
  44. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.js +3 -3
  45. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +1 -1
  46. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.d.ts.map +1 -1
  47. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.js +2 -4
  48. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.js +1 -1
  49. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -1
  50. package/lib/exercises/math/calculLitteral/factorisation/factoType2.js +1 -1
  51. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
  52. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.js +4 -5
  53. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
  54. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.js +1 -0
  55. package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.js +1 -1
  56. package/lib/exercises/math/conversion/aeraConversion.d.ts.map +1 -1
  57. package/lib/exercises/math/conversion/aeraConversion.js +4 -4
  58. package/lib/exercises/math/conversion/hoursToDecimal.d.ts.map +1 -1
  59. package/lib/exercises/math/conversion/hoursToDecimal.js +6 -5
  60. package/lib/exercises/math/conversion/hoursToSecond.d.ts.map +1 -1
  61. package/lib/exercises/math/conversion/hoursToSecond.js +8 -7
  62. package/lib/exercises/math/conversion/lengthConversion.js +1 -1
  63. package/lib/exercises/math/conversion/massConversion.js +2 -2
  64. package/lib/exercises/math/conversion/volumeCapacityConversion.d.ts.map +1 -1
  65. package/lib/exercises/math/conversion/volumeCapacityConversion.js +42 -23
  66. package/lib/exercises/math/conversion/volumeConversion.js +2 -2
  67. package/lib/exercises/math/dataRepresentations/barChartReading.d.ts.map +1 -1
  68. package/lib/exercises/math/dataRepresentations/barChartReading.js +5 -5
  69. package/lib/exercises/math/dataRepresentations/tableReading.d.ts.map +1 -1
  70. package/lib/exercises/math/dataRepresentations/tableReading.js +4 -4
  71. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts.map +1 -1
  72. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.js +27 -14
  73. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts.map +1 -1
  74. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.js +4 -5
  75. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +1 -1
  76. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +1 -1
  77. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +1 -1
  78. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts.map +1 -1
  79. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.js +8 -5
  80. package/lib/exercises/math/derivation/tangent/derivativeNumberOrImageReading.d.ts +10 -0
  81. package/lib/exercises/math/derivation/tangent/derivativeNumberOrImageReading.d.ts.map +1 -0
  82. package/lib/exercises/math/derivation/tangent/derivativeNumberOrImageReading.js +144 -0
  83. package/lib/exercises/math/derivation/tangent/derivativeNumberReading.d.ts.map +1 -1
  84. package/lib/exercises/math/derivation/tangent/derivativeNumberReading.js +17 -12
  85. package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.js +2 -2
  86. package/lib/exercises/math/derivation/tangent/horizontalTangentFromAlgebraic.d.ts +7 -0
  87. package/lib/exercises/math/derivation/tangent/horizontalTangentFromAlgebraic.d.ts.map +1 -0
  88. package/lib/exercises/math/derivation/tangent/horizontalTangentFromAlgebraic.js +108 -0
  89. package/lib/exercises/math/derivation/tangent/index.d.ts +3 -0
  90. package/lib/exercises/math/derivation/tangent/index.d.ts.map +1 -1
  91. package/lib/exercises/math/derivation/tangent/index.js +3 -0
  92. package/lib/exercises/math/derivation/tangent/tangentEquationWithData.d.ts +9 -0
  93. package/lib/exercises/math/derivation/tangent/tangentEquationWithData.d.ts.map +1 -0
  94. package/lib/exercises/math/derivation/tangent/tangentEquationWithData.js +121 -0
  95. package/lib/exercises/math/derivation/tangent/tangentEquations.d.ts.map +1 -1
  96. package/lib/exercises/math/derivation/tangent/tangentEquations.js +5 -5
  97. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -1
  98. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +6 -0
  99. package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
  100. package/lib/exercises/math/functions/affines/signFunction.js +7 -7
  101. package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
  102. package/lib/exercises/math/functions/exponential/expEquation.js +4 -6
  103. package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +1 -1
  104. package/lib/exercises/math/geometry/areas/circleArea.d.ts.map +1 -1
  105. package/lib/exercises/math/geometry/areas/circleArea.js +6 -3
  106. package/lib/exercises/math/geometry/areas/circleRadiusFromArea.d.ts.map +1 -1
  107. package/lib/exercises/math/geometry/areas/circleRadiusFromArea.js +6 -5
  108. package/lib/exercises/math/geometry/areas/rectangleArea.d.ts.map +1 -1
  109. package/lib/exercises/math/geometry/areas/rectangleArea.js +5 -4
  110. package/lib/exercises/math/geometry/areas/rectangleSideFromArea.d.ts.map +1 -1
  111. package/lib/exercises/math/geometry/areas/rectangleSideFromArea.js +3 -2
  112. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +1 -1
  113. package/lib/exercises/math/geometry/areas/squareArea.d.ts.map +1 -1
  114. package/lib/exercises/math/geometry/areas/squareArea.js +4 -3
  115. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  116. package/lib/exercises/math/geometry/areas/triangleArea.js +8 -5
  117. package/lib/exercises/math/geometry/areas/triangleAreaV2.d.ts.map +1 -1
  118. package/lib/exercises/math/geometry/areas/triangleAreaV2.js +3 -2
  119. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +1 -1
  120. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -1
  121. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +8 -6
  122. package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +1 -1
  123. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +1 -1
  124. package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
  125. package/lib/exercises/math/geometry/perimeters/circleCircumference.js +10 -8
  126. package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.d.ts.map +1 -1
  127. package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.js +15 -13
  128. package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.d.ts.map +1 -1
  129. package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.js +4 -3
  130. package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.d.ts.map +1 -1
  131. package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.js +1 -0
  132. package/lib/exercises/math/geometry/perimeters/squarePerimeter.d.ts.map +1 -1
  133. package/lib/exercises/math/geometry/perimeters/squarePerimeter.js +3 -2
  134. package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.d.ts.map +1 -1
  135. package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.js +1 -0
  136. package/lib/exercises/math/geometry/perimeters/trianglePerimeter.js +1 -1
  137. package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
  138. package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +6 -3
  139. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  140. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +4 -3
  141. package/lib/exercises/math/geometry/triangles/triangleNature.js +1 -1
  142. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts.map +1 -1
  143. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.js +11 -4
  144. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.js +1 -1
  145. package/lib/exercises/math/geometry/volumes/coneVolume.d.ts.map +1 -1
  146. package/lib/exercises/math/geometry/volumes/coneVolume.js +7 -8
  147. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
  148. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +21 -22
  149. package/lib/exercises/math/geometry/volumes/sphereVolume.d.ts.map +1 -1
  150. package/lib/exercises/math/geometry/volumes/sphereVolume.js +2 -1
  151. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts.map +1 -1
  152. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +6 -3
  153. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
  154. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +3 -2
  155. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -1
  156. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +3 -2
  157. package/lib/exercises/math/percent/averageEvolutionRate.js +1 -1
  158. package/lib/exercises/math/percent/evolutions/applyPercent.d.ts +9 -0
  159. package/lib/exercises/math/percent/evolutions/applyPercent.d.ts.map +1 -0
  160. package/lib/exercises/math/percent/evolutions/applyPercent.js +114 -0
  161. package/lib/exercises/math/percent/evolutions/averageEvolutionRate.d.ts +8 -0
  162. package/lib/exercises/math/percent/evolutions/averageEvolutionRate.d.ts.map +1 -0
  163. package/lib/exercises/math/percent/evolutions/averageEvolutionRate.js +104 -0
  164. package/lib/exercises/math/percent/evolutions/cmToEvolution.d.ts +7 -0
  165. package/lib/exercises/math/percent/evolutions/cmToEvolution.d.ts.map +1 -0
  166. package/lib/exercises/math/percent/evolutions/cmToEvolution.js +88 -0
  167. package/lib/exercises/math/percent/evolutions/compoundInterest.d.ts +12 -0
  168. package/lib/exercises/math/percent/evolutions/compoundInterest.d.ts.map +1 -0
  169. package/lib/exercises/math/percent/evolutions/compoundInterest.js +128 -0
  170. package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.d.ts +8 -0
  171. package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.d.ts.map +1 -0
  172. package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.js +100 -0
  173. package/lib/exercises/math/percent/evolutions/evolutionToCM.d.ts +7 -0
  174. package/lib/exercises/math/percent/evolutions/evolutionToCM.d.ts.map +1 -0
  175. package/lib/exercises/math/percent/evolutions/evolutionToCM.js +83 -0
  176. package/lib/exercises/math/percent/evolutions/findEndValueAfterEvolution.d.ts +8 -0
  177. package/lib/exercises/math/percent/evolutions/findEndValueAfterEvolution.d.ts.map +1 -0
  178. package/lib/exercises/math/percent/evolutions/findEndValueAfterEvolution.js +102 -0
  179. package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.d.ts +10 -0
  180. package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.d.ts.map +1 -0
  181. package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.js +113 -0
  182. package/lib/exercises/math/percent/evolutions/findStartValueAfterEvolution.d.ts +8 -0
  183. package/lib/exercises/math/percent/evolutions/findStartValueAfterEvolution.d.ts.map +1 -0
  184. package/lib/exercises/math/percent/evolutions/findStartValueAfterEvolution.js +100 -0
  185. package/lib/exercises/math/percent/evolutions/globalPercent.d.ts +7 -0
  186. package/lib/exercises/math/percent/evolutions/globalPercent.d.ts.map +1 -0
  187. package/lib/exercises/math/percent/evolutions/globalPercent.js +104 -0
  188. package/lib/exercises/math/percent/evolutions/index.d.ts +12 -0
  189. package/lib/exercises/math/percent/evolutions/index.d.ts.map +1 -0
  190. package/lib/exercises/math/percent/evolutions/index.js +11 -0
  191. package/lib/exercises/math/percent/evolutions/reciprocalPercentage.d.ts +8 -0
  192. package/lib/exercises/math/percent/evolutions/reciprocalPercentage.d.ts.map +1 -0
  193. package/lib/exercises/math/percent/evolutions/reciprocalPercentage.js +108 -0
  194. package/lib/exercises/math/percent/findEndValueAfterEvolution.js +1 -1
  195. package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
  196. package/lib/exercises/math/percent/findProportion.js +33 -11
  197. package/lib/exercises/math/percent/findStartValueAfterEvolution.js +1 -1
  198. package/lib/exercises/math/percent/findTVA.d.ts.map +1 -1
  199. package/lib/exercises/math/percent/findTVA.js +4 -4
  200. package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -1
  201. package/lib/exercises/math/percent/htToTTC.js +11 -7
  202. package/lib/exercises/math/percent/index.d.ts +1 -10
  203. package/lib/exercises/math/percent/index.d.ts.map +1 -1
  204. package/lib/exercises/math/percent/index.js +1 -10
  205. package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
  206. package/lib/exercises/math/percent/percentToDecimal.js +4 -0
  207. package/lib/exercises/math/percent/percentWritings.d.ts.map +1 -1
  208. package/lib/exercises/math/percent/percentWritings.js +4 -4
  209. package/lib/exercises/math/percent/populationEffectifFromSubPopulation.d.ts.map +1 -1
  210. package/lib/exercises/math/percent/populationEffectifFromSubPopulation.js +7 -5
  211. package/lib/exercises/math/percent/reciprocalPercentage.js +1 -1
  212. package/lib/exercises/math/percent/subPopulationEffectifFromPercent.d.ts.map +1 -1
  213. package/lib/exercises/math/percent/subPopulationEffectifFromPercent.js +6 -4
  214. package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -1
  215. package/lib/exercises/math/percent/ttcToHT.js +4 -4
  216. package/lib/exercises/math/percent/valuePercent.d.ts.map +1 -1
  217. package/lib/exercises/math/percent/valuePercent.js +4 -4
  218. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  219. package/lib/exercises/math/powers/calculateNegativePower.js +6 -10
  220. package/lib/exercises/math/powers/calculatePower.d.ts.map +1 -1
  221. package/lib/exercises/math/powers/calculatePower.js +1 -0
  222. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  223. package/lib/exercises/math/powers/decimalToScientific.js +36 -9
  224. package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
  225. package/lib/exercises/math/powers/powersMixOperations.js +0 -4
  226. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts.map +1 -1
  227. package/lib/exercises/math/powers/powersOfTenMixOperations.js +0 -4
  228. package/lib/exercises/math/powers/powersOfTenToDecimal.js +2 -2
  229. package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
  230. package/lib/exercises/math/powers/powersProduct.js +0 -5
  231. package/lib/exercises/math/powers/scientificToDecimal.js +2 -2
  232. package/lib/exercises/math/probaStat/ballsBasicProbas.d.ts.map +1 -1
  233. package/lib/exercises/math/probaStat/ballsBasicProbas.js +4 -4
  234. package/lib/exercises/math/probaStat/basicStats/calculateFrequency.d.ts.map +1 -1
  235. package/lib/exercises/math/probaStat/basicStats/calculateFrequency.js +4 -4
  236. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts +8 -0
  237. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts.map +1 -0
  238. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.js +117 -0
  239. package/lib/exercises/math/probaStat/basicStats/index.d.ts +1 -0
  240. package/lib/exercises/math/probaStat/basicStats/index.d.ts.map +1 -1
  241. package/lib/exercises/math/probaStat/basicStats/index.js +1 -0
  242. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts.map +1 -1
  243. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.js +66 -41
  244. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts.map +1 -1
  245. package/lib/exercises/math/probaStat/cardBasicProbas.js +4 -2
  246. package/lib/exercises/math/probaStat/conditionalProbability.d.ts.map +1 -1
  247. package/lib/exercises/math/probaStat/conditionalProbability.js +168 -88
  248. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts.map +1 -1
  249. package/lib/exercises/math/probaStat/diceBasicProbas.js +3 -0
  250. package/lib/exercises/math/probaStat/independancy.d.ts.map +1 -1
  251. package/lib/exercises/math/probaStat/independancy.js +18 -8
  252. package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts.map +1 -1
  253. package/lib/exercises/math/probaStat/issuesCountingForCards.js +41 -15
  254. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  255. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +4 -4
  256. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  257. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +5 -2
  258. package/lib/exercises/math/probaStat/probabilityTree.d.ts.map +1 -1
  259. package/lib/exercises/math/probaStat/probabilityTree.js +8 -4
  260. package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
  261. package/lib/exercises/math/probaStat/stats1var/medianList.js +1 -4
  262. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.js +1 -1
  263. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +1 -1
  264. package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
  265. package/lib/exercises/math/probaStat/stats2var/averagePoint.js +25 -22
  266. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  267. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +52 -43
  268. package/lib/exercises/math/sampling/confidenceInterval.d.ts.map +1 -1
  269. package/lib/exercises/math/sampling/confidenceInterval.js +4 -4
  270. package/lib/exercises/math/sampling/fluctuationInterval.d.ts.map +1 -1
  271. package/lib/exercises/math/sampling/fluctuationInterval.js +4 -4
  272. package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts.map +1 -1
  273. package/lib/exercises/math/sampling/isSamplingRepresentative.js +5 -5
  274. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -1
  275. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +0 -2
  276. package/lib/exercises/math/sequences/geometric/geometricVariations.js +1 -1
  277. package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
  278. package/lib/exercises/math/sets/intervals/inequalityToInterval.js +4 -4
  279. package/lib/exercises/math/sets/intervals/intervalToInequality.d.ts.map +1 -1
  280. package/lib/exercises/math/sets/intervals/intervalToInequality.js +4 -4
  281. package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
  282. package/lib/exercises/math/sets/intervals/intervalsIntersection.js +8 -1
  283. package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
  284. package/lib/exercises/math/sets/intervals/intervalsUnion.js +3 -0
  285. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -1
  286. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +0 -5
  287. package/lib/exercises/math/spaceGeometry/index.js +1 -0
  288. package/lib/exercises/math/spaceGeometry/planes/index.d.ts +2 -0
  289. package/lib/exercises/math/spaceGeometry/planes/index.d.ts.map +1 -0
  290. package/lib/exercises/math/spaceGeometry/planes/index.js +2 -0
  291. package/lib/exercises/math/spaceGeometry/planes/isPointOnCartesianPlane.d.ts +2 -0
  292. package/lib/exercises/math/spaceGeometry/planes/isPointOnCartesianPlane.d.ts.map +1 -0
  293. package/lib/exercises/math/spaceGeometry/planes/isPointOnCartesianPlane.js +102 -0
  294. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts.map +1 -1
  295. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +4 -4
  296. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.d.ts.map +1 -1
  297. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.js +4 -2
  298. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts.map +1 -1
  299. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +4 -6
  300. package/lib/exercises/math/trigonometry/arcLength.d.ts.map +1 -1
  301. package/lib/exercises/math/trigonometry/arcLength.js +5 -2
  302. package/lib/exercises/math/trigonometry/basicEquationCos.d.ts.map +1 -1
  303. package/lib/exercises/math/trigonometry/basicEquationCos.js +4 -3
  304. package/lib/exercises/math/trigonometry/basicEquationSin.d.ts.map +1 -1
  305. package/lib/exercises/math/trigonometry/basicEquationSin.js +4 -3
  306. package/lib/exercises/math/trigonometry/basicTrigoSystemEquation.d.ts.map +1 -1
  307. package/lib/exercises/math/trigonometry/basicTrigoSystemEquation.js +4 -3
  308. package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
  309. package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +1 -0
  310. package/lib/exercises/math/trigonometry/degreeToRadians.d.ts.map +1 -1
  311. package/lib/exercises/math/trigonometry/degreeToRadians.js +7 -6
  312. package/lib/exercises/math/trigonometry/equationCosOnRandomInterval.d.ts.map +1 -1
  313. package/lib/exercises/math/trigonometry/equationCosOnRandomInterval.js +4 -3
  314. package/lib/exercises/math/trigonometry/equationSinOnRandomInterval.d.ts.map +1 -1
  315. package/lib/exercises/math/trigonometry/equationSinOnRandomInterval.js +4 -3
  316. package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -1
  317. package/lib/exercises/math/trigonometry/mainAngleMeasure.js +4 -5
  318. package/lib/exercises/math/trigonometry/mainRemarkableValues.d.ts.map +1 -1
  319. package/lib/exercises/math/trigonometry/mainRemarkableValues.js +4 -3
  320. package/lib/exercises/math/trigonometry/trigonometry.js +2 -2
  321. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  322. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +5 -3
  323. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  324. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +6 -6
  325. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
  326. package/lib/index.d.ts +47 -25
  327. package/lib/index.d.ts.map +1 -1
  328. package/lib/math/spaceGeometry/plane.d.ts +9 -0
  329. package/lib/math/spaceGeometry/plane.d.ts.map +1 -0
  330. package/lib/math/spaceGeometry/plane.js +22 -0
  331. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  332. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  333. package/lib/tree/nodes/equations/equationSolutionNode.d.ts +2 -2
  334. package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
  335. package/lib/tree/nodes/equations/equationSolutionNode.js +2 -2
  336. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  337. package/lib/tree/nodes/operators/fractionNode.js +4 -0
  338. package/package.json +1 -1
@@ -0,0 +1,113 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
4
+ import { randint } from "../../../../math/utils/random/randint.js";
5
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
6
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
7
+ import { frac, isFractionNode, } from "../../../../tree/nodes/operators/fractionNode.js";
8
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
9
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
10
+ import { probaFlip } from "../../../../utils/alea/probaFlip.js";
11
+ import { random } from "../../../../utils/alea/random.js";
12
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
13
+ const getPropositions = (n, { answer, ...identifiers }) => {
14
+ const propositions = [];
15
+ addValidProp(propositions, answer);
16
+ const { nb } = identifiers;
17
+ const value = reifyAlgebraic(nb);
18
+ tryToAddWrongProp(propositions, opposite(value).toTex());
19
+ tryToAddWrongProp(propositions, "0");
20
+ while (propositions.length < n) {
21
+ tryToAddWrongProp(propositions, randint(1, 10).frenchify());
22
+ }
23
+ return shuffleProps(propositions, n);
24
+ };
25
+ const getAnswer = (identifiers) => {
26
+ const { nb } = identifiers;
27
+ const value = reifyAlgebraic(nb);
28
+ return frac(1, value).simplify({ fractionsToDecimal: true }).toTex();
29
+ };
30
+ const getInstruction = (identifiers) => {
31
+ const { nb } = identifiers;
32
+ const value = reifyAlgebraic(nb);
33
+ return `Quel est l'inverse de $${value.toTex()}$ ?`;
34
+ };
35
+ const getHint = (identifiers) => {
36
+ return `Pour $x\\neq 0$, $a\\neq 0$ et $b\\neq 0$ :
37
+
38
+ - L'inverse de $x$ est $\\frac{1}{x}$.
39
+
40
+ - L'inverse de $\\frac{a}{b}$ est $\\frac{b}{a}$.`;
41
+ };
42
+ const getCorrection = (identifiers) => {
43
+ const { nb } = identifiers;
44
+ const value = reifyAlgebraic(nb);
45
+ if (isFractionNode(value)) {
46
+ return `Pour $a\\neq 0$ et $b\\neq 0$, l'inverse de $\\frac{a}{b}$ est $\\frac{b}{a}$.
47
+
48
+ L'inverse de $${value.toTex()}$ est donc $${getAnswer(identifiers)}$.`;
49
+ }
50
+ else {
51
+ return `Pour $x\\neq 0$, l'inverse de $x$ est $\\frac{1}{x}$.
52
+
53
+ L'inverse de $${value.toTex()}$ est donc $${getAnswer(identifiers)}$.`;
54
+ }
55
+ };
56
+ const getKeys = (identifiers) => {
57
+ return [];
58
+ };
59
+ const isAnswerValid = (ans, { answer }) => {
60
+ try {
61
+ const parsed = parseAlgebraic(ans);
62
+ return parsed.simplify({ fractionsToDecimal: true }).toTex() === answer;
63
+ }
64
+ catch (err) {
65
+ return handleVEAError(err);
66
+ }
67
+ };
68
+ const getNumberInverseQuestion = (ops) => {
69
+ //1 2 4 5 et inverse décimal et opposés
70
+ //10 100 1000 1000 et inverse
71
+ const isFrac = probaFlip(0.4);
72
+ let nb;
73
+ if (isFrac) {
74
+ const frac = RationalConstructor.randomIrreductible();
75
+ nb = frac.toTree();
76
+ }
77
+ else {
78
+ const abs = random([1, 2, 4, 5, 10, 100, 1000]);
79
+ const isInv = coinFlip();
80
+ const isOpp = coinFlip();
81
+ const signed = (isOpp ? -1 : 1) * abs;
82
+ nb = isInv ? frac(1, signed).evaluate().toTree() : signed.toTree();
83
+ }
84
+ const identifiers = {
85
+ nb: nb.toIdentifiers(),
86
+ };
87
+ return getQuestionFromIdentifiers(identifiers);
88
+ };
89
+ const getQuestionFromIdentifiers = (identifiers) => {
90
+ return {
91
+ answer: getAnswer(identifiers),
92
+ instruction: getInstruction(identifiers),
93
+ keys: getKeys(identifiers),
94
+ answerFormat: "tex",
95
+ identifiers,
96
+ hint: getHint(identifiers),
97
+ correction: getCorrection(identifiers),
98
+ };
99
+ };
100
+ export const numberInverse = {
101
+ id: "numberInverse",
102
+ connector: "=",
103
+ label: "Déterminer l'inverse d'un nombre",
104
+ isSingleStep: true,
105
+ generator: (nb, opts) => getDistinctQuestions(() => getNumberInverseQuestion(opts), nb),
106
+ qcmTimer: 60,
107
+ freeTimer: 60,
108
+ getPropositions,
109
+ isAnswerValid,
110
+ subject: "Mathématiques",
111
+ getQuestionFromIdentifiers,
112
+ hasHintAndCorrection: true,
113
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"rectangleSideAfterReduction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/rectangleSideAfterReduction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CAGnB,CAAC;AAoPF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAoB7D,CAAC"}
1
+ {"version":3,"file":"rectangleSideAfterReduction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/rectangleSideAfterReduction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CAGnB,CAAC;AAsPF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAoB7D,CAAC"}
@@ -107,7 +107,9 @@ const getInstruction = (identifiers) => {
107
107
  // Output the SVG string
108
108
  const sideIsOnFirstRect = askedIndex < 2;
109
109
  const sideTypeAsked = askedIndex % 2 === 0 ? "longueur" : "largeur";
110
- const sidesString = lengths.map((e, i) => e === 0 ? "" : `${i % 2 === 0 ? "longueur" : "largeur"} $${e}$ cm`);
110
+ const sidesString = lengths.map((e, i) => e === 0
111
+ ? ""
112
+ : `${i % 2 === 0 ? "longueur" : "largeur"} $${e}\\ \\textrm{cm}$`);
111
113
  return `Sur la figure suivante, le premier rectangle a pour ${sideIsOnFirstRect
112
114
  ? sidesString[askedIndex === 1 ? 0 : 1]
113
115
  : sidesString[0] + " et pour " + sidesString[1]}.
@@ -118,7 +120,7 @@ Le deuxième rectangle est une réduction du premier rectangle et a pour ${sideI
118
120
 
119
121
  ${d3n.svgString()}
120
122
 
121
- Quelle est la ${sideTypeAsked} (en cm) du ${sideIsOnFirstRect ? "premier" : "deuxième"} rectangle ? Arrondir à $0,1$ cm si nécessaire.`;
123
+ Quelle est la ${sideTypeAsked} (en $\\textrm{cm}$) du ${sideIsOnFirstRect ? "premier" : "deuxième"} rectangle ? Arrondir à $0,1\\ \\textrm{cm}$ si nécessaire.`;
122
124
  };
123
125
  // const getHint: GetHint<Identifiers> = (identifiers) => {};
124
126
  // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
@@ -1 +1 @@
1
- {"version":3,"file":"scaleCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/scaleCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IAEtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAqFF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
1
+ {"version":3,"file":"scaleCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/proportionality/scaleCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IAEtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AA+HF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
@@ -5,59 +5,89 @@ import { randint } from "../../../../math/utils/random/randint.js";
5
5
  import { Measure } from "../../../../pc/measure/measure.js";
6
6
  import { DistanceUnit } from "../../../../pc/units/distanceUnits.js";
7
7
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
8
- const getScaleCalculationQuestion = () => {
9
- const isSmallScale = coinFlip();
10
- const scale = isSmallScale ? randint(1, 5) * 10 : randint(5, 100) * 1000;
8
+ const getInstruction = (identifiers) => {
9
+ const { scale, isSmallScale, fakeDistance } = identifiers;
11
10
  const realUnit = isSmallScale ? DistanceUnit.m : DistanceUnit.km;
12
11
  const cm = DistanceUnit.cm;
13
- const fakeDistanceNb = isSmallScale ? randint(5, 100) : randint(1, 100);
14
- const fakeDistance = new Measure(fakeDistanceNb, 0, cm);
15
- const realDistanceNb = (scale * fakeDistance.evaluate()) / (isSmallScale ? 100 : 100000);
12
+ const fakeDistanceMeasure = new Measure(fakeDistance, 0, cm);
13
+ const realDistanceNb = (scale * fakeDistanceMeasure.evaluate()) / (isSmallScale ? 100 : 100000);
16
14
  const realDistance = new Measure(realDistanceNb, 0, realUnit);
17
15
  const instruction = isSmallScale
18
16
  ? `Un bateau de $${realDistance.toTex({
19
17
  notScientific: true,
20
- })}$ est représenté par un modèle réduit de $${fakeDistance.toTex({
18
+ })}$ est représenté par un modèle réduit de $${fakeDistanceMeasure.toTex({
21
19
  notScientific: true,
22
20
  })}$. Quelle est l'échelle du modèle réduit ?`
23
21
  : `La distance entre deux villes est de $${realDistance.toTex({
24
22
  notScientific: true,
25
- })}$. Sur une carte, cette distance mesure $${fakeDistance.toTex({
23
+ })}$. Sur une carte, cette distance mesure $${fakeDistanceMeasure.toTex({
26
24
  notScientific: true,
27
25
  })}$. Quelle est l'échelle de la carte ?`;
26
+ return instruction;
27
+ };
28
+ const getAnswer = (identifiers) => {
29
+ const { scale, isSmallScale, fakeDistance } = identifiers;
28
30
  const answer = new Rational(1, scale).toTex();
29
- const question = {
30
- answer,
31
- instruction,
32
- keys: [],
33
- answerFormat: "tex",
34
- hint: `Convertis les longueurs en $${cm.toTex()}$, puis fais un calcul de propotionnalité.`,
35
- correction: `On convertit d'abord les longueurs en cm :
31
+ return answer;
32
+ };
33
+ const getHint = (identifiers) => {
34
+ const { scale, isSmallScale, fakeDistance } = identifiers;
35
+ const cm = DistanceUnit.cm;
36
+ return `Convertis les longueurs en $${cm.toTex()}$, puis fais un calcul de proportionnalité.`;
37
+ };
38
+ const getCorrection = (identifiers) => {
39
+ const { scale, isSmallScale, fakeDistance } = identifiers;
40
+ const realUnit = isSmallScale ? DistanceUnit.m : DistanceUnit.km;
41
+ const cm = DistanceUnit.cm;
42
+ const fakeDistanceMeasure = new Measure(fakeDistance, 0, cm);
43
+ const realDistanceNb = (scale * fakeDistanceMeasure.evaluate()) / (isSmallScale ? 100 : 100000);
44
+ const realDistance = new Measure(realDistanceNb, 0, realUnit);
45
+ const answer = getAnswer(identifiers);
46
+ return `On convertit d'abord les longueurs en cm :
36
47
 
37
48
  $$
38
49
  ${realDistance.toTex({ notScientific: true })} = ${realDistance
39
- .convert("cm")
40
- .toTex({ notScientific: true })}
50
+ .convert("cm")
51
+ .toTex({ notScientific: true })}
41
52
  $$
42
53
 
43
- Puis, on fait un calcul de proportionnalité : puisque $${fakeDistance.toTex({
44
- notScientific: true,
45
- })}$ représentent $${realDistance.convert("cm").toTex({
46
- notScientific: true,
47
- })}$ réels, alors $1${cm.toTex()}$ représente $\\frac{${realDistance
48
- .convert("cm")
49
- .toTex({ notScientific: true, hideUnit: true })}}{${fakeDistance.toTex({
50
- notScientific: true,
51
- hideUnit: true,
52
- })}}=${scale}${cm.toTex()}$ réels.
54
+ Puis on fait un calcul de proportionnalité : puisque $${fakeDistanceMeasure.toTex({
55
+ notScientific: true,
56
+ })}$ représentent $${realDistance.convert("cm").toTex({
57
+ notScientific: true,
58
+ })}$ réels, alors $1\\ ${cm.toTex()}$ représente $\\frac{${realDistance
59
+ .convert("cm")
60
+ .toTex({
61
+ notScientific: true,
62
+ hideUnit: true,
63
+ })}}{${fakeDistanceMeasure.toTex({
64
+ notScientific: true,
65
+ hideUnit: true,
66
+ })}}=${scale}\\ ${cm.toTex()}$ réels.
53
67
 
54
68
  L'échelle est donc de $${answer}$.
55
- `,
56
- identifiers: {
57
- scale,
58
- fakeDistance: fakeDistanceNb,
59
- isSmallScale,
60
- },
69
+ `;
70
+ };
71
+ const getScaleCalculationQuestion = () => {
72
+ const isSmallScale = coinFlip();
73
+ const scale = isSmallScale ? randint(1, 5) * 10 : randint(5, 100) * 1000;
74
+ const fakeDistanceNb = isSmallScale ? randint(5, 100) : randint(1, 100);
75
+ const identifiers = {
76
+ scale,
77
+ fakeDistance: fakeDistanceNb,
78
+ isSmallScale,
79
+ };
80
+ return getQuestionFromIdentifiers(identifiers);
81
+ };
82
+ const getQuestionFromIdentifiers = (identifiers) => {
83
+ const question = {
84
+ answer: getAnswer(identifiers),
85
+ instruction: getInstruction(identifiers),
86
+ keys: [],
87
+ answerFormat: "tex",
88
+ hint: getHint(identifiers),
89
+ correction: getCorrection(identifiers),
90
+ identifiers,
61
91
  };
62
92
  return question;
63
93
  };
@@ -76,9 +106,7 @@ export const scaleCalculation = {
76
106
  id: "scaleCalculation",
77
107
  connector: "=",
78
108
  label: "Calculer une échelle",
79
- levels: [],
80
109
  isSingleStep: true,
81
- sections: [],
82
110
  generator: (nb) => getDistinctQuestions(getScaleCalculationQuestion, nb),
83
111
  qcmTimer: 60,
84
112
  freeTimer: 60,
@@ -86,4 +114,6 @@ export const scaleCalculation = {
86
114
  isAnswerValid,
87
115
  subject: "Mathématiques",
88
116
  hasHintAndCorrection: true,
117
+ shouldHaveCalculator: true,
118
+ getQuestionFromIdentifiers,
89
119
  };
@@ -7,7 +7,7 @@ import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
7
7
  import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
8
8
  import { alignTex } from "../../../../utils/latex/alignTex.js";
9
9
  const getHint = ({ coeff, affine1, affine2 }) => {
10
- return `Choisis deux facteurs de ce produit et multiplie les entre eux. Puis, multiplier le résultat obtenu par le troisième terme.`;
10
+ return `Choisis deux facteurs de ce produit et multiplie les entre eux. Puis multiplie le résultat obtenu par le troisième terme.`;
11
11
  };
12
12
  const getCorrection = (identifiers) => {
13
13
  const affine1 = new Affine(identifiers.affine1[1], identifiers.affine1[0]);
@@ -18,7 +18,7 @@ const getCorrection = (identifiers) => {
18
18
 
19
19
  ${alignTex(`${statement} = ${new MultiplyNode(affine1.times(identifiers.coeff).toTree(), affine2.toTree()).toTex()}`)}
20
20
 
21
- Puis, on utilise la double distributivité :
21
+ Puis on utilise la double distributivité :
22
22
 
23
23
  ${alignTex([
24
24
  ["", "", new MultiplyNode(affine3.toTree(), affine2.toTree()).toTex()],
@@ -44,7 +44,7 @@ $$
44
44
  };
45
45
  const getHint = (identifiers) => {
46
46
  const affine = new Affine(identifiers.a, 0);
47
- return `Multiplie chaque terme dans la parenthèse par $${affine
47
+ return `Multiplie chaque terme de la parenthèse par $${affine
48
48
  .toTree()
49
49
  .toTex()}$.`;
50
50
  };
@@ -128,23 +128,23 @@ const getHint = (identifiers) => {
128
128
  //ax = b tous entiers
129
129
  return `L'écriture $ax$ signifie $a$ multiplié par $x$.
130
130
 
131
- Quelle opération permet d'annuler une multiplication ?`;
131
+ Quelle est l'opération contraire d'une multiplication ?`;
132
132
  case 2:
133
133
  // ax + b = c tous entiers
134
- return `Quelle opération permet d'annuler une addition ?`;
134
+ return `Quelle est l'opération contraire d'une addition ?`;
135
135
  case 3:
136
136
  //ax-b = c tous entiers
137
- return `Quelle opération permet d'annuler une soustraction ?`;
137
+ return `Quelle est l'opération contraire d'une soustraction ?`;
138
138
  case 4:
139
139
  //x/a = b tous entiers
140
- return `Quelle opération permet d'annuler une division ?`;
140
+ return `Quelle est l'opération contraire d'une division ?`;
141
141
  case 5:
142
142
  //x+a = b
143
- return `Quelle opération permet d'annuler une addition ?`;
143
+ return `Quelle est l'opération contraire d'une addition ?`;
144
144
  case 6:
145
145
  default:
146
146
  //x-a = b
147
- return `Quelle opération permet d'annuler une soustraction ?`;
147
+ return `Quelle est l'opération contraire d'une soustraction ?`;
148
148
  }
149
149
  };
150
150
  const getCorrection = (identifiers) => {
@@ -154,33 +154,33 @@ const getCorrection = (identifiers) => {
154
154
  //ax = b tous entiers
155
155
  return `$${multiply(a, "x").toTex()}$ est une multiplication de $${a}$ par $x$.
156
156
 
157
- Pour isoler $x$, il faut donc diviser par $${a}$.`;
157
+ Pour isoler $x$, il faut donc diviser les deux membres de l'équation par $${a}$.`;
158
158
  case 2:
159
159
  // ax + b = c tous entiers
160
- return `Pour isoler $x$, on commence par passer $${b}$ à droite de l'équation.
160
+ return `Pour isoler $x$, on commence par regrouper les termes sans $x$ dans le membre de droite.
161
161
 
162
- Pour cela, il faut soustraire par $${b}$.`;
162
+ Pour cela, il faut soustraire les deux membres de l'équation par $${b}$.`;
163
163
  case 3:
164
164
  //ax-b = c tous entiers
165
- return `Pour isoler $x$, on commence par passer $${-b}$ à droite de l'équation.
165
+ return `Pour isoler $x$, on commence par regrouper les termes sans $x$ dans le membre de droite.
166
166
 
167
- Pour cela, il faut additionner par $${b}$.`;
167
+ Pour cela, il faut additionner les deux membres de l'équation par $${b}$.`;
168
168
  case 4:
169
169
  //x/a = b tous entiers
170
- return `Pour isoler $x$, on doit "annuler" la division par $${a}$.
170
+ return `Pour isoler $x$, on commence par regrouper les termes sans $x$ dans le membre de droite.
171
171
 
172
- Pour cela, on multiplie par $${a}$.`;
172
+ Pour cela, on multiplie les deux membres de l'équation par $${a}$.`;
173
173
  case 5:
174
174
  //x+a = b
175
- return `Pour isoler $x$, il faut faire passer $${a}$ à droite de l'équation.
175
+ return `Pour isoler $x$, on commence par regrouper les termes sans $x$ dans le membre de droite.
176
176
 
177
- Pour cela, il faut soustraire par $${a}$.`;
177
+ Pour cela, il faut soustraire les deux membres de l'équation par $${a}$.`;
178
178
  case 6:
179
179
  default:
180
180
  //x-a = b
181
- return `Pour isoler $x$, il faut faire passer $${-a}$ à droite de l'équation.
181
+ return `Pour isoler $x$, on commence par regrouper les termes sans $x$ dans le membre de droite.
182
182
 
183
- Pour cela, il faut additionner par $${a}$.`;
183
+ Pour cela, il faut additionner les deux membres de l'équation par $${a}$.`;
184
184
  }
185
185
  };
186
186
  const getQuestionFromIdentifiers = (identifiers) => {
@@ -28,7 +28,7 @@ const getAnswer = (identifiers) => {
28
28
  };
29
29
  const getHint = (identifiers) => {
30
30
  const { a, b } = identifiers;
31
- return `Il faut isoler $x$ à gauche. Pour cela, effectue l'opération des deux côtés de l'équation qui permet de supprimer le terme $${a < 0 ? "" : "+"}${a}$.`;
31
+ return `Il faut isoler $x$ à gauche. Pour cela, effectue des deux côtés de l'équation l'opération qui permet de supprimer le terme $${a < 0 ? "" : "+"}${a}$.`;
32
32
  };
33
33
  const getCorrection = (identifiers) => {
34
34
  const { a, b } = identifiers;
@@ -44,7 +44,7 @@ const getHint = (identifiers) => {
44
44
  const { a, b, isXRight, aNumberType } = identifiers;
45
45
  const aTree = reifyAlgebraic(a);
46
46
  const bTree = reifyAlgebraic(b);
47
- return `Il faut isoler $x$ à ${isXRight ? "droite" : "gauche"}. Pour cela, effectue l'opération des deux côtés de l'équation qui permet de supprimer la multiplication par $${aTree.toTex()}$.`;
47
+ return `Il faut isoler $x$ à ${isXRight ? "droite" : "gauche"}. Pour cela, effectue des deux côtés de l'équation l'opération qui permet de supprimer la multiplication par $${aTree.toTex()}$.`;
48
48
  };
49
49
  const getCorrection = (identifiers) => {
50
50
  const { a, b, isXRight, aNumberType } = identifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"equa3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equa3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAerC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAsBvD,CAAC"}
1
+ {"version":3,"file":"equa3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equa3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAerC;;GAEG;AACH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAsBvD,CAAC"}
@@ -26,15 +26,13 @@ ${getStatementNode(identifiers).toTex()}
26
26
  $$`;
27
27
  };
28
28
  const getHint = (identifiers) => {
29
- return "Isolez le terme $x$ dans la partie gauche de l'équation.";
29
+ return "Isole le terme $x$ dans le membre gauche de l'équation.";
30
30
  };
31
31
  const getCorrection = (identifiers) => {
32
32
  const { a, b, c } = identifiers;
33
33
  const statementTex = getStatementNode(identifiers).toTex();
34
34
  const answer = getAnswer(identifiers);
35
- return `Commencer par soustraire $${b}$ des deux côtés de l'équation pour
36
- l'éliminer du côté gauche. Ensuite, diviser les deux côtés de l'équation par
37
- $${a}$ pour isoler $x$, ce qui donne :
35
+ return `On commence par soustraire $${b}$ des deux côtés de l'équation pour l'éliminer du côté gauche. Ensuite, on divise les deux côtés de l'équation par $${a}$ pour isoler $x$.
38
36
 
39
37
  ${alignTex([
40
38
  [
@@ -59,7 +59,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
59
59
  return question;
60
60
  };
61
61
  const getHint = (identifiers) => {
62
- return `Commence par regrouper les termes en $x$ d'un même côté de l'équation. Puis, isole $x$ en effectuant les bonnes opérations.`;
62
+ return `Commence par regrouper les termes en $x$ d'un même côté de l'équation. Puis isole $x$ en effectuant les bonnes opérations.`;
63
63
  };
64
64
  const getCorrection = (identifiers) => {
65
65
  const { a, b, c, d } = identifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"equationFromSentenceExercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationFromSentenceExercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AASF,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAkOF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAa9D,CAAC"}
1
+ {"version":3,"file":"equationFromSentenceExercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationFromSentenceExercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AA2PF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAY9D,CAAC"}
@@ -12,17 +12,85 @@ import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
12
12
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
13
13
  const x = new VariableNode("x");
14
14
  const twoNode = new NumberNode(2);
15
+ const getInstruction = (identifiers) => {
16
+ const { type, vars } = identifiers;
17
+ const { flip, resultNb, randAdd, op2 } = vars;
18
+ let instruction = `On appelle $x$ le nombre à trouver.
19
+ Traduire par une équation la phrase suivante :
20
+
21
+ `;
22
+ switch (type) {
23
+ case 1:
24
+ return (instruction +
25
+ `"${flip ? `Le double` : `La moitié`} du nombre à trouver vaut $${resultNb}$".`);
26
+ case 2:
27
+ return (instruction +
28
+ `"${flip ? `La somme` : `La différence`} du nombre à trouver et de $${randAdd}$ a pour résultat $${resultNb}$".`);
29
+ case 3:
30
+ default:
31
+ return (instruction +
32
+ `"${flip ? `Le double` : `La moitié`} du nombre à trouver ${flip ? op2 : op2 + "e"} de $${randAdd}$ vaut $${resultNb}$".`);
33
+ }
34
+ };
35
+ const getAnswerNode = (identifiers) => {
36
+ const { type, vars } = identifiers;
37
+ const randAddNode = vars.randAdd
38
+ ? new NumberNode(vars.randAdd)
39
+ : new NumberNode(0);
40
+ switch (type) {
41
+ case 1:
42
+ return new EqualNode(vars.flip
43
+ ? new MultiplyNode(x, twoNode).simplify()
44
+ : new FractionNode(x, twoNode).simplify(), new NumberNode(vars.resultNb));
45
+ case 2:
46
+ return new EqualNode(vars.flip
47
+ ? new AddNode(x, randAddNode)
48
+ : new SubstractNode(x, randAddNode), new NumberNode(vars.resultNb));
49
+ case 3:
50
+ return new EqualNode(vars.op2 === "augmenté"
51
+ ? new AddNode(vars.flip
52
+ ? new MultiplyNode(twoNode, x).simplify()
53
+ : new FractionNode(x, twoNode).simplify(), randAddNode)
54
+ : new SubstractNode(vars.flip
55
+ ? new MultiplyNode(twoNode, x).simplify()
56
+ : new FractionNode(x, twoNode).simplify(), randAddNode), new NumberNode(vars.resultNb));
57
+ }
58
+ return new EqualNode(x, x);
59
+ };
60
+ const getAnswer = (identifiers) => {
61
+ return getAnswerNode(identifiers).toTex();
62
+ };
15
63
  const getEquationFromSentenceExerciseQuestion = () => {
16
- const exercise = generateExercise();
64
+ const type = randint(1, 4);
65
+ const flip = coinFlip();
66
+ const resultNb = randint(1, 51) * 2;
67
+ let randAdd;
68
+ let op2;
69
+ switch (type) {
70
+ case 1:
71
+ break;
72
+ case 2:
73
+ randAdd = randint(1, 11);
74
+ break;
75
+ case 3:
76
+ randAdd = randint(1, 11);
77
+ op2 = coinFlip() ? `augmenté` : `diminué`;
78
+ break;
79
+ }
80
+ const vars = { randAdd, resultNb, op2, flip };
81
+ const identifiers = {
82
+ type,
83
+ vars,
84
+ };
85
+ return getQuestionFromIdentifiers(identifiers);
86
+ };
87
+ const getQuestionFromIdentifiers = (identifiers) => {
17
88
  const question = {
18
- answer: exercise.answer.toTex(),
19
- instruction: exercise.instruction,
89
+ answer: getAnswer(identifiers),
90
+ instruction: getInstruction(identifiers),
20
91
  keys: ["x", "equal"],
21
92
  answerFormat: "tex",
22
- identifiers: {
23
- type: exercise.type,
24
- vars: exercise.vars,
25
- },
93
+ identifiers,
26
94
  };
27
95
  return question;
28
96
  };
@@ -37,8 +105,8 @@ const getPropositions = (n, { answer, type, vars }) => {
37
105
  }
38
106
  return shuffleProps(propositions, n);
39
107
  };
40
- const isAnswerValid = (ans, { type, vars }) => {
41
- const correctAnswer = getCorrectAnswer(type, vars);
108
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
109
+ const correctAnswer = getAnswerNode(identifiers);
42
110
  return correctAnswer.toAllValidTexs().includes(ans);
43
111
  };
44
112
  const generateProposition = (type, vars) => {
@@ -90,68 +158,15 @@ const getSecondProposition = (type, vars, randAddNode, resultNode) => {
90
158
  }
91
159
  return new EqualNode(x, x);
92
160
  };
93
- const getCorrectAnswer = (type, vars) => {
94
- const randAddNode = vars.randAdd
95
- ? new NumberNode(vars.randAdd)
96
- : new NumberNode(0);
97
- switch (type) {
98
- case 1:
99
- return new EqualNode(vars.flip
100
- ? new MultiplyNode(x, twoNode).simplify()
101
- : new FractionNode(x, twoNode).simplify(), new NumberNode(vars.resultNb));
102
- case 2:
103
- return new EqualNode(vars.flip
104
- ? new AddNode(x, randAddNode)
105
- : new SubstractNode(x, randAddNode), new NumberNode(vars.resultNb));
106
- case 3:
107
- return new EqualNode(vars.op2 === "augmenté"
108
- ? new AddNode(vars.flip
109
- ? new MultiplyNode(twoNode, x).simplify()
110
- : new FractionNode(x, twoNode).simplify(), randAddNode)
111
- : new SubstractNode(vars.flip
112
- ? new MultiplyNode(twoNode, x).simplify()
113
- : new FractionNode(x, twoNode).simplify(), randAddNode), new NumberNode(vars.resultNb));
114
- }
115
- return new EqualNode(x, x);
116
- };
117
- const generateExercise = () => {
118
- const type = randint(1, 4);
119
- const flip = coinFlip();
120
- const resultNb = randint(1, 51) * 2;
121
- let randAdd;
122
- let op2;
123
- let instruction = "";
124
- switch (type) {
125
- case 1:
126
- instruction = `On appelle $x$ le nombre à trouver.
127
- Traduire par une équation la phrase "${flip ? `Le double` : `La moitié`} du nombre à trouver vaut $${resultNb}$".`;
128
- break;
129
- case 2:
130
- randAdd = randint(1, 11);
131
- instruction = `On appelle $x$ le nombre à trouver.
132
- Traduire par une équation la phrase "${flip ? `La somme` : `La différence`} du nombre à trouver et de $${randAdd}$ a pour résultat $${resultNb}$".`;
133
- break;
134
- case 3:
135
- randAdd = randint(1, 11);
136
- op2 = coinFlip() ? `augmenté` : `diminué`;
137
- instruction = `On appelle $x$ le nombre à trouver.
138
- Traduire par une équation la phrase "${flip ? `Le double` : `La moitié`} du nombre à trouver ${flip ? op2 : op2 + "e"} de $${randAdd}$ vaut $${resultNb}$".`;
139
- break;
140
- }
141
- const vars = { randAdd, resultNb, op2, flip };
142
- const answer = getCorrectAnswer(type, vars);
143
- return { type, instruction, answer, vars };
144
- };
145
161
  export const equationFromSentenceExericse = {
146
162
  id: "equationFromSentenceExercise",
147
163
  label: "Traduire une phrase en une équation mathématique",
148
- levels: ["5ème"],
149
164
  isSingleStep: true,
150
- sections: ["Calcul littéral"],
151
165
  generator: (nb) => getDistinctQuestions(getEquationFromSentenceExerciseQuestion, nb),
152
166
  qcmTimer: 60,
153
167
  freeTimer: 60,
154
168
  getPropositions,
155
169
  isAnswerValid,
156
170
  subject: "Mathématiques",
171
+ getQuestionFromIdentifiers,
157
172
  };
@@ -13,14 +13,14 @@ const getInstruction = (identifiers) => {
13
13
  const { a, b } = identifiers;
14
14
  const frac = new FractionNode(a.toTree(), "x".toTree());
15
15
  const statement = new EqualNode(frac, b.toTree()).toTex();
16
- return `Résoudre l'équation suivante :
16
+ return `Résoudre l'équation suivante, où $x\\neq 0$ :
17
17
 
18
18
  $$
19
19
  ${statement}
20
20
  $$`;
21
21
  };
22
22
  const getHint = (identifiers) => {
23
- return `Multiplie les deux côtés de l'équation par $x$, puis isole $x$ dans la partie droite de l'équation.`;
23
+ return `Multiplie les deux membres de l'équation par $x$, puis isole $x$ dans le membre de droite de l'équation.`;
24
24
  };
25
25
  const getAnswer = (identifiers) => {
26
26
  const { a, b } = identifiers;
@@ -32,7 +32,7 @@ const getCorrection = (identifiers) => {
32
32
  const frac = new FractionNode(a.toTree(), "x".toTree());
33
33
  const statement = new EqualNode(frac, b.toTree()).toTex();
34
34
  const answer = getAnswer(identifiers);
35
- return `On multiplie les deux côtés de l'équation par $x$, puis on divise par $${b}$ :
35
+ return `On multiplie les deux membres de l'équation par $x$ (qui est bien différent de $0$), puis on divise par $${b}$ :
36
36
 
37
37
  ${alignTex([
38
38
  ["", `${statement}`],