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
@@ -5,6 +5,7 @@ import { sqrt } from "../../../../../tree/nodes/functions/sqrtNode.js";
5
5
  import { add } from "../../../../../tree/nodes/operators/addNode.js";
6
6
  import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
7
7
  import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
8
9
  import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
9
10
  const getPropositions = (n, { answer }) => {
10
11
  const propositions = [];
@@ -43,7 +44,13 @@ const getKeys = (identifiers) => {
43
44
  };
44
45
  const isAnswerValid = (ans, { answer }) => {
45
46
  try {
46
- throw Error("VEA not implemented");
47
+ const parsed = parseAlgebraic(ans);
48
+ return (parsed
49
+ .simplify({
50
+ towardsDistribute: true,
51
+ forceDistributeFractions: true,
52
+ })
53
+ .toTex() === answer);
47
54
  }
48
55
  catch (err) {
49
56
  return handleVEAError(err);
@@ -77,9 +84,5 @@ export const sqrtProductDerivative = {
77
84
  getPropositions,
78
85
  isAnswerValid,
79
86
  subject: "Mathématiques",
80
- getInstruction,
81
- getHint,
82
- getCorrection,
83
- getAnswer,
84
87
  getQuestionFromIdentifiers,
85
88
  };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ A: number[];
4
+ B: number[];
5
+ coeffs: number[];
6
+ isAskingDerivative: boolean;
7
+ };
8
+ export declare const derivativeNumberOrImageReading: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=derivativeNumberOrImageReading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"derivativeNumberOrImageReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeNumberOrImageReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAsBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAAC;AA6IF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAchE,CAAC"}
@@ -0,0 +1,144 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { blueMain, orange, } from "../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { Integer } from "../../../../math/numbers/integer/integer.js";
6
+ import { Rational } from "../../../../math/numbers/rationals/rational.js";
7
+ import { Polynomial } from "../../../../math/polynomials/polynomial.js";
8
+ import { randint } from "../../../../math/utils/random/randint.js";
9
+ import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
10
+ import { rationalParser } from "../../../../tree/parsers/rationalParser.js";
11
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
12
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
13
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
14
+ const getInstruction = (identifiers) => {
15
+ const { A, isAskingDerivative } = identifiers;
16
+ const xA = A[0];
17
+ return `Ci-dessous sont tracées la courbe $\\mathcal C_f$ de la fonction $f$ et la tangente à cette courbe au point d'abscisse $${xA}$.
18
+
19
+ Déterminer ${isAskingDerivative ? `$f'(${xA})$.` : `$f(${xA})$.`}`;
20
+ };
21
+ const getAnswer = (identifiers) => {
22
+ const { A, B, isAskingDerivative } = identifiers;
23
+ const xA = A[0];
24
+ const xB = B[0];
25
+ const yA = A[1];
26
+ const yB = B[1];
27
+ if (isAskingDerivative) {
28
+ const pente = new Rational(yB - yA, xB - xA).simplify();
29
+ const penteTree = pente.toTree();
30
+ const answer = penteTree.toTex();
31
+ return answer;
32
+ }
33
+ else
34
+ return yA.frenchify();
35
+ };
36
+ const getGGBOptions = (identifiers) => {
37
+ const { A, B } = identifiers;
38
+ const xA = A[0];
39
+ const xB = B[0];
40
+ const yA = A[1];
41
+ const yB = B[1];
42
+ const pente = new Rational(yB - yA, xB - xA).simplify();
43
+ const origin = pente
44
+ .opposite()
45
+ .multiply(new Integer(xA))
46
+ .add(new Integer(yA));
47
+ const penteTree = pente.toTree();
48
+ const originTree = origin.toTree();
49
+ const penteString = penteTree.toMathString();
50
+ const originString = originTree.toMathString();
51
+ const polynome = new Polynomial(identifiers.coeffs);
52
+ const commands = [
53
+ `f(x) = ${polynome.toMathString()}`,
54
+ `SetColor(f, "${blueMain}")`,
55
+ `SetCaption(f, "$\\mathcal C_f$")`,
56
+ `ShowLabel(f, true)`,
57
+ `g(x) = (${penteString}) * x + (${originString})`,
58
+ `SetColor(g, "${orange}")`,
59
+ `A = (${xA},${yA})`,
60
+ "SetFixed(A, true)",
61
+ "SetPointStyle(A, 1)",
62
+ ];
63
+ const xMin = Math.min(xA, xB);
64
+ const yMin = Math.min(yA, yB);
65
+ const xMax = Math.max(xA, xB);
66
+ const yMax = Math.max(yA, yB);
67
+ const ggb = new GeogebraConstructor({
68
+ commands,
69
+ });
70
+ return ggb.getOptions({
71
+ coords: [xMin - 5, xMax + 5, yMin - 5, yMax + 5],
72
+ });
73
+ };
74
+ const getDerivativeNumberReading = () => {
75
+ let xA, yA, xB, yB;
76
+ [xA, yA] = [1, 2].map((el) => randint(-5, 6));
77
+ xB = xA > 0 ? randint(xA - 4, 6, [xA]) : randint(-4, xA + 5, [xA]); // l'écart entre les deux points ne soit pas grand
78
+ yB = yA > 0 ? randint(yA - 4, 6) : randint(-4, yA + 5);
79
+ const pente = new Rational(yB - yA, xB - xA).simplify();
80
+ const penteValue = pente.value;
81
+ const [a, b] = [
82
+ (3 * randint(-100, 100, [0])) / 100,
83
+ (2 * randint(-4, 5)) / 100,
84
+ ];
85
+ const c = penteValue - a * Math.pow(xA, 2) - b * xA;
86
+ const d = yA - (a / 3) * Math.pow(xA, 3) - (b / 2) * Math.pow(xA, 2) - xA * c;
87
+ const isAskingDerivative = coinFlip();
88
+ const identifiers = {
89
+ A: [xA, yA],
90
+ B: [xB, yB],
91
+ coeffs: [d, c, b / 2, a / 3],
92
+ isAskingDerivative,
93
+ };
94
+ return getQuestionFromIdentifiers(identifiers);
95
+ };
96
+ const getQuestionFromIdentifiers = (identifiers) => {
97
+ const question = {
98
+ instruction: getInstruction(identifiers),
99
+ startStatement: "a",
100
+ answer: getAnswer(identifiers),
101
+ ggbOptions: getGGBOptions(identifiers),
102
+ answerFormat: "tex",
103
+ keys: [],
104
+ identifiers,
105
+ };
106
+ return question;
107
+ };
108
+ const getPropositions = (n, { answer, A, B, coeffs, isAskingDerivative }) => {
109
+ const propositions = [];
110
+ addValidProp(propositions, answer);
111
+ tryToAddWrongProp(propositions, getAnswer({ A, B, coeffs, isAskingDerivative: !isAskingDerivative }));
112
+ if (B[1] - A[1] !== 0)
113
+ tryToAddWrongProp(propositions, new Rational(B[0] - A[0], B[1] - A[1]).simplify().toTree().toTex());
114
+ while (propositions.length < n) {
115
+ const wrongAnswer = new NumberNode(randint(-4, 5, [0]));
116
+ tryToAddWrongProp(propositions, wrongAnswer.toTex());
117
+ }
118
+ return shuffle(propositions);
119
+ };
120
+ const isAnswerValid = (ans, { answer, A, B }) => {
121
+ try {
122
+ const parsed = rationalParser(ans);
123
+ if (!parsed)
124
+ return false;
125
+ return parsed.simplify({ decimalToFractions: true }).toTex() === answer;
126
+ }
127
+ catch (err) {
128
+ return handleVEAError(err);
129
+ }
130
+ };
131
+ export const derivativeNumberOrImageReading = {
132
+ id: "derivativeNumberOrImageReading",
133
+ connector: "=",
134
+ label: "Lire graphiquement $f'(a)$ ou $f(a)$",
135
+ isSingleStep: false,
136
+ generator: (nb) => getDistinctQuestions(getDerivativeNumberReading, nb),
137
+ qcmTimer: 60,
138
+ freeTimer: 60,
139
+ getPropositions,
140
+ isAnswerValid,
141
+ hasGeogebra: true,
142
+ subject: "Mathématiques",
143
+ getQuestionFromIdentifiers,
144
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAkJF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAmBzD,CAAC"}
1
+ {"version":3,"file":"derivativeNumberReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/derivativeNumberReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAqBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA0JF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAezD,CAAC"}
@@ -7,7 +7,9 @@ import { Rational } from "../../../../math/numbers/rationals/rational.js";
7
7
  import { Polynomial } from "../../../../math/polynomials/polynomial.js";
8
8
  import { randint } from "../../../../math/utils/random/randint.js";
9
9
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
10
+ import { rationalParser } from "../../../../tree/parsers/rationalParser.js";
10
11
  import { shuffle } from "../../../../utils/alea/shuffle.js";
12
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
11
13
  const rebuildIdentifiers = (oldIds) => {
12
14
  if (oldIds?.coeffs?.length)
13
15
  return oldIds;
@@ -107,6 +109,9 @@ const getDerivativeNumberReading = () => {
107
109
  B: [xB, yB],
108
110
  coeffs: [d, c, b / 2, a / 3],
109
111
  };
112
+ return getQuestionFromIdentifiers(identifiers);
113
+ };
114
+ const getQuestionFromIdentifiers = (identifiers) => {
110
115
  const question = {
111
116
  instruction: getInstruction(identifiers),
112
117
  startStatement: "a",
@@ -129,19 +134,21 @@ const getPropositions = (n, { answer, A, B }) => {
129
134
  }
130
135
  return shuffle(propositions);
131
136
  };
132
- const isAnswerValid = (ans, { A, B }) => {
133
- const answer = new Rational(B[1] - A[1], B[0] - A[0])
134
- .simplify()
135
- .toTree({ allowFractionToDecimal: true });
136
- const texs = answer.toAllValidTexs();
137
- return texs.includes(ans);
137
+ const isAnswerValid = (ans, { answer, A, B }) => {
138
+ try {
139
+ const parsed = rationalParser(ans);
140
+ if (!parsed)
141
+ return false;
142
+ return parsed.simplify({ decimalToFractions: true }).toTex() === answer;
143
+ }
144
+ catch (err) {
145
+ return handleVEAError(err);
146
+ }
138
147
  };
139
148
  export const derivativeNumberReading = {
140
149
  id: "derivativeNumberReading",
141
150
  connector: "=",
142
- label: "Lecture de nombre dérivé",
143
- levels: ["1reESM", "1reSpé", "1reTech", "MathComp", "1rePro"],
144
- sections: ["Dérivation"],
151
+ label: "Lire graphiquement un nombre dérivé",
145
152
  isSingleStep: false,
146
153
  generator: (nb) => getDistinctQuestions(getDerivativeNumberReading, nb),
147
154
  qcmTimer: 60,
@@ -150,8 +157,6 @@ export const derivativeNumberReading = {
150
157
  isAnswerValid,
151
158
  hasGeogebra: true,
152
159
  subject: "Mathématiques",
153
- getInstruction,
154
- getAnswer,
155
- getGGBOptions,
156
160
  rebuildIdentifiers,
161
+ getQuestionFromIdentifiers,
157
162
  };
@@ -99,7 +99,7 @@ $$
99
99
 
100
100
  Ici, on a $a = ${xA}$ et $f(a)=${yA}$.
101
101
 
102
- Puis, on sait que $f'(a)$ est le coefficient directeur de la tangente. On lit graphiquement que le coefficient directeur de la droite est $${yPrimeTex}$. On a donc $f'(a)=${yPrimeTex}$.
102
+ Puis on sait que $f'(a)$ est le coefficient directeur de la tangente. On lit graphiquement que le coefficient directeur de la droite est $${yPrimeTex}$. On a donc $f'(a)=${yPrimeTex}$.
103
103
 
104
104
  Ainsi, l'équation de la tangente est :
105
105
  ${alignTex([
@@ -207,7 +207,7 @@ export const derivativeTangentEquationReading = {
207
207
  getAnswer,
208
208
  hasGeogebra: true,
209
209
  hasHintAndCorrection: true,
210
- getGGBOptions,
210
+ getQuestionFromIdentifiers,
211
211
  };
212
212
  /**Math
213
213
  *
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ trinomCoeffs: number[];
4
+ };
5
+ export declare const horizontalTangentFromAlgebraic: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=horizontalTangentFromAlgebraic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"horizontalTangentFromAlgebraic.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/horizontalTangentFromAlgebraic.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAkGF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAiBhE,CAAC"}
@@ -0,0 +1,108 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { rationalVEA } from "../../../../exercises/vea/rationalVEA.js";
4
+ import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
5
+ import { TrinomConstructor } from "../../../../math/polynomials/trinom.js";
6
+ import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
7
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
8
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
9
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
10
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
11
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
12
+ const getPropositions = (n, { answer }) => {
13
+ const propositions = [];
14
+ addValidProp(propositions, answer);
15
+ while (propositions.length < n) {
16
+ tryToAddWrongProp(propositions, RationalConstructor.randomIrreductible().toTree().toTex());
17
+ }
18
+ return shuffleProps(propositions, n);
19
+ };
20
+ const getAnswer = (identifiers) => {
21
+ const { trinomCoeffs } = identifiers;
22
+ //-b/2a
23
+ const ans = frac(-trinomCoeffs[1], 2 * trinomCoeffs[2])
24
+ .simplify()
25
+ .toTex();
26
+ return ans;
27
+ };
28
+ const getInstruction = (identifiers) => {
29
+ const { trinomCoeffs } = identifiers;
30
+ const trinom = TrinomConstructor.fromCoeffs(trinomCoeffs);
31
+ return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
32
+
33
+ $$
34
+ f(x) = ${trinom.toTex()}
35
+ $$
36
+
37
+ En quelle abscisse la courbe de $f$ admet-elle une tangente horizontale ?`;
38
+ };
39
+ const getHint = (identifiers) => {
40
+ return `Une droite est horizontale (parallèle à l'axe des abscisses) si et seulement si son coefficient directeur est nul.
41
+
42
+ Le coefficient directeur d'une tangente en $a$ à la courbe de $f$ est le nombre dérivé $f'(a)$.`;
43
+ };
44
+ const getCorrection = (identifiers) => {
45
+ const { trinomCoeffs } = identifiers;
46
+ const [c, b, a] = trinomCoeffs;
47
+ const deriv = add(multiply(2, multiply(a, "x")), b);
48
+ const derivSimp = deriv.simplify();
49
+ const equation = new EqualNode(derivSimp, (0).toTree());
50
+ const steps = [];
51
+ const res = equation.isolate("x", { steps });
52
+ return `On calcule la fonction dérivée $f'$ de $f$ :
53
+
54
+ ${alignTex([
55
+ ["f'(x)", "=", deriv.toTex()],
56
+ ["", "=", derivSimp.toTex()],
57
+ ])}
58
+
59
+ On résout ensuite l'équation $f'(x) = 0$ :
60
+
61
+ ${alignTex(steps.map((e) => [e]))}
62
+
63
+ La tangente à la courbe de $f$ au point d'abscisse $${res.rightChild
64
+ .simplify()
65
+ .toTex()}$ est donc horizontale, puisqu'elle a un coefficient directeur nul.
66
+ `;
67
+ };
68
+ const getKeys = (identifiers) => {
69
+ return [];
70
+ };
71
+ const isAnswerValid = (ans, { answer }) => {
72
+ try {
73
+ return rationalVEA(ans, answer);
74
+ }
75
+ catch (err) {
76
+ return handleVEAError(err);
77
+ }
78
+ };
79
+ const getHorizontalTangentFromAlgebraicQuestion = (ops) => {
80
+ const trinom = TrinomConstructor.random();
81
+ const identifiers = { trinomCoeffs: trinom.coefficients };
82
+ return getQuestionFromIdentifiers(identifiers);
83
+ };
84
+ const getQuestionFromIdentifiers = (identifiers) => {
85
+ return {
86
+ answer: getAnswer(identifiers),
87
+ instruction: getInstruction(identifiers),
88
+ keys: getKeys(identifiers),
89
+ answerFormat: "tex",
90
+ identifiers,
91
+ hint: getHint(identifiers),
92
+ correction: getCorrection(identifiers),
93
+ };
94
+ };
95
+ export const horizontalTangentFromAlgebraic = {
96
+ id: "horizontalTangentFromAlgebraic",
97
+ connector: "\\iff",
98
+ label: "Déterminer une tangente horizontale",
99
+ isSingleStep: true,
100
+ generator: (nb, opts) => getDistinctQuestions(() => getHorizontalTangentFromAlgebraicQuestion(opts), nb),
101
+ qcmTimer: 60,
102
+ freeTimer: 60,
103
+ getPropositions,
104
+ isAnswerValid,
105
+ subject: "Mathématiques",
106
+ getQuestionFromIdentifiers,
107
+ hasHintAndCorrection: true,
108
+ };
@@ -1,4 +1,7 @@
1
1
  export * from "./tangentEquations.js";
2
2
  export * from "./derivativeNumberReading.js";
3
3
  export * from "./derivativeTangentEquationReading.js";
4
+ export * from "./tangentEquationWithData.js";
5
+ export * from "./derivativeNumberOrImageReading.js";
6
+ export * from "./horizontalTangentFromAlgebraic.js";
4
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC"}
@@ -1,3 +1,6 @@
1
1
  export * from "./tangentEquations.js";
2
2
  export * from "./derivativeNumberReading.js";
3
3
  export * from "./derivativeTangentEquationReading.js";
4
+ export * from "./tangentEquationWithData.js";
5
+ export * from "./derivativeNumberOrImageReading.js";
6
+ export * from "./horizontalTangentFromAlgebraic.js";
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ fa: number;
5
+ fprimea: number;
6
+ };
7
+ export declare const tangentEquationWithData: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=tangentEquationWithData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tangentEquationWithData.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquationWithData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAwHF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../math/utils/random/randint.js";
4
+ import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
5
+ import { add, AddNode } from "../../../../tree/nodes/operators/addNode.js";
6
+ import { multiply, MultiplyNode, } from "../../../../tree/nodes/operators/multiplyNode.js";
7
+ import { substract, SubstractNode, } from "../../../../tree/nodes/operators/substractNode.js";
8
+ import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
9
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
10
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
11
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
12
+ const getPropositions = (n, { answer }) => {
13
+ const propositions = [];
14
+ addValidProp(propositions, answer);
15
+ while (propositions.length < n) {
16
+ const randomfactor1 = randint(-10, 10);
17
+ const randomfactor2 = randint(-99, 99);
18
+ const randomequation = new EqualNode(new VariableNode("y"), new SubstractNode(new MultiplyNode(randomfactor1.toTree(), new VariableNode("x")), randomfactor2.toTree()).simplify());
19
+ const wrongAnswer = randomequation.toTex();
20
+ tryToAddWrongProp(propositions, wrongAnswer);
21
+ }
22
+ return shuffleProps(propositions, n);
23
+ };
24
+ const getAnswer = (identifiers) => {
25
+ const { a, fa, fprimea } = identifiers;
26
+ const constante = fa - fprimea * a;
27
+ const equation = new EqualNode(new VariableNode("y"), new AddNode(new MultiplyNode(fprimea.toTree(), new VariableNode("x")), constante.toTree()).simplify({ towardsDistribute: true, forbidFactorize: true }));
28
+ return equation.toTex();
29
+ };
30
+ const getInstruction = (identifiers) => {
31
+ const { a, fa, fprimea } = identifiers;
32
+ return `Soit $f$ une fonction définie et dérivable en $${a}$ telle que $f(${a}) = ${fa}$ et $f'(${a}) = ${fprimea}$.
33
+
34
+ Déterminer l'équation de la tangente à la courbe de $f$ en $${a}$.`;
35
+ };
36
+ const getHint = (identifiers) => {
37
+ return `Si $f$ est une fonction dérivable en $a$, alors l'équation de la tangente à la courbe de $f$ au point d'abscisse $a$ est donné par:
38
+
39
+ $$
40
+ y = f'(a)(x-a)+f(a)
41
+ $$`;
42
+ };
43
+ const getCorrection = (identifiers) => {
44
+ const { a, fa, fprimea } = identifiers;
45
+ return `L'équation de la tangente à la courbe de $f$ au point d'abscisse $a$ est donné par:
46
+
47
+ $$
48
+ y = f'(a)(x-a)+f(a)
49
+ $$
50
+
51
+ Ici, on a $f'(${a}) = ${fprimea}$ et $f(${a}) = ${fa}$.
52
+
53
+
54
+ L'équation de la tangente en $${a}$ est donc :
55
+
56
+ ${alignTex([
57
+ ["y", "=", add(multiply(fprimea, substract("x", a)), fa).toTex()],
58
+ ["", "=", getAnswer(identifiers).split("=")[1]],
59
+ ])}
60
+ `;
61
+ };
62
+ const getKeys = (identifiers) => {
63
+ return ["y", "equal", "x"];
64
+ };
65
+ const isAnswerValid = (ans, { answer }) => {
66
+ try {
67
+ let valueAns = "";
68
+ const formated = ans.split("=");
69
+ if (formated.length === 1)
70
+ valueAns = formated[0];
71
+ else
72
+ valueAns = formated[1];
73
+ if (!valueAns)
74
+ return false;
75
+ const parsed = parseAlgebraic(valueAns);
76
+ return ("y=" +
77
+ parsed
78
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
79
+ .toTex() ===
80
+ answer);
81
+ }
82
+ catch (err) {
83
+ return handleVEAError(err);
84
+ }
85
+ };
86
+ const getTangentEquationWithDataQuestion = (ops) => {
87
+ const a = randint(-10, 11);
88
+ const fa = randint(-10, 11);
89
+ const fprimea = randint(-10, 11);
90
+ const identifiers = {
91
+ a,
92
+ fa,
93
+ fprimea,
94
+ };
95
+ return getQuestionFromIdentifiers(identifiers);
96
+ };
97
+ const getQuestionFromIdentifiers = (identifiers) => {
98
+ return {
99
+ answer: getAnswer(identifiers),
100
+ instruction: getInstruction(identifiers),
101
+ keys: getKeys(identifiers),
102
+ answerFormat: "tex",
103
+ identifiers,
104
+ hint: getHint(identifiers),
105
+ correction: getCorrection(identifiers),
106
+ };
107
+ };
108
+ export const tangentEquationWithData = {
109
+ id: "tangentEquationWithData",
110
+ connector: "\\iff",
111
+ label: "Déterminer l'équation d'une tangente ($f(a)$ et $f'(a)$ donnés)",
112
+ isSingleStep: true,
113
+ generator: (nb, opts) => getDistinctQuestions(() => getTangentEquationWithDataQuestion(opts), nb),
114
+ qcmTimer: 60,
115
+ freeTimer: 60,
116
+ getPropositions,
117
+ isAnswerValid,
118
+ subject: "Mathématiques",
119
+ getQuestionFromIdentifiers,
120
+ hasHintAndCorrection: true,
121
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"tangentEquations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAmIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
1
+ {"version":3,"file":"tangentEquations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAyIF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAYlD,CAAC"}
@@ -74,6 +74,9 @@ const getTangentEquationQuestion = () => {
74
74
  const trinome = TrinomConstructor.random();
75
75
  const abscisse = randint(-10, 10);
76
76
  const identifiers = { abscisse, trinome: [trinome.a, trinome.b, trinome.c] };
77
+ return getQuestionFromIdentifiers(identifiers);
78
+ };
79
+ const getQuestionFromIdentifiers = (identifiers) => {
77
80
  const question = {
78
81
  answer: getAnswer(identifiers),
79
82
  instruction: getInstruction(identifiers),
@@ -89,7 +92,7 @@ const getPropositions = (n, { answer }) => {
89
92
  const propositions = [];
90
93
  addValidProp(propositions, answer);
91
94
  while (propositions.length < n) {
92
- const randomfactor1 = randint(-99, 99);
95
+ const randomfactor1 = randint(-10, 10);
93
96
  const randomfactor2 = randint(-99, 99);
94
97
  const randomequation = new EqualNode(new VariableNode("y"), new SubstractNode(new MultiplyNode(randomfactor1.toTree(), new VariableNode("x")), randomfactor2.toTree()).simplify());
95
98
  const wrongAnswer = randomequation.toTex();
@@ -128,9 +131,6 @@ export const tangentEquations = {
128
131
  getPropositions,
129
132
  isAnswerValid,
130
133
  subject: "Mathématiques",
131
- getInstruction,
132
- getAnswer,
133
- getHint,
134
- getCorrection,
135
134
  hasHintAndCorrection: true,
135
+ getQuestionFromIdentifiers,
136
136
  };
@@ -1 +1 @@
1
- {"version":3,"file":"exponentialDifferentialEquationWithIC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAqGF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAavE,CAAC"}
1
+ {"version":3,"file":"exponentialDifferentialEquationWithIC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA4GF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAavE,CAAC"}
@@ -62,6 +62,12 @@ const getPropositions = (n, { answer }) => {
62
62
  return shuffle(propositions);
63
63
  };
64
64
  const isAnswerValid = (ans, { a, initialY }) => {
65
+ // try {
66
+ // const formated = ans.split("=")
67
+ // const parsed = parseAlgebraic(ans);
68
+ // } catch(err){
69
+ // return handleVEAError(err)
70
+ // }
65
71
  const solution = initialY === 0
66
72
  ? new NumberNode(0) // y(0) = 0 ==> y(x) = 0
67
73
  : new MultiplyNode(new NumberNode(initialY), new ExpNode(new MultiplyNode(new NumberNode(a), new VariableNode("x"))));
@@ -1 +1 @@
1
- {"version":3,"file":"signFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/signFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AA2IF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAqB9C,CAAC"}
1
+ {"version":3,"file":"signFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/signFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAkJF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
@@ -71,6 +71,9 @@ const getSignFunction = () => {
71
71
  const b = randint(-9, 10);
72
72
  const askingPositive = coinFlip();
73
73
  const identifiers = { a, askingPositive, b };
74
+ return getQuestionFromIdentifiers(identifiers);
75
+ };
76
+ const getQuestionFromIdentifiers = (identifiers) => {
74
77
  const question = {
75
78
  instruction: getInstruction(identifiers),
76
79
  answer: getAnswer(identifiers),
@@ -111,8 +114,9 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
111
114
  const a = parseAlgebraic(splitted[0]);
112
115
  const b = parseAlgebraic(splitted[1]);
113
116
  const intAnswer = getAnswerNode(identifiers);
114
- return (a.simplify().toTex() === intAnswer.a.toTex() &&
115
- b.simplify().toTex() === intAnswer.b.toTex());
117
+ return (a.simplify({ decimalToFractions: true }).toTex() ===
118
+ intAnswer.a.toTex() &&
119
+ b.simplify({ decimalToFractions: true }).toTex() === intAnswer.b.toTex());
116
120
  }
117
121
  catch (err) {
118
122
  return handleVEAError(err);
@@ -122,8 +126,6 @@ export const signFunction = {
122
126
  id: "signFunction",
123
127
  connector: "=",
124
128
  label: "Signe d'une fonction affine",
125
- levels: ["3ème", "2nde", "2ndPro", "1rePro", "1reTech"],
126
- sections: ["Fonctions affines"],
127
129
  isSingleStep: true,
128
130
  generator: (nb) => getDistinctQuestions(getSignFunction, nb),
129
131
  qcmTimer: 60,
@@ -133,9 +135,7 @@ export const signFunction = {
133
135
  subject: "Mathématiques",
134
136
  getHint,
135
137
  hasHintAndCorrection: true,
136
- getCorrection,
137
- getAnswer,
138
- getInstruction,
138
+ getQuestionFromIdentifiers,
139
139
  pdfOptions: {
140
140
  shouldSpreadPropositions: true,
141
141
  },