math-exercises 3.0.69 → 3.0.70

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 (477) hide show
  1. package/lib/exercises/exercise.d.ts +9 -1
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/addAndSub.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/addAndSub.js +4 -0
  5. package/lib/exercises/math/calcul/addAndSubWithoutRelatives.d.ts +3 -0
  6. package/lib/exercises/math/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/addAndSubWithoutRelatives.js +33 -20
  8. package/lib/exercises/math/calcul/digitDecimalRank.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/digitDecimalRank.js +36 -13
  10. package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts.map +1 -1
  11. package/lib/exercises/math/calcul/digitDecimalRankNumber.js +27 -12
  12. package/lib/exercises/math/calcul/digitRank.d.ts.map +1 -1
  13. package/lib/exercises/math/calcul/digitRank.js +37 -13
  14. package/lib/exercises/math/calcul/digitRankNumber.d.ts.map +1 -1
  15. package/lib/exercises/math/calcul/digitRankNumber.js +21 -12
  16. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.d.ts.map +1 -1
  17. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +33 -17
  18. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts.map +1 -1
  19. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.js +36 -18
  20. package/lib/exercises/math/calcul/mentalCaluls/mentalDivisions.d.ts.map +1 -1
  21. package/lib/exercises/math/calcul/mentalCaluls/mentalDivisions.js +38 -30
  22. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.d.ts.map +1 -1
  23. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.js +35 -21
  24. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.d.ts.map +1 -1
  25. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.js +4 -0
  26. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.d.ts.map +1 -1
  27. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.js +22 -9
  28. package/lib/exercises/math/calcul/operations/expressionNature.d.ts +2 -1
  29. package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
  30. package/lib/exercises/math/calcul/operations/expressionNature.js +36 -15
  31. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts +2 -1
  32. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +26 -15
  34. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts +2 -1
  35. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts.map +1 -1
  36. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.js +26 -17
  37. package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts +1 -0
  38. package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
  39. package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.js +89 -60
  40. package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -1
  41. package/lib/exercises/math/calcul/ordering/decimalOrdering.js +30 -13
  42. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.d.ts.map +1 -1
  43. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.js +26 -13
  44. package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -1
  45. package/lib/exercises/math/calcul/ordering/framing.js +70 -59
  46. package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -1
  47. package/lib/exercises/math/calcul/ordering/integerOrdering.js +30 -11
  48. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
  49. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +4 -0
  50. package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -1
  51. package/lib/exercises/math/calcul/proportionality/isTableProportional.js +42 -24
  52. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
  53. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +4 -0
  54. package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts +1 -0
  55. package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts.map +1 -1
  56. package/lib/exercises/math/calcul/proportionality/scaleUsage.js +75 -39
  57. package/lib/exercises/math/calcul/writing/index.d.ts +1 -1
  58. package/lib/exercises/math/calcul/writing/index.d.ts.map +1 -1
  59. package/lib/exercises/math/calcul/writing/index.js +3 -1
  60. package/lib/exercises/math/calcul/writing/numberToFrenchWriting.d.ts +0 -5
  61. package/lib/exercises/math/calcul/writing/numberToFrenchWriting.d.ts.map +1 -1
  62. package/lib/exercises/math/calcul/writing/numberToFrenchWriting.js +87 -64
  63. package/lib/exercises/math/calculLitteral/distributivity/allIdentities.d.ts.map +1 -1
  64. package/lib/exercises/math/calculLitteral/distributivity/allIdentities.js +29 -5
  65. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts +2 -1
  66. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts.map +1 -1
  67. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.js +3 -3
  68. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts +2 -1
  69. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts.map +1 -1
  70. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.js +3 -3
  71. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts +2 -1
  72. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts.map +1 -1
  73. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.js +3 -3
  74. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts.map +1 -1
  75. package/lib/exercises/math/calculLitteral/factorisation/facto1.js +3 -1
  76. package/lib/exercises/math/complex/addComplex.d.ts.map +1 -1
  77. package/lib/exercises/math/complex/addComplex.js +31 -18
  78. package/lib/exercises/math/complex/argumentFromAlgebraicComplex.d.ts.map +1 -1
  79. package/lib/exercises/math/complex/argumentFromAlgebraicComplex.js +24 -11
  80. package/lib/exercises/math/complex/conjugateComplex.d.ts.map +1 -1
  81. package/lib/exercises/math/complex/conjugateComplex.js +20 -7
  82. package/lib/exercises/math/complex/conjugateDivideComplex.d.ts.map +1 -1
  83. package/lib/exercises/math/complex/conjugateDivideComplex.js +29 -16
  84. package/lib/exercises/math/complex/conjugateMultiplyComplex.d.ts.map +1 -1
  85. package/lib/exercises/math/complex/conjugateMultiplyComplex.js +26 -13
  86. package/lib/exercises/math/complex/divideComplex.d.ts.map +1 -1
  87. package/lib/exercises/math/complex/divideComplex.js +29 -16
  88. package/lib/exercises/math/complex/inverseComplex.d.ts.map +1 -1
  89. package/lib/exercises/math/complex/inverseComplex.js +18 -7
  90. package/lib/exercises/math/complex/linearCombinaisonComplex.d.ts.map +1 -1
  91. package/lib/exercises/math/complex/linearCombinaisonComplex.js +30 -13
  92. package/lib/exercises/math/complex/moduloFromAlgebraicComplex.d.ts.map +1 -1
  93. package/lib/exercises/math/complex/moduloFromAlgebraicComplex.js +20 -8
  94. package/lib/exercises/math/complex/mutiplyComplex.d.ts.map +1 -1
  95. package/lib/exercises/math/complex/mutiplyComplex.js +26 -13
  96. package/lib/exercises/math/complex/reAndIm.d.ts.map +1 -1
  97. package/lib/exercises/math/complex/reAndIm.js +22 -9
  98. package/lib/exercises/math/conversion/volumeCapacityConversion.d.ts.map +1 -1
  99. package/lib/exercises/math/conversion/volumeCapacityConversion.js +1 -0
  100. package/lib/exercises/math/dataRepresentations/testGen.d.ts.map +1 -1
  101. package/lib/exercises/math/dataRepresentations/testGen.js +5 -1
  102. package/lib/exercises/math/dataRepresentations/testGenGGB.d.ts.map +1 -1
  103. package/lib/exercises/math/dataRepresentations/testGenGGB.js +5 -1
  104. package/lib/exercises/math/dataRepresentations/testGenStudentGGB.d.ts.map +1 -1
  105. package/lib/exercises/math/dataRepresentations/testGenStudentGGB.js +5 -1
  106. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -1
  107. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +4 -0
  108. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts.map +1 -1
  109. package/lib/exercises/math/derivation/convexity/convexityTrinomials.js +4 -0
  110. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts.map +1 -1
  111. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +4 -2
  112. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
  113. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +4 -2
  114. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -1
  115. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +4 -0
  116. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -1
  117. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +4 -0
  118. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts.map +1 -1
  119. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +4 -2
  120. package/lib/exercises/math/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
  121. package/lib/exercises/math/derivation/derivative/inverseFunctionDerivative.js +4 -0
  122. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts.map +1 -1
  123. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.js +4 -0
  124. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts +2 -1
  125. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts.map +1 -1
  126. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.js +6 -4
  127. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts +2 -1
  128. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts.map +1 -1
  129. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +4 -0
  130. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts +2 -1
  131. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts.map +1 -1
  132. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +4 -0
  133. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts.map +1 -1
  134. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.js +4 -0
  135. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts.map +1 -1
  136. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.js +4 -0
  137. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts +2 -1
  138. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts.map +1 -1
  139. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +4 -10
  140. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts.map +1 -1
  141. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.js +32 -4
  142. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts.map +1 -1
  143. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.js +4 -2
  144. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts.map +1 -1
  145. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.js +4 -0
  146. package/lib/exercises/math/derivation/derivative/productDerivative.d.ts.map +1 -1
  147. package/lib/exercises/math/derivation/derivative/productDerivative.js +4 -0
  148. package/lib/exercises/math/derivation/derivative/quotientDerivative.d.ts.map +1 -1
  149. package/lib/exercises/math/derivation/derivative/quotientDerivative.js +4 -0
  150. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts.map +1 -1
  151. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.js +4 -0
  152. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -1
  153. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +4 -0
  154. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts.map +1 -1
  155. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.js +4 -0
  156. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts.map +1 -1
  157. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.js +4 -0
  158. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts.map +1 -1
  159. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.js +4 -0
  160. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts.map +1 -1
  161. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.js +4 -0
  162. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts +4 -3
  163. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  164. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +32 -16
  165. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
  166. package/lib/exercises/math/functions/exponential/expFactorization.js +1 -0
  167. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts.map +1 -1
  168. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +73 -41
  169. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.d.ts.map +1 -1
  170. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.js +32 -16
  171. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts.map +1 -1
  172. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.js +1 -2
  173. package/lib/exercises/math/geometry/areas/circleRadiusFromArea.d.ts.map +1 -1
  174. package/lib/exercises/math/geometry/areas/circleRadiusFromArea.js +1 -0
  175. package/lib/exercises/math/geometry/areas/squareSideFromArea.d.ts.map +1 -1
  176. package/lib/exercises/math/geometry/areas/squareSideFromArea.js +1 -0
  177. package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts +4 -1
  178. package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
  179. package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +97 -44
  180. package/lib/exercises/math/geometry/vectors/coordinatesReading.d.ts.map +1 -1
  181. package/lib/exercises/math/geometry/vectors/coordinatesReading.js +28 -14
  182. package/lib/exercises/math/geometry/vectors/determinant.d.ts.map +1 -1
  183. package/lib/exercises/math/geometry/vectors/determinant.js +26 -12
  184. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.d.ts.map +1 -1
  185. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.js +25 -11
  186. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts +1 -0
  187. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
  188. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +60 -33
  189. package/lib/exercises/math/geometry/vectors/fourthParallelogramPoint.d.ts.map +1 -1
  190. package/lib/exercises/math/geometry/vectors/fourthParallelogramPoint.js +34 -19
  191. package/lib/exercises/math/geometry/vectors/paralellismViaColinearity.d.ts.map +1 -1
  192. package/lib/exercises/math/geometry/vectors/paralellismViaColinearity.js +42 -20
  193. package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.d.ts.map +1 -1
  194. package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.js +42 -20
  195. package/lib/exercises/math/geometry/vectors/traceOppositeVector.d.ts.map +1 -1
  196. package/lib/exercises/math/geometry/vectors/traceOppositeVector.js +4 -0
  197. package/lib/exercises/math/geometry/vectors/traceVectorDifference.d.ts.map +1 -1
  198. package/lib/exercises/math/geometry/vectors/traceVectorDifference.js +4 -0
  199. package/lib/exercises/math/geometry/vectors/traceVectorMultiple.d.ts.map +1 -1
  200. package/lib/exercises/math/geometry/vectors/traceVectorMultiple.js +4 -0
  201. package/lib/exercises/math/geometry/vectors/traceVectorSum.d.ts.map +1 -1
  202. package/lib/exercises/math/geometry/vectors/traceVectorSum.js +4 -0
  203. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts +2 -0
  204. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
  205. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +45 -25
  206. package/lib/exercises/math/geometry/vectors/vectorLinearCombination.d.ts.map +1 -1
  207. package/lib/exercises/math/geometry/vectors/vectorLinearCombination.js +33 -14
  208. package/lib/exercises/math/geometry/vectors/vectorNormCalculation.d.ts.map +1 -1
  209. package/lib/exercises/math/geometry/vectors/vectorNormCalculation.js +9 -3
  210. package/lib/exercises/math/limits/limitReading.d.ts +5 -1
  211. package/lib/exercises/math/limits/limitReading.d.ts.map +1 -1
  212. package/lib/exercises/math/limits/limitReading.js +96 -38
  213. package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
  214. package/lib/exercises/math/limits/polynomLimit.js +0 -2
  215. package/lib/exercises/math/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -1
  216. package/lib/exercises/math/limits/rationalFracForbiddenValueLimit.js +37 -20
  217. package/lib/exercises/math/limits/rationalFracLimit.d.ts.map +1 -1
  218. package/lib/exercises/math/limits/rationalFracLimit.js +34 -17
  219. package/lib/exercises/math/limits/sequenceGeometricLimit.d.ts.map +1 -1
  220. package/lib/exercises/math/limits/sequenceGeometricLimit.js +4 -0
  221. package/lib/exercises/math/limits/sequencePolynomLimit.d.ts.map +1 -1
  222. package/lib/exercises/math/limits/sequencePolynomLimit.js +23 -10
  223. package/lib/exercises/math/limits/sequencePolynomNoFILimit.d.ts.map +1 -1
  224. package/lib/exercises/math/limits/sequencePolynomNoFILimit.js +24 -11
  225. package/lib/exercises/math/limits/sequencePolynomProductLimit.d.ts.map +1 -1
  226. package/lib/exercises/math/limits/sequencePolynomProductLimit.js +31 -18
  227. package/lib/exercises/math/limits/sequenceRationalFracLimit.d.ts.map +1 -1
  228. package/lib/exercises/math/limits/sequenceRationalFracLimit.js +33 -16
  229. package/lib/exercises/math/matrices/matrixGeneralTerm.d.ts.map +1 -1
  230. package/lib/exercises/math/matrices/matrixGeneralTerm.js +21 -8
  231. package/lib/exercises/math/matrices/matrixInversibilityDomain.d.ts.map +1 -1
  232. package/lib/exercises/math/matrices/matrixInversibilityDomain.js +44 -26
  233. package/lib/exercises/math/matrices/productCell.d.ts +2 -0
  234. package/lib/exercises/math/matrices/productCell.d.ts.map +1 -1
  235. package/lib/exercises/math/matrices/productCell.js +27 -12
  236. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  237. package/lib/exercises/math/powers/decimalToScientific.js +9 -0
  238. package/lib/exercises/math/primitive/constantPrimitive.d.ts +2 -1
  239. package/lib/exercises/math/primitive/constantPrimitive.d.ts.map +1 -1
  240. package/lib/exercises/math/primitive/constantPrimitive.js +3 -3
  241. package/lib/exercises/math/primitive/exponentialPrimitive.d.ts +2 -1
  242. package/lib/exercises/math/primitive/exponentialPrimitive.d.ts.map +1 -1
  243. package/lib/exercises/math/primitive/exponentialPrimitive.js +3 -3
  244. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts +2 -1
  245. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  246. package/lib/exercises/math/primitive/polynomialPrimitive.js +3 -3
  247. package/lib/exercises/math/primitive/sinCosPrimitive.d.ts +2 -1
  248. package/lib/exercises/math/primitive/sinCosPrimitive.d.ts.map +1 -1
  249. package/lib/exercises/math/primitive/sinCosPrimitive.js +3 -3
  250. package/lib/exercises/math/primitive/usualPrimitives.d.ts.map +1 -1
  251. package/lib/exercises/math/primitive/usualPrimitives.js +33 -6
  252. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts.map +1 -1
  253. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.js +1 -0
  254. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  255. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +4 -1
  256. package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
  257. package/lib/exercises/math/probaStat/stats2var/averagePoint.js +1 -2
  258. package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
  259. package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +47 -23
  260. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
  261. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +4 -6
  262. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.d.ts.map +1 -1
  263. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.js +4 -0
  264. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.d.ts.map +1 -1
  265. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.js +30 -12
  266. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.d.ts.map +1 -1
  267. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.js +4 -0
  268. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.d.ts.map +1 -1
  269. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.js +23 -9
  270. package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.d.ts.map +1 -1
  271. package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.js +62 -41
  272. package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.d.ts.map +1 -1
  273. package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.js +4 -2
  274. package/lib/exercises/math/sequences/arithmetic/arithmeticReasonUsage.d.ts.map +1 -1
  275. package/lib/exercises/math/sequences/arithmetic/arithmeticReasonUsage.js +4 -0
  276. package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
  277. package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +26 -10
  278. package/lib/exercises/math/sequences/arithmetic/arithmeticThresholdFind.d.ts.map +1 -1
  279. package/lib/exercises/math/sequences/arithmetic/arithmeticThresholdFind.js +33 -14
  280. package/lib/exercises/math/sequences/arithmetic/firstIntegersSum.d.ts.map +1 -1
  281. package/lib/exercises/math/sequences/arithmetic/firstIntegersSum.js +4 -2
  282. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -1
  283. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +35 -14
  284. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
  285. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +37 -24
  286. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromFirstTerms.d.ts.map +1 -1
  287. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromFirstTerms.js +4 -0
  288. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.d.ts.map +1 -1
  289. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.js +29 -15
  290. package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
  291. package/lib/exercises/math/sequences/explicitFormulaUsage.js +27 -10
  292. package/lib/exercises/math/sequences/genericSequenceVariations.d.ts.map +1 -1
  293. package/lib/exercises/math/sequences/genericSequenceVariations.js +23 -10
  294. package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
  295. package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +9 -3
  296. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
  297. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +45 -17
  298. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts.map +1 -1
  299. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +20 -9
  300. package/lib/exercises/math/sequences/geometric/geometricFindReason.d.ts.map +1 -1
  301. package/lib/exercises/math/sequences/geometric/geometricFindReason.js +20 -9
  302. package/lib/exercises/math/sequences/geometric/geometricFindTerm.d.ts.map +1 -1
  303. package/lib/exercises/math/sequences/geometric/geometricFindTerm.js +60 -41
  304. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
  305. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.js +1 -0
  306. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
  307. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +26 -10
  308. package/lib/exercises/math/sequences/geometric/geometricRecognizeReasonFromFirstTerms.d.ts.map +1 -1
  309. package/lib/exercises/math/sequences/geometric/geometricRecognizeReasonFromFirstTerms.js +4 -0
  310. package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
  311. package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.js +27 -10
  312. package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts.map +1 -1
  313. package/lib/exercises/math/sequences/geometric/geometricVariations.js +4 -0
  314. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
  315. package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +23 -11
  316. package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -1
  317. package/lib/exercises/math/sequences/sequenceEvaluation.js +45 -21
  318. package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
  319. package/lib/exercises/math/sets/intervals/intervalsUnion.js +1 -2
  320. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
  321. package/lib/exercises/pc/calibrationCurveOfSolution.js +56 -48
  322. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +3 -1
  323. package/lib/exercises/pc/chemicalElements/weightPercent.d.ts.map +1 -1
  324. package/lib/exercises/pc/chemicalElements/weightPercent.js +1 -0
  325. package/lib/exercises/pc/chemicalEquations.d.ts.map +1 -1
  326. package/lib/exercises/pc/chemicalEquations.js +0 -2
  327. package/lib/exercises/pc/chemicalReactions/chemicalEquations.d.ts +8 -0
  328. package/lib/exercises/pc/chemicalReactions/chemicalEquations.d.ts.map +1 -0
  329. package/lib/exercises/pc/chemicalReactions/chemicalEquations.js +62 -0
  330. package/lib/exercises/pc/chemicalReactions/chemicalReactionsProduct.d.ts +9 -0
  331. package/lib/exercises/pc/chemicalReactions/chemicalReactionsProduct.d.ts.map +1 -0
  332. package/lib/exercises/pc/chemicalReactions/chemicalReactionsProduct.js +70 -0
  333. package/lib/exercises/pc/chemicalReactions/index.d.ts +2 -0
  334. package/lib/exercises/pc/chemicalReactions/index.d.ts.map +1 -1
  335. package/lib/exercises/pc/chemicalReactions/index.js +2 -0
  336. package/lib/exercises/pc/delution.d.ts.map +1 -1
  337. package/lib/exercises/pc/delution.js +25 -12
  338. package/lib/exercises/pc/dosage/concentrationCalculation.d.ts.map +1 -1
  339. package/lib/exercises/pc/dosage/concentrationCalculation.js +5 -3
  340. package/lib/exercises/pc/electricity/calculateVoltage.d.ts.map +1 -1
  341. package/lib/exercises/pc/electricity/calculateVoltage.js +112 -90
  342. package/lib/exercises/pc/electricity/electricEnergyFromPower.d.ts.map +1 -1
  343. package/lib/exercises/pc/electricity/electricEnergyFromPower.js +1 -0
  344. package/lib/exercises/pc/energy/efficiencyCalculation.d.ts.map +1 -1
  345. package/lib/exercises/pc/energy/efficiencyCalculation.js +5 -3
  346. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -1
  347. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +0 -1
  348. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.d.ts.map +1 -1
  349. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.js +87 -38
  350. package/lib/exercises/pc/forces/gravitationalAttractionValue.d.ts.map +1 -1
  351. package/lib/exercises/pc/forces/gravitationalAttractionValue.js +31 -16
  352. package/lib/exercises/pc/forces/gravitationalForcePlanets.d.ts.map +1 -1
  353. package/lib/exercises/pc/forces/gravitationalForcePlanets.js +71 -31
  354. package/lib/exercises/pc/forces/massWeight.d.ts.map +1 -1
  355. package/lib/exercises/pc/forces/massWeight.js +53 -20
  356. package/lib/exercises/pc/forces/pressingForce.d.ts.map +1 -1
  357. package/lib/exercises/pc/forces/pressingForce.js +71 -31
  358. package/lib/exercises/pc/formulaFromComposition.d.ts.map +1 -1
  359. package/lib/exercises/pc/formulaFromComposition.js +28 -8
  360. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts.map +1 -1
  361. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +31 -12
  362. package/lib/exercises/pc/index.d.ts +4 -6
  363. package/lib/exercises/pc/index.d.ts.map +1 -1
  364. package/lib/exercises/pc/index.js +4 -6
  365. package/lib/exercises/pc/kineticEnergy.d.ts.map +1 -1
  366. package/lib/exercises/pc/kineticEnergy.js +22 -10
  367. package/lib/exercises/pc/math/isolateVariables.d.ts.map +1 -1
  368. package/lib/exercises/pc/math/isolateVariables.js +114 -32
  369. package/lib/exercises/pc/math/proportionnalityCoeffFromLine.d.ts.map +1 -1
  370. package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +34 -16
  371. package/lib/exercises/pc/mecanicalWaves/elongationReading.d.ts.map +1 -1
  372. package/lib/exercises/pc/mecanicalWaves/elongationReading.js +35 -13
  373. package/lib/exercises/pc/molarQuantity.d.ts.map +1 -1
  374. package/lib/exercises/pc/molarQuantity.js +29 -13
  375. package/lib/exercises/pc/mole/concentrationReading.d.ts +4 -1
  376. package/lib/exercises/pc/mole/concentrationReading.d.ts.map +1 -1
  377. package/lib/exercises/pc/mole/concentrationReading.js +28 -10
  378. package/lib/exercises/pc/mole/molFromMass.d.ts.map +1 -1
  379. package/lib/exercises/pc/mole/molFromMass.js +21 -8
  380. package/lib/exercises/pc/mole/molFromMolarMass.d.ts.map +1 -1
  381. package/lib/exercises/pc/mole/molFromMolarMass.js +21 -8
  382. package/lib/exercises/pc/mole/molarMass.d.ts +3 -1
  383. package/lib/exercises/pc/mole/molarMass.d.ts.map +1 -1
  384. package/lib/exercises/pc/mole/molarMass.js +22 -9
  385. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.d.ts.map +1 -1
  386. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.js +25 -11
  387. package/lib/exercises/pc/mole/moleculeCountFromMol.d.ts.map +1 -1
  388. package/lib/exercises/pc/mole/moleculeCountFromMol.js +18 -7
  389. package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
  390. package/lib/exercises/pc/moleculeFormula.js +30 -9
  391. package/lib/exercises/pc/moleculeNomenclature.d.ts.map +1 -1
  392. package/lib/exercises/pc/moleculeNomenclature.js +23 -8
  393. package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
  394. package/lib/exercises/pc/motion/averageSpeed.js +68 -55
  395. package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -1
  396. package/lib/exercises/pc/motion/averageSpeedCalculation.js +97 -39
  397. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.d.ts +4 -1
  398. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.d.ts.map +1 -1
  399. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.js +51 -49
  400. package/lib/exercises/pc/motion/motionReference.d.ts +1 -0
  401. package/lib/exercises/pc/motion/motionReference.d.ts.map +1 -1
  402. package/lib/exercises/pc/motion/motionReference.js +47 -26
  403. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts +1 -1
  404. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
  405. package/lib/exercises/pc/motion/typeOfAcceleration.js +61 -62
  406. package/lib/exercises/pc/motion/typeOfMovement.d.ts +2 -1
  407. package/lib/exercises/pc/motion/typeOfMovement.d.ts.map +1 -1
  408. package/lib/exercises/pc/motion/typeOfMovement.js +58 -57
  409. package/lib/exercises/pc/orderOfMagnitude.d.ts.map +1 -1
  410. package/lib/exercises/pc/orderOfMagnitude.js +24 -23
  411. package/lib/exercises/pc/pH.d.ts.map +1 -1
  412. package/lib/exercises/pc/pH.js +37 -16
  413. package/lib/exercises/pc/perceivedFrequency.d.ts.map +1 -1
  414. package/lib/exercises/pc/perceivedFrequency.js +26 -13
  415. package/lib/exercises/pc/potentialEnergy.d.ts.map +1 -1
  416. package/lib/exercises/pc/potentialEnergy.js +23 -11
  417. package/lib/exercises/pc/power/calculatePowerOfLight.d.ts +2 -2
  418. package/lib/exercises/pc/power/calculatePowerOfLight.d.ts.map +1 -1
  419. package/lib/exercises/pc/power/calculatePowerOfLight.js +65 -39
  420. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +3 -1
  421. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -1
  422. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +48 -47
  423. package/lib/exercises/pc/snellDescartes.d.ts.map +1 -1
  424. package/lib/exercises/pc/snellDescartes.js +31 -13
  425. package/lib/exercises/pc/sound/findPeriodFromGraph.d.ts.map +1 -1
  426. package/lib/exercises/pc/sound/findPeriodFromGraph.js +42 -26
  427. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.d.ts +1 -0
  428. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.d.ts.map +1 -1
  429. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.js +51 -32
  430. package/lib/exercises/pc/sound/findSoundFrequencyFromPeriod.d.ts.map +1 -1
  431. package/lib/exercises/pc/sound/findSoundFrequencyFromPeriod.js +20 -7
  432. package/lib/exercises/pc/sound/findSoundPeriodFromFrequency.d.ts.map +1 -1
  433. package/lib/exercises/pc/sound/findSoundPeriodFromFrequency.js +20 -7
  434. package/lib/exercises/pc/sound/frequencyComparison.d.ts.map +1 -1
  435. package/lib/exercises/pc/sound/frequencyComparison.js +25 -14
  436. package/lib/exercises/pc/spectral/spectralEnergy.d.ts +1 -3
  437. package/lib/exercises/pc/spectral/spectralEnergy.d.ts.map +1 -1
  438. package/lib/exercises/pc/spectral/spectralEnergy.js +98 -56
  439. package/lib/exercises/pc/waves/findDistanceFromEarth.d.ts.map +1 -1
  440. package/lib/exercises/pc/waves/findDistanceFromEarth.js +22 -9
  441. package/lib/exercises/pc/waves/lightDistanceConversion.d.ts.map +1 -1
  442. package/lib/exercises/pc/waves/lightDistanceConversion.js +104 -76
  443. package/lib/exercises/pc/waves/periodicWaveCelerity.d.ts +1 -0
  444. package/lib/exercises/pc/waves/periodicWaveCelerity.d.ts.map +1 -1
  445. package/lib/exercises/pc/waves/periodicWaveCelerity.js +81 -25
  446. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
  447. package/lib/exercises/pc/weight/calculateWeight.js +55 -26
  448. package/lib/exercises/pc/weight/weightOnTheMoon.d.ts.map +1 -1
  449. package/lib/exercises/pc/weight/weightOnTheMoon.js +67 -32
  450. package/lib/index.d.ts +58 -37
  451. package/lib/index.d.ts.map +1 -1
  452. package/lib/latexTester.js +7 -2
  453. package/lib/math/geometry/ray.d.ts +8 -1
  454. package/lib/math/geometry/ray.d.ts.map +1 -1
  455. package/lib/math/geometry/ray.js +11 -1
  456. package/lib/math/polynomials/trinom.d.ts +5 -0
  457. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  458. package/lib/math/polynomials/trinom.js +6 -0
  459. package/lib/pc/constants/molecularChemistry/reaction.js +1 -1
  460. package/lib/pc/measure/measure.d.ts +11 -4
  461. package/lib/pc/measure/measure.d.ts.map +1 -1
  462. package/lib/pc/measure/measure.js +10 -6
  463. package/lib/playground.d.ts.map +1 -1
  464. package/lib/playground.js +8 -1
  465. package/lib/tests/exoTest.d.ts.map +1 -1
  466. package/lib/tests/exoTest.js +13 -0
  467. package/lib/tests/mega.test.d.ts +2 -0
  468. package/lib/tests/mega.test.d.ts.map +1 -0
  469. package/lib/tests/mega.test.js +13 -0
  470. package/lib/tests/megaxl.test.d.ts +2 -0
  471. package/lib/tests/megaxl.test.d.ts.map +1 -0
  472. package/lib/tests/megaxl.test.js +10 -0
  473. package/lib/tests/singleExo.test.d.ts.map +1 -1
  474. package/lib/tests/singleExo.test.js +2 -2
  475. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  476. package/lib/tree/nodes/operators/powerNode.js +2 -1
  477. package/package.json +3 -1
@@ -5,23 +5,19 @@ import { Measure } from "../../../pc/measure/measure.js";
5
5
  import { planets } from "../../../pc/constants/mechanics/planets.js";
6
6
  import { earthG, sunMass } from "../../../pc/constants/mechanics/gravitational.js";
7
7
  const G = earthG.measure;
8
- const getGravitationalForcePlanetsQuestion = () => {
9
- const planetIndex = randint(0, planets.length);
10
- const selectedPlanet = planets[planetIndex];
8
+ const getInstruction = (identifiers) => {
9
+ const { planet, mass, distance } = identifiers;
10
+ const selectedPlanet = planets.find((p) => p.name === planet);
11
11
  const massSun = sunMass.measure;
12
- // Convert distance from km to m
13
- const distanceInMeters = selectedPlanet.distanceFromSun.convert("m");
14
- const force = G.times(selectedPlanet.mass)
15
- .times(massSun)
16
- .divide(distanceInMeters.times(distanceInMeters))
17
- .toSignificant(2);
18
- const instruction = `Considérez la planète ${selectedPlanet.name} dans le ${selectedPlanet.system}.
19
- La masse de ${selectedPlanet.name} est de $${selectedPlanet.mass.toTex({
12
+ const instruction = `On considère la planète ${selectedPlanet.name} dans le ${selectedPlanet.system}.
13
+
14
+ La masse de ${selectedPlanet.name} est de $${selectedPlanet.mass.toTex({
20
15
  scientific: 2,
21
16
  })}$ et la distance entre ${selectedPlanet.name} et le Soleil est de $${selectedPlanet.distanceFromSun.toTex({
22
17
  scientific: 2,
23
18
  })}$.
24
- Calculez la force gravitationnelle exercée par le Soleil sur ${selectedPlanet.name}.
19
+
20
+ Calculez la force gravitationnelle exercée par le Soleil sur ${selectedPlanet.name}.
25
21
 
26
22
  Données:
27
23
  - Constante de gravitation universelle: $G = ${G.toTex({
@@ -30,15 +26,49 @@ Données:
30
26
  - Masse du Soleil: $m_{\\text{soleil}} = ${massSun.toTex({
31
27
  scientific: 2,
32
28
  })}$`;
33
- const hint = `Utilisez la formule de la force gravitationnelle.`;
29
+ return instruction;
30
+ };
31
+ const getAnswer = (identifiers) => {
32
+ const { planet, mass, distance } = identifiers;
33
+ const selectedPlanet = planets.find((p) => p.name === planet);
34
+ const massSun = sunMass.measure;
35
+ // Convert distance from km to m
36
+ const distanceInMeters = selectedPlanet.distanceFromSun.convert("m");
37
+ const force = G.times(selectedPlanet.mass)
38
+ .times(massSun)
39
+ .divide(distanceInMeters.times(distanceInMeters))
40
+ .toSignificant(2);
41
+ return force.toTex({ scientific: 2 });
42
+ };
43
+ const getHint = (identifiers) => {
44
+ const hint = `Utilise la formule de la force gravitationnelle.`;
45
+ return hint;
46
+ };
47
+ const getCorrection = (identifiers) => {
48
+ const { planet, mass, distance } = identifiers;
49
+ const selectedPlanet = planets.find((p) => p.name === planet);
50
+ const massSun = sunMass.measure;
51
+ // Convert distance from km to m
52
+ const distanceInMeters = selectedPlanet.distanceFromSun.convert("m");
53
+ const force = G.times(selectedPlanet.mass)
54
+ .times(massSun)
55
+ .divide(distanceInMeters.times(distanceInMeters))
56
+ .toSignificant(2);
34
57
  const correction = `La force gravitationnelle est donnée par la formule vectorielle :
35
58
 
36
- $$\\vec{F}_{\\text{Soleil/${selectedPlanet.name}}} = -G \\cdot \\frac{m_{\\text{soleil}} \\cdot m_{${selectedPlanet.name.charAt(0)}}}{d^2} \\cdot \\vec{u}_{\\text{Soleil→${selectedPlanet.name}}}$$. \n
37
- La formule de la force gravitationnelle en valeur est :
38
- $$F_{\\text{Soleil/${selectedPlanet.name}}} = G \\cdot \\frac{m_{\\text{soleil}} \\cdot m_{${selectedPlanet.name.charAt(0)}}}{d^2}$$. \n
39
- En utilisant les valeurs fournies :
59
+ $$
60
+ \\overrightarrow{F}_{\\text{Soleil/${selectedPlanet.name}}} = -G \\cdot \\frac{m_{\\text{soleil}} \\cdot m_{${selectedPlanet.name.charAt(0)}}}{d^2} \\cdot \\overrightarrow{u}_{\\text{Soleil→${selectedPlanet.name}}}
61
+ $$
62
+
63
+ La formule de la force gravitationnelle en valeur est :
64
+ $$
65
+ F_{\\text{Soleil/${selectedPlanet.name}}} = G \\cdot \\frac{m_{\\text{soleil}} \\cdot m_{${selectedPlanet.name.charAt(0)}}}{d^2}
66
+ $$
67
+
68
+ En utilisant les valeurs fournies :
40
69
 
41
- $$F_{\\text{Soleil/${selectedPlanet.name}}} = ${G.toTex({
70
+ $$
71
+ F_{\\text{Soleil/${selectedPlanet.name}}} = ${G.toTex({
42
72
  scientific: 2,
43
73
  })} \\cdot \\frac{${selectedPlanet.mass.toTex({
44
74
  scientific: 2,
@@ -46,23 +76,34 @@ Données:
46
76
  scientific: 2,
47
77
  })}}{(${distanceInMeters.toTex({
48
78
  scientific: 2,
49
- })})^2} = ${force.toTex({ scientific: 2 })}$$. \n
50
- Donc, la force gravitationnelle exercée par le Soleil sur ${selectedPlanet.name} est $${force.toTex({ scientific: 2 })}$.`;
79
+ })})^2} = ${force.toTex({ scientific: 2 })}
80
+ $$
81
+
82
+ Donc, la force gravitationnelle exercée par le Soleil sur ${selectedPlanet.name} est $${force.toTex({ scientific: 2 })}$.`;
83
+ return correction;
84
+ };
85
+ const getQuestionFromIdentifiers = (identifiers) => {
51
86
  const question = {
52
- answer: force.toTex({ scientific: 2 }),
53
- instruction,
54
- hint,
55
- correction,
87
+ answer: getAnswer(identifiers),
88
+ instruction: getInstruction(identifiers),
89
+ hint: getHint(identifiers),
90
+ correction: getCorrection(identifiers),
56
91
  keys: ["N", "timesTenPower"],
57
92
  answerFormat: "tex",
58
- identifiers: {
59
- planet: selectedPlanet.name,
60
- mass: selectedPlanet.mass,
61
- distance: selectedPlanet.distanceFromSun,
62
- },
93
+ identifiers,
63
94
  };
64
95
  return question;
65
96
  };
97
+ const getGravitationalForcePlanetsQuestion = () => {
98
+ const planetIndex = randint(0, planets.length);
99
+ const selectedPlanet = planets[planetIndex];
100
+ const identifiers = {
101
+ planet: selectedPlanet.name,
102
+ mass: selectedPlanet.mass,
103
+ distance: selectedPlanet.distanceFromSun,
104
+ };
105
+ return getQuestionFromIdentifiers(identifiers);
106
+ };
66
107
  const getPropositions = (n, { answer, mass, distance }) => {
67
108
  const propositions = [];
68
109
  addValidProp(propositions, answer);
@@ -103,9 +144,7 @@ export const gravitationalForcePlanets = {
103
144
  id: "gravitationalForcePlanets",
104
145
  connector: "=",
105
146
  label: "Calculer la force gravitationnelle entre le Soleil et une planète",
106
- levels: ["2nde"],
107
147
  isSingleStep: true,
108
- sections: ["Mécanique gravitationnelle"],
109
148
  generator: (nb) => getDistinctQuestions(getGravitationalForcePlanetsQuestion, nb, 8),
110
149
  qcmTimer: 60,
111
150
  freeTimer: 60,
@@ -114,4 +153,5 @@ export const gravitationalForcePlanets = {
114
153
  subject: "Physique",
115
154
  maxAllowedQuestions: 8,
116
155
  hasHintAndCorrection: true,
156
+ getQuestionFromIdentifiers,
117
157
  };
@@ -1 +1 @@
1
- {"version":3,"file":"massWeight.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/forces/massWeight.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACjC,CAAC;AAmEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAapD,CAAC"}
1
+ {"version":3,"file":"massWeight.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/forces/massWeight.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACjC,CAAC;AAwGF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAYpD,CAAC"}
@@ -5,39 +5,73 @@ import { round } from "../../../math/utils/round.js";
5
5
  import { randint } from "../../../math/utils/random/randint.js";
6
6
  import { coinFlip } from "../../../utils/alea/coinFlip.js";
7
7
  const g = 9.81;
8
- const getMassWeightQuestion = () => {
9
- const mass = round(randint(1, 1000), 2);
10
- const force = round(mass * g, 2);
11
- const target = coinFlip() ? "le poids" : "la masse";
12
- const instruction = `Un système qui pèse $${mass}\\ kg$ subit une force de $${frenchify(force)}\\ N$ due à la gravité. Quel est ${target} de ce système ?`;
8
+ const getInstruction = (identifiers) => {
9
+ const { mass, force, target } = identifiers;
10
+ const instruction = `Un système qui pèse $${mass}\\ \\textrm{kg}$ subit une force de $${frenchify(force)}\\ \\textrm{N}$ due à la gravité.
11
+
12
+ Quel${target === "la masse" ? "le" : ""} est ${target} de ce système ?`;
13
+ return instruction;
14
+ };
15
+ const getAnswer = (identifiers) => {
16
+ const { mass, force, target } = identifiers;
13
17
  const answer = target === "le poids"
14
18
  ? `${force.toTree().toTex()}`
15
19
  : `${mass.toTree().toTex()}`;
20
+ return answer;
21
+ };
22
+ const getHint = (identifiers) => {
23
+ const { mass, force, target } = identifiers;
16
24
  const hint = target === "le poids"
17
- ? `Le poids est la force de gravité qui agit sur un objet. La formule est $P = m \\times g$, où $P$ est le poids en newtons (N), $m$ est la masse en kilogrammes (kg) et $g$ est l'accélération due à la gravité (environ $9.81\\ m/s^2$).`
18
- : `La masse est la quantité de matière dans un objet. La formule pour la trouver à partir du poids est $m = \\frac{P}{g}$, où $m$ est la masse en kilogrammes (kg), $P$ est le poids en newtons (N) et $g$ est l'accélération due à la gravité (environ $9.81\\ m/s^2$).`;
25
+ ? `Le poids est la force de gravité qui agit sur un objet. La formule est :
26
+
27
+ $$
28
+ P = m \\times g
29
+ $$
30
+
31
+ où $P$ est le poids en newtons ($\\textrm{N}$), $m$ est la masse en kilogrammes ($\\textrm{kg}$) et $g$ est l'accélération due à la gravité (environ $9,81\\ \\textrm{m}/\\textrm{s}^2$).`
32
+ : `La masse est la quantité de matière dans un objet. La formule pour la trouver à partir du poids est :
33
+
34
+ $$
35
+ m = \\frac{P}{g}
36
+ $$
37
+
38
+ où $m$ est la masse en kilogrammes ($\\textrm{kg}$), $P$ est le poids en newtons ($\\textrm{N}$) et $g$ est l'accélération due à la gravité (environ $9,81\\ \\textrm{m}/\\textrm{s}^2$).`;
39
+ return hint;
40
+ };
41
+ const getCorrection = (identifiers) => {
42
+ const { mass, force, target } = identifiers;
19
43
  const correction = target === "le poids"
20
44
  ? `Le poids est la force exercée par la gravité sur un objet. Donc ici, le poids est $${force
21
45
  .toTree()
22
- .toTex()}\\ N$.`
46
+ .toTex()}\\ \\textrm{N}$.`
23
47
  : `La masse est la quantité de matière dans un objet. Donc ici, la masse est $${mass
24
48
  .toTree()
25
- .toTex()}\\ kg$.`;
49
+ .toTex()}\\ \\textrm{kg}$.`;
50
+ return correction;
51
+ };
52
+ const getQuestionFromIdentifiers = (identifiers) => {
26
53
  const question = {
27
- answer,
28
- instruction,
29
- hint,
30
- correction,
54
+ answer: getAnswer(identifiers),
55
+ instruction: getInstruction(identifiers),
56
+ hint: getHint(identifiers),
57
+ correction: getCorrection(identifiers),
31
58
  keys: [],
32
59
  answerFormat: "tex",
33
- identifiers: {
34
- mass,
35
- force,
36
- target,
37
- },
60
+ identifiers,
38
61
  };
39
62
  return question;
40
63
  };
64
+ const getMassWeightQuestion = () => {
65
+ const mass = round(randint(1, 1000), 2);
66
+ const force = round(mass * g, 2);
67
+ const target = coinFlip() ? "le poids" : "la masse";
68
+ const identifiers = {
69
+ mass,
70
+ force,
71
+ target,
72
+ };
73
+ return getQuestionFromIdentifiers(identifiers);
74
+ };
41
75
  const getPropositions = (n, { answer, mass, force, target }) => {
42
76
  const propositions = [];
43
77
  addValidProp(propositions, answer, "tex");
@@ -52,9 +86,7 @@ const isAnswerValid = (ans, { answer }) => {
52
86
  export const MassWeightExercise = {
53
87
  id: "massWeight",
54
88
  label: "Calculer le poids ou la masse d'un système",
55
- levels: ["2nde"],
56
89
  isSingleStep: true,
57
- sections: ["Forces"],
58
90
  generator: (nb) => getDistinctQuestions(getMassWeightQuestion, nb),
59
91
  qcmTimer: 60,
60
92
  freeTimer: 60,
@@ -62,4 +94,5 @@ export const MassWeightExercise = {
62
94
  isAnswerValid,
63
95
  subject: "Physique",
64
96
  hasHintAndCorrection: true,
97
+ getQuestionFromIdentifiers,
65
98
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pressingForce.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/forces/pressingForce.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAClD,CAAC;AAuGF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAa/C,CAAC"}
1
+ {"version":3,"file":"pressingForce.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/forces/pressingForce.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAClD,CAAC;AA4IF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,CAAC"}
@@ -3,59 +3,100 @@ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuesti
3
3
  import { randfloat } from "../../../math/utils/random/randfloat.js";
4
4
  import { Measure } from "../../../pc/measure/measure.js";
5
5
  import { random } from "../../../utils/alea/random.js";
6
+ const getInstruction = (identifiers) => {
7
+ const { varAsked, F, P, S } = identifiers;
8
+ const FMeasure = new Measure(F.significantPart, F.exponent);
9
+ const PMeasure = new Measure(P.significantPart, P.exponent);
10
+ const SMeasure = new Measure(S.significantPart, S.exponent);
11
+ let PInstruction = "";
12
+ let SInstruction = "";
13
+ let FInstruction = "";
14
+ let unit = "";
15
+ switch (varAsked) {
16
+ case "F":
17
+ PInstruction = `P=${PMeasure.toTex({ scientific: 1 })}\\ \\textrm{Pa}`;
18
+ SInstruction = `S=${SMeasure.toTex({ scientific: 1 })}\\ \\textrm{m}^2`;
19
+ FInstruction = "F\\ \\textrm{N}";
20
+ unit = "$\\textrm{N}$";
21
+ break;
22
+ case "S":
23
+ PInstruction = `P=${PMeasure.toTex({ scientific: 1 })}\\ \\textrm{Pa}`;
24
+ FInstruction = `F=${FMeasure.toTex({ scientific: 1 })}\\ \\textrm{N}`;
25
+ SInstruction = `S\\ \\textrm{m}^2`;
26
+ unit = "$\\textrm{m}^2$";
27
+ break;
28
+ case "P":
29
+ default:
30
+ SInstruction = `S=${SMeasure.toTex({ scientific: 1 })}\\ \\textrm{m}^2`;
31
+ FInstruction = `F=${FMeasure.toTex({ scientific: 1 })}\\ \\textrm{N}`;
32
+ PInstruction = `P\\ \\textrm{Pa}`;
33
+ unit = "$\\textrm{Pa}$";
34
+ break;
35
+ }
36
+ return `Un fluide de pression $${PInstruction}$ exerce une force de valeur $${FInstruction}$ sur une paroi de surface $${SInstruction}$.
37
+
38
+ Calculer $${varAsked}$ (en ${unit}).`;
39
+ };
40
+ const getAnswer = (identifiers) => {
41
+ const { varAsked, F, P, S } = identifiers;
42
+ const FMeasure = new Measure(F.significantPart, F.exponent);
43
+ const PMeasure = new Measure(P.significantPart, P.exponent);
44
+ const SMeasure = new Measure(S.significantPart, S.exponent);
45
+ let answer = "";
46
+ switch (varAsked) {
47
+ case "F":
48
+ answer = FMeasure.toSignificant(1).toTex({ scientific: 1 });
49
+ break;
50
+ case "S":
51
+ answer = SMeasure.toSignificant(1).toTex({ scientific: 1 });
52
+ break;
53
+ case "P":
54
+ default:
55
+ answer = PMeasure.toSignificant(1).toTex({ scientific: 1 });
56
+ break;
57
+ }
58
+ return answer;
59
+ };
60
+ const getQuestionFromIdentifiers = (identifiers) => {
61
+ const question = {
62
+ answer: getAnswer(identifiers),
63
+ instruction: getInstruction(identifiers),
64
+ keys: ["timesTenPower"],
65
+ answerFormat: "tex",
66
+ identifiers,
67
+ };
68
+ return question;
69
+ };
6
70
  const getPressingForceQuestion = () => {
7
71
  let F;
8
72
  let S;
9
73
  let P;
10
74
  const varAsked = random(["F", "S", "P"]);
11
- let FInstruction = "F";
12
- let PInstruction = "P";
13
- let SInstruction = "S";
14
- let answer = "";
15
- let unit = "";
16
75
  switch (varAsked) {
17
76
  case "F":
18
77
  P = new Measure(randfloat(1, 8, 1), 5);
19
- PInstruction = `P=${P.toTex({ scientific: 1 })}\\ \\text{Pa}`;
20
78
  S = new Measure(randfloat(1, 8, 1), 2);
21
- SInstruction = `S=${S.toTex({ scientific: 1 })}\\ \\text{m}^2`;
22
79
  F = P.times(S);
23
- answer = F.toSignificant(1).toTex({ scientific: 1 });
24
- unit = "$\\text{N}$";
25
80
  break;
26
81
  case "S":
27
82
  P = new Measure(randfloat(1, 8, 1), 5);
28
- PInstruction = `P=${P.toTex({ scientific: 1 })}\\ \\text{Pa}`;
29
83
  F = new Measure(randfloat(1, 8, 1), 7);
30
- FInstruction = `F=${F.toTex({ scientific: 1 })}\\ \\text{N}`;
31
84
  S = F.divide(P);
32
- answer = S.toSignificant(1).toTex({ scientific: 1 });
33
- unit = "$\\text{m}^2$";
34
85
  break;
35
86
  case "P":
36
87
  default:
37
88
  S = new Measure(randfloat(1, 8, 1), 2);
38
- SInstruction = `S=${S.toTex({ scientific: 1 })}\\ \\text{m}^2`;
39
89
  F = new Measure(randfloat(1, 8, 1), 7);
40
- FInstruction = `F=${F.toTex({ scientific: 1 })}\\ \\text{N}`;
41
90
  P = F.divide(S);
42
- answer = P.toSignificant(1).toTex({ scientific: 1 });
43
- unit = "$\\text{Pa}$";
44
91
  break;
45
92
  }
46
- const question = {
47
- answer,
48
- instruction: `Un fluide de pression $${PInstruction}$ exerce une force de valeur $${FInstruction}$ sur une paroi de surface $${SInstruction}$. Calculer $${varAsked}$ (en ${unit}).`,
49
- keys: ["timesTenPower"],
50
- answerFormat: "tex",
51
- identifiers: {
52
- F: F.toIdentifiers(),
53
- P: P.toIdentifiers(),
54
- S: S.toIdentifiers(),
55
- varAsked,
56
- },
93
+ const identifiers = {
94
+ F: F.toIdentifiers(),
95
+ P: P.toIdentifiers(),
96
+ S: S.toIdentifiers(),
97
+ varAsked,
57
98
  };
58
- return question;
99
+ return getQuestionFromIdentifiers(identifiers);
59
100
  };
60
101
  const getPropositions = (n, { answer, varAsked }) => {
61
102
  const propositions = [];
@@ -82,13 +123,12 @@ export const pressingForce = {
82
123
  id: "pressingForce",
83
124
  connector: "=",
84
125
  label: "Calculer la force pressante",
85
- levels: ["1reSpé"],
86
126
  isSingleStep: true,
87
- sections: ["Forces"],
88
127
  generator: (nb) => getDistinctQuestions(getPressingForceQuestion, nb),
89
128
  qcmTimer: 60,
90
129
  freeTimer: 60,
91
130
  getPropositions,
92
131
  isAnswerValid,
93
132
  subject: "Physique",
133
+ getQuestionFromIdentifiers,
94
134
  };
@@ -1 +1 @@
1
- {"version":3,"file":"formulaFromComposition.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/formulaFromComposition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAwFF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
1
+ {"version":3,"file":"formulaFromComposition.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/formulaFromComposition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AA2HF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
@@ -5,9 +5,9 @@ import { round } from "../../math/utils/round.js";
5
5
  import { atomes } from "../../pc/constants/molecularChemistry/atome.js";
6
6
  import { molecules } from "../../pc/constants/molecularChemistry/molecule.js";
7
7
  import { shuffle } from "../../utils/alea/shuffle.js";
8
- const getFormulaFromComposition = () => {
8
+ const getInstruction = (identifiers) => {
9
+ const randomMoleculeIndex = identifiers.randomMoleculeIndex;
9
10
  const moleculesWith2Atoms = molecules.filter((molecule) => molecule.atoms.length === 2 && molecule.state !== "aqueous");
10
- const randomMoleculeIndex = Math.floor(Math.random() * moleculesWith2Atoms.length);
11
11
  const myRandomMolecule = moleculesWith2Atoms[randomMoleculeIndex];
12
12
  const [elementName1, elementName2] = myRandomMolecule.atoms.map((el) => el.atom.symbole);
13
13
  const [elementcount1, elementcount2] = myRandomMolecule.atoms.map((el) => el.count);
@@ -19,16 +19,37 @@ const getFormulaFromComposition = () => {
19
19
  const percentageElement2 = round(((elementcount2 * elementMolarMass2) /
20
20
  (elementcount1 * elementMolarMass1 + elementcount2 * elementMolarMass2)) *
21
21
  100, 2);
22
+ return `Déterminer la formule brute $${elementName1}_x${elementName2}_y$ à partir de la composition centésimale $${elementName1}$ : $${percentageElement1}$ $\\%$ $${elementName2}$ : $${percentageElement2}$ $\\%$.`;
23
+ };
24
+ const getAnswer = (identifiers) => {
25
+ const randomMoleculeIndex = identifiers.randomMoleculeIndex;
26
+ const moleculesWith2Atoms = molecules.filter((molecule) => molecule.atoms.length === 2 && molecule.state !== "aqueous");
27
+ const myRandomMolecule = moleculesWith2Atoms[randomMoleculeIndex];
22
28
  const answer = myRandomMolecule.formula;
29
+ return answer;
30
+ };
31
+ const getKeys = (identifiers) => {
32
+ const randomMoleculeIndex = identifiers.randomMoleculeIndex;
33
+ const moleculesWith2Atoms = molecules.filter((molecule) => molecule.atoms.length === 2 && molecule.state !== "aqueous");
34
+ const myRandomMolecule = moleculesWith2Atoms[randomMoleculeIndex];
35
+ return [...myRandomMolecule.atoms.map((el) => el.atom.name), "underscore"];
36
+ };
37
+ const getQuestionFromIdentifiers = (identifiers) => {
23
38
  const question = {
24
- instruction: `Déterminer la formule brute $${elementName1}_x${elementName2}_y$ à partir de la composition centésimale $${elementName1}$ : $${percentageElement1}$ $\\%$ $${elementName2}$ : $${percentageElement2}$ $\\%$.`,
25
- answer,
26
- keys: [...myRandomMolecule.atoms.map((el) => el.atom.name), "underscore"],
39
+ instruction: getInstruction(identifiers),
40
+ answer: getAnswer(identifiers),
41
+ keys: getKeys(identifiers),
27
42
  answerFormat: "tex",
28
- identifiers: { randomMoleculeIndex },
43
+ identifiers,
29
44
  };
30
45
  return question;
31
46
  };
47
+ const getFormulaFromComposition = () => {
48
+ const moleculesWith2Atoms = molecules.filter((molecule) => molecule.atoms.length === 2 && molecule.state !== "aqueous");
49
+ const randomMoleculeIndex = Math.floor(Math.random() * moleculesWith2Atoms.length);
50
+ const identifiers = { randomMoleculeIndex };
51
+ return getQuestionFromIdentifiers(identifiers);
52
+ };
32
53
  const getPropositions = (n, { answer, randomMoleculeIndex }) => {
33
54
  const moleculesWith2Atoms = molecules.filter((molecule) => molecule.atoms.length === 2 && molecule.state !== "aqueous");
34
55
  const myRandomMolecule = moleculesWith2Atoms[randomMoleculeIndex];
@@ -55,8 +76,6 @@ export const formulaFromComposition = {
55
76
  id: "formulaFromComposition",
56
77
  connector: "\\iff",
57
78
  label: "Déterminer la formule brute à partir de la composition centésimale",
58
- levels: ["4ème", "3ème", "2nde"],
59
- sections: ["Chimie organique"],
60
79
  subject: "Chimie",
61
80
  isSingleStep: true,
62
81
  generator: (nb) => getDistinctQuestions(getFormulaFromComposition, nb),
@@ -64,4 +83,5 @@ export const formulaFromComposition = {
64
83
  freeTimer: 60,
65
84
  getPropositions,
66
85
  isAnswerValid,
86
+ getQuestionFromIdentifiers,
67
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"identifyAtomicMassOrAtomicNb.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/identifyAtomicMassOrAtomicNb.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA4EF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAa9D,CAAC"}
1
+ {"version":3,"file":"identifyAtomicMassOrAtomicNb.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/identifyAtomicMassOrAtomicNb.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAkGF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAY9D,CAAC"}
@@ -2,26 +2,46 @@ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../exercises/
2
2
  import { getDistinctQuestions } from "../../exercises/utils/getDistinctQuestions.js";
3
3
  import { randint } from "../../math/utils/random/randint.js";
4
4
  import { round } from "../../math/utils/round.js";
5
+ import { atomes } from "../../pc/constants/molecularChemistry/atome.js";
5
6
  import { coinFlip } from "../../utils/alea/coinFlip.js";
6
7
  import { random } from "../../utils/alea/random.js";
7
8
  import { requiresApostropheBefore } from "../../utils/strings/requiresApostropheBefore.js";
8
9
  import { getAtoms } from "../utils/getAtoms.js";
9
- const getIdentifyAtomicMassOrAtomicNbQuestion = () => {
10
- const exo = generateExercise();
10
+ const getInstruction = (identifiers) => {
11
+ const { atomicMass, atomicNumber, isAsking, symbol } = identifiers;
12
+ const atom = atomes.find((a) => a.symbole === symbol);
13
+ return `À l'aide du tableau périodique simplifié, déterminer ${isAsking} d'un atome ${requiresApostropheBefore(atom.name) ? "d'" : "de "}${atom.name}.
14
+
15
+ ![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/periodicTable2.png)`;
16
+ };
17
+ const getAnswer = (identifiers) => {
18
+ const { atomicMass, atomicNumber, isAsking, symbol } = identifiers;
19
+ return isAsking == "la masse atomique"
20
+ ? round(atomicMass, 1).frenchify()
21
+ : atomicNumber.toTree().toTex();
22
+ };
23
+ const getQuestionFromIdentifiers = (identifiers) => {
11
24
  const question = {
12
- answer: exo.answer,
13
- instruction: `À l'aide du tableau périodique simplifié, déterminer ${exo.isAsking} d'un atome ${requiresApostropheBefore(exo.atom.name) ? "d'" : "de "}${exo.atom.name}![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/periodicTable2.png)`,
25
+ answer: getAnswer(identifiers),
26
+ instruction: getInstruction(identifiers),
14
27
  keys: [],
15
28
  answerFormat: "tex",
16
- identifiers: {
17
- atomicMass: exo.atomicMasss,
18
- atomicNumber: exo.atomicNumber,
19
- isAsking: exo.isAsking,
20
- symbol: exo.atom.symbole,
21
- },
29
+ identifiers,
22
30
  };
23
31
  return question;
24
32
  };
33
+ const getIdentifyAtomicMassOrAtomicNbQuestion = () => {
34
+ const atoms = getAtoms(3);
35
+ const atom = random(atoms);
36
+ const isAsking = coinFlip() ? "la masse atomique" : "le numéro atomique";
37
+ const identifiers = {
38
+ atomicMass: atom.masseAtomique,
39
+ atomicNumber: atom.numeroAtomique,
40
+ isAsking: isAsking,
41
+ symbol: atom.symbole,
42
+ };
43
+ return getQuestionFromIdentifiers(identifiers);
44
+ };
25
45
  const getPropositions = (n, { answer, atomicMass, atomicNumber }) => {
26
46
  const propositions = [];
27
47
  addValidProp(propositions, answer);
@@ -59,13 +79,12 @@ const generateExercise = () => {
59
79
  export const identifyAtomicMassOrAtomicNb = {
60
80
  id: "identifyAtomicMassOrAtomicNb",
61
81
  label: "Identifier la masse atomique et le numéro atomique",
62
- levels: ["2nde"],
63
82
  isSingleStep: true,
64
- sections: ["Chimie organique"],
65
83
  generator: (nb) => getDistinctQuestions(getIdentifyAtomicMassOrAtomicNbQuestion, nb),
66
84
  qcmTimer: 60,
67
85
  freeTimer: 60,
68
86
  getPropositions,
69
87
  isAnswerValid,
70
88
  subject: "Chimie",
89
+ getQuestionFromIdentifiers,
71
90
  };
@@ -1,5 +1,4 @@
1
- export * from "./chemicalEquations.js";
2
- export * from "./chemicalReactionsProduct.js";
1
+ export * from "./calibrationCurveOfSolution.js";
3
2
  export * from "./delution.js";
4
3
  export * from "./formulaFromComposition.js";
5
4
  export * from "./kineticEnergy.js";
@@ -10,6 +9,9 @@ export * from "./pH.js";
10
9
  export * from "./perceivedFrequency.js";
11
10
  export * from "./potentialEnergy.js";
12
11
  export * from "./snellDescartes.js";
12
+ export * from "./identifyAtomicMassOrAtomicNb.js";
13
+ export * from "./recognizeRefractionOrReflectionAngles.js";
14
+ export * from "./orderOfMagnitude.js";
13
15
  export * from "./sound/index.js";
14
16
  export * from "./math/index.js";
15
17
  export * from "./weight/index.js";
@@ -23,12 +25,8 @@ export * from "./fluids/index.js";
23
25
  export * from "./electricity/index.js";
24
26
  export * from "./energy/index.js";
25
27
  export * from "./motion/index.js";
26
- export * from "./calibrationCurveOfSolution.js";
27
28
  export * from "./dosage/index.js";
28
29
  export * from "./spectral/index.js";
29
- export * from "./identifyAtomicMassOrAtomicNb.js";
30
- export * from "./recognizeRefractionOrReflectionAngles.js";
31
- export * from "./orderOfMagnitude.js";
32
30
  export * from "./power/index.js";
33
31
  /**exos pris des maths */
34
32
  export * from "../math/percent/findProportion.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AAEjC,yBAAyB;AACzB,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kEAAkE,CAAC;AACjF,cAAc,+DAA+D,CAAC;AAC9E,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sDAAsD,CAAC;AACrE,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC;AACzD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,6DAA6D,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,oEAAoE,CAAC;AAC5G,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iDAAiD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uBAAuB,CAAC;AAEtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AAEjC,yBAAyB;AACzB,cAAc,mCAAmC,CAAC;AAClD,cAAc,wDAAwD,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AACrF,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kEAAkE,CAAC;AACjF,cAAc,+DAA+D,CAAC;AAC9E,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sDAAsD,CAAC;AACrE,cAAc,mCAAmC,CAAC;AAClD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC;AACzD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,6DAA6D,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,mEAAmE,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,oEAAoE,CAAC;AAC5G,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iDAAiD,CAAC"}
@@ -1,5 +1,4 @@
1
- export * from "./chemicalEquations.js";
2
- export * from "./chemicalReactionsProduct.js";
1
+ export * from "./calibrationCurveOfSolution.js";
3
2
  export * from "./delution.js";
4
3
  export * from "./formulaFromComposition.js";
5
4
  export * from "./kineticEnergy.js";
@@ -10,6 +9,9 @@ export * from "./pH.js";
10
9
  export * from "./perceivedFrequency.js";
11
10
  export * from "./potentialEnergy.js";
12
11
  export * from "./snellDescartes.js";
12
+ export * from "./identifyAtomicMassOrAtomicNb.js";
13
+ export * from "./recognizeRefractionOrReflectionAngles.js";
14
+ export * from "./orderOfMagnitude.js";
13
15
  export * from "./sound/index.js";
14
16
  export * from "./math/index.js";
15
17
  export * from "./weight/index.js";
@@ -23,12 +25,8 @@ export * from "./fluids/index.js";
23
25
  export * from "./electricity/index.js";
24
26
  export * from "./energy/index.js";
25
27
  export * from "./motion/index.js";
26
- export * from "./calibrationCurveOfSolution.js";
27
28
  export * from "./dosage/index.js";
28
29
  export * from "./spectral/index.js";
29
- export * from "./identifyAtomicMassOrAtomicNb.js";
30
- export * from "./recognizeRefractionOrReflectionAngles.js";
31
- export * from "./orderOfMagnitude.js";
32
30
  export * from "./power/index.js";
33
31
  /**exos pris des maths */
34
32
  export * from "../math/percent/findProportion.js";
@@ -1 +1 @@
1
- {"version":3,"file":"kineticEnergy.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/kineticEnergy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA6CF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAa/C,CAAC"}
1
+ {"version":3,"file":"kineticEnergy.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/kineticEnergy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA6DF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,CAAC"}