math-exercises 3.0.177 → 3.0.179

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 (255) hide show
  1. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts +14 -0
  2. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -0
  3. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +283 -0
  4. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts +15 -0
  5. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -0
  6. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +296 -0
  7. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +3 -3
  8. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts +14 -0
  9. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -0
  10. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +346 -0
  11. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts +15 -0
  12. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -0
  13. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +435 -0
  14. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts +13 -0
  15. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -0
  16. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +326 -0
  17. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts +14 -0
  18. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts.map +1 -0
  19. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.js +181 -0
  20. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts +10 -0
  21. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts.map +1 -0
  22. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.js +272 -0
  23. package/lib/exercises/math/derivation/problems/index.d.ts +5 -0
  24. package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -0
  25. package/lib/exercises/math/derivation/problems/index.js +4 -0
  26. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts +8 -0
  27. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -0
  28. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +171 -0
  29. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts +15 -0
  30. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -0
  31. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +328 -0
  32. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts +13 -0
  33. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -0
  34. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +275 -0
  35. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts +8 -0
  36. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts.map +1 -0
  37. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.js +137 -0
  38. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts +10 -0
  39. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +478 -0
  41. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts +10 -0
  42. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts.map +1 -0
  43. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.js +499 -0
  44. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts +10 -0
  45. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts.map +1 -0
  46. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.js +240 -0
  47. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts +12 -0
  48. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts.map +1 -0
  49. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.js +436 -0
  50. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts +12 -0
  51. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts.map +1 -0
  52. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.js +219 -0
  53. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts +13 -0
  54. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts.map +1 -0
  55. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.js +273 -0
  56. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts +18 -0
  57. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts.map +1 -0
  58. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.js +295 -0
  59. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts +13 -0
  60. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -0
  61. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +388 -0
  62. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts +9 -0
  63. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts.map +1 -0
  64. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.js +308 -0
  65. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts +14 -0
  66. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -0
  67. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +439 -0
  68. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts +14 -0
  69. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -0
  70. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +547 -0
  71. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts +15 -0
  72. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -0
  73. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +537 -0
  74. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts +15 -0
  75. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -0
  76. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +639 -0
  77. package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.js +1 -1
  78. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts +14 -0
  79. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -0
  80. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +530 -0
  81. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts +10 -0
  82. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts.map +1 -0
  83. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.js +451 -0
  84. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts +11 -0
  85. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -0
  86. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +514 -0
  87. package/lib/exercises/math/functions/composition/index.d.ts +0 -1
  88. package/lib/exercises/math/functions/composition/index.d.ts.map +1 -1
  89. package/lib/exercises/math/functions/composition/index.js +1 -1
  90. package/lib/exercises/math/functions/exponential/algebraic/index.d.ts +0 -1
  91. package/lib/exercises/math/functions/exponential/algebraic/index.d.ts.map +1 -1
  92. package/lib/exercises/math/functions/exponential/algebraic/index.js +1 -1
  93. package/lib/exercises/math/functions/trinoms/sign/index.d.ts +1 -0
  94. package/lib/exercises/math/functions/trinoms/sign/index.d.ts.map +1 -1
  95. package/lib/exercises/math/functions/trinoms/sign/index.js +1 -0
  96. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts +8 -0
  97. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -0
  98. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +226 -0
  99. package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.d.ts.map +1 -1
  100. package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.js +10 -10
  101. package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.js +8 -8
  102. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.js +6 -6
  103. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.js +8 -8
  104. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +1 -1
  105. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +2 -2
  106. package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +2 -2
  107. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
  108. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +32 -17
  109. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts +13 -0
  110. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts.map +1 -0
  111. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.js +195 -0
  112. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts +9 -0
  113. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts.map +1 -0
  114. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.js +220 -0
  115. package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts +15 -0
  116. package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts.map +1 -0
  117. package/lib/exercises/math/probaStat/conditional/conditionalProbability.js +332 -0
  118. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts +8 -0
  119. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -0
  120. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +222 -0
  121. package/lib/exercises/math/probaStat/conditional/index.d.ts +5 -0
  122. package/lib/exercises/math/probaStat/conditional/index.d.ts.map +1 -0
  123. package/lib/exercises/math/probaStat/conditional/index.js +4 -0
  124. package/lib/exercises/math/probaStat/index.d.ts +1 -2
  125. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  126. package/lib/exercises/math/probaStat/index.js +1 -2
  127. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts +1 -0
  128. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  129. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +26 -199
  130. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  131. package/lib/exercises/math/probaStat/randomVariable/index.js +1 -0
  132. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
  133. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +6 -2
  134. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
  135. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +6 -5
  136. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
  137. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +4 -27
  138. package/lib/exercises/math/probaStat/twoEventsSituations.d.ts +29 -0
  139. package/lib/exercises/math/probaStat/twoEventsSituations.d.ts.map +1 -0
  140. package/lib/exercises/math/probaStat/twoEventsSituations.js +145 -0
  141. package/lib/exercises/math/python/index.d.ts +1 -0
  142. package/lib/exercises/math/python/index.d.ts.map +1 -1
  143. package/lib/exercises/math/python/index.js +1 -0
  144. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts.map +1 -1
  145. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.js +11 -8
  146. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
  147. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.js +4 -3
  148. package/lib/exercises/math/sequences/arithmetic/index.d.ts +4 -3
  149. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  150. package/lib/exercises/math/sequences/arithmetic/index.js +4 -3
  151. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts.map +1 -1
  152. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.js +3 -2
  153. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
  154. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +8 -6
  155. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -1
  156. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +6 -5
  157. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +0 -2
  158. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -1
  159. package/lib/exercises/math/sequences/arithmetic/situations/index.js +2 -2
  160. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts +1 -0
  161. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts.map +1 -1
  162. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.js +65 -14
  163. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts +0 -1
  164. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts.map +1 -1
  165. package/lib/exercises/math/sequences/arithmetic/sum/index.js +1 -1
  166. package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts +4 -1
  167. package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
  168. package/lib/exercises/math/sequences/explicitFormulaUsage.js +47 -7
  169. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts +14 -0
  170. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts.map +1 -0
  171. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.js +291 -0
  172. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
  173. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +4 -3
  174. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.d.ts +15 -0
  175. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.d.ts.map +1 -0
  176. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.js +249 -0
  177. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +2 -2
  178. package/lib/exercises/math/sequences/geometric/index.d.ts +3 -2
  179. package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
  180. package/lib/exercises/math/sequences/geometric/index.js +6 -2
  181. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -1
  182. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +3 -2
  183. package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.js +1 -1
  184. package/lib/exercises/math/sequences/geometric/situations/index.d.ts +0 -1
  185. package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -1
  186. package/lib/exercises/math/sequences/geometric/situations/index.js +1 -1
  187. package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.js +2 -2
  188. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +2 -2
  189. package/lib/exercises/math/sequences/index.d.ts +1 -0
  190. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  191. package/lib/exercises/math/sequences/index.js +1 -0
  192. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts +5 -1
  193. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
  194. package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +89 -9
  195. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts.map +1 -1
  196. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.js +5 -9
  197. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +1 -1
  198. package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -1
  199. package/lib/exercises/math/trigonometry/circle/associatePoint.js +55 -6
  200. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -1
  201. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +5 -6
  202. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts.map +1 -1
  203. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.js +1 -3
  204. package/lib/exercises/math/trigonometry/triangle/trigonometryAngleCalcul.js +2 -2
  205. package/lib/exercises/pc/snellDescartes.js +2 -2
  206. package/lib/exercises/vea/polynomialVEA.d.ts +2 -0
  207. package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -0
  208. package/lib/exercises/vea/polynomialVEA.js +17 -0
  209. package/lib/exercises/vea/valueTableVEA.d.ts +8 -0
  210. package/lib/exercises/vea/valueTableVEA.d.ts.map +1 -0
  211. package/lib/exercises/vea/valueTableVEA.js +12 -0
  212. package/lib/index.d.ts +152 -41
  213. package/lib/index.d.ts.map +1 -1
  214. package/lib/latexTester.d.ts.map +1 -1
  215. package/lib/latexTester.js +9 -6
  216. package/lib/math/polynomials/affine.d.ts +1 -0
  217. package/lib/math/polynomials/affine.d.ts.map +1 -1
  218. package/lib/math/polynomials/affine.js +5 -0
  219. package/lib/math/utils/arithmetic/primeFactors.js +1 -1
  220. package/lib/math/utils/functions/functionComposition.d.ts.map +1 -1
  221. package/lib/math/utils/functions/functionComposition.js +18 -1
  222. package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts +19 -0
  223. package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts.map +1 -0
  224. package/lib/math/utils/polynomial/polynomialInterpolationUtils.js +53 -0
  225. package/lib/math/utils/polynomial/polynomialUtils.d.ts +37 -0
  226. package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -0
  227. package/lib/math/utils/polynomial/polynomialUtils.js +223 -0
  228. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts +18 -4
  229. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
  230. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +434 -333
  231. package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -1
  232. package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +3 -1
  233. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts +5 -0
  234. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -1
  235. package/lib/math/utils/sequences/situations/seqGeometricSituations.js +58 -25
  236. package/lib/prototypesEnhancement.d.ts +1 -0
  237. package/lib/prototypesEnhancement.d.ts.map +1 -1
  238. package/lib/prototypesEnhancement.js +3 -0
  239. package/lib/tests/pdfs/mdCodeToLatex.d.ts.map +1 -1
  240. package/lib/tests/pdfs/mdCodeToLatex.js +8 -15
  241. package/lib/tests/questionTest.d.ts.map +1 -1
  242. package/lib/tests/questionTest.js +6 -3
  243. package/lib/tree/nodes/geometry/degree.js +1 -1
  244. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  245. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  246. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  247. package/lib/tree/nodes/operators/substractNode.js +2 -1
  248. package/lib/tree/parsers/degreeParser.js +2 -2
  249. package/lib/tree/utilities/nodeUtils.d.ts +6 -0
  250. package/lib/tree/utilities/nodeUtils.d.ts.map +1 -0
  251. package/lib/tree/utilities/nodeUtils.js +24 -0
  252. package/lib/utils/strings/prependArticle.d.ts +2 -0
  253. package/lib/utils/strings/prependArticle.d.ts.map +1 -0
  254. package/lib/utils/strings/prependArticle.js +1 -0
  255. package/package.json +1 -1
@@ -101,8 +101,10 @@ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
101
101
  const isAnswerValid = (ans, { answer, ...identifiers }, optsIn) => {
102
102
  const opts = optsIn ?? optsDefault;
103
103
  try {
104
+ const nodeAnswer = getAnswerNode(identifiers, opts);
104
105
  if (!ans.includes("=")) {
105
- return false;
106
+ // return false;
107
+ ans = nodeAnswer.leftChild.toTex() + "=" + ans;
106
108
  }
107
109
  //TODO faire fonctionner parseAlgebraic("u_n = 3 \\times 2^n") (token _ not implemented)
108
110
  // const nodeAns = parseAlgebraic(ans);
@@ -115,7 +117,6 @@ const isAnswerValid = (ans, { answer, ...identifiers }, optsIn) => {
115
117
  if (!isEqualNode(nodeAns)) {
116
118
  return false;
117
119
  }
118
- const nodeAnswer = getAnswerNode(identifiers, opts);
119
120
  const isValidLhs = () => nodeAns.leftChild.toTex() === nodeAnswer.leftChild.toTex();
120
121
  const isValidRhs = () => {
121
122
  const nodeAnsRhs = nodeAns.rightChild;
@@ -24,7 +24,7 @@ const getInstruction = (identifiers, optsIn) => {
24
24
  const situation = situations[situationIndex];
25
25
  return `${situation.getStrSituation(initial, reason, firstRank, superfluousData)}
26
26
 
27
- Que vaut $u_{${rankAsked}}$ ?`;
27
+ Quel calcul permet de trouver $u_{${rankAsked}}$ ?`;
28
28
  };
29
29
  const getAnswerNode = (identifiers, opts) => {
30
30
  const firstRank = opts?.firstTermRankOne ? 1 : 0;
@@ -1,4 +1,3 @@
1
- export * from "./geometricFindExplicitFormulaFromSituation.js";
2
1
  export * from "./geometricFindRecurrenceFormulaFromSituation.js";
3
2
  export * from "./geometricFindTermFromSituation.js";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/situations/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC;AAC/D,cAAc,kDAAkD,CAAC;AACjE,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/situations/index.ts"],"names":[],"mappings":"AACA,cAAc,kDAAkD,CAAC;AACjE,cAAc,qCAAqC,CAAC"}
@@ -1,4 +1,4 @@
1
- export * from "./geometricFindExplicitFormulaFromSituation.js";
1
+ // export * from "./geometricFindExplicitFormulaFromSituation.js";
2
2
  export * from "./geometricFindRecurrenceFormulaFromSituation.js";
3
3
  export * from "./geometricFindTermFromSituation.js";
4
4
  // export * from "./geometricFindRankFromSituation.js";
@@ -185,7 +185,7 @@ const createRandomIdentifiers = (opts) => {
185
185
  const initial = randint(-9, 10, [0]);
186
186
  const signReason = coinFlip() ? 1 : -1;
187
187
  const reason = signReason * randint(2, 6);
188
- const nbTerms = randint(7, 15);
188
+ const nbTerms = randint(5, 9);
189
189
  const minRankDots = firstRank + 2;
190
190
  const lastRank = firstRank + nbTerms - 1;
191
191
  const lowRankDots = randint(minRankDots, Math.min(minRankDots + randint(1, 3), lastRank));
@@ -225,7 +225,7 @@ const options = [
225
225
  generatorOptionFirstTermRankOne,
226
226
  {
227
227
  id: "isGiveCount",
228
- label: "Donner $n$",
228
+ label: "Donner le nombre de termes de la somme dans la consigne",
229
229
  target: GeneratorOptionTarget.generation,
230
230
  type: GeneratorOptionType.checkbox,
231
231
  defaultValue: optsDefault.isGiveCount,
@@ -102,12 +102,12 @@ export const placeFirstSequencePoints = {
102
102
  isGGBAnswerValid,
103
103
  subject: "Mathématiques",
104
104
  getHint,
105
- getInstruction,
106
105
  getCorrection,
106
+ hasHintAndCorrection: true,
107
+ getInstruction,
107
108
  getGGBAnswer,
108
109
  getStudentGGBOptions,
109
110
  answerType: "GGB",
110
111
  getQuestionFromIdentifiers,
111
112
  options,
112
- hasHintAndCorrection: true,
113
113
  };
@@ -7,5 +7,6 @@ export * from "./sequenceEvaluation.js";
7
7
  export * from "./sequencePlot.js";
8
8
  export * from "./graph/index.js";
9
9
  export * from "./notation/index.js";
10
+ export * from "./seqArithmGeom/index.js";
10
11
  export * from "./variations/index.js";
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,uBAAuB,CAAC"}
@@ -7,5 +7,6 @@ export * from "./sequenceEvaluation.js";
7
7
  export * from "./sequencePlot.js";
8
8
  export * from "./graph/index.js";
9
9
  export * from "./notation/index.js";
10
+ export * from "./seqArithmGeom/index.js";
10
11
  // export * from "./limits/index.js";
11
12
  export * from "./variations/index.js";
@@ -4,6 +4,10 @@ type Identifiers = {
4
4
  u0: number;
5
5
  coeffs: number[];
6
6
  };
7
- export declare const recurrenceFormulaUsage: Exercise<Identifiers>;
7
+ type Options = {
8
+ functionType: string[];
9
+ askedRank: string[];
10
+ };
11
+ export declare const recurrenceFormulaUsage: Exercise<Identifiers, Options>;
8
12
  export {};
9
13
  //# sourceMappingURL=recurrenceFormulaUsage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/recurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAwEF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
1
+ {"version":3,"file":"recurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/recurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAwIF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAmBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAejE,CAAC"}
@@ -1,7 +1,8 @@
1
- import { shuffleProps, tryToAddWrongProp, addValidProp, propWhile, } from "../../../exercises/exercise.js";
1
+ import { shuffleProps, tryToAddWrongProp, addValidProp, propWhile, GeneratorOptionType, GeneratorOptionTarget, } from "../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { Polynomial } from "../../../math/polynomials/polynomial.js";
4
4
  import { randint } from "../../../math/utils/random/randint.js";
5
+ import { random } from "../../../utils/alea/random.js";
5
6
  const getInstruction = (identifiers) => {
6
7
  const { rank, u0, coeffs } = identifiers;
7
8
  const u = new Polynomial(coeffs, "u_n");
@@ -27,21 +28,80 @@ const getAnswer = (identifiers) => {
27
28
  return answer;
28
29
  };
29
30
  const getQuestionFromIdentifiers = (identifiers) => {
30
- const question = {
31
+ return {
31
32
  answer: getAnswer(identifiers),
32
33
  instruction: getInstruction(identifiers),
33
- keys: ["u", "underscore", "equal"],
34
+ keys: [],
34
35
  answerFormat: "tex",
35
36
  identifiers,
37
+ hint: getHint(identifiers),
38
+ correction: getCorrection(identifiers),
36
39
  };
37
- return question;
38
40
  };
39
- const getRecurrenceFormulaUsageQuestion = () => {
40
- const coeffs = [randint(-5, 6), randint(-5, 6), randint(-3, 4, [0])];
41
+ const getHint = (identifiers) => {
42
+ const { rank } = identifiers;
43
+ let corr = `La formule qui est donnée est une formule de récurrence. Pour calculer $u_1$, tu peux remplacer $n$ par $0$ dans la formule.`;
44
+ if (rank > 1) {
45
+ corr += `
46
+
47
+ Tu peux ensuite répéter cette méthode : remplace $n$ par $1$ et utilise la valeur de $u_1$ que tu as trouvée pour déterminer $u_2$.`;
48
+ }
49
+ return corr;
50
+ };
51
+ const getCorrection = (identifiers) => {
52
+ const { rank, u0, coeffs } = identifiers;
53
+ const u = new Polynomial(coeffs, "u_n");
54
+ let currentValue = u0;
55
+ const values = [u0];
56
+ for (let i = 0; i < rank; i++) {
57
+ currentValue = u.calculate(currentValue);
58
+ values.push(currentValue);
59
+ }
60
+ let corr = `On remplace $n$ par $0$ :
61
+
62
+ $$
63
+ u_1 = ${u.toTree().toDetailedEvaluation({ u_n: u0.toTree() }).toTex()}
64
+ $$
65
+
66
+ donc $u_1 = ${values[1].frenchify()}$.
67
+
68
+ `;
69
+ if (rank > 1) {
70
+ corr += `Puis, on se sert de ce résultat pour trouver $u_2$ : on remplace $n$ par $1$ dans la formule de récurrence :
71
+
72
+ $$
73
+ u_2 = ${u.toTree().toDetailedEvaluation({ u_n: values[1].toTree() }).toTex()}
74
+ $$
75
+
76
+ donc $u_2 = ${values[2].frenchify()}$.
77
+
78
+ `;
79
+ }
80
+ if (rank > 2) {
81
+ corr += `De même pour trouver $u_3$ :
82
+
83
+ $$
84
+ u_2 = ${u.toTree().toDetailedEvaluation({ u_n: values[2].toTree() }).toTex()}
85
+ $$
86
+
87
+ donc $u_2 = ${values[3].frenchify()}$.`;
88
+ }
89
+ return corr;
90
+ };
91
+ const getRecurrenceFormulaUsageQuestion = (opts) => {
92
+ const type = opts?.functionType?.length
93
+ ? random(opts.functionType)
94
+ : random(["Affine", "Second degré"]);
95
+ const coeffs = type === "Affine"
96
+ ? [randint(-5, 6), randint(-5, 6, [0])]
97
+ : [randint(-5, 6), randint(-5, 6), randint(-3, 4, [0])];
41
98
  const u0 = randint(-2, 3, [0]);
42
- const rank = randint(1, 4);
99
+ const texRank = opts?.askedRank?.length
100
+ ? random(opts.askedRank)
101
+ : random(["$1$", "$2$", "$3$"]);
102
+ const rank = Number(texRank[1]);
43
103
  const identifiers = { rank, u0, coeffs };
44
- return getQuestionFromIdentifiers(identifiers);
104
+ return getQuestionFromIdentifiers(identifiers, opts);
45
105
  };
46
106
  const getPropositions = (n, { answer, rank, coeffs }) => {
47
107
  const propositions = [];
@@ -57,16 +117,36 @@ const getPropositions = (n, { answer, rank, coeffs }) => {
57
117
  const isAnswerValid = (ans, { answer, rank }) => {
58
118
  return [answer, `u_{${rank}}=${answer}`, `u_${rank}=${answer}`].includes(ans);
59
119
  };
120
+ const options = [
121
+ {
122
+ id: "functionType",
123
+ label: "Type de fonction",
124
+ values: ["Affine", "Second degré"],
125
+ target: GeneratorOptionTarget.generation,
126
+ type: GeneratorOptionType.multiselect,
127
+ defaultValue: ["Affine", "Second degré"],
128
+ },
129
+ {
130
+ id: "askedRank",
131
+ label: "Rang demandé",
132
+ values: ["$1$", "$2$", "$3$"],
133
+ target: GeneratorOptionTarget.generation,
134
+ type: GeneratorOptionType.multiselect,
135
+ defaultValue: ["$1$", "$2$", "$3$"],
136
+ },
137
+ ];
60
138
  export const recurrenceFormulaUsage = {
61
139
  id: "recurrenceFormulaUsage",
62
140
  connector: "=",
63
141
  label: "Utiliser la formule de récurrence d'une suite",
64
142
  isSingleStep: true,
65
- generator: (nb) => getDistinctQuestions(getRecurrenceFormulaUsageQuestion, nb),
143
+ generator: (nb, opts) => getDistinctQuestions(() => getRecurrenceFormulaUsageQuestion(opts), nb),
66
144
  qcmTimer: 60,
67
145
  freeTimer: 60,
68
146
  getPropositions,
69
147
  isAnswerValid,
70
148
  subject: "Mathématiques",
71
149
  getQuestionFromIdentifiers,
150
+ options,
151
+ hasHintAndCorrection: true,
72
152
  };
@@ -1 +1 @@
1
- {"version":3,"file":"seqArithmGeomRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AA8C3D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoMF,KAAK,OAAO,GAAG,sBAAsB,GAAG;IAAE,mBAAmB,EAAE,MAAM,CAAA;CAAE,CAAC;AAkBxE,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CACxD,WAAW,EACX,OAAO,CAoBR,CAAC"}
1
+ {"version":3,"file":"seqArithmGeomRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AA8C3D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA+LF,KAAK,OAAO,GAAG,sBAAsB,GAAG;IAAE,mBAAmB,EAAE,MAAM,CAAA;CAAE,CAAC;AAkBxE,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CACxD,WAAW,EACX,OAAO,CAoBR,CAAC"}
@@ -26,9 +26,11 @@ const getDictSequenceSlice = (coeffs, rank1, value1, rankAsked) => {
26
26
  return acc;
27
27
  }, { [rank1]: value1.toTree() });
28
28
  };
29
- const getInstruction = (identifiers) => {
29
+ const getInstruction = (identifiers, optsIn) => {
30
+ const opts = optsIn ?? optsDefault;
31
+ const firstRank = opts.firstTermRankOne ? 1 : 0;
30
32
  const { rank1, value1, coeffs, rankAsked } = identifiers;
31
- return `$(u_n)$ est une suite définie par, pour $n\\geq 1$ :
33
+ return `$(u_n)$ est une suite définie par, pour $n\\geq ${firstRank}$ :
32
34
 
33
35
  $$
34
36
  u_{n+1} = ${getNodeUNext(coeffs).toTex()}
@@ -38,11 +40,6 @@ et $u_{${rank1}} = ${value1}$.
38
40
 
39
41
  Calculer le terme $u_{${rankAsked}}$.`;
40
42
  };
41
- const getStartStatement = (identifiers) => {
42
- const { rank1 } = identifiers;
43
- const askedRank = rank1 + 1;
44
- return `u_{${askedRank}}`;
45
- };
46
43
  const getAnswerStuff = (identifiers) => {
47
44
  const { rank1, value1, coeffs, rankAsked } = identifiers;
48
45
  const dictSequenceSlice = getDictSequenceSlice(coeffs, rank1, value1, rankAsked);
@@ -149,7 +146,7 @@ const getSeqArithmGeomRecurrenceFormulaUsageQuestion = (optsIn) => {
149
146
  const distanceOfRankAsked = Number(opts.distanceOfRankAsked);
150
147
  const rank1 = randint(firstRank, 20);
151
148
  const value1 = randint(-10, 10);
152
- const a = randint(-10, 10, [0]);
149
+ const a = randint(-10, 10, [0, 1]);
153
150
  const b = randint(-10, 10, [0]);
154
151
  const coeffs = [a, b];
155
152
  const rankAsked = rank1 + distanceOfRankAsked;
@@ -159,7 +156,6 @@ const getSeqArithmGeomRecurrenceFormulaUsageQuestion = (optsIn) => {
159
156
  const getQuestionFromIdentifiers = (identifiers, opts) => {
160
157
  const question = {
161
158
  instruction: getInstruction(identifiers, opts),
162
- startStatement: getStartStatement(identifiers, opts),
163
159
  answer: getAnswer(identifiers, opts),
164
160
  keys: [],
165
161
  answerFormat: "tex",
@@ -152,7 +152,7 @@ const getKeys = () => {
152
152
  return ["degree", "N", "O", "S", "E"];
153
153
  };
154
154
  const isAnswerValid = (ans, { answer }) => {
155
- const ansRefined = ans.replace("^{\\circ}", "°");
155
+ const ansRefined = ans.replace("^{\\circ}", "°").replace("^\\circ", "°");
156
156
  return ansRefined === answer;
157
157
  };
158
158
  const getSphereLatLonReading2dQuestion = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"associatePoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/associatePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,eAAe,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgFF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
1
+ {"version":3,"file":"associatePoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/associatePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,eAAe,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgIF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
@@ -2,6 +2,9 @@ import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../..
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { RemarkableValueConstructor } from "../../../../math/trigonometry/remarkableValue.js";
4
4
  import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
5
+ import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
6
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
7
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
5
8
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
6
9
  import { random } from "../../../../utils/alea/random.js";
7
10
  const points = [
@@ -32,12 +35,55 @@ const getAnswer = (identifiers) => {
32
35
  const { point } = identifiers;
33
36
  return point;
34
37
  };
35
- // const getHint: GetHint<Identifiers> = (identifiers) => {
36
- // return ``;
37
- // };
38
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
39
- // return ``;
40
- // };
38
+ const getHint = (identifiers) => {
39
+ const { angleIdentifiers } = identifiers;
40
+ const angle = reifyAlgebraic(angleIdentifiers);
41
+ const isSimplifiable = angle.evaluate() > Math.PI || angle.evaluate() <= -Math.PI;
42
+ let hint = "";
43
+ if (isSimplifiable) {
44
+ hint += `Commence par te ramener à l'intervalle $]-\\pi; \\pi]$, en ajoutant ou en retirant un multiple de $2\\pi$ à $${angle.toTex()}$.
45
+
46
+ `;
47
+ }
48
+ return hint + `Le cercle trigonométrique a un périmètre de $2\\pi$.`;
49
+ };
50
+ const getCorrection = (identifiers) => {
51
+ const { angleIdentifiers } = identifiers;
52
+ const angle = reifyAlgebraic(angleIdentifiers);
53
+ const isSimplifiable = angle.evaluate() > Math.PI || angle.evaluate() <= -Math.PI;
54
+ let corr = "";
55
+ if (isSimplifiable) {
56
+ let toAdd = 0;
57
+ let newAngle = angle;
58
+ let counter = 0;
59
+ while (newAngle.evaluate() > Math.PI || newAngle.evaluate() <= -Math.PI) {
60
+ counter++;
61
+ if (counter > 1000)
62
+ throw new Error("too many iterations in remarkable values");
63
+ if (newAngle.evaluate() > 0)
64
+ toAdd--;
65
+ else
66
+ toAdd++;
67
+ console.log(newAngle.evaluate(), toAdd);
68
+ newAngle = add(newAngle, multiply(toAdd > 0 ? 2 : -2, PiNode)).simplify();
69
+ }
70
+ // const raw = frac(angle, PiNode).simplify();
71
+ corr += `On se ramène à l'intervalle $]-\\pi; \\pi]$ :
72
+
73
+ $$
74
+ ${add(angle, multiply(2 * toAdd, PiNode)).toTex()} = ${newAngle.toTex()}
75
+ $$`;
76
+ }
77
+ return (corr +
78
+ `
79
+
80
+ On se sert du cercle trigonométrique ci-dessous :
81
+
82
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/piCercle_nombres.jpg)
83
+
84
+ Le point cherché est donc $${getAnswer(identifiers)}$.
85
+ `);
86
+ };
41
87
  const getQuestionFromIdentifiers = (identifiers) => {
42
88
  const question = {
43
89
  answer: getAnswer(identifiers),
@@ -45,6 +91,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
45
91
  keys: points,
46
92
  answerFormat: "tex",
47
93
  identifiers,
94
+ hint: getHint(identifiers),
95
+ correction: getCorrection(identifiers),
48
96
  };
49
97
  return question;
50
98
  };
@@ -83,4 +131,5 @@ export const associatePoint = {
83
131
  isAnswerValid,
84
132
  subject: "Mathématiques",
85
133
  getQuestionFromIdentifiers,
134
+ hasHintAndCorrection: true,
86
135
  };
@@ -1 +1 @@
1
- {"version":3,"file":"selectQuadrantOnTrigoCircle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA2FF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAuB7D,CAAC"}
1
+ {"version":3,"file":"selectQuadrantOnTrigoCircle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA8FF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAuB7D,CAAC"}
@@ -1,13 +1,12 @@
1
- import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { randint } from "../../../../math/utils/random/randint.js";
4
- const getPropositions = (n, { answer }) => {
4
+ const getPropositions = (_n, { answer }) => {
5
5
  const propositions = [];
6
- addValidProp(propositions, answer, "raw");
7
- ["Bleu", "Rouge", "Vert", "Jaune"].forEach((color) => {
8
- tryToAddWrongProp(propositions, color, "raw");
6
+ ["Bleu", "Jaune", "Rouge", "Vert"].forEach((color) => {
7
+ (color === answer ? addValidProp : tryToAddWrongProp)(propositions, color, "raw");
9
8
  });
10
- return shuffleProps(propositions, n);
9
+ return propositions;
11
10
  };
12
11
  const getAnswer = (identifiers) => {
13
12
  return ["Bleu", "Rouge", "Vert", "Jaune"][identifiers.quartant];
@@ -1 +1 @@
1
- {"version":3,"file":"associateAngleSimplification.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/associateAngleSimplification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAgKF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAsB9D,CAAC"}
1
+ {"version":3,"file":"associateAngleSimplification.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/trigonometry/functions/associateAngleSimplification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8JF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAsB9D,CAAC"}
@@ -95,9 +95,7 @@ $$`;
95
95
  corr += `
96
96
 
97
97
  $$
98
- ${multiply(d, fct(substract(PiNode, "x"))).toTex()} = ${isCos
99
- ? multiply(-d, cos(substract(PiNode, "x"))).toTex()
100
- : multiply(d, sin(substract(PiNode, "x"))).toTex()}
98
+ ${multiply(d, fct(substract(PiNode, "x"))).toTex()} = ${isCos ? multiply(-d, cos("x")).toTex() : multiply(d, sin("x")).toTex()}
101
99
  $$`;
102
100
  }
103
101
  corr += `
@@ -21,7 +21,7 @@ const getAnswer = (identifiers) => {
21
21
  const { randAngle, triangleIdentifiers } = identifiers;
22
22
  const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
23
23
  const answer = round(triangle.angles[randAngle].evaluate(), 0);
24
- return answer + "^{\\circ}";
24
+ return answer + "^\\circ";
25
25
  };
26
26
  const getHint = () => {
27
27
  return `On peut utiliser :
@@ -149,7 +149,7 @@ const getPropositions = (n, { answer }) => {
149
149
  const propositions = [];
150
150
  addValidProp(propositions, answer);
151
151
  propWhile(propositions, n, () => {
152
- tryToAddWrongProp(propositions, randint(20, 80) + "^{\\circ}");
152
+ tryToAddWrongProp(propositions, randint(20, 80) + "^\\circ");
153
153
  });
154
154
  return shuffle(propositions);
155
155
  };
@@ -73,7 +73,7 @@ const getAnswer = (identifiers) => {
73
73
  const angleIncidenceRad = (ramdonAngleIncidenceDeg * Math.PI) / 180;
74
74
  const angleRefractionRad = Math.asin((n1 / n2) * Math.sin(angleIncidenceRad));
75
75
  const angleRefractionDeg = (angleRefractionRad * 180) / Math.PI;
76
- const answer = `${frenchify(round(angleRefractionDeg, 1))}^{\\circ}`;
76
+ const answer = `${frenchify(round(angleRefractionDeg, 1))}^\\circ`;
77
77
  return answer;
78
78
  };
79
79
  const getQuestionFromIdentifiers = (identifiers) => {
@@ -103,7 +103,7 @@ const getPropositions = (n, { answer }) => {
103
103
  const propositions = [];
104
104
  addValidProp(propositions, answer);
105
105
  propWhile(propositions, n, () => {
106
- tryToAddWrongProp(propositions, frenchify(round(randint(100, 900) / 10, 1)) + "^{\\circ}");
106
+ tryToAddWrongProp(propositions, frenchify(round(randint(100, 900) / 10, 1)) + "^\\circ");
107
107
  });
108
108
  return shuffle(propositions);
109
109
  };
@@ -0,0 +1,2 @@
1
+ export declare const polynomialVEA: (ans: string, answer: string) => boolean;
2
+ //# sourceMappingURL=polynomialVEA.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polynomialVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/polynomialVEA.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,QAAQ,MAAM,YAmBxD,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { getArrNodeCoeffOfPolynomialNode } from "../../math/utils/polynomial/polynomialUtils.js";
2
+ import { substract } from "../../tree/nodes/operators/substractNode.js";
3
+ import { parseAlgebraic } from "../../tree/parsers/latexParser.js";
4
+ import { zip } from "../../utils/arrays/arrayZip.js";
5
+ import { handleVEAError } from "../../utils/errors/handleVEAError.js";
6
+ export const polynomialVEA = (ans, answer) => {
7
+ try {
8
+ const nodeAns = parseAlgebraic(ans);
9
+ const nodeAnswer = parseAlgebraic(answer);
10
+ const [arrNodeCoeffAns, arrNodeCoeffAnswer] = [nodeAns, nodeAnswer].map((node) => getArrNodeCoeffOfPolynomialNode(node));
11
+ return (arrNodeCoeffAns.length === arrNodeCoeffAnswer.length &&
12
+ zip(arrNodeCoeffAns, arrNodeCoeffAnswer).every(([nodeCoeffAns, nodeCoeffAnswer]) => substract(nodeCoeffAns, nodeCoeffAnswer).evaluate() === 0));
13
+ }
14
+ catch (err) {
15
+ return handleVEAError(err);
16
+ }
17
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ *
3
+ * @param ans tableau du student
4
+ * @param answerTable tableau réponse
5
+ * TODO passer en argument le VEA check qui est ajd fixé à rationalVEA
6
+ */
7
+ export declare const valueTableVEA: (ans: string[][], answerTable: string[][]) => boolean;
8
+ //# sourceMappingURL=valueTableVEA.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valueTableVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/valueTableVEA.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,EAAE,EAAE,EAAE,aAAa,MAAM,EAAE,EAAE,YAOrE,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ *
3
+ * @param ans tableau du student
4
+ * @param answerTable tableau réponse
5
+ * TODO passer en argument le VEA check qui est ajd fixé à rationalVEA
6
+ */
7
+ import { rationalVEA } from "./rationalVEA.js";
8
+ export const valueTableVEA = (ans, answerTable) => {
9
+ return ans.every((row, i) => {
10
+ return row.every((cell, j) => cell === answerTable[i][j] || rationalVEA(cell, answerTable[i][j]));
11
+ });
12
+ };