math-exercises 2.2.3 → 2.2.5

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 (500) hide show
  1. package/lib/exercises/exercise.d.ts +2 -1
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/digitDecimalRank.js +4 -4
  4. package/lib/exercises/math/calcul/digitRank.js +4 -4
  5. package/lib/exercises/math/calcul/digitRankNumber.d.ts +8 -0
  6. package/lib/exercises/math/calcul/digitRankNumber.d.ts.map +1 -0
  7. package/lib/exercises/math/calcul/digitRankNumber.js +57 -0
  8. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +34 -0
  10. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
  11. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +17 -0
  12. package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
  13. package/lib/exercises/math/calcul/fractions/fractionsDivision.js +23 -0
  14. package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
  15. package/lib/exercises/math/calcul/fractions/fractionsProduct.js +15 -0
  16. package/lib/exercises/math/calcul/index.d.ts +1 -0
  17. package/lib/exercises/math/calcul/index.d.ts.map +1 -1
  18. package/lib/exercises/math/calcul/index.js +1 -0
  19. package/lib/exercises/math/calcul/proportionality/index.d.ts +2 -0
  20. package/lib/exercises/math/calcul/proportionality/index.d.ts.map +1 -1
  21. package/lib/exercises/math/calcul/proportionality/index.js +2 -0
  22. package/lib/exercises/math/calcul/proportionality/scaleCalculation.d.ts +9 -0
  23. package/lib/exercises/math/calcul/proportionality/scaleCalculation.d.ts.map +1 -0
  24. package/lib/exercises/math/calcul/proportionality/scaleCalculation.js +90 -0
  25. package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts +9 -0
  26. package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts.map +1 -0
  27. package/lib/exercises/math/calcul/proportionality/scaleUsage.js +95 -0
  28. package/lib/exercises/math/calcul/rounding/rounding.d.ts.map +1 -1
  29. package/lib/exercises/math/calcul/rounding/rounding.js +18 -0
  30. package/lib/exercises/math/calculLitteral/distributivity/allIdentities.d.ts.map +1 -1
  31. package/lib/exercises/math/calculLitteral/distributivity/allIdentities.js +1 -0
  32. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.d.ts +7 -0
  33. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.d.ts.map +1 -0
  34. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.js +60 -0
  35. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
  36. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.js +31 -1
  37. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts +9 -0
  38. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map +1 -0
  39. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +86 -0
  40. package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
  41. package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.js +21 -2
  42. package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +2 -0
  43. package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
  44. package/lib/exercises/math/calculLitteral/distributivity/index.js +2 -0
  45. package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
  46. package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +23 -2
  47. package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
  48. package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.js +17 -2
  49. package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
  50. package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.js +21 -2
  51. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
  52. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +26 -1
  53. package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
  54. package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.js +18 -2
  55. package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
  56. package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +19 -2
  57. package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
  58. package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +15 -2
  59. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
  60. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +20 -5
  61. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
  62. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.js +24 -1
  63. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.d.ts.map +1 -1
  64. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +20 -1
  65. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.d.ts.map +1 -1
  66. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.js +19 -3
  67. package/lib/exercises/math/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
  68. package/lib/exercises/math/calculLitteral/equation/fractionEquation.js +24 -8
  69. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  70. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +21 -2
  71. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  72. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +24 -4
  73. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  74. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +25 -5
  75. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  76. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +19 -0
  77. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  78. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +1 -0
  79. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.d.ts +8 -0
  80. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.d.ts.map +1 -0
  81. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.js +77 -0
  82. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts +8 -0
  83. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts.map +1 -0
  84. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.js +80 -0
  85. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +2 -0
  86. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  87. package/lib/exercises/math/calculLitteral/factorisation/index.js +2 -0
  88. package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
  89. package/lib/exercises/math/conversion/lengthConversion.js +18 -4
  90. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
  91. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +1 -0
  92. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts +10 -0
  93. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -0
  94. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +81 -0
  95. package/lib/exercises/math/functions/affines/index.d.ts +1 -0
  96. package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
  97. package/lib/exercises/math/functions/affines/index.js +1 -0
  98. package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
  99. package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +12 -2
  100. package/lib/exercises/math/functions/trinoms/index.d.ts +2 -0
  101. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  102. package/lib/exercises/math/functions/trinoms/index.js +2 -0
  103. package/lib/exercises/math/functions/trinoms/solveEquationByFactorisation.d.ts +5 -0
  104. package/lib/exercises/math/functions/trinoms/solveEquationByFactorisation.d.ts.map +1 -0
  105. package/lib/exercises/math/functions/trinoms/solveEquationByFactorisation.js +44 -0
  106. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.d.ts +9 -0
  107. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -0
  108. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.js +134 -0
  109. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.d.ts +7 -0
  110. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.d.ts.map +1 -0
  111. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.js +59 -0
  112. package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
  113. package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.js +1 -0
  114. package/lib/exercises/math/index.d.ts +1 -0
  115. package/lib/exercises/math/index.d.ts.map +1 -1
  116. package/lib/exercises/math/index.js +1 -0
  117. package/lib/exercises/math/percent/applyPercent.d.ts.map +1 -1
  118. package/lib/exercises/math/percent/applyPercent.js +20 -2
  119. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.d.ts +11 -0
  120. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.d.ts.map +1 -0
  121. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.js +49 -0
  122. package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -0
  123. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  124. package/lib/exercises/math/sequences/arithmetic/index.js +1 -0
  125. package/lib/exercises/math/spaceGeometry/index.d.ts +2 -0
  126. package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -0
  127. package/lib/exercises/math/spaceGeometry/index.js +17 -0
  128. package/lib/exercises/math/spaceGeometry/vectors/index.d.ts +4 -0
  129. package/lib/exercises/math/spaceGeometry/vectors/index.d.ts.map +1 -0
  130. package/lib/exercises/math/spaceGeometry/vectors/index.js +19 -0
  131. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts +5 -0
  132. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts.map +1 -0
  133. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +52 -0
  134. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.d.ts +5 -0
  135. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.d.ts.map +1 -0
  136. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.js +62 -0
  137. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts +9 -0
  138. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts.map +1 -0
  139. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +54 -0
  140. package/lib/exercises/math/squareRoots/squareRootIdentities.js +3 -3
  141. package/lib/exercises/math/suites/sequencePlot.d.ts.map +1 -1
  142. package/lib/exercises/math/suites/sequencePlot.js +1 -2
  143. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  144. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +1 -0
  145. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
  146. package/lib/exercises/pc/calibrationCurveOfSolution.js +2 -1
  147. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.d.ts +1 -1
  148. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.d.ts.map +1 -1
  149. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
  150. package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.d.ts +1 -1
  151. package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.d.ts.map +1 -1
  152. package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.js +3 -3
  153. package/lib/exercises/pc/chemicalElements/calculateVolumetricMass.d.ts.map +1 -1
  154. package/lib/exercises/pc/chemicalElements/calculateVolumetricMass.js +29 -4
  155. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.d.ts +1 -1
  156. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.d.ts.map +1 -1
  157. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.js +6 -6
  158. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.d.ts +1 -1
  159. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.d.ts.map +1 -1
  160. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.js +2 -1
  161. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.d.ts +1 -1
  162. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.d.ts.map +1 -1
  163. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.js +1 -1
  164. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.d.ts +1 -1
  165. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.d.ts.map +1 -1
  166. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.js +1 -1
  167. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.d.ts +1 -1
  168. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.d.ts.map +1 -1
  169. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +1 -1
  170. package/lib/exercises/pc/chemicalElements/index.d.ts +1 -0
  171. package/lib/exercises/pc/chemicalElements/index.d.ts.map +1 -1
  172. package/lib/exercises/pc/chemicalElements/index.js +1 -0
  173. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.d.ts +11 -0
  174. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.d.ts.map +1 -0
  175. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.js +100 -0
  176. package/lib/exercises/pc/chemicalEquations.d.ts +1 -1
  177. package/lib/exercises/pc/chemicalEquations.d.ts.map +1 -1
  178. package/lib/exercises/pc/chemicalEquations.js +1 -1
  179. package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.d.ts.map +1 -1
  180. package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.js +1 -0
  181. package/lib/exercises/pc/chemicalReactions/index.d.ts +2 -0
  182. package/lib/exercises/pc/chemicalReactions/index.d.ts.map +1 -1
  183. package/lib/exercises/pc/chemicalReactions/index.js +2 -0
  184. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts +5 -0
  185. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -0
  186. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +69 -0
  187. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.d.ts +11 -0
  188. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.d.ts.map +1 -0
  189. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.js +181 -0
  190. package/lib/exercises/pc/chemicalReactionsProduct.d.ts +1 -1
  191. package/lib/exercises/pc/chemicalReactionsProduct.d.ts.map +1 -1
  192. package/lib/exercises/pc/chemicalReactionsProduct.js +1 -1
  193. package/lib/exercises/pc/dosage/beerLambertRandomValue.d.ts.map +1 -1
  194. package/lib/exercises/pc/dosage/beerLambertRandomValue.js +2 -1
  195. package/lib/exercises/pc/dosage/concentrationCalculation.d.ts +10 -0
  196. package/lib/exercises/pc/dosage/concentrationCalculation.d.ts.map +1 -0
  197. package/lib/exercises/pc/dosage/concentrationCalculation.js +119 -0
  198. package/lib/exercises/pc/dosage/concentrationFromMassCalculation.d.ts +10 -0
  199. package/lib/exercises/pc/dosage/concentrationFromMassCalculation.d.ts.map +1 -0
  200. package/lib/exercises/pc/dosage/concentrationFromMassCalculation.js +117 -0
  201. package/lib/exercises/pc/dosage/index.d.ts +2 -0
  202. package/lib/exercises/pc/dosage/index.d.ts.map +1 -1
  203. package/lib/exercises/pc/dosage/index.js +2 -0
  204. package/lib/exercises/pc/electricity/calculateIntensity.d.ts +8 -0
  205. package/lib/exercises/pc/electricity/calculateIntensity.d.ts.map +1 -0
  206. package/lib/exercises/pc/electricity/calculateIntensity.js +60 -0
  207. package/lib/exercises/pc/electricity/calculateIntensityInSerieOrParallel.d.ts +10 -0
  208. package/lib/exercises/pc/electricity/calculateIntensityInSerieOrParallel.d.ts.map +1 -0
  209. package/lib/exercises/pc/electricity/calculateIntensityInSerieOrParallel.js +105 -0
  210. package/lib/exercises/pc/electricity/calculateVoltage.d.ts +11 -0
  211. package/lib/exercises/pc/electricity/calculateVoltage.d.ts.map +1 -0
  212. package/lib/exercises/pc/electricity/calculateVoltage.js +144 -0
  213. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.d.ts +9 -0
  214. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.d.ts.map +1 -0
  215. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.js +81 -0
  216. package/lib/exercises/pc/electricity/index.d.ts +7 -0
  217. package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
  218. package/lib/exercises/pc/electricity/index.js +7 -0
  219. package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.d.ts +10 -0
  220. package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.d.ts.map +1 -0
  221. package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.js +110 -0
  222. package/lib/exercises/pc/electricity/ohmLaw.d.ts +11 -0
  223. package/lib/exercises/pc/electricity/ohmLaw.d.ts.map +1 -0
  224. package/lib/exercises/pc/electricity/ohmLaw.js +123 -0
  225. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts +5 -0
  226. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -0
  227. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +95 -0
  228. package/lib/exercises/pc/energy/calorificValue.d.ts +8 -0
  229. package/lib/exercises/pc/energy/calorificValue.d.ts.map +1 -0
  230. package/lib/exercises/pc/energy/calorificValue.js +78 -0
  231. package/lib/exercises/pc/energy/combustionTransferEnergy.d.ts +8 -0
  232. package/lib/exercises/pc/energy/combustionTransferEnergy.d.ts.map +1 -0
  233. package/lib/exercises/pc/energy/combustionTransferEnergy.js +78 -0
  234. package/lib/exercises/pc/energy/combustionTransferEnergy2.d.ts +11 -0
  235. package/lib/exercises/pc/energy/combustionTransferEnergy2.d.ts.map +1 -0
  236. package/lib/exercises/pc/energy/combustionTransferEnergy2.js +141 -0
  237. package/lib/exercises/pc/energy/efficencyOfConverter.d.ts +8 -0
  238. package/lib/exercises/pc/energy/efficencyOfConverter.d.ts.map +1 -0
  239. package/lib/exercises/pc/energy/efficencyOfConverter.js +84 -0
  240. package/lib/exercises/pc/energy/efficiencyCalculation.d.ts +10 -0
  241. package/lib/exercises/pc/energy/efficiencyCalculation.d.ts.map +1 -0
  242. package/lib/exercises/pc/energy/efficiencyCalculation.js +122 -0
  243. package/lib/exercises/pc/energy/energyTransfer.d.ts +10 -0
  244. package/lib/exercises/pc/energy/energyTransfer.d.ts.map +1 -0
  245. package/lib/exercises/pc/energy/energyTransfer.js +67 -0
  246. package/lib/exercises/pc/energy/index.d.ts +9 -0
  247. package/lib/exercises/pc/energy/index.d.ts.map +1 -0
  248. package/lib/exercises/pc/energy/index.js +24 -0
  249. package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.d.ts +10 -0
  250. package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.d.ts.map +1 -0
  251. package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.js +168 -0
  252. package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.d.ts +11 -0
  253. package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.d.ts.map +1 -0
  254. package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.js +143 -0
  255. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts +8 -0
  256. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -0
  257. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +102 -0
  258. package/lib/exercises/pc/forces/electroStaticForce.d.ts +13 -0
  259. package/lib/exercises/pc/forces/electroStaticForce.d.ts.map +1 -0
  260. package/lib/exercises/pc/forces/electroStaticForce.js +117 -0
  261. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.d.ts +9 -0
  262. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.d.ts.map +1 -0
  263. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.js +132 -0
  264. package/lib/exercises/pc/forces/gravitationalAttractionValue.d.ts +1 -0
  265. package/lib/exercises/pc/forces/gravitationalAttractionValue.d.ts.map +1 -1
  266. package/lib/exercises/pc/forces/gravitationalAttractionValue.js +31 -27
  267. package/lib/exercises/pc/forces/gravitationalForcePlanets.d.ts +10 -0
  268. package/lib/exercises/pc/forces/gravitationalForcePlanets.d.ts.map +1 -0
  269. package/lib/exercises/pc/forces/gravitationalForcePlanets.js +118 -0
  270. package/lib/exercises/pc/forces/index.d.ts +5 -0
  271. package/lib/exercises/pc/forces/index.d.ts.map +1 -1
  272. package/lib/exercises/pc/forces/index.js +6 -0
  273. package/lib/exercises/pc/forces/massWeight.d.ts +9 -0
  274. package/lib/exercises/pc/forces/massWeight.d.ts.map +1 -0
  275. package/lib/exercises/pc/forces/massWeight.js +68 -0
  276. package/lib/exercises/pc/forces/pressureDifferenceCalculation.d.ts +1 -0
  277. package/lib/exercises/pc/forces/pressureDifferenceCalculation.d.ts.map +1 -0
  278. package/lib/exercises/pc/forces/pressureDifferenceCalculation.js +106 -0
  279. package/lib/exercises/pc/formulaFromComposition.js +2 -2
  280. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts +8 -0
  281. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts.map +1 -0
  282. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +72 -0
  283. package/lib/exercises/pc/index.d.ts +6 -0
  284. package/lib/exercises/pc/index.d.ts.map +1 -1
  285. package/lib/exercises/pc/index.js +6 -0
  286. package/lib/exercises/pc/molarQuantity.js +2 -2
  287. package/lib/exercises/pc/mole/index.d.ts +2 -0
  288. package/lib/exercises/pc/mole/index.d.ts.map +1 -1
  289. package/lib/exercises/pc/mole/index.js +2 -0
  290. package/lib/exercises/pc/mole/molarMass.js +1 -1
  291. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.d.ts +9 -0
  292. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.d.ts.map +1 -0
  293. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.js +75 -0
  294. package/lib/exercises/pc/mole/moleculeCountFromMol.d.ts +7 -0
  295. package/lib/exercises/pc/mole/moleculeCountFromMol.d.ts.map +1 -0
  296. package/lib/exercises/pc/mole/moleculeCountFromMol.js +66 -0
  297. package/lib/exercises/pc/moleculeFormula.js +1 -1
  298. package/lib/exercises/pc/moleculeNomenclature.js +1 -1
  299. package/lib/exercises/pc/motion/averageSpeed.d.ts +12 -0
  300. package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -0
  301. package/lib/exercises/pc/motion/averageSpeed.js +122 -0
  302. package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts +10 -0
  303. package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -0
  304. package/lib/exercises/pc/motion/averageSpeedCalculation.js +146 -0
  305. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.d.ts +7 -0
  306. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.d.ts.map +1 -0
  307. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.js +86 -0
  308. package/lib/exercises/pc/motion/index.d.ts +7 -0
  309. package/lib/exercises/pc/motion/index.d.ts.map +1 -0
  310. package/lib/exercises/pc/motion/index.js +22 -0
  311. package/lib/exercises/pc/motion/motionReference.d.ts +9 -0
  312. package/lib/exercises/pc/motion/motionReference.d.ts.map +1 -0
  313. package/lib/exercises/pc/motion/motionReference.js +168 -0
  314. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts +5 -0
  315. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -0
  316. package/lib/exercises/pc/motion/typeOfAcceleration.js +97 -0
  317. package/lib/exercises/pc/motion/typeOfMovement.d.ts +5 -0
  318. package/lib/exercises/pc/motion/typeOfMovement.d.ts.map +1 -0
  319. package/lib/exercises/pc/motion/typeOfMovement.js +111 -0
  320. package/lib/exercises/pc/orderOfMagnitude.d.ts +8 -0
  321. package/lib/exercises/pc/orderOfMagnitude.d.ts.map +1 -0
  322. package/lib/exercises/pc/orderOfMagnitude.js +68 -0
  323. package/lib/exercises/pc/pH.d.ts.map +1 -1
  324. package/lib/exercises/pc/pH.js +1 -0
  325. package/lib/exercises/pc/potentialEnergy.d.ts.map +1 -1
  326. package/lib/exercises/pc/potentialEnergy.js +17 -5
  327. package/lib/exercises/pc/power/calculatePowerOfLight.d.ts +8 -0
  328. package/lib/exercises/pc/power/calculatePowerOfLight.d.ts.map +1 -0
  329. package/lib/exercises/pc/power/calculatePowerOfLight.js +86 -0
  330. package/lib/exercises/pc/power/index.d.ts +2 -0
  331. package/lib/exercises/pc/power/index.d.ts.map +1 -0
  332. package/lib/exercises/pc/power/index.js +17 -0
  333. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +5 -0
  334. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -0
  335. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +117 -0
  336. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.d.ts +9 -0
  337. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.d.ts.map +1 -0
  338. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.js +95 -0
  339. package/lib/exercises/pc/sound/index.d.ts +1 -0
  340. package/lib/exercises/pc/sound/index.d.ts.map +1 -1
  341. package/lib/exercises/pc/sound/index.js +1 -0
  342. package/lib/exercises/pc/spectral/spectralEnergy.d.ts.map +1 -1
  343. package/lib/exercises/pc/spectral/spectralEnergy.js +1 -0
  344. package/lib/exercises/pc/waves/index.d.ts +1 -0
  345. package/lib/exercises/pc/waves/index.d.ts.map +1 -1
  346. package/lib/exercises/pc/waves/index.js +1 -0
  347. package/lib/exercises/pc/waves/lightDistanceConversion.d.ts +10 -0
  348. package/lib/exercises/pc/waves/lightDistanceConversion.d.ts.map +1 -0
  349. package/lib/exercises/pc/waves/lightDistanceConversion.js +161 -0
  350. package/lib/exercises/pc/waves/periodicWaveCelerity.d.ts.map +1 -1
  351. package/lib/exercises/pc/waves/periodicWaveCelerity.js +1 -0
  352. package/lib/exercises/pc/weight/calculateWeight.d.ts +7 -0
  353. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -0
  354. package/lib/exercises/pc/weight/calculateWeight.js +73 -0
  355. package/lib/exercises/pc/weight/index.d.ts +1 -0
  356. package/lib/exercises/pc/weight/index.d.ts.map +1 -1
  357. package/lib/exercises/pc/weight/index.js +1 -0
  358. package/lib/exercises/pc/weight/weightOnTheMoon.d.ts.map +1 -1
  359. package/lib/exercises/pc/weight/weightOnTheMoon.js +7 -6
  360. package/lib/exercises/utils/getAtoms.d.ts +1 -1
  361. package/lib/exercises/utils/getAtoms.d.ts.map +1 -1
  362. package/lib/exercises/utils/getAtoms.js +1 -1
  363. package/lib/index.d.ts +216 -75
  364. package/lib/index.d.ts.map +1 -1
  365. package/lib/index.js +4 -0
  366. package/lib/math/geometry/spacePoint.d.ts +27 -0
  367. package/lib/math/geometry/spacePoint.d.ts.map +1 -0
  368. package/lib/math/geometry/spacePoint.js +80 -0
  369. package/lib/math/geometry/spaceVector.d.ts +28 -0
  370. package/lib/math/geometry/spaceVector.d.ts.map +1 -0
  371. package/lib/math/geometry/spaceVector.js +83 -0
  372. package/lib/math/numbers/decimals/decimal.d.ts +1 -0
  373. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  374. package/lib/math/numbers/decimals/decimal.js +8 -0
  375. package/lib/math/numbers/rationals/rational.d.ts +1 -0
  376. package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
  377. package/lib/math/numbers/rationals/rational.js +4 -0
  378. package/lib/math/numbers/reals/extendedRingElement.d.ts +1 -2
  379. package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -1
  380. package/lib/math/polynomials/affine.d.ts +4 -0
  381. package/lib/math/polynomials/affine.d.ts.map +1 -1
  382. package/lib/math/polynomials/affine.js +10 -0
  383. package/lib/math/polynomials/trinom.d.ts +2 -1
  384. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  385. package/lib/math/polynomials/trinom.js +3 -0
  386. package/lib/pc/constants/atoms.d.ts +0 -1
  387. package/lib/pc/constants/atoms.d.ts.map +1 -1
  388. package/lib/pc/constants/atoms.js +2 -2
  389. package/lib/pc/constants/coulomb.d.ts +3 -0
  390. package/lib/pc/constants/coulomb.d.ts.map +1 -0
  391. package/lib/pc/constants/coulomb.js +13 -0
  392. package/lib/pc/constants/earth.d.ts +0 -1
  393. package/lib/pc/constants/earth.d.ts.map +1 -1
  394. package/lib/pc/constants/earth.js +4 -4
  395. package/lib/pc/constants/gravity.d.ts +1 -1
  396. package/lib/pc/constants/gravity.d.ts.map +1 -1
  397. package/lib/pc/constants/gravity.js +16 -7
  398. package/lib/pc/constants/mechanics/gravitational.d.ts +14 -0
  399. package/lib/pc/constants/mechanics/gravitational.d.ts.map +1 -0
  400. package/lib/pc/constants/mechanics/gravitational.js +37 -0
  401. package/lib/pc/constants/mechanics/planets.d.ts +15 -0
  402. package/lib/pc/constants/mechanics/planets.d.ts.map +1 -0
  403. package/lib/pc/constants/mechanics/planets.js +35 -0
  404. package/lib/pc/constants/mechanics/waves.d.ts +8 -0
  405. package/lib/pc/constants/mechanics/waves.d.ts.map +1 -0
  406. package/lib/pc/constants/mechanics/waves.js +8 -0
  407. package/lib/pc/constants/molecularChemistry/atomSymbols.d.ts +2 -0
  408. package/lib/pc/constants/molecularChemistry/atomSymbols.d.ts.map +1 -0
  409. package/lib/pc/constants/molecularChemistry/atomSymbols.js +2 -0
  410. package/lib/pc/constants/molecularChemistry/atome.d.ts +18 -0
  411. package/lib/pc/constants/molecularChemistry/atome.d.ts.map +1 -0
  412. package/lib/pc/constants/molecularChemistry/atome.js +174 -0
  413. package/lib/pc/constants/molecularChemistry/atoms.d.ts +9 -0
  414. package/lib/pc/constants/molecularChemistry/atoms.d.ts.map +1 -0
  415. package/lib/pc/constants/molecularChemistry/atoms.js +15 -0
  416. package/lib/pc/constants/molecularChemistry/molecule.d.ts +25 -0
  417. package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -0
  418. package/lib/pc/constants/molecularChemistry/molecule.js +579 -0
  419. package/lib/pc/constants/molecularChemistry/reaction.d.ts +27 -0
  420. package/lib/pc/constants/molecularChemistry/reaction.d.ts.map +1 -0
  421. package/lib/pc/constants/molecularChemistry/reaction.js +471 -0
  422. package/lib/pc/measure/measure.d.ts +16 -6
  423. package/lib/pc/measure/measure.d.ts.map +1 -1
  424. package/lib/pc/measure/measure.js +112 -16
  425. package/lib/pc/units/AmountOfSubstance.d.ts +17 -0
  426. package/lib/pc/units/AmountOfSubstance.d.ts.map +1 -0
  427. package/lib/pc/units/AmountOfSubstance.js +40 -0
  428. package/lib/pc/units/PressionUnit.d.ts +17 -0
  429. package/lib/pc/units/PressionUnit.d.ts.map +1 -0
  430. package/lib/pc/units/PressionUnit.js +32 -0
  431. package/lib/pc/units/distanceUnits.d.ts +16 -0
  432. package/lib/pc/units/distanceUnits.d.ts.map +1 -0
  433. package/lib/pc/units/distanceUnits.js +32 -0
  434. package/lib/pc/units/divideUnit.d.ts +13 -0
  435. package/lib/pc/units/divideUnit.d.ts.map +1 -0
  436. package/lib/pc/units/divideUnit.js +32 -0
  437. package/lib/pc/units/electricalChargeUnit.d.ts +17 -0
  438. package/lib/pc/units/electricalChargeUnit.d.ts.map +1 -0
  439. package/lib/pc/units/electricalChargeUnit.js +40 -0
  440. package/lib/pc/units/electricalResistanceUnit.d.ts +18 -0
  441. package/lib/pc/units/electricalResistanceUnit.d.ts.map +1 -0
  442. package/lib/pc/units/electricalResistanceUnit.js +32 -0
  443. package/lib/pc/units/electricalUnit.d.ts +18 -0
  444. package/lib/pc/units/electricalUnit.d.ts.map +1 -0
  445. package/lib/pc/units/electricalUnit.js +32 -0
  446. package/lib/pc/units/energyUnit.d.ts +16 -0
  447. package/lib/pc/units/energyUnit.d.ts.map +1 -0
  448. package/lib/pc/units/energyUnit.js +32 -0
  449. package/lib/pc/units/forceUnits.d.ts +16 -0
  450. package/lib/pc/units/forceUnits.d.ts.map +1 -0
  451. package/lib/pc/units/forceUnits.js +32 -0
  452. package/lib/pc/units/frequenceUnit.d.ts +17 -0
  453. package/lib/pc/units/frequenceUnit.d.ts.map +1 -0
  454. package/lib/pc/units/frequenceUnit.js +40 -0
  455. package/lib/pc/units/interfaces/baseTenUnit.d.ts +10 -0
  456. package/lib/pc/units/interfaces/baseTenUnit.d.ts.map +1 -0
  457. package/lib/pc/units/interfaces/baseTenUnit.js +16 -0
  458. package/lib/pc/units/interfaces/basicUnit.d.ts +13 -0
  459. package/lib/pc/units/interfaces/basicUnit.d.ts.map +1 -0
  460. package/lib/pc/units/interfaces/basicUnit.js +19 -0
  461. package/lib/pc/units/interfaces/unit.d.ts +13 -0
  462. package/lib/pc/units/interfaces/unit.d.ts.map +1 -0
  463. package/lib/pc/units/interfaces/unit.js +2 -0
  464. package/lib/pc/units/massUnits.d.ts +17 -0
  465. package/lib/pc/units/massUnits.d.ts.map +1 -0
  466. package/lib/pc/units/massUnits.js +32 -0
  467. package/lib/pc/units/mulitplyUnits.d.ts +13 -0
  468. package/lib/pc/units/mulitplyUnits.d.ts.map +1 -0
  469. package/lib/pc/units/mulitplyUnits.js +26 -0
  470. package/lib/pc/units/powerUnits.d.ts +14 -0
  471. package/lib/pc/units/powerUnits.d.ts.map +1 -0
  472. package/lib/pc/units/powerUnits.js +26 -0
  473. package/lib/pc/units/timeUnits.d.ts +13 -0
  474. package/lib/pc/units/timeUnits.d.ts.map +1 -0
  475. package/lib/pc/units/timeUnits.js +42 -0
  476. package/lib/pc/units/volumeUnit.d.ts +17 -0
  477. package/lib/pc/units/volumeUnit.d.ts.map +1 -0
  478. package/lib/pc/units/volumeUnit.js +32 -0
  479. package/lib/pc/units/wattUnit.d.ts +17 -0
  480. package/lib/pc/units/wattUnit.d.ts.map +1 -0
  481. package/lib/pc/units/wattUnit.js +32 -0
  482. package/lib/playground.d.ts +2 -0
  483. package/lib/playground.d.ts.map +1 -0
  484. package/lib/playground.js +19 -0
  485. package/lib/server.d.ts +3 -0
  486. package/lib/server.d.ts.map +1 -1
  487. package/lib/server.js +11 -5
  488. package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
  489. package/lib/tree/nodes/equations/equationSolutionNode.js +8 -0
  490. package/lib/tree/nodes/node.d.ts +4 -0
  491. package/lib/tree/nodes/node.d.ts.map +1 -1
  492. package/lib/tree/nodes/operators/addNode.js +2 -2
  493. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  494. package/lib/tree/nodes/operators/multiplyNode.js +40 -12
  495. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  496. package/lib/tree/nodes/operators/powerNode.js +12 -0
  497. package/lib/utils/alignTex.d.ts +2 -0
  498. package/lib/utils/alignTex.d.ts.map +1 -0
  499. package/lib/utils/alignTex.js +18 -0
  500. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalReactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalReactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC"}
@@ -18,3 +18,5 @@ __exportStar(require("./calculateSynthesisEfficiency"), exports);
18
18
  __exportStar(require("./calculateCombustionEnergy"), exports);
19
19
  __exportStar(require("./identifyLimitingReagent"), exports);
20
20
  __exportStar(require("./identifyStoichiometricMixture"), exports);
21
+ __exportStar(require("./stoichiometricReaction"), exports);
22
+ __exportStar(require("./titrationEquivalenceRelation"), exports);
@@ -0,0 +1,5 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {};
3
+ export declare const stoichiometricReaction: Exercise<Identifiers>;
4
+ export {};
5
+ //# sourceMappingURL=stoichiometricReaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stoichiometricReaction.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalReactions/stoichiometricReaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAyDtB,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stoichiometricReaction = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const randint_1 = require("../../../math/utils/random/randint");
7
+ const measure_1 = require("../../../pc/measure/measure");
8
+ const AmountOfSubstance_1 = require("../../../pc/units/AmountOfSubstance");
9
+ const coinFlip_1 = require("../../../utils/coinFlip");
10
+ const getStoichiometricReactionQuestion = () => {
11
+ const exo = genearteExercise();
12
+ const question = {
13
+ answer: exo.answer,
14
+ instruction: exo.instruction,
15
+ keys: [],
16
+ answerFormat: "raw",
17
+ identifiers: {},
18
+ };
19
+ return question;
20
+ };
21
+ const getPropositions = (n, { answer }) => {
22
+ const propositions = [];
23
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
24
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Oui.", "raw");
25
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Non.", "raw");
26
+ (0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir.", "raw");
27
+ return (0, exercise_1.shuffleProps)(propositions, n);
28
+ };
29
+ const isAnswerValid = (ans, { answer }) => {
30
+ return ans === answer;
31
+ };
32
+ const genearteExercise = () => {
33
+ const answer = (0, coinFlip_1.coinFlip)() ? "Oui." : "Non.";
34
+ const a = (0, randint_1.randint)(2, 9);
35
+ const b = (0, randint_1.randint)(2, 9);
36
+ const c = (0, randint_1.randint)(2, 9);
37
+ const d = (0, randint_1.randint)(2, 9);
38
+ const nA = answer === "Oui." ? a * (0, randint_1.randint)(2, 5) : a * (0, randint_1.randint)(2, 6);
39
+ const nB = answer === "Oui." ? b * (nA / a) : b * (0, randint_1.randint)(6, 11);
40
+ const nAMeasure = new measure_1.Measure(nA, 0, AmountOfSubstance_1.AmountOfSubstance.mol);
41
+ const nBMeasure = new measure_1.Measure(nB, 0, AmountOfSubstance_1.AmountOfSubstance.mol);
42
+ const nCMeasure = new measure_1.Measure((0, randint_1.randint)(2, 20), 0, AmountOfSubstance_1.AmountOfSubstance.mol);
43
+ const nDMeasure = new measure_1.Measure((0, randint_1.randint)(2, 20), 0, AmountOfSubstance_1.AmountOfSubstance.mol);
44
+ const instruction = `Soit la réaction chimique, $${a}A + ${b}B \\rightarrow ${c}C + ${d}D$. Déterminer si elle est stochiométrique, en sachant :
45
+ - $n(A) = ${nAMeasure.toTex({ notScientific: true })}$
46
+ - $n(B) = ${nBMeasure.toTex({ notScientific: true })}$
47
+ - $n(C) = ${nCMeasure.toTex({ notScientific: true })}$
48
+ - $n(D) = ${nDMeasure.toTex({ notScientific: true })}$`;
49
+ return {
50
+ instruction,
51
+ answer,
52
+ nA,
53
+ nB,
54
+ };
55
+ };
56
+ exports.stoichiometricReaction = {
57
+ id: "stoichiometricReaction",
58
+ label: "Déterminer si une réaction est stochiométrique",
59
+ levels: ["1reSpé"],
60
+ isSingleStep: true,
61
+ sections: ["Réaction chimique"],
62
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getStoichiometricReactionQuestion, nb),
63
+ qcmTimer: 60,
64
+ freeTimer: 60,
65
+ getPropositions,
66
+ isAnswerValid,
67
+ answerType: "QCM",
68
+ subject: "Physique",
69
+ };
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ vA: number;
6
+ vB: number;
7
+ cB: number;
8
+ };
9
+ export declare const titrationEquivalenceRelation: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=titrationEquivalenceRelation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"titrationEquivalenceRelation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalReactions/titrationEquivalenceRelation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAwMF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAgB9D,CAAC"}
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.titrationEquivalenceRelation = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const frenchify_1 = require("../../../math/utils/latex/frenchify");
7
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
8
+ const randint_1 = require("../../../math/utils/random/randint");
9
+ const round_1 = require("../../../math/utils/round");
10
+ const measure_1 = require("../../../pc/measure/measure");
11
+ const AmountOfSubstance_1 = require("../../../pc/units/AmountOfSubstance");
12
+ const divideUnit_1 = require("../../../pc/units/divideUnit");
13
+ const volumeUnit_1 = require("../../../pc/units/volumeUnit");
14
+ const random_1 = require("../../../utils/random");
15
+ const titrationReactions = [
16
+ {
17
+ titré: { name: "de l'acide chlorhydrique", symbol: "HCl" },
18
+ titrant: { name: "de l'hydroxyde de sodium", symbol: "NaOH" },
19
+ produit: "NaCl + H₂O",
20
+ coeff: [1, 1],
21
+ },
22
+ {
23
+ titré: { name: "de l'acide acétique", symbol: "CH₃COOH" },
24
+ titrant: { name: "de l'hydroxyde de sodium", symbol: "NaOH" },
25
+ produit: "CH₃COONa + H₂O",
26
+ coeff: [1, 1],
27
+ },
28
+ {
29
+ titré: { name: "de l'acide sulfurique", symbol: "H₂SO₄" },
30
+ titrant: { name: "de l'hydroxyde de sodium", symbol: "NaOH" },
31
+ produit: "Na₂SO₄ + H₂O",
32
+ coeff: [1, 2],
33
+ },
34
+ {
35
+ titré: { name: "de l'acide nitrique", symbol: "HNO₃" },
36
+ titrant: { name: "de l'hydroxyde de sodium", symbol: "NaOH" },
37
+ produit: "NaNO₃ + H₂O",
38
+ coeff: [1, 1],
39
+ },
40
+ {
41
+ titré: { name: "de l'acide oxalique", symbol: "H₂C₂O₄" },
42
+ titrant: { name: "du permanganate de potassium", symbol: "KMnO₄" },
43
+ produit: "MnSO₄ + CO₂ + H₂O",
44
+ coeff: [5, 2],
45
+ },
46
+ {
47
+ titré: { name: "du chlorure de sodium", symbol: "NaCl" },
48
+ titrant: { name: "du nitrate d'argent", symbol: "AgNO₃" },
49
+ produit: "AgCl + NaNO₃",
50
+ coeff: [1, 1],
51
+ },
52
+ {
53
+ titré: { name: "de l'acide ascorbique", symbol: "C₆H₈O₆" },
54
+ titrant: { name: "de l'iode", symbol: "I₂" },
55
+ produit: "C₆H₆O₆ + HI",
56
+ coeff: [1, 1],
57
+ },
58
+ {
59
+ titré: { name: "de l'hydroxyde de calcium", symbol: "Ca(OH)₂" },
60
+ titrant: { name: "de l'acide chlorhydrique", symbol: "HCl" },
61
+ produit: "CaCl₂ + H₂O",
62
+ coeff: [1, 2],
63
+ },
64
+ {
65
+ titré: { name: "de l'acide phosphorique", symbol: "H₃PO₄" },
66
+ titrant: { name: "de l'hydroxyde de sodium", symbol: "NaOH" },
67
+ produit: "Na₃PO₄ + H₂O",
68
+ coeff: [1, 3],
69
+ },
70
+ {
71
+ titré: { name: "de l'acide borique", symbol: "H₃BO₃" },
72
+ titrant: { name: "de l'hydroxyde de sodium", symbol: "NaOH" },
73
+ produit: "NaB(OH)₄",
74
+ coeff: [1, 1],
75
+ },
76
+ ];
77
+ const getTitrationEquivalenceRelationQuestion = () => {
78
+ const exo = generateExo();
79
+ const question = {
80
+ answer: exo.answer.toTex(),
81
+ instruction: exo.instruction,
82
+ keys: [],
83
+ hint: exo.hint,
84
+ correction: exo.correction,
85
+ answerFormat: "tex",
86
+ identifiers: {
87
+ a: exo.a,
88
+ b: exo.b,
89
+ vA: exo.vA.getValueAsNumber(),
90
+ vB: exo.vB.getValueAsNumber(),
91
+ cB: exo.cB.getValueAsNumber(),
92
+ },
93
+ };
94
+ return question;
95
+ };
96
+ const getPropositions = (n, { answer, a, b, vA, vB, cB }) => {
97
+ const propositions = [];
98
+ (0, exercise_1.addValidProp)(propositions, answer);
99
+ const correctAns = (0, round_1.round)((b * vB * cB) / (a * vA), 2);
100
+ const unit = new divideUnit_1.DivideUnit(AmountOfSubstance_1.AmountOfSubstance.mol, volumeUnit_1.VolumeUnit.mL);
101
+ let random;
102
+ while (propositions.length < n) {
103
+ random = (0, randfloat_1.randfloat)(correctAns - 1, correctAns + 2, 2, [correctAns]);
104
+ (0, exercise_1.tryToAddWrongProp)(propositions, new measure_1.Measure(Math.abs(random), 0, unit).toTex());
105
+ }
106
+ return (0, exercise_1.shuffleProps)(propositions, n);
107
+ };
108
+ const isAnswerValid = (ans, { answer, a, b, vA, vB, cB }) => {
109
+ const correctAns = (0, round_1.round)((b * vB * cB) / (a * vA), 2);
110
+ const unit = new divideUnit_1.DivideUnit(AmountOfSubstance_1.AmountOfSubstance.mol, volumeUnit_1.VolumeUnit.mL);
111
+ return [
112
+ answer,
113
+ (0, frenchify_1.frenchify)(correctAns),
114
+ answer.replace(`\\ ${unit.toTex()}`, ""),
115
+ ].includes(ans);
116
+ };
117
+ const generateExo = () => {
118
+ const reaction = (0, random_1.random)(titrationReactions);
119
+ const vA = new measure_1.Measure(5 * (0, randint_1.randint)(2, 11), 0, volumeUnit_1.VolumeUnit.mL);
120
+ const cB = new measure_1.Measure((0, random_1.random)([0.05, 0.1, 0.2, 0.25, 0.5, 0.75, 1.0]), 0, new divideUnit_1.DivideUnit(AmountOfSubstance_1.AmountOfSubstance.mol, volumeUnit_1.VolumeUnit.mL));
121
+ const vB = new measure_1.Measure(5 * (0, randint_1.randint)(1, 11), 0, volumeUnit_1.VolumeUnit.mL);
122
+ const reactionString = `${reaction.coeff[0] !== 1 ? reaction.coeff[0] : ""}${reaction.titré.symbol} + ${reaction.coeff[1] !== 1 ? reaction.coeff[1] : ""}${reaction.titrant.symbol} \\Rightarrow ${reaction.produit}`;
123
+ const hint = `Rappel : Au point d'équivalence, les quantités de matière ${reaction.titré.name} et ${reaction.titrant.name} sont égales , c'est-à-dire :
124
+
125
+ - $${reaction.coeff[0]} \\times n(${reaction.titré.symbol}) = ${reaction.coeff[1]} \\times n(${reaction.titrant.symbol})$`;
126
+ const instruction = `On réalise un titrage entre une solution ${reaction.titré.name}$(${reaction.titré.symbol})$ et une solution ${reaction.titrant.name}$(${reaction.titrant.symbol})$.
127
+
128
+ - On prélève un volume de $V_A=${vA.toTex({
129
+ notScientific: true,
130
+ })}$ de la solution ${reaction.titré.name} de concentration inconnue $C_A$
131
+ - On ajoute progressivement une solution ${reaction.titrant.name} de concentration connue $C_B=${cB.toTex({ notScientific: true })}$
132
+ - Le volume ${reaction.titrant.name} nécessaire pour atteindre le point d'équivalence est $V_B=${vB.toTex({
133
+ notScientific: true,
134
+ })}$
135
+ - Réaction : $${reactionString}$
136
+
137
+ Calculer la concentration $C_A$ de (${reaction.titré.name}), arrondie au centiéme.
138
+ `;
139
+ const answer = cB
140
+ .times(vB)
141
+ .times(reaction.coeff[1])
142
+ .divide(vA.times(reaction.coeff[0]))
143
+ .toSignificant(2);
144
+ const correction = `Utiliser la relation d'équivalence du titrage :
145
+
146
+ Au point d'équivalence, les quantités de matière ${reaction.titré.name} et ${reaction.titrant.name} sont égales , c'est-à-dire :
147
+ - $${reaction.coeff[0]} \\times n(${reaction.titré.symbol}) = ${reaction.coeff[1]} \\times n(${reaction.titrant.symbol})$
148
+ - Or, la quantité de matière est donnée par : $n=C \\times V$
149
+ - Donc à l'équivalence : $a \\times C_A \\times V_A =b \\times C_B \\times V_B$
150
+ - Ce qui donne : $C_A = \\frac{b \\times C_B \\times V_B}{a \\times V_A} \\Rightarrow C_A = \\frac{${reaction.coeff[1]} \\times ${cB.toTex({ notScientific: true })} \\times ${vB.toTex({
151
+ notScientific: true,
152
+ })}}{${reaction.coeff[0]} \\times ${vA.toTex({
153
+ notScientific: true,
154
+ })}} \\Rightarrow C_A = ${answer.toTex({ notScientific: true })}$`;
155
+ return {
156
+ instruction,
157
+ answer,
158
+ hint,
159
+ correction,
160
+ vA,
161
+ vB,
162
+ cB,
163
+ a: reaction.coeff[0],
164
+ b: reaction.coeff[1],
165
+ };
166
+ };
167
+ exports.titrationEquivalenceRelation = {
168
+ id: "titrationEquivalenceRelation",
169
+ label: "Calculer la concentration d'un element titré à l'aide d'une équation de réaction d'un mélange stœchiométrique.",
170
+ levels: ["1reSpé"],
171
+ isSingleStep: true,
172
+ sections: ["Réaction chimique"],
173
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getTitrationEquivalenceRelationQuestion, nb, 10),
174
+ qcmTimer: 60,
175
+ freeTimer: 60,
176
+ getPropositions,
177
+ isAnswerValid,
178
+ maxAllowedQuestions: 10,
179
+ subject: "Physique",
180
+ hasHintAndCorrection: true,
181
+ };
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../exercises/exercise";
2
- import { ReactionSpecies } from "../../pc/molecularChemistry/reaction";
2
+ import { ReactionSpecies } from "../../pc/constants/molecularChemistry/reaction";
3
3
  type Identifiers = {
4
4
  reactionArray: ReactionSpecies[];
5
5
  randomSpacieIndex: number;
@@ -1 +1 @@
1
- {"version":3,"file":"chemicalReactionsProduct.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/chemicalReactionsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAEL,eAAe,EAEhB,MAAM,sCAAsC,CAAC;AAG9C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAyCF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAe1D,CAAC"}
1
+ {"version":3,"file":"chemicalReactionsProduct.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/chemicalReactionsProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAEL,eAAe,EAEhB,MAAM,gDAAgD,CAAC;AAGxD,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAyCF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAe1D,CAAC"}
@@ -4,7 +4,7 @@ exports.chemicalReactionsProduct = void 0;
4
4
  const exercise_1 = require("../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
6
6
  const randint_1 = require("../../math/utils/random/randint");
7
- const reaction_1 = require("../../pc/molecularChemistry/reaction");
7
+ const reaction_1 = require("../../pc/constants/molecularChemistry/reaction");
8
8
  const shuffle_1 = require("../../utils/shuffle");
9
9
  const getChemicalReactionsProduct = () => {
10
10
  const reaction = reaction_1.ReactionConstructor.randomReaction();
@@ -1 +1 @@
1
- {"version":3,"file":"beerLambertRandomValue.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/dosage/beerLambertRandomValue.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAmNF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAahE,CAAC"}
1
+ {"version":3,"file":"beerLambertRandomValue.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/dosage/beerLambertRandomValue.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAmNF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAchE,CAAC"}
@@ -5,11 +5,11 @@ const frenchify_1 = require("../../../math/utils/latex/frenchify");
5
5
  const exercise_1 = require("../../../exercises/exercise");
6
6
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
7
7
  const round_1 = require("../../../math/utils/round");
8
- const molecule_1 = require("../../../pc/molecularChemistry/molecule");
9
8
  const random_1 = require("../../../utils/random");
10
9
  const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
11
10
  const randfloat_1 = require("../../../math/utils/random/randfloat");
12
11
  const randint_1 = require("../../../math/utils/random/randint");
12
+ const molecule_1 = require("../../../pc/constants/molecularChemistry/molecule");
13
13
  const getBeerLambertRandomValueQuestion = () => {
14
14
  const molecule = (0, random_1.random)(molecule_1.molecules);
15
15
  const concentration = (0, round_1.round)((0, randfloat_1.randfloat)(0.01, 0.1), 2); // Concentration in mol/L
@@ -160,4 +160,5 @@ exports.BeerLambertRandomValueExercise = {
160
160
  getPropositions,
161
161
  isAnswerValid,
162
162
  subject: "Chimie",
163
+ hasHintAndCorrection: true,
163
164
  };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ concentration: number;
4
+ quantity: number;
5
+ volume: number;
6
+ variable: "C" | "n" | "V";
7
+ };
8
+ export declare const concentrationCalculation: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=concentrationCalculation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concentrationCalculation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/dosage/concentrationCalculation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC3B,CAAC;AA6IF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAc1D,CAAC"}
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.concentrationCalculation = void 0;
4
+ const frenchify_1 = require("../../../math/utils/latex/frenchify");
5
+ const exercise_1 = require("../../../exercises/exercise");
6
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
7
+ const round_1 = require("../../../math/utils/round");
8
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
9
+ const randint_1 = require("../../../math/utils/random/randint");
10
+ const getConcentrationCalculationQuestion = () => {
11
+ const concentration = (0, round_1.round)((0, randfloat_1.randfloat)(0.1, 2), 2); // Concentration en mol/L
12
+ const quantity = (0, round_1.round)((0, randfloat_1.randfloat)(0.1, 5), 2); // Quantité de matière en mol
13
+ const volume = (0, round_1.round)((0, randfloat_1.randfloat)(0.1, 2), 2); // Volume en L
14
+ const variableIndex = (0, randint_1.randint)(0, 3);
15
+ const variables = ["C", "n", "V"];
16
+ const variable = variables[variableIndex];
17
+ let questionText, answer;
18
+ switch (variable) {
19
+ case "C":
20
+ questionText = `Vous avez une solution contenant une quantité de matière $n = ${(0, frenchify_1.frenchify)(quantity)}\\ \\text{mol}$ dissoute dans un volume $V = ${(0, frenchify_1.frenchify)(volume)}\\ \\text{L}$. Déterminez la concentration $[X_i]$ en $\\text{mol.L}^{-1}$ de cette solution.`;
21
+ answer = (0, round_1.round)(quantity / volume, 2);
22
+ break;
23
+ case "n":
24
+ questionText = `Vous avez une solution de concentration $[X_i] = ${(0, frenchify_1.frenchify)(concentration)}\\ \\text{mol.L}^{-1}$ dans un volume $V = ${(0, frenchify_1.frenchify)(volume)}\\ \\text{L}$. Déterminez la quantité de matière $n$ en $\\text{mol}$ de cette solution.`;
25
+ answer = (0, round_1.round)(concentration * volume, 2);
26
+ break;
27
+ case "V":
28
+ questionText = `Vous avez une solution de concentration $[X_i] = ${(0, frenchify_1.frenchify)(concentration)}\\ \\text{mol.L}^{-1}$ contenant une quantité de matière $n = ${(0, frenchify_1.frenchify)(quantity)}\\ \\text{mol}$. Déterminez le volume $V$ en $\\text{L}$ de cette solution.`;
29
+ answer = (0, round_1.round)(quantity / concentration, 2);
30
+ break;
31
+ }
32
+ const hint = `La concentration en quantité de matière $[X_i]$ d'une espèce chimique en solution est le quotient de la quantité de matière $n$ de soluté par le volume $V_{\\text{solution}}$ de la solution :
33
+ $$
34
+ [X_i] = \\frac{n}{V_{\\text{solution}}}
35
+ $$
36
+ Réarrangez cette formule pour isoler la variable à trouver.`;
37
+ const correction = `La formule de la concentration est :
38
+ $$
39
+ [X_i] = \\frac{n}{V}
40
+ $$
41
+
42
+ Pour résoudre ce problème, nous devons réorganiser la formule pour isoler la variable inconnue.
43
+
44
+ ${variable === "C"
45
+ ? `$$[X_i] = \\frac{n}{V} = \\frac{${(0, frenchify_1.frenchify)(quantity)}}{${(0, frenchify_1.frenchify)(volume)}} = ${(0, frenchify_1.frenchify)(answer)}\\ \\text{mol.L}^{-1}$$`
46
+ : variable === "n"
47
+ ? `$$n = [X_i] \\times V = ${(0, frenchify_1.frenchify)(concentration)} \\times ${(0, frenchify_1.frenchify)(volume)} = ${(0, frenchify_1.frenchify)(answer)}\\ \\text{mol}$$`
48
+ : `$$V = \\frac{n}{[X_i]} = \\frac{${(0, frenchify_1.frenchify)(quantity)}}{${(0, frenchify_1.frenchify)(concentration)}} = ${(0, frenchify_1.frenchify)(answer)}\\ \\text{L}$$`}`;
49
+ const question = {
50
+ answer: answer.toTree().toTex(),
51
+ instruction: questionText,
52
+ hint,
53
+ correction,
54
+ keys: ["C", "n", "V"],
55
+ answerFormat: "tex",
56
+ identifiers: {
57
+ concentration,
58
+ quantity,
59
+ volume,
60
+ variable,
61
+ },
62
+ };
63
+ return question;
64
+ };
65
+ const getPropositions = (n, { answer, concentration, quantity, volume, variable }) => {
66
+ const propositions = [];
67
+ (0, exercise_1.addValidProp)(propositions, answer);
68
+ const wrongAnswers = [
69
+ variable === "C"
70
+ ? (0, round_1.round)(quantity * volume, 2)
71
+ : (0, round_1.round)(quantity / volume, 2),
72
+ variable === "n"
73
+ ? (0, round_1.round)(concentration / volume, 2)
74
+ : (0, round_1.round)(concentration * volume, 2),
75
+ variable === "V"
76
+ ? (0, round_1.round)(quantity * concentration, 2)
77
+ : (0, round_1.round)(quantity / concentration, 2),
78
+ ];
79
+ wrongAnswers.forEach((wrongAnswer) => {
80
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toTree().toTex());
81
+ });
82
+ while (propositions.length < n) {
83
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(0.1, 5, 2).toTree().toTex());
84
+ }
85
+ return (0, exercise_1.shuffleProps)(propositions, n);
86
+ };
87
+ const isAnswerValid = (ans, { answer, variable, concentration, quantity, volume }) => {
88
+ let validanswer;
89
+ switch (variable) {
90
+ case "C":
91
+ validanswer = (0, round_1.round)(quantity / volume, 2);
92
+ break;
93
+ case "n":
94
+ validanswer = (0, round_1.round)(concentration * volume, 2);
95
+ break;
96
+ case "V":
97
+ validanswer = (0, round_1.round)(quantity / concentration, 2);
98
+ break;
99
+ }
100
+ const latexs = [
101
+ ...validanswer.toTree().toAllValidTexs(),
102
+ validanswer.toScientific(2).toTex(),
103
+ ];
104
+ return latexs.includes(ans);
105
+ };
106
+ exports.concentrationCalculation = {
107
+ id: "concentrationCalculation",
108
+ label: "Calculer la concentration d'un élément dans une solution",
109
+ levels: ["1reSpé"],
110
+ isSingleStep: true,
111
+ sections: ["Chimie des solutions"],
112
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getConcentrationCalculationQuestion, nb),
113
+ qcmTimer: 60,
114
+ freeTimer: 60,
115
+ getPropositions,
116
+ isAnswerValid,
117
+ subject: "Chimie",
118
+ hasHintAndCorrection: true,
119
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ concentration: number;
4
+ mass: number;
5
+ molarMass: number;
6
+ variable: "C" | "t" | "M";
7
+ };
8
+ export declare const concentrationFromMassCalculation: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=concentrationFromMassCalculation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"concentrationFromMassCalculation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/dosage/concentrationFromMassCalculation.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC3B,CAAC;AA2IF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAelE,CAAC"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.concentrationFromMassCalculation = void 0;
4
+ const frenchify_1 = require("../../../math/utils/latex/frenchify");
5
+ const exercise_1 = require("../../../exercises/exercise");
6
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
7
+ const round_1 = require("../../../math/utils/round");
8
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
9
+ const randint_1 = require("../../../math/utils/random/randint");
10
+ const getConcentrationFromMassCalculationQuestion = () => {
11
+ const concentration = (0, round_1.round)((0, randfloat_1.randfloat)(0.1, 2), 2); // Concentration en mol/L
12
+ const mass = (0, round_1.round)((0, randfloat_1.randfloat)(0.1, 5), 2); // Concentration en masse en g/L
13
+ const molarMass = (0, round_1.round)((0, randfloat_1.randfloat)(10, 200), 2); // Masse molaire en g/mol
14
+ const variableIndex = (0, randint_1.randint)(0, 3);
15
+ const variables = ["C", "t", "M"];
16
+ const variable = variables[variableIndex];
17
+ let questionText, answer;
18
+ switch (variable) {
19
+ case "C":
20
+ questionText = `Vous avez une solution avec une concentration en masse $t = ${(0, frenchify_1.frenchify)(mass)}\\ \\text{g.L}^{-1}$ et une masse molaire $M = ${(0, frenchify_1.frenchify)(molarMass)}\\ \\text{g.mol}^{-1}$. Déterminez la concentration $C$ en $\\text{mol.L}^{-1}$ de cette solution.`;
21
+ answer = (0, round_1.round)(mass / molarMass, 2);
22
+ break;
23
+ case "t":
24
+ questionText = `Vous avez une solution avec une concentration $C = ${(0, frenchify_1.frenchify)(concentration)}\\ \\text{mol.L}^{-1}$ et une masse molaire $M = ${(0, frenchify_1.frenchify)(molarMass)}\\ \\text{g.mol}^{-1}$. Déterminez la concentration en masse $t$ en $\\text{g.L}^{-1}$ de cette solution.`;
25
+ answer = (0, round_1.round)(concentration * molarMass, 2);
26
+ break;
27
+ case "M":
28
+ questionText = `Vous avez une solution avec une concentration en masse $t = ${(0, frenchify_1.frenchify)(mass)}\\ \\text{g.L}^{-1}$ et une concentration $C = ${(0, frenchify_1.frenchify)(concentration)}\\ \\text{mol.L}^{-1}$. Déterminez la masse molaire $M$ en $\\text{g.mol}^{-1}$ de cette solution.`;
29
+ answer = (0, round_1.round)(mass / concentration, 2);
30
+ break;
31
+ }
32
+ const hint = `La relation entre la concentration en quantité de matière $C$, la concentration en masse $t$, et la masse molaire $M$ est donnée par :
33
+ $$
34
+ C = \\frac{t}{M}
35
+ $$
36
+ Réarrangez cette formule pour isoler la variable à trouver.`;
37
+ const correction = `La relation entre la concentration en quantité de matière, la concentration en masse et la masse molaire est :
38
+ $$
39
+ C = \\frac{t}{M}
40
+ $$
41
+
42
+ Pour résoudre ce problème, nous devons réorganiser la formule pour isoler la variable inconnue.
43
+
44
+ ${variable === "C"
45
+ ? `$$C = \\frac{t}{M} = \\frac{${(0, frenchify_1.frenchify)(mass)}}{${(0, frenchify_1.frenchify)(molarMass)}} = ${(0, frenchify_1.frenchify)(answer)}\\ \\text{mol.L}^{-1}$$`
46
+ : variable === "t"
47
+ ? `$$t = C \\times M = ${(0, frenchify_1.frenchify)(concentration)} \\times ${(0, frenchify_1.frenchify)(molarMass)} = ${(0, frenchify_1.frenchify)(answer)}\\ \\text{g.L}^{-1}$$`
48
+ : `$$M = \\frac{t}{C} = \\frac{${(0, frenchify_1.frenchify)(mass)}}{${(0, frenchify_1.frenchify)(concentration)}} = ${(0, frenchify_1.frenchify)(answer)}\\ \\text{g.mol}^{-1}$$`}`;
49
+ const question = {
50
+ answer: answer.toTree().toTex(),
51
+ instruction: questionText,
52
+ hint,
53
+ correction,
54
+ keys: ["C", "t", "M"],
55
+ answerFormat: "tex",
56
+ identifiers: {
57
+ concentration,
58
+ mass,
59
+ molarMass,
60
+ variable,
61
+ },
62
+ };
63
+ return question;
64
+ };
65
+ const getPropositions = (n, { answer, concentration, mass, molarMass, variable }) => {
66
+ const propositions = [];
67
+ (0, exercise_1.addValidProp)(propositions, answer);
68
+ const wrongAnswers = [
69
+ variable === "C" ? (0, round_1.round)(mass * molarMass, 2) : (0, round_1.round)(mass / molarMass, 2),
70
+ variable === "t"
71
+ ? (0, round_1.round)(concentration / molarMass, 2)
72
+ : (0, round_1.round)(concentration * molarMass, 2),
73
+ variable === "M"
74
+ ? (0, round_1.round)(mass * concentration, 2)
75
+ : (0, round_1.round)(mass / concentration, 2),
76
+ ];
77
+ wrongAnswers.forEach((wrongAnswer) => {
78
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toTree().toTex());
79
+ });
80
+ while (propositions.length < n) {
81
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(0.1, 5, 2).toTree().toTex());
82
+ }
83
+ return (0, exercise_1.shuffleProps)(propositions, n);
84
+ };
85
+ const isAnswerValid = (ans, { answer, variable, mass, molarMass, concentration }) => {
86
+ let validanswer;
87
+ switch (variable) {
88
+ case "C":
89
+ validanswer = (0, round_1.round)(mass / molarMass, 2);
90
+ break;
91
+ case "t":
92
+ validanswer = (0, round_1.round)(concentration * molarMass, 2);
93
+ break;
94
+ case "M":
95
+ validanswer = (0, round_1.round)(mass / concentration, 2);
96
+ break;
97
+ }
98
+ const latexs = [
99
+ ...validanswer.toTree().toAllValidTexs(),
100
+ validanswer.toScientific(2).toTex(),
101
+ ];
102
+ return latexs.includes(ans);
103
+ };
104
+ exports.concentrationFromMassCalculation = {
105
+ id: "concentrationFromMassCalculation",
106
+ label: "Calculer la concentration à partir de la concentration en masse et la masse molaire",
107
+ levels: ["1reSpé"],
108
+ isSingleStep: true,
109
+ sections: ["Chimie des solutions"],
110
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getConcentrationFromMassCalculationQuestion, nb),
111
+ qcmTimer: 60,
112
+ freeTimer: 60,
113
+ getPropositions,
114
+ isAnswerValid,
115
+ subject: "Chimie",
116
+ hasHintAndCorrection: true,
117
+ };
@@ -1,2 +1,4 @@
1
1
  export * from "./beerLambertRandomValue";
2
+ export * from "./concentrationCalculation";
3
+ export * from "./concentrationFromMassCalculation";
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/dosage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/dosage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC"}
@@ -15,3 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./beerLambertRandomValue"), exports);
18
+ __exportStar(require("./concentrationCalculation"), exports);
19
+ __exportStar(require("./concentrationFromMassCalculation"), exports);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ l1: number;
4
+ l2: number;
5
+ };
6
+ export declare const calculateIntensity: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=calculateIntensity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateIntensity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/electricity/calculateIntensity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAqDF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAapD,CAAC"}