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
@@ -1,14 +1,19 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { rationalVEA } from "../../../exercises/vea/rationalVEA.js";
3
4
  import { randfloat } from "../../../math/utils/random/randfloat.js";
4
5
  import { randint } from "../../../math/utils/random/randint.js";
5
6
  import { round } from "../../../math/utils/round.js";
7
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
8
+ import { percentParser } from "../../../tree/parsers/percentParser.js";
9
+ import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
10
+ import { approxOrEqual } from "../../../utils/latex/approxOrEqual.js";
6
11
  const getInstruction = (identifiers) => {
7
12
  const { total, lefties } = identifiers;
8
- return `Dans un lycée de $${total}$ élèves, $${lefties}$ sont gauchers. Quel est le pourcentage de gauchers dans ce lycée ? Arrondir au centième de pourcentage.`;
13
+ return `Dans un lycée de $${total}$ élèves, $${lefties}$ sont gauchers. Quelle est la proportion de gauchers dans ce lycée, en pourcentage ? Arrondir au centième de pourcentage.`;
9
14
  };
10
15
  const getHint = (identifiers) => {
11
- return `La proportion de gauchers s'obtient par la formule :
16
+ return `La proportion de gauchers en pourcentage s'obtient par la formule :
12
17
 
13
18
  $$
14
19
  \\frac{\\text{nombre de gauchers}}{\\text{nombre d'élèves}}\\times 100
@@ -17,11 +22,14 @@ $$
17
22
  };
18
23
  const getCorrection = (identifiers) => {
19
24
  const { total, lefties } = identifiers;
20
- return `Le pourcentage de gauchers dans ce lycée est de :
25
+ const frac = (100 * lefties) / total;
26
+ return `La proportion de gauchers en pourcentage dans ce lycée est de :
21
27
 
22
28
  $$
23
- \\frac{${lefties}}{${total}}\\times 100 = ${getAnswer(identifiers)}
29
+ \\frac{${lefties}}{${total}}\\times 100 ${approxOrEqual(frac, 2).join("")}
24
30
  $$
31
+
32
+ Il y a donc $${getAnswer(identifiers)}$ de gauchers dans ce lycée.
25
33
  `;
26
34
  };
27
35
  const getAnswer = (identifiers) => {
@@ -33,6 +41,9 @@ const getFindProportionQuestion = () => {
33
41
  const total = randint(120, 200);
34
42
  const lefties = randint(30, 120);
35
43
  const identifiers = { total, lefties };
44
+ return getQuestionFromIdentifiers(identifiers);
45
+ };
46
+ const getQuestionFromIdentifiers = (identifiers) => {
36
47
  const question = {
37
48
  answer: getAnswer(identifiers),
38
49
  instruction: getInstruction(identifiers),
@@ -53,7 +64,23 @@ const getPropositions = (n, { answer, total, lefties }) => {
53
64
  }
54
65
  return shuffleProps(propositions, n);
55
66
  };
56
- const isAnswerValid = (ans, { answer }) => {
67
+ const isAnswerValid = (ans, { answer, lefties, total }) => {
68
+ try {
69
+ if (ans.includes("\\%")) {
70
+ return percentParser(ans) === answer;
71
+ }
72
+ const nb = ans.unfrenchify();
73
+ if (!isNaN(nb)) {
74
+ const value = answer.replace("\\%", "").unfrenchify();
75
+ return nb === value || nb === round(value / 100, 4);
76
+ }
77
+ else {
78
+ return rationalVEA(ans, frac(lefties, total).simplify().toTex());
79
+ }
80
+ }
81
+ catch (err) {
82
+ return handleVEAError(err);
83
+ }
57
84
  const texs = [answer, answer.replace("\\%", "")];
58
85
  return texs.includes(ans);
59
86
  };
@@ -61,9 +88,7 @@ export const findProportion = {
61
88
  id: "findProportion",
62
89
  connector: "=",
63
90
  label: "Calculer une proportion en pourcentage",
64
- levels: ["4ème", "3ème", "2nde"],
65
91
  isSingleStep: true,
66
- sections: ["Pourcentages"],
67
92
  generator: (nb) => getDistinctQuestions(getFindProportionQuestion, nb),
68
93
  qcmTimer: 60,
69
94
  freeTimer: 60,
@@ -71,9 +96,6 @@ export const findProportion = {
71
96
  isAnswerValid,
72
97
  subject: "Mathématiques",
73
98
  hasHintAndCorrection: true,
74
- getInstruction,
75
- getAnswer,
76
- getHint,
77
- getCorrection,
99
+ getQuestionFromIdentifiers,
78
100
  shouldHaveCalculator: true,
79
101
  };
@@ -26,7 +26,7 @@ const getInstruction = (identifiers) => {
26
26
  Quel était son prix initial ? Arrondir au centième.`;
27
27
  };
28
28
  const getHint = (identifiers) => {
29
- return `Transforme le taux d'évolution en coefficient multiplicateur. Puis, divise le prix final par ce coefficient multiplicateur.`;
29
+ return `Transforme le taux d'évolution en coefficient multiplicateur. Puis divise le prix final par ce coefficient multiplicateur.`;
30
30
  };
31
31
  const getCorrection = (identifiers) => {
32
32
  const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
@@ -1 +1 @@
1
- {"version":3,"file":"findTVA.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findTVA.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAuEF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAiBzC,CAAC"}
1
+ {"version":3,"file":"findTVA.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findTVA.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AA4EF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAczC,CAAC"}
@@ -57,6 +57,9 @@ const getFindTvaQuestion = () => {
57
57
  const ttc = round(ht * (1 + tva / 100), 2);
58
58
  const identifiers = { ht, tva, ttc };
59
59
  //20, 10, 5.5, 2.1
60
+ return getQuestionFromIdentifiers(identifiers);
61
+ };
62
+ const getQuestionFromIdentifiers = (identifiers) => {
60
63
  const question = {
61
64
  answer: getAnswer(identifiers),
62
65
  instruction: getInstruction(identifiers),
@@ -80,9 +83,6 @@ export const findTVA = {
80
83
  getPropositions,
81
84
  isAnswerValid,
82
85
  subject: "Mathématiques",
83
- getHint,
84
- getCorrection,
85
- getAnswer,
86
- getInstruction,
86
+ getQuestionFromIdentifiers,
87
87
  hasHintAndCorrection: true,
88
88
  };
@@ -1 +1 @@
1
- {"version":3,"file":"htToTTC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/htToTTC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAmEF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAkBzC,CAAC"}
1
+ {"version":3,"file":"htToTTC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/htToTTC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA6EF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAgBzC,CAAC"}
@@ -6,6 +6,7 @@ import { round } from "../../../math/utils/round.js";
6
6
  import { numberParser } from "../../../tree/parsers/numberParser.js";
7
7
  import { coinFlip } from "../../../utils/alea/coinFlip.js";
8
8
  import { random } from "../../../utils/alea/random.js";
9
+ import { approxOrEqual } from "../../../utils/latex/approxOrEqual.js";
9
10
  const getAnswer = (identifiers) => {
10
11
  const { TVA, ht } = identifiers;
11
12
  const answer = round(ht * (1 + TVA / 100), 2).frenchify();
@@ -13,7 +14,7 @@ const getAnswer = (identifiers) => {
13
14
  };
14
15
  const getInstruction = (identifiers) => {
15
16
  const { TVA, ht } = identifiers;
16
- return `Un objet coûte $${ht.frenchify()}€$ en HT. Quel est son prix TTC, sachant que la TVA est de $${TVA.frenchify()}\\%$ ? Arrondir au centième.`;
17
+ return `Un objet coûte $${ht.frenchify()}€$ HT. Quel est son prix TTC, sachant que la TVA est de $${TVA.frenchify()}\\%$ ? Arrondir le prix au centième.`;
17
18
  };
18
19
  const getHint = (identifiers) => {
19
20
  const { TVA, ht } = identifiers;
@@ -22,16 +23,18 @@ const getHint = (identifiers) => {
22
23
  const getCorrection = (identifiers) => {
23
24
  const { TVA, ht } = identifiers;
24
25
  const answer = getAnswer(identifiers);
26
+ const roundTVA = round(1 + TVA / 100, 3);
27
+ const final = roundTVA * ht;
25
28
  return `Pour augmenter $${ht.frenchify()}$ de $${TVA.frenchify()}\\%$, on le multiplie par :
26
29
 
27
30
  $$
28
- 1 + \\frac{${TVA.frenchify()}}{100} = ${round(1 + TVA / 100, 3).frenchify()}
31
+ 1 + \\frac{${TVA.frenchify()}}{100} = ${roundTVA.frenchify()}
29
32
  $$
30
33
 
31
34
  Le prix TTC est donc :
32
35
 
33
36
  $$
34
- ${ht.frenchify()} \\times ${round(1 + TVA / 100, 3).frenchify()} = ${answer}
37
+ ${ht.frenchify()} \\times ${roundTVA.frenchify()} ${approxOrEqual(final, 2).join("")}
35
38
  $$
36
39
  `;
37
40
  };
@@ -39,6 +42,9 @@ const getHtToTtcQuestion = () => {
39
42
  const TVA = random([20, 5.5]);
40
43
  const ht = coinFlip() ? randint(50, 1000) : randfloat(20, 200, 2);
41
44
  const identifiers = { TVA, ht };
45
+ return getQuestionFromIdentifiers(identifiers);
46
+ };
47
+ const getQuestionFromIdentifiers = (identifiers) => {
42
48
  const question = {
43
49
  answer: getAnswer(identifiers),
44
50
  instruction: getInstruction(identifiers),
@@ -77,8 +83,6 @@ export const htToTTC = {
77
83
  isAnswerValid,
78
84
  subject: "Mathématiques",
79
85
  hasHintAndCorrection: true,
80
- getAnswer,
81
- getInstruction,
82
- getHint,
83
- getCorrection,
86
+ getQuestionFromIdentifiers,
87
+ shouldHaveCalculator: true,
84
88
  };
@@ -1,20 +1,11 @@
1
- export * from "./applyPercent.js";
2
- export * from "./averageEvolutionRate.js";
3
- export * from "./evolutionToCM.js";
4
- export * from "./globalPercent.js";
5
- export * from "./reciprocalPercentage.js";
6
1
  export * from "./percentToDecimal.js";
7
2
  export * from "./valuePercent.js";
8
3
  export * from "./findProportion.js";
9
- export * from "./cmToEvolution.js";
10
4
  export * from "./htToTTC.js";
11
5
  export * from "./ttcToHT.js";
12
6
  export * from "./findTVA.js";
13
- export * from "./evolutionRateFromValues.js";
14
- export * from "./findStartValueAfterEvolution.js";
15
7
  export * from "./subPopulationEffectifFromPercent.js";
16
8
  export * from "./populationEffectifFromSubPopulation.js";
17
- export * from "./findEndValueAfterEvolution.js";
18
- export * from "./findRightCalculForPriceEvolution.js";
19
9
  export * from "./percentWritings.js";
10
+ export * from "./evolutions/index.js";
20
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
@@ -1,19 +1,10 @@
1
- export * from "./applyPercent.js";
2
- export * from "./averageEvolutionRate.js";
3
- export * from "./evolutionToCM.js";
4
- export * from "./globalPercent.js";
5
- export * from "./reciprocalPercentage.js";
6
1
  export * from "./percentToDecimal.js";
7
2
  export * from "./valuePercent.js";
8
3
  export * from "./findProportion.js";
9
- export * from "./cmToEvolution.js";
10
4
  export * from "./htToTTC.js";
11
5
  export * from "./ttcToHT.js";
12
6
  export * from "./findTVA.js";
13
- export * from "./evolutionRateFromValues.js";
14
- export * from "./findStartValueAfterEvolution.js";
15
7
  export * from "./subPopulationEffectifFromPercent.js";
16
8
  export * from "./populationEffectifFromSubPopulation.js";
17
- export * from "./findEndValueAfterEvolution.js";
18
- export * from "./findRightCalculForPriceEvolution.js";
19
9
  export * from "./percentWritings.js";
10
+ export * from "./evolutions/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA2IF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
1
+ {"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA+IF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAgBlD,CAAC"}
@@ -67,6 +67,9 @@ const getPercentToDecimalQuestion = () => {
67
67
  isPercentToDecimal,
68
68
  nb: round(nb.value, 10),
69
69
  };
70
+ return getQuestionFromIdentifiers(identifiers);
71
+ };
72
+ const getQuestionFromIdentifiers = (identifiers) => {
70
73
  const question = {
71
74
  answer: getAnswer(identifiers),
72
75
  instruction: getInstruction(identifiers),
@@ -125,4 +128,5 @@ export const percentToDecimal = {
125
128
  isAnswerValid,
126
129
  subject: "Mathématiques",
127
130
  hasHintAndCorrection: true,
131
+ getQuestionFromIdentifiers,
128
132
  };
@@ -1 +1 @@
1
- {"version":3,"file":"percentWritings.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentWritings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EACF,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,CAAC;CACzB,CAAC;AA8JF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAgBjD,CAAC"}
1
+ {"version":3,"file":"percentWritings.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentWritings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EACF,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,CAAC;CACzB,CAAC;AAoKF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
@@ -113,6 +113,9 @@ const getPercentWritingsQuestion = (ops) => {
113
113
  percent,
114
114
  target,
115
115
  };
116
+ return getQuestionFromIdentifiers(identifiers);
117
+ };
118
+ const getQuestionFromIdentifiers = (identifiers) => {
116
119
  const question = {
117
120
  answer: getAnswer(identifiers),
118
121
  instruction: getInstruction(identifiers),
@@ -135,8 +138,5 @@ export const percentWritings = {
135
138
  getPropositions,
136
139
  isAnswerValid,
137
140
  subject: "Mathématiques",
138
- getInstruction,
139
- // getHint,
140
- // getCorrection,
141
- getAnswer,
141
+ getQuestionFromIdentifiers,
142
142
  };
@@ -1 +1 @@
1
- {"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAgJF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAiBrE,CAAC"}
1
+ {"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsJF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAgBrE,CAAC"}
@@ -24,7 +24,7 @@ const getInstruction = (identifiers) => {
24
24
  const arrondi = "Arrondir à l'unité si nécessaire.";
25
25
  switch (identifiers.contextType) {
26
26
  case 0:
27
- return `Dans une classe, $${identifiers.subPopulationPercent.frenchify()}\\%$ des élèves sont des garcons, ce qui représente $${identifiers.subPopulationEffectif}$ élèves. Quel est le nombre d'élèves dans cette classe ? ${arrondi}`;
27
+ return `Dans une classe, $${identifiers.subPopulationPercent.frenchify()}\\%$ des élèves sont des garçons, ce qui représente $${identifiers.subPopulationEffectif}$ élèves. Quel est le nombre d'élèves dans cette classe ? ${arrondi}`;
28
28
  case 1:
29
29
  return `Dans un collège, $${identifiers.subPopulationPercent.frenchify()}\\%$ des élèves sont gauchers, ce qui représente $${identifiers.subPopulationEffectif}$ élèves. Quel est le nombre d'élèves dans ce collège ? ${arrondi}`;
30
30
  case 2:
@@ -40,14 +40,14 @@ const isAnswerValid = (ans, { answer }) => {
40
40
  };
41
41
  const getHint = (identifiers) => {
42
42
  const itemType = identifiers.contextType === 2 ? "habitants" : "élèves";
43
- return `Utilise un produit en croix : si $${identifiers.subPopulationPercent.frenchify()}\\%$ représente $${identifiers.subPopulationEffectif}$ ${itemType}, alors que représente $100\\%$ ?`;
43
+ return `Détermine la quatrième proportionnelle un produit en croix : si $${identifiers.subPopulationPercent.frenchify()}\\%$ représente $${identifiers.subPopulationEffectif}$ ${itemType}, alors que représente $100\\%$ ?`;
44
44
  };
45
45
  const getCorrection = (identifiers) => {
46
46
  const itemType = identifiers.contextType === 2 ? "habitants" : "élèves";
47
47
  const answer = getAnswer(identifiers);
48
48
  return `On sait que $${identifiers.subPopulationPercent.frenchify()}\\%$ représente $${identifiers.subPopulationEffectif}$ ${itemType}, et on cherche ce que réprésente $100\\%$ des ${itemType}.
49
49
 
50
- Pour cela, on peut faire un produit en croix :
50
+ Pour cela, on peut déterminer la quatrième proportionnelle :
51
51
 
52
52
  ${mdTable([
53
53
  ["$?$", "$100\\%$"],
@@ -94,6 +94,9 @@ const getPopulationEffectifFromSubPopulationQuestion = () => {
94
94
  subPopulationEffectif,
95
95
  subPopulationPercent,
96
96
  };
97
+ return getQuestionFromIdentifiers(identifiers);
98
+ };
99
+ const getQuestionFromIdentifiers = (identifiers) => {
97
100
  const question = {
98
101
  answer: getAnswer(identifiers),
99
102
  instruction: getInstruction(identifiers),
@@ -120,7 +123,6 @@ export const populationEffectifFromSubPopulation = {
120
123
  getPropositions,
121
124
  isAnswerValid,
122
125
  subject: "Mathématiques",
123
- getHint,
124
- getCorrection,
126
+ getQuestionFromIdentifiers,
125
127
  hasHintAndCorrection: true,
126
128
  };
@@ -57,7 +57,7 @@ const getReciprocalPercentageQuestion = () => {
57
57
  keys: ["percent"],
58
58
  answerFormat: "tex",
59
59
  identifiers: { isUp, randPercent },
60
- hint: `Calcule le coefficient multiplicateur associé à une ${isUp ? "hausse" : "baisse"} de $${randPercent}\\%$. Puis, calcule le coefficient multiplicateur réciproque : c'est l'inverse du coefficient multiplicateur. Il ne reste alors plus qu'à transformer le coefficient multiplicateur réciproque en taux d'évolution.`,
60
+ hint: `Calcule le coefficient multiplicateur associé à une ${isUp ? "hausse" : "baisse"} de $${randPercent}\\%$. Puis calcule le coefficient multiplicateur réciproque : c'est l'inverse du coefficient multiplicateur. Il ne reste alors plus qu'à transformer le coefficient multiplicateur réciproque en taux d'évolution.`,
61
61
  correction: getCorrection(identifiers),
62
62
  };
63
63
  return question;
@@ -1 +1 @@
1
- {"version":3,"file":"subPopulationEffectifFromPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/subPopulationEffectifFromPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAqGF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAiBlE,CAAC"}
1
+ {"version":3,"file":"subPopulationEffectifFromPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/subPopulationEffectifFromPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA2GF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAgBlE,CAAC"}
@@ -20,7 +20,7 @@ const getInstruction = (identifiers) => {
20
20
  const arrondi = "Arrondir à l'unité si nécessaire.";
21
21
  switch (identifiers.contextType) {
22
22
  case 0:
23
- return `Dans une classe de $${identifiers.total}$ élèves, $${identifiers.populationPercent.frenchify()}\\%$ des élèves sont des garcons. Quel est le nombre de garcons dans cette classe ? ${arrondi}`;
23
+ return `Dans une classe de $${identifiers.total}$ élèves, $${identifiers.populationPercent.frenchify()}\\%$ des élèves sont des garçons. Quel est le nombre de garçons dans cette classe ? ${arrondi}`;
24
24
  case 1:
25
25
  return `Dans un collège de $${identifiers.total}$ élèves, $${identifiers.populationPercent.frenchify()}\\%$ des élèves sont gauchers. Quel est le nombre de gauchers dans ce collège ? ${arrondi}`;
26
26
  case 2:
@@ -72,6 +72,9 @@ const getSubPopulationEffectifFromPercentQuestion = () => {
72
72
  populationPercent,
73
73
  total,
74
74
  };
75
+ return getQuestionFromIdentifiers(identifiers);
76
+ };
77
+ const getQuestionFromIdentifiers = (identifiers) => {
75
78
  const question = {
76
79
  answer: getAnswer(identifiers),
77
80
  instruction: getInstruction(identifiers),
@@ -95,8 +98,7 @@ export const subPopulationEffectifFromPercent = {
95
98
  getPropositions,
96
99
  isAnswerValid,
97
100
  subject: "Mathématiques",
98
- getAnswer,
99
- getCorrection,
100
- getHint,
101
+ getQuestionFromIdentifiers,
101
102
  hasHintAndCorrection: true,
103
+ shouldHaveCalculator: true,
102
104
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ttcToHT.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/ttcToHT.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AA6EF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAkBzC,CAAC"}
1
+ {"version":3,"file":"ttcToHT.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/ttcToHT.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAmFF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAezC,CAAC"}
@@ -38,6 +38,9 @@ const getTtcToHtQuestion = () => {
38
38
  const TVA = random([20, 5.5]);
39
39
  const TTC = coinFlip() ? randint(50, 1000) : randfloat(20, 200, 2);
40
40
  const identifiers = { TTC, TVA };
41
+ return getQuestionFromIdentifiers(identifiers);
42
+ };
43
+ const getQuestionFromIdentifiers = (identifiers) => {
41
44
  const question = {
42
45
  answer: getAnswer(identifiers),
43
46
  instruction: getInstruction(identifiers),
@@ -76,8 +79,5 @@ export const ttcToHT = {
76
79
  isAnswerValid,
77
80
  subject: "Mathématiques",
78
81
  hasHintAndCorrection: true,
79
- getInstruction,
80
- getCorrection,
81
- getHint,
82
- getAnswer,
82
+ getQuestionFromIdentifiers,
83
83
  };
@@ -1 +1 @@
1
- {"version":3,"file":"valuePercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/valuePercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA4DF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
1
+ {"version":3,"file":"valuePercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/valuePercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAkEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
@@ -27,6 +27,9 @@ const getValuePercentQuestion = () => {
27
27
  const percent = randint(1, 100);
28
28
  const nb = randint(1, 100);
29
29
  const identifiers = { percent, nb };
30
+ return getQuestionFromIdentifiers(identifiers);
31
+ };
32
+ const getQuestionFromIdentifiers = (identifiers) => {
30
33
  const question = {
31
34
  answer: getAnswer(identifiers),
32
35
  instruction: getInstruction(identifiers),
@@ -61,9 +64,6 @@ export const valuePercent = {
61
64
  isAnswerValid,
62
65
  subject: "Mathématiques",
63
66
  hasHintAndCorrection: true,
64
- getAnswer,
65
- getInstruction,
66
- getCorrection,
67
- getHint,
67
+ getQuestionFromIdentifiers,
68
68
  shouldHaveCalculator: true,
69
69
  };
@@ -1 +1 @@
1
- {"version":3,"file":"calculateNegativePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculateNegativePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAmHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
1
+ {"version":3,"file":"calculateNegativePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculateNegativePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAkHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
- import { Rational } from "../../../math/numbers/rationals/rational.js";
4
3
  import { randint } from "../../../math/utils/random/randint.js";
5
4
  import { isNumberNode, NumberNode, } from "../../../tree/nodes/numbers/numberNode.js";
6
5
  import { frac, isFractionNode, } from "../../../tree/nodes/operators/fractionNode.js";
@@ -18,15 +17,13 @@ $$`;
18
17
  };
19
18
  const getAnswer = (identifiers) => {
20
19
  const { int, power } = identifiers;
21
- const answer = new Rational(1, int ** Math.abs(power))
22
- .simplify()
23
- .toTree()
24
- .toTex();
25
- return answer;
20
+ const fraction = frac(1, new PowerNode(int.toTree(), Math.abs(power).toTree()));
21
+ const answer = fraction.simplify();
22
+ return answer.toTex();
26
23
  };
27
24
  const getHint = (identifiers) => {
28
25
  const { int, power } = identifiers;
29
- return `Pour tous nombre $a$ et tout nombre $x$ positif, on a :
26
+ return `Pour tout nombre $a$ et tout nombre $x$ positif, on a :
30
27
 
31
28
  $$
32
29
  a^{-x} = \\frac{1}{a^x}
@@ -75,9 +72,8 @@ const getPropositions = (n, { answer, int, power }) => {
75
72
  tryToAddWrongProp(propositions, -power + "");
76
73
  }
77
74
  while (propositions.length < n) {
78
- const wrongAnswer = new Rational(1, int ** randint(0, 6, [power]))
75
+ const wrongAnswer = frac(1, int ** randint(0, 6, [power]))
79
76
  .simplify()
80
- .toTree()
81
77
  .toTex();
82
78
  tryToAddWrongProp(propositions, wrongAnswer);
83
79
  }
@@ -89,7 +85,7 @@ const isAnswerValid = (ans, { answer, int, power }) => {
89
85
  if (!isNumberNode(parsed) && !isFractionNode(parsed)) {
90
86
  return false;
91
87
  }
92
- return parsed.simplify({ calculatePowers: true }).toTex() === answer;
88
+ return parsed.simplify().toTex() === answer;
93
89
  }
94
90
  catch (err) {
95
91
  return handleVEAError(err);
@@ -1 +1 @@
1
- {"version":3,"file":"calculatePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculatePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAyHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
1
+ {"version":3,"file":"calculatePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculatePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAyHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
@@ -116,4 +116,5 @@ export const calculatePower = {
116
116
  subject: "Mathématiques",
117
117
  getQuestionFromIdentifiers,
118
118
  hasHintAndCorrection: true,
119
+ shouldHaveCalculator: true,
119
120
  };
@@ -1 +1 @@
1
- {"version":3,"file":"decimalToScientific.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/decimalToScientific.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,QAAQ,EAeT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAqGF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
1
+ {"version":3,"file":"decimalToScientific.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/decimalToScientific.ts"],"names":[],"mappings":"AAyBA,OAAO,EACL,QAAQ,EAeT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA4HF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
@@ -1,10 +1,12 @@
1
1
  import { Decimal, DecimalConstructor, } from "../../../math/numbers/decimals/decimal.js";
2
2
  import { IntegerConstructor, } from "../../../math/numbers/integer/integer.js";
3
3
  import { randint } from "../../../math/utils/random/randint.js";
4
- import { NumberNode } from "../../../tree/nodes/numbers/numberNode.js";
5
- import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
6
- import { PowerNode } from "../../../tree/nodes/operators/powerNode.js";
4
+ import { isNumberNode, NumberNode, } from "../../../tree/nodes/numbers/numberNode.js";
5
+ import { isMultiplyNode, MultiplyNode, } from "../../../tree/nodes/operators/multiplyNode.js";
6
+ import { isPowerNode, PowerNode, } from "../../../tree/nodes/operators/powerNode.js";
7
+ import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
7
8
  import { probaFlip } from "../../../utils/alea/probaFlip.js";
9
+ import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
8
10
  import { pluralize } from "../../../utils/strings/pluralize.js";
9
11
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../exercise.js";
10
12
  import { getDistinctQuestions } from "../../utils/getDistinctQuestions.js";
@@ -19,7 +21,9 @@ $$`;
19
21
  const getAnswer = (identifiers) => {
20
22
  const { decimal } = identifiers;
21
23
  const dec = new Decimal(decimal);
22
- const answer = dec.toScientificNotation().toTex();
24
+ const answer = dec
25
+ .toScientificNotation()
26
+ .toTex({ forceNoSimplification: true });
23
27
  return answer;
24
28
  };
25
29
  const getHint = (identifiers) => {
@@ -29,7 +33,7 @@ $$
29
33
  a\\times 10^n
30
34
  $$
31
35
 
32
- où $a$ est un nombre compris entre $1$ et $10$ (exclus). Repère où placer la virgule pour que $a$ soit correct, puis compte combien de fois il faut déplacer la virgule.`;
36
+ où $a$ est un nombre compris entre $1$ et $10$ (exclus). Repère où placer la virgule pour que $a$ soit effectivement compris entre $1$ et $10$, puis compte combien de fois il faut déplacer la virgule.`;
33
37
  };
34
38
  const getCorrection = (identifiers) => {
35
39
  const { decimal } = identifiers;
@@ -43,7 +47,7 @@ $$
43
47
  ${decimal.frenchify()} = ${getAnswer(identifiers)}
44
48
  $$
45
49
 
46
- On a déplacé la virgule de $${absExp}$ ${pluralize("rang", absExp)} vers la ${order}, donc l'exposant est $${dec.tenthExponentBelow}$.`;
50
+ On a déplacé la virgule de $${absExp}$ ${pluralize("rang", absExp)} vers la ${order}, donc l'exposant de la puissance de $10$ est $${dec.tenthExponentBelow}$.`;
47
51
  };
48
52
  const getQuestionFromIdentifiers = (identifiers) => {
49
53
  const question = {
@@ -82,9 +86,32 @@ const getPropositions = (n, { answer, decimal }) => {
82
86
  return shuffleProps(propositions, n);
83
87
  };
84
88
  const isAnswerValid = (ans, { decimal }) => {
85
- const answerTree = new Decimal(decimal).toScientificNotation();
86
- const texs = answerTree.toAllValidTexs({ forbidPowerToProduct: true });
87
- return texs.includes(ans);
89
+ try {
90
+ const parsed = parseAlgebraic(ans);
91
+ if (!isMultiplyNode(parsed))
92
+ return false;
93
+ if (!isNumberNode(parsed.leftChild))
94
+ return false;
95
+ if (parsed.leftChild.value < 0 || parsed.leftChild.value >= 10)
96
+ return false;
97
+ if (isNumberNode(parsed.rightChild)) {
98
+ if (parsed.rightChild.value !== 10)
99
+ return false;
100
+ return parsed.simplify().toTex() === decimal.frenchify();
101
+ }
102
+ if (isPowerNode(parsed.rightChild)) {
103
+ if (!isNumberNode(parsed.rightChild.leftChild))
104
+ return false;
105
+ if (parsed.rightChild.leftChild.value !== 10)
106
+ return false;
107
+ return (parsed.simplify({ calculatePowers: true }).toTex() ===
108
+ decimal.frenchify());
109
+ }
110
+ return false;
111
+ }
112
+ catch (err) {
113
+ return handleVEAError(err);
114
+ }
88
115
  };
89
116
  export const decimalToScientific = {
90
117
  id: "decimalToScientific",
@@ -1 +1 @@
1
- {"version":3,"file":"powersMixOperations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersMixOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAwBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AA2KF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAkBrD,CAAC"}
1
+ {"version":3,"file":"powersMixOperations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersMixOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAwBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AA2KF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
@@ -159,10 +159,6 @@ export const powersMixOperations = {
159
159
  getPropositions,
160
160
  isAnswerValid,
161
161
  subject: "Mathématiques",
162
- getInstruction,
163
- // getHint,
164
- // getCorrection,
165
- getAnswer,
166
162
  hasHintAndCorrection: true,
167
163
  getQuestionFromIdentifiers,
168
164
  };
@@ -1 +1 @@
1
- {"version":3,"file":"powersOfTenMixOperations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersOfTenMixOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuHF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAkB1D,CAAC"}
1
+ {"version":3,"file":"powersOfTenMixOperations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersOfTenMixOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuHF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAc1D,CAAC"}
@@ -120,10 +120,6 @@ export const powersOfTenMixOperations = {
120
120
  getPropositions,
121
121
  isAnswerValid,
122
122
  subject: "Mathématiques",
123
- getInstruction,
124
- // getHint,
125
- // getCorrection,
126
- getAnswer,
127
123
  getQuestionFromIdentifiers,
128
124
  hasHintAndCorrection: true,
129
125
  };