math-exercises 2.2.2 → 2.2.4

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 (355) 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/proportionality/index.d.ts +2 -0
  4. package/lib/exercises/math/calcul/proportionality/index.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/proportionality/index.js +2 -0
  6. package/lib/exercises/math/calcul/proportionality/scaleCalculation.d.ts +9 -0
  7. package/lib/exercises/math/calcul/proportionality/scaleCalculation.d.ts.map +1 -0
  8. package/lib/exercises/math/calcul/proportionality/scaleCalculation.js +90 -0
  9. package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts +9 -0
  10. package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts.map +1 -0
  11. package/lib/exercises/math/calcul/proportionality/scaleUsage.js +95 -0
  12. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.d.ts +7 -0
  13. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.d.ts.map +1 -0
  14. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.js +59 -0
  15. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts +9 -0
  16. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map +1 -0
  17. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +77 -0
  18. package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +2 -0
  19. package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
  20. package/lib/exercises/math/calculLitteral/distributivity/index.js +2 -0
  21. package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
  22. package/lib/exercises/math/conversion/lengthConversion.js +18 -4
  23. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts +10 -0
  24. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -0
  25. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +81 -0
  26. package/lib/exercises/math/functions/affines/index.d.ts +1 -0
  27. package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
  28. package/lib/exercises/math/functions/affines/index.js +1 -0
  29. package/lib/exercises/pc/calibrationCurveOfSolution.js +1 -1
  30. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.d.ts +1 -1
  31. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.d.ts.map +1 -1
  32. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
  33. package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.d.ts +1 -1
  34. package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.d.ts.map +1 -1
  35. package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.js +3 -3
  36. package/lib/exercises/pc/chemicalElements/calculateVolumetricMass.d.ts.map +1 -1
  37. package/lib/exercises/pc/chemicalElements/calculateVolumetricMass.js +29 -4
  38. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.d.ts +1 -1
  39. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.d.ts.map +1 -1
  40. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.js +6 -6
  41. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.d.ts +1 -1
  42. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.d.ts.map +1 -1
  43. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.js +1 -1
  44. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.d.ts +1 -1
  45. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.d.ts.map +1 -1
  46. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.js +1 -1
  47. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.d.ts +1 -1
  48. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.d.ts.map +1 -1
  49. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.js +1 -1
  50. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.d.ts +1 -1
  51. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.d.ts.map +1 -1
  52. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +1 -1
  53. package/lib/exercises/pc/chemicalElements/index.d.ts +1 -0
  54. package/lib/exercises/pc/chemicalElements/index.d.ts.map +1 -1
  55. package/lib/exercises/pc/chemicalElements/index.js +1 -0
  56. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.d.ts +11 -0
  57. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.d.ts.map +1 -0
  58. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.js +99 -0
  59. package/lib/exercises/pc/chemicalEquations.d.ts +1 -1
  60. package/lib/exercises/pc/chemicalEquations.d.ts.map +1 -1
  61. package/lib/exercises/pc/chemicalEquations.js +1 -1
  62. package/lib/exercises/pc/chemicalReactions/index.d.ts +2 -0
  63. package/lib/exercises/pc/chemicalReactions/index.d.ts.map +1 -1
  64. package/lib/exercises/pc/chemicalReactions/index.js +2 -0
  65. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts +5 -0
  66. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -0
  67. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +69 -0
  68. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.d.ts +11 -0
  69. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.d.ts.map +1 -0
  70. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.js +180 -0
  71. package/lib/exercises/pc/chemicalReactionsProduct.d.ts +1 -1
  72. package/lib/exercises/pc/chemicalReactionsProduct.d.ts.map +1 -1
  73. package/lib/exercises/pc/chemicalReactionsProduct.js +1 -1
  74. package/lib/exercises/pc/dosage/beerLambertRandomValue.js +1 -1
  75. package/lib/exercises/pc/dosage/concentrationCalculation.d.ts +10 -0
  76. package/lib/exercises/pc/dosage/concentrationCalculation.d.ts.map +1 -0
  77. package/lib/exercises/pc/dosage/concentrationCalculation.js +118 -0
  78. package/lib/exercises/pc/dosage/concentrationFromMassCalculation.d.ts +10 -0
  79. package/lib/exercises/pc/dosage/concentrationFromMassCalculation.d.ts.map +1 -0
  80. package/lib/exercises/pc/dosage/concentrationFromMassCalculation.js +116 -0
  81. package/lib/exercises/pc/dosage/index.d.ts +2 -0
  82. package/lib/exercises/pc/dosage/index.d.ts.map +1 -1
  83. package/lib/exercises/pc/dosage/index.js +2 -0
  84. package/lib/exercises/pc/electricity/calculateIntensity.d.ts +8 -0
  85. package/lib/exercises/pc/electricity/calculateIntensity.d.ts.map +1 -0
  86. package/lib/exercises/pc/electricity/calculateIntensity.js +60 -0
  87. package/lib/exercises/pc/electricity/calculateIntensityInSerieOrParallel.d.ts +10 -0
  88. package/lib/exercises/pc/electricity/calculateIntensityInSerieOrParallel.d.ts.map +1 -0
  89. package/lib/exercises/pc/electricity/calculateIntensityInSerieOrParallel.js +105 -0
  90. package/lib/exercises/pc/electricity/calculateVoltage.d.ts +11 -0
  91. package/lib/exercises/pc/electricity/calculateVoltage.d.ts.map +1 -0
  92. package/lib/exercises/pc/electricity/calculateVoltage.js +143 -0
  93. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.d.ts +9 -0
  94. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.d.ts.map +1 -0
  95. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.js +80 -0
  96. package/lib/exercises/pc/electricity/index.d.ts +7 -0
  97. package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
  98. package/lib/exercises/pc/electricity/index.js +7 -0
  99. package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.d.ts +10 -0
  100. package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.d.ts.map +1 -0
  101. package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.js +110 -0
  102. package/lib/exercises/pc/electricity/ohmLaw.d.ts +11 -0
  103. package/lib/exercises/pc/electricity/ohmLaw.d.ts.map +1 -0
  104. package/lib/exercises/pc/electricity/ohmLaw.js +122 -0
  105. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts +5 -0
  106. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -0
  107. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +94 -0
  108. package/lib/exercises/pc/energy/calorificValue.d.ts +8 -0
  109. package/lib/exercises/pc/energy/calorificValue.d.ts.map +1 -0
  110. package/lib/exercises/pc/energy/calorificValue.js +77 -0
  111. package/lib/exercises/pc/energy/combustionTransferEnergy.d.ts +8 -0
  112. package/lib/exercises/pc/energy/combustionTransferEnergy.d.ts.map +1 -0
  113. package/lib/exercises/pc/energy/combustionTransferEnergy.js +77 -0
  114. package/lib/exercises/pc/energy/combustionTransferEnergy2.d.ts +11 -0
  115. package/lib/exercises/pc/energy/combustionTransferEnergy2.d.ts.map +1 -0
  116. package/lib/exercises/pc/energy/combustionTransferEnergy2.js +140 -0
  117. package/lib/exercises/pc/energy/efficencyOfConverter.d.ts +8 -0
  118. package/lib/exercises/pc/energy/efficencyOfConverter.d.ts.map +1 -0
  119. package/lib/exercises/pc/energy/efficencyOfConverter.js +83 -0
  120. package/lib/exercises/pc/energy/efficiencyCalculation.d.ts +10 -0
  121. package/lib/exercises/pc/energy/efficiencyCalculation.d.ts.map +1 -0
  122. package/lib/exercises/pc/energy/efficiencyCalculation.js +121 -0
  123. package/lib/exercises/pc/energy/energyTransfer.d.ts +10 -0
  124. package/lib/exercises/pc/energy/energyTransfer.d.ts.map +1 -0
  125. package/lib/exercises/pc/energy/energyTransfer.js +67 -0
  126. package/lib/exercises/pc/energy/index.d.ts +9 -0
  127. package/lib/exercises/pc/energy/index.d.ts.map +1 -0
  128. package/lib/exercises/pc/energy/index.js +24 -0
  129. package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.d.ts +10 -0
  130. package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.d.ts.map +1 -0
  131. package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.js +167 -0
  132. package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.d.ts +11 -0
  133. package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.d.ts.map +1 -0
  134. package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.js +142 -0
  135. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts +8 -0
  136. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -0
  137. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +101 -0
  138. package/lib/exercises/pc/forces/electroStaticForce.d.ts +13 -0
  139. package/lib/exercises/pc/forces/electroStaticForce.d.ts.map +1 -0
  140. package/lib/exercises/pc/forces/electroStaticForce.js +116 -0
  141. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.d.ts +9 -0
  142. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.d.ts.map +1 -0
  143. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.js +131 -0
  144. package/lib/exercises/pc/forces/gravitationalAttractionValue.d.ts +1 -0
  145. package/lib/exercises/pc/forces/gravitationalAttractionValue.d.ts.map +1 -1
  146. package/lib/exercises/pc/forces/gravitationalAttractionValue.js +31 -27
  147. package/lib/exercises/pc/forces/gravitationalForcePlanets.d.ts +10 -0
  148. package/lib/exercises/pc/forces/gravitationalForcePlanets.d.ts.map +1 -0
  149. package/lib/exercises/pc/forces/gravitationalForcePlanets.js +117 -0
  150. package/lib/exercises/pc/forces/index.d.ts +5 -0
  151. package/lib/exercises/pc/forces/index.d.ts.map +1 -1
  152. package/lib/exercises/pc/forces/index.js +6 -0
  153. package/lib/exercises/pc/forces/massWeight.d.ts +9 -0
  154. package/lib/exercises/pc/forces/massWeight.d.ts.map +1 -0
  155. package/lib/exercises/pc/forces/massWeight.js +67 -0
  156. package/lib/exercises/pc/forces/pressureDifferenceCalculation.d.ts +1 -0
  157. package/lib/exercises/pc/forces/pressureDifferenceCalculation.d.ts.map +1 -0
  158. package/lib/exercises/pc/forces/pressureDifferenceCalculation.js +106 -0
  159. package/lib/exercises/pc/formulaFromComposition.js +2 -2
  160. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts +8 -0
  161. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts.map +1 -0
  162. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +72 -0
  163. package/lib/exercises/pc/index.d.ts +6 -0
  164. package/lib/exercises/pc/index.d.ts.map +1 -1
  165. package/lib/exercises/pc/index.js +6 -0
  166. package/lib/exercises/pc/molarQuantity.js +2 -2
  167. package/lib/exercises/pc/mole/index.d.ts +2 -0
  168. package/lib/exercises/pc/mole/index.d.ts.map +1 -1
  169. package/lib/exercises/pc/mole/index.js +2 -0
  170. package/lib/exercises/pc/mole/molarMass.js +1 -1
  171. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.d.ts +9 -0
  172. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.d.ts.map +1 -0
  173. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.js +75 -0
  174. package/lib/exercises/pc/mole/moleculeCountFromMol.d.ts +7 -0
  175. package/lib/exercises/pc/mole/moleculeCountFromMol.d.ts.map +1 -0
  176. package/lib/exercises/pc/mole/moleculeCountFromMol.js +66 -0
  177. package/lib/exercises/pc/moleculeFormula.js +1 -1
  178. package/lib/exercises/pc/moleculeNomenclature.js +1 -1
  179. package/lib/exercises/pc/motion/averageSpeed.d.ts +12 -0
  180. package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -0
  181. package/lib/exercises/pc/motion/averageSpeed.js +121 -0
  182. package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts +10 -0
  183. package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -0
  184. package/lib/exercises/pc/motion/averageSpeedCalculation.js +145 -0
  185. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.d.ts +7 -0
  186. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.d.ts.map +1 -0
  187. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.js +86 -0
  188. package/lib/exercises/pc/motion/index.d.ts +7 -0
  189. package/lib/exercises/pc/motion/index.d.ts.map +1 -0
  190. package/lib/exercises/pc/motion/index.js +22 -0
  191. package/lib/exercises/pc/motion/motionReference.d.ts +9 -0
  192. package/lib/exercises/pc/motion/motionReference.d.ts.map +1 -0
  193. package/lib/exercises/pc/motion/motionReference.js +167 -0
  194. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts +5 -0
  195. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -0
  196. package/lib/exercises/pc/motion/typeOfAcceleration.js +97 -0
  197. package/lib/exercises/pc/motion/typeOfMovement.d.ts +5 -0
  198. package/lib/exercises/pc/motion/typeOfMovement.d.ts.map +1 -0
  199. package/lib/exercises/pc/motion/typeOfMovement.js +111 -0
  200. package/lib/exercises/pc/orderOfMagnitude.d.ts +8 -0
  201. package/lib/exercises/pc/orderOfMagnitude.d.ts.map +1 -0
  202. package/lib/exercises/pc/orderOfMagnitude.js +68 -0
  203. package/lib/exercises/pc/potentialEnergy.d.ts.map +1 -1
  204. package/lib/exercises/pc/potentialEnergy.js +17 -5
  205. package/lib/exercises/pc/power/calculatePowerOfLight.d.ts +8 -0
  206. package/lib/exercises/pc/power/calculatePowerOfLight.d.ts.map +1 -0
  207. package/lib/exercises/pc/power/calculatePowerOfLight.js +85 -0
  208. package/lib/exercises/pc/power/index.d.ts +2 -0
  209. package/lib/exercises/pc/power/index.d.ts.map +1 -0
  210. package/lib/exercises/pc/power/index.js +17 -0
  211. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +5 -0
  212. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -0
  213. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +117 -0
  214. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.d.ts +9 -0
  215. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.d.ts.map +1 -0
  216. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.js +95 -0
  217. package/lib/exercises/pc/sound/index.d.ts +1 -0
  218. package/lib/exercises/pc/sound/index.d.ts.map +1 -1
  219. package/lib/exercises/pc/sound/index.js +1 -0
  220. package/lib/exercises/pc/waves/index.d.ts +1 -0
  221. package/lib/exercises/pc/waves/index.d.ts.map +1 -1
  222. package/lib/exercises/pc/waves/index.js +1 -0
  223. package/lib/exercises/pc/waves/lightDistanceConversion.d.ts +10 -0
  224. package/lib/exercises/pc/waves/lightDistanceConversion.d.ts.map +1 -0
  225. package/lib/exercises/pc/waves/lightDistanceConversion.js +160 -0
  226. package/lib/exercises/pc/weight/calculateWeight.d.ts +7 -0
  227. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -0
  228. package/lib/exercises/pc/weight/calculateWeight.js +72 -0
  229. package/lib/exercises/pc/weight/index.d.ts +1 -0
  230. package/lib/exercises/pc/weight/index.d.ts.map +1 -1
  231. package/lib/exercises/pc/weight/index.js +1 -0
  232. package/lib/exercises/pc/weight/weightOnTheMoon.d.ts.map +1 -1
  233. package/lib/exercises/pc/weight/weightOnTheMoon.js +6 -6
  234. package/lib/exercises/utils/getAtoms.d.ts +1 -1
  235. package/lib/exercises/utils/getAtoms.d.ts.map +1 -1
  236. package/lib/exercises/utils/getAtoms.js +1 -1
  237. package/lib/geogebra/deleteObjectNamesFromAnswer.d.ts +1 -1
  238. package/lib/geogebra/deleteObjectNamesFromAnswer.d.ts.map +1 -1
  239. package/lib/geogebra/deleteObjectNamesFromAnswer.js +2 -2
  240. package/lib/index.d.ts +188 -11
  241. package/lib/index.d.ts.map +1 -1
  242. package/lib/math/numbers/reals/extendedRingElement.d.ts +1 -2
  243. package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -1
  244. package/lib/math/polynomials/affine.d.ts +4 -0
  245. package/lib/math/polynomials/affine.d.ts.map +1 -1
  246. package/lib/math/polynomials/affine.js +10 -0
  247. package/lib/math/polynomials/trinom.d.ts +2 -1
  248. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  249. package/lib/math/polynomials/trinom.js +3 -0
  250. package/lib/pc/constants/atoms.d.ts +0 -1
  251. package/lib/pc/constants/atoms.d.ts.map +1 -1
  252. package/lib/pc/constants/atoms.js +2 -2
  253. package/lib/pc/constants/coulomb.d.ts +3 -0
  254. package/lib/pc/constants/coulomb.d.ts.map +1 -0
  255. package/lib/pc/constants/coulomb.js +13 -0
  256. package/lib/pc/constants/earth.d.ts +0 -1
  257. package/lib/pc/constants/earth.d.ts.map +1 -1
  258. package/lib/pc/constants/earth.js +4 -4
  259. package/lib/pc/constants/gravity.d.ts +1 -1
  260. package/lib/pc/constants/gravity.d.ts.map +1 -1
  261. package/lib/pc/constants/gravity.js +16 -7
  262. package/lib/pc/constants/mechanics/gravitational.d.ts +14 -0
  263. package/lib/pc/constants/mechanics/gravitational.d.ts.map +1 -0
  264. package/lib/pc/constants/mechanics/gravitational.js +37 -0
  265. package/lib/pc/constants/mechanics/planets.d.ts +15 -0
  266. package/lib/pc/constants/mechanics/planets.d.ts.map +1 -0
  267. package/lib/pc/constants/mechanics/planets.js +35 -0
  268. package/lib/pc/constants/mechanics/waves.d.ts +8 -0
  269. package/lib/pc/constants/mechanics/waves.d.ts.map +1 -0
  270. package/lib/pc/constants/mechanics/waves.js +8 -0
  271. package/lib/pc/constants/molecularChemistry/atomSymbols.d.ts +2 -0
  272. package/lib/pc/constants/molecularChemistry/atomSymbols.d.ts.map +1 -0
  273. package/lib/pc/constants/molecularChemistry/atomSymbols.js +2 -0
  274. package/lib/pc/constants/molecularChemistry/atome.d.ts +18 -0
  275. package/lib/pc/constants/molecularChemistry/atome.d.ts.map +1 -0
  276. package/lib/pc/constants/molecularChemistry/atome.js +174 -0
  277. package/lib/pc/constants/molecularChemistry/atoms.d.ts +9 -0
  278. package/lib/pc/constants/molecularChemistry/atoms.d.ts.map +1 -0
  279. package/lib/pc/constants/molecularChemistry/atoms.js +15 -0
  280. package/lib/pc/constants/molecularChemistry/molecule.d.ts +25 -0
  281. package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -0
  282. package/lib/pc/constants/molecularChemistry/molecule.js +579 -0
  283. package/lib/pc/constants/molecularChemistry/reaction.d.ts +27 -0
  284. package/lib/pc/constants/molecularChemistry/reaction.d.ts.map +1 -0
  285. package/lib/pc/constants/molecularChemistry/reaction.js +471 -0
  286. package/lib/pc/measure/measure.d.ts +16 -6
  287. package/lib/pc/measure/measure.d.ts.map +1 -1
  288. package/lib/pc/measure/measure.js +112 -16
  289. package/lib/pc/units/AmountOfSubstance.d.ts +17 -0
  290. package/lib/pc/units/AmountOfSubstance.d.ts.map +1 -0
  291. package/lib/pc/units/AmountOfSubstance.js +40 -0
  292. package/lib/pc/units/PressionUnit.d.ts +17 -0
  293. package/lib/pc/units/PressionUnit.d.ts.map +1 -0
  294. package/lib/pc/units/PressionUnit.js +32 -0
  295. package/lib/pc/units/distanceUnits.d.ts +16 -0
  296. package/lib/pc/units/distanceUnits.d.ts.map +1 -0
  297. package/lib/pc/units/distanceUnits.js +32 -0
  298. package/lib/pc/units/divideUnit.d.ts +13 -0
  299. package/lib/pc/units/divideUnit.d.ts.map +1 -0
  300. package/lib/pc/units/divideUnit.js +32 -0
  301. package/lib/pc/units/electricalChargeUnit.d.ts +17 -0
  302. package/lib/pc/units/electricalChargeUnit.d.ts.map +1 -0
  303. package/lib/pc/units/electricalChargeUnit.js +40 -0
  304. package/lib/pc/units/electricalResistanceUnit.d.ts +18 -0
  305. package/lib/pc/units/electricalResistanceUnit.d.ts.map +1 -0
  306. package/lib/pc/units/electricalResistanceUnit.js +32 -0
  307. package/lib/pc/units/electricalUnit.d.ts +18 -0
  308. package/lib/pc/units/electricalUnit.d.ts.map +1 -0
  309. package/lib/pc/units/electricalUnit.js +32 -0
  310. package/lib/pc/units/energyUnit.d.ts +16 -0
  311. package/lib/pc/units/energyUnit.d.ts.map +1 -0
  312. package/lib/pc/units/energyUnit.js +32 -0
  313. package/lib/pc/units/forceUnits.d.ts +16 -0
  314. package/lib/pc/units/forceUnits.d.ts.map +1 -0
  315. package/lib/pc/units/forceUnits.js +32 -0
  316. package/lib/pc/units/frequenceUnit.d.ts +17 -0
  317. package/lib/pc/units/frequenceUnit.d.ts.map +1 -0
  318. package/lib/pc/units/frequenceUnit.js +40 -0
  319. package/lib/pc/units/interfaces/baseTenUnit.d.ts +10 -0
  320. package/lib/pc/units/interfaces/baseTenUnit.d.ts.map +1 -0
  321. package/lib/pc/units/interfaces/baseTenUnit.js +16 -0
  322. package/lib/pc/units/interfaces/basicUnit.d.ts +13 -0
  323. package/lib/pc/units/interfaces/basicUnit.d.ts.map +1 -0
  324. package/lib/pc/units/interfaces/basicUnit.js +19 -0
  325. package/lib/pc/units/interfaces/unit.d.ts +13 -0
  326. package/lib/pc/units/interfaces/unit.d.ts.map +1 -0
  327. package/lib/pc/units/interfaces/unit.js +2 -0
  328. package/lib/pc/units/massUnits.d.ts +17 -0
  329. package/lib/pc/units/massUnits.d.ts.map +1 -0
  330. package/lib/pc/units/massUnits.js +32 -0
  331. package/lib/pc/units/mulitplyUnits.d.ts +13 -0
  332. package/lib/pc/units/mulitplyUnits.d.ts.map +1 -0
  333. package/lib/pc/units/mulitplyUnits.js +26 -0
  334. package/lib/pc/units/powerUnits.d.ts +14 -0
  335. package/lib/pc/units/powerUnits.d.ts.map +1 -0
  336. package/lib/pc/units/powerUnits.js +26 -0
  337. package/lib/pc/units/timeUnits.d.ts +13 -0
  338. package/lib/pc/units/timeUnits.d.ts.map +1 -0
  339. package/lib/pc/units/timeUnits.js +42 -0
  340. package/lib/pc/units/volumeUnit.d.ts +17 -0
  341. package/lib/pc/units/volumeUnit.d.ts.map +1 -0
  342. package/lib/pc/units/volumeUnit.js +32 -0
  343. package/lib/pc/units/wattUnit.d.ts +17 -0
  344. package/lib/pc/units/wattUnit.d.ts.map +1 -0
  345. package/lib/pc/units/wattUnit.js +32 -0
  346. package/lib/server.d.ts.map +1 -1
  347. package/lib/server.js +6 -6
  348. package/lib/tree/nodes/node.d.ts +3 -0
  349. package/lib/tree/nodes/node.d.ts.map +1 -1
  350. package/lib/tree/nodes/operators/addNode.js +2 -2
  351. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  352. package/lib/tree/nodes/operators/multiplyNode.js +32 -10
  353. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  354. package/lib/tree/nodes/operators/powerNode.js +12 -0
  355. package/package.json +1 -1
@@ -0,0 +1,180 @@
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
+ };
@@ -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();
@@ -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
@@ -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,CAa1D,CAAC"}
@@ -0,0 +1,118 @@
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
+ };
@@ -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,CAclE,CAAC"}
@@ -0,0 +1,116 @@
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
+ };
@@ -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"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateIntensity = 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 getCalculateIntensityQuestion = () => {
8
+ const exo = generateExercise();
9
+ const question = {
10
+ answer: exo.answer + "",
11
+ instruction: exo.instruction +
12
+ `![](https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/xpliveV2/activities/quizzes/generator/electricCircuit2.png)`,
13
+ keys: [],
14
+ correction: `1 - Calculer l'instensité au bord de la lampe à l'aide de la loi des noeuds : $L_1+L_2=L$ $\\Rightarrow$ $${exo.l1}+${exo.l2}=${exo.answer}$ $mA$`,
15
+ answerFormat: "tex",
16
+ identifiers: { l1: exo.l1, l2: exo.l2 },
17
+ };
18
+ return question;
19
+ };
20
+ const getPropositions = (n, { answer, l1, l2 }) => {
21
+ const propositions = [];
22
+ (0, exercise_1.addValidProp)(propositions, answer);
23
+ generatePropositions(l1, l2).forEach((value) => (0, exercise_1.tryToAddWrongProp)(propositions, value + ""));
24
+ while (propositions.length < n) {
25
+ let random = (0, randint_1.randint)(+answer - Math.min(5, +answer - 1), +answer + 6, [+answer]) + "";
26
+ (0, exercise_1.tryToAddWrongProp)(propositions, random);
27
+ }
28
+ return (0, exercise_1.shuffleProps)(propositions, n);
29
+ };
30
+ const isAnswerValid = (ans, { answer }) => {
31
+ return ans === answer;
32
+ };
33
+ const generateExercise = () => {
34
+ const l1 = (0, randint_1.randint)(10, 60);
35
+ const l2 = (0, randint_1.randint)(10, 60);
36
+ const instruction = `Pour ce circuit schématisé, l'intensité du courant qui traverse la lampe $L_1$ est de $${l1}$ $mA$, celle traversant la lampe $L_2$ est de $${l2}$ $mA$. \n \\
37
+ Calculer l'intensité du courant qui traverse la pile.`;
38
+ return {
39
+ instruction,
40
+ answer: l1 + l2,
41
+ l1,
42
+ l2,
43
+ };
44
+ };
45
+ const generatePropositions = (l1, l2) => {
46
+ return [l1 - l2, l1, l2];
47
+ };
48
+ exports.calculateIntensity = {
49
+ id: "calculateIntensity",
50
+ label: "Calcul d'intnsité dans un circuit électrique en parallèle",
51
+ levels: ["2nde"],
52
+ isSingleStep: true,
53
+ sections: ["Électricité"],
54
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCalculateIntensityQuestion, nb),
55
+ qcmTimer: 60,
56
+ freeTimer: 60,
57
+ getPropositions,
58
+ isAnswerValid,
59
+ subject: "Physique",
60
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ l1: number;
4
+ l2: number;
5
+ isAsking: string;
6
+ circuit: string;
7
+ };
8
+ export declare const calculateIntensityInSerieOrParallel: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=calculateIntensityInSerieOrParallel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateIntensityInSerieOrParallel.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/electricity/calculateIntensityInSerieOrParallel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAkHF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAarE,CAAC"}