math-exercises 2.1.4 → 2.1.6

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 (136) hide show
  1. package/lib/exercises/exercise.d.ts +1 -1
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calculLitteral/systems/index.d.ts +1 -0
  4. package/lib/exercises/math/calculLitteral/systems/index.d.ts.map +1 -1
  5. package/lib/exercises/math/calculLitteral/systems/index.js +1 -0
  6. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts +9 -0
  7. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -0
  8. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +63 -0
  9. package/lib/exercises/math/derivation/derivative/expDerivativeFour.d.ts +8 -0
  10. package/lib/exercises/math/derivation/derivative/expDerivativeFour.d.ts.map +1 -0
  11. package/lib/exercises/math/derivation/derivative/expDerivativeFour.js +57 -0
  12. package/lib/exercises/math/derivation/derivative/index.d.ts +1 -0
  13. package/lib/exercises/math/derivation/derivative/index.d.ts.map +1 -1
  14. package/lib/exercises/math/derivation/derivative/index.js +1 -0
  15. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
  16. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +4 -3
  17. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.d.ts +9 -0
  18. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.d.ts.map +1 -0
  19. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.js +59 -0
  20. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.d.ts +10 -0
  21. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.d.ts.map +1 -0
  22. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.js +49 -0
  23. package/lib/exercises/math/sequences/arithmetic/index.d.ts +2 -0
  24. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  25. package/lib/exercises/math/sequences/arithmetic/index.js +2 -0
  26. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts +9 -0
  27. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts.map +1 -0
  28. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +62 -0
  29. package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
  30. package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
  31. package/lib/exercises/math/sequences/geometric/index.js +1 -0
  32. package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.js +1 -1
  33. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.d.ts +9 -0
  34. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.d.ts.map +1 -0
  35. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.js +73 -0
  36. package/lib/exercises/pc/chemicalElements/index.d.ts +1 -0
  37. package/lib/exercises/pc/chemicalElements/index.d.ts.map +1 -1
  38. package/lib/exercises/pc/chemicalElements/index.js +1 -0
  39. package/lib/exercises/pc/chemicalReactions/calculateCombustionEnergy.d.ts +8 -0
  40. package/lib/exercises/pc/chemicalReactions/calculateCombustionEnergy.d.ts.map +1 -0
  41. package/lib/exercises/pc/chemicalReactions/calculateCombustionEnergy.js +64 -0
  42. package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.d.ts +8 -0
  43. package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.d.ts.map +1 -0
  44. package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.js +52 -0
  45. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.d.ts +8 -0
  46. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.d.ts.map +1 -0
  47. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.js +61 -0
  48. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.d.ts +8 -0
  49. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.d.ts.map +1 -0
  50. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +68 -0
  51. package/lib/exercises/pc/chemicalReactions/index.d.ts +5 -0
  52. package/lib/exercises/pc/chemicalReactions/index.d.ts.map +1 -0
  53. package/lib/exercises/pc/chemicalReactions/index.js +20 -0
  54. package/lib/exercises/pc/electricity/electricChargeFromIntensity.d.ts +8 -0
  55. package/lib/exercises/pc/electricity/electricChargeFromIntensity.d.ts.map +1 -0
  56. package/lib/exercises/pc/electricity/electricChargeFromIntensity.js +51 -0
  57. package/lib/exercises/pc/electricity/electricEnergyFromPower.d.ts +8 -0
  58. package/lib/exercises/pc/electricity/electricEnergyFromPower.d.ts.map +1 -0
  59. package/lib/exercises/pc/electricity/electricEnergyFromPower.js +70 -0
  60. package/lib/exercises/pc/electricity/index.d.ts +3 -0
  61. package/lib/exercises/pc/electricity/index.d.ts.map +1 -0
  62. package/lib/exercises/pc/electricity/index.js +18 -0
  63. package/lib/exercises/pc/fluids/index.d.ts +2 -0
  64. package/lib/exercises/pc/fluids/index.d.ts.map +1 -0
  65. package/lib/exercises/pc/fluids/index.js +17 -0
  66. package/lib/exercises/pc/fluids/mariotte.d.ts +11 -0
  67. package/lib/exercises/pc/fluids/mariotte.d.ts.map +1 -0
  68. package/lib/exercises/pc/fluids/mariotte.js +73 -0
  69. package/lib/exercises/pc/forces/forceWork.d.ts +9 -0
  70. package/lib/exercises/pc/forces/forceWork.d.ts.map +1 -0
  71. package/lib/exercises/pc/forces/forceWork.js +51 -0
  72. package/lib/exercises/pc/forces/gravitationalAttractionValue.js +1 -1
  73. package/lib/exercises/pc/forces/index.d.ts +2 -0
  74. package/lib/exercises/pc/forces/index.d.ts.map +1 -1
  75. package/lib/exercises/pc/forces/index.js +2 -0
  76. package/lib/exercises/pc/forces/pressingForce.d.ts +19 -0
  77. package/lib/exercises/pc/forces/pressingForce.d.ts.map +1 -0
  78. package/lib/exercises/pc/forces/pressingForce.js +97 -0
  79. package/lib/exercises/pc/index.d.ts +5 -0
  80. package/lib/exercises/pc/index.d.ts.map +1 -1
  81. package/lib/exercises/pc/index.js +5 -0
  82. package/lib/exercises/pc/kineticEnergy.js +1 -1
  83. package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +1 -1
  84. package/lib/exercises/pc/mecanicalWaves/elongationReading.d.ts +8 -0
  85. package/lib/exercises/pc/mecanicalWaves/elongationReading.d.ts.map +1 -0
  86. package/lib/exercises/pc/mecanicalWaves/elongationReading.js +72 -0
  87. package/lib/exercises/pc/mecanicalWaves/index.d.ts +2 -0
  88. package/lib/exercises/pc/mecanicalWaves/index.d.ts.map +1 -0
  89. package/lib/exercises/pc/mecanicalWaves/index.js +17 -0
  90. package/lib/exercises/pc/mole/concentrationReading.d.ts +5 -0
  91. package/lib/exercises/pc/mole/concentrationReading.d.ts.map +1 -0
  92. package/lib/exercises/pc/mole/concentrationReading.js +57 -0
  93. package/lib/exercises/pc/mole/index.d.ts +4 -0
  94. package/lib/exercises/pc/mole/index.d.ts.map +1 -0
  95. package/lib/exercises/pc/mole/index.js +20 -0
  96. package/lib/exercises/pc/mole/molFromMass.d.ts +8 -0
  97. package/lib/exercises/pc/mole/molFromMass.d.ts.map +1 -0
  98. package/lib/exercises/pc/mole/molFromMass.js +45 -0
  99. package/lib/exercises/pc/mole/molFromMolarMass.d.ts +8 -0
  100. package/lib/exercises/pc/mole/molFromMolarMass.d.ts.map +1 -0
  101. package/lib/exercises/pc/mole/molFromMolarMass.js +45 -0
  102. package/lib/exercises/pc/mole/molarMass.d.ts +5 -0
  103. package/lib/exercises/pc/mole/molarMass.d.ts.map +1 -0
  104. package/lib/exercises/pc/mole/molarMass.js +48 -0
  105. package/lib/exercises/pc/waves/index.d.ts +1 -0
  106. package/lib/exercises/pc/waves/index.d.ts.map +1 -1
  107. package/lib/exercises/pc/waves/index.js +1 -0
  108. package/lib/exercises/pc/waves/periodicWaveCelerity.d.ts +9 -0
  109. package/lib/exercises/pc/waves/periodicWaveCelerity.d.ts.map +1 -0
  110. package/lib/exercises/pc/waves/periodicWaveCelerity.js +74 -0
  111. package/lib/index.d.ts +78 -0
  112. package/lib/index.d.ts.map +1 -1
  113. package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
  114. package/lib/math/trigonometry/remarkableValue.js +1 -0
  115. package/lib/math/trigonometry/remarkableValues.d.ts +1 -0
  116. package/lib/math/trigonometry/remarkableValues.d.ts.map +1 -1
  117. package/lib/math/trigonometry/remarkableValues.js +22 -1
  118. package/lib/math/utils/latex/unfrenchify.d.ts +2 -0
  119. package/lib/math/utils/latex/unfrenchify.d.ts.map +1 -0
  120. package/lib/math/utils/latex/unfrenchify.js +7 -0
  121. package/lib/math/utils/random/randfloat.d.ts +1 -1
  122. package/lib/math/utils/random/randfloat.d.ts.map +1 -1
  123. package/lib/math/utils/random/randfloat.js +8 -1
  124. package/lib/pc/measure/measure.d.ts +8 -0
  125. package/lib/pc/measure/measure.d.ts.map +1 -1
  126. package/lib/pc/measure/measure.js +15 -6
  127. package/lib/pc/molecularChemistry/molecule.js +2 -2
  128. package/lib/server.d.ts.map +1 -1
  129. package/lib/server.js +10 -1
  130. package/lib/tree/nodes/equations/equalNode.js +1 -1
  131. package/lib/tree/nodes/functions/cosNode.d.ts +1 -1
  132. package/lib/tree/nodes/functions/cosNode.js +3 -3
  133. package/lib/tree/nodes/functions/sinNode.js +1 -1
  134. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  135. package/lib/tree/nodes/operators/multiplyNode.js +6 -1
  136. package/package.json +1 -1
@@ -22,3 +22,4 @@ __exportStar(require("./weightPercent"), exports);
22
22
  __exportStar(require("./calculateVolumetricMass"), exports);
23
23
  __exportStar(require("./findValenceElectronsNumberFromElectronicConfiguration"), exports);
24
24
  __exportStar(require("./identifyRightElectronicConfiguration"), exports);
25
+ __exportStar(require("./findAtomEntitiesNumberFromMass"), exports);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ combustibleName: string;
4
+ combustibleQuantity: number;
5
+ };
6
+ export declare const calculateCombustionEnergy: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=calculateCombustionEnergy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateCombustionEnergy.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalReactions/calculateCombustionEnergy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,CAAC;AAiE5E,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateCombustionEnergy = 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 round_1 = require("../../../math/utils/round");
8
+ const random_1 = require("../../../utils/random");
9
+ const requiresApostropheBefore_1 = require("../../../utils/requiresApostropheBefore");
10
+ const combustibles = [
11
+ { name: "bois", value: 15 },
12
+ { name: "éthanol", value: 29 },
13
+ { name: "butane", value: 46.4 },
14
+ { name: "heptane", value: 44.6 },
15
+ { name: "gazole", value: 45 },
16
+ { name: "méthane", value: 50 },
17
+ ];
18
+ const getCalculateCombustionEnergyQuestion = () => {
19
+ const combustibleQuantity = (0, randint_1.randint)(100, 301);
20
+ const combustible = (0, random_1.random)(combustibles);
21
+ const instruction = `Calculer l'énergie libérée lors de la combustion de $${combustibleQuantity}\\ \\text{g}$ ${(0, requiresApostropheBefore_1.requiresApostropheBefore)(combustible.name) ? "d'" : "de"}
22
+ ${combustible.name} (en MJ). $\\text{PC(${combustible.name})} = ${combustible.value}\\ \\text{MJ}\\cdot\\text{kg}^{-1}$`;
23
+ const energy = (0, round_1.roundSignificant)(-combustibleQuantity * 0.001 * combustible.value, 1);
24
+ const question = {
25
+ answer: energy,
26
+ instruction,
27
+ keys: [],
28
+ answerFormat: "tex",
29
+ identifiers: { combustibleName: combustible.name, combustibleQuantity },
30
+ };
31
+ return question;
32
+ };
33
+ const getPropositions = (n, { answer, combustibleName, combustibleQuantity }) => {
34
+ const propositions = [];
35
+ (0, exercise_1.addValidProp)(propositions, answer);
36
+ const combustible = combustibles.find((c) => c.name === combustibleName);
37
+ const noNegative = (0, round_1.roundSignificant)(combustibleQuantity * 0.001 * combustible.value, 1);
38
+ const noConversion = (0, round_1.roundSignificant)(-combustibleQuantity * combustible.value, 1);
39
+ const noNegativeNoConversion = (0, round_1.roundSignificant)(combustibleQuantity * combustible.value, 1);
40
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${noNegative}`);
41
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${noConversion}`);
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${noNegativeNoConversion}`);
43
+ while (propositions.length < n) {
44
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, randint_1.randint)(0, 10)}`);
45
+ }
46
+ return (0, exercise_1.shuffleProps)(propositions, n);
47
+ };
48
+ const isAnswerValid = (ans, { answer }) => {
49
+ // throw Error("VEA not implemented");
50
+ return ans === answer;
51
+ };
52
+ exports.calculateCombustionEnergy = {
53
+ id: "calculateCombustionEnergy",
54
+ label: "Calculer l'énergie libérée par combustion",
55
+ levels: ["1reSpé"],
56
+ isSingleStep: true,
57
+ sections: ["Chimie des solutions"],
58
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCalculateCombustionEnergyQuestion, nb),
59
+ qcmTimer: 60,
60
+ freeTimer: 60,
61
+ getPropositions,
62
+ isAnswerValid,
63
+ subject: "Chimie",
64
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ maxQuantity: number;
4
+ productQuantity: number;
5
+ };
6
+ export declare const calculateSynthesisEfficiency: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=calculateSynthesisEfficiency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateSynthesisEfficiency.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAqDF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAa9D,CAAC"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateSynthesisEfficiency = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
7
+ const round_1 = require("../../../math/utils/round");
8
+ const getCalculateSynthesisEfficiencyQuestion = () => {
9
+ const maxQuantity = (0, randfloat_1.randfloat)(0.2, 0.6, 2);
10
+ const productQuantity = (0, randfloat_1.randfloat)(maxQuantity / 2, maxQuantity * 0.9, 2);
11
+ const efficiency = (0, round_1.round)(productQuantity / maxQuantity, 2);
12
+ const question = {
13
+ answer: `${(0, round_1.roundSignificant)(efficiency, 2)}`,
14
+ instruction: `Lors d'une synthèse chimique, $${(0, round_1.roundSignificant)(maxQuantity, 2)}\\ \\text{mol}$ de produit est attendu au maximum, et il se forme au final $${(0, round_1.roundSignificant)(productQuantity, 2)}\\ \\text{mol}$ de produit.
15
+ Calculer le rendement.
16
+ `,
17
+ keys: [],
18
+ answerFormat: "tex",
19
+ identifiers: { maxQuantity, productQuantity },
20
+ };
21
+ return question;
22
+ };
23
+ const getPropositions = (n, { answer, maxQuantity, productQuantity }) => {
24
+ const propositions = [];
25
+ (0, exercise_1.addValidProp)(propositions, answer);
26
+ const wrongDivision = maxQuantity / productQuantity;
27
+ const multiplied = maxQuantity * productQuantity;
28
+ const substracted = maxQuantity - productQuantity;
29
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(wrongDivision, 2)}`);
30
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(multiplied, 2)}`);
31
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(substracted, 2)}`);
32
+ while (propositions.length < n) {
33
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)((0, randfloat_1.randfloat)(0, 5), 2)}`);
34
+ }
35
+ return (0, exercise_1.shuffleProps)(propositions, n);
36
+ };
37
+ const isAnswerValid = (ans, { answer }) => {
38
+ return ans === answer;
39
+ };
40
+ exports.calculateSynthesisEfficiency = {
41
+ id: "calculateSynthesisEfficiency",
42
+ label: "Calculer un rendement",
43
+ levels: ["1reSpé"],
44
+ isSingleStep: true,
45
+ sections: ["Chimie des solutions"],
46
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCalculateSynthesisEfficiencyQuestion, nb),
47
+ qcmTimer: 60,
48
+ freeTimer: 60,
49
+ getPropositions,
50
+ isAnswerValid,
51
+ subject: "Chimie",
52
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ firstReagentVariables: number[];
4
+ secondReagentVariables: number[];
5
+ };
6
+ export declare const identifyLimitingReagent: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=identifyLimitingReagent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identifyLimitingReagent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalReactions/identifyLimitingReagent.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,sBAAsB,EAAE,MAAM,EAAE,CAAC;CAClC,CAAC;AAwEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.identifyLimitingReagent = void 0;
4
+ const round_1 = require("../../../math/utils/round");
5
+ const exercise_1 = require("../../../exercises/exercise");
6
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const getIdentifyLimitingReagentQuestion = () => {
9
+ let firstReagentVariables = [];
10
+ let secondReagentVariables = [];
11
+ let firstXMax;
12
+ let secondXMax;
13
+ do {
14
+ firstReagentVariables = [];
15
+ secondReagentVariables = [];
16
+ firstReagentVariables.push((0, randint_1.randint)(1, 11));
17
+ firstReagentVariables.push((0, randint_1.randint)(1, 5, [firstReagentVariables[0]]));
18
+ secondReagentVariables.push((0, randint_1.randint)(1, 11, [firstReagentVariables[0], firstReagentVariables[1]]));
19
+ secondReagentVariables.push((0, randint_1.randint)(1, 5, [firstReagentVariables[0], firstReagentVariables[1]]));
20
+ firstXMax = (0, round_1.roundSignificant)(firstReagentVariables[0] / firstReagentVariables[1], 1);
21
+ secondXMax = (0, round_1.roundSignificant)(secondReagentVariables[0] / secondReagentVariables[1], 1);
22
+ } while (firstXMax === secondXMax);
23
+ const limitingReagent = firstXMax < secondXMax ? "Le réactif A" : "Le réactif B";
24
+ const instruction = `On considère l'état final d'un système chimique,
25
+ pour lequel il y a eu transformation totale. Les quantités finales des
26
+ deux réactifs $\\text{A}$ et $\\text{B (en mol)}$, sont $\\text{n}_{\\text{A}} = ${(0, round_1.roundSignificant)(firstReagentVariables[0], 1)} - ${firstReagentVariables[1] === 1 ? "" : firstReagentVariables[1]} x_{\\text{max}}$ et $\\text{n}_{\\text{
27
+ B
28
+ }} = ${(0, round_1.roundSignificant)(secondReagentVariables[0], 1)} - ${secondReagentVariables[1] === 1 ? "" : secondReagentVariables[1]} x_{\\text{max}}$. Quel est le réactif limitant ?`;
29
+ const question = {
30
+ answer: limitingReagent,
31
+ instruction,
32
+ keys: [],
33
+ answerFormat: "raw",
34
+ identifiers: { firstReagentVariables, secondReagentVariables },
35
+ };
36
+ return question;
37
+ };
38
+ const getPropositions = (n, { answer }) => {
39
+ const propositions = [];
40
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
41
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Le réactif A", "raw");
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Le réactif B", "raw");
43
+ return (0, exercise_1.shuffleProps)(propositions, n);
44
+ };
45
+ const isAnswerValid = (ans, { answer }) => {
46
+ return ans === answer;
47
+ };
48
+ exports.identifyLimitingReagent = {
49
+ id: "identifyLimitingReagent",
50
+ label: "Identifier un réactif limitant",
51
+ levels: ["1reSpé"],
52
+ isSingleStep: true,
53
+ sections: ["Chimie des solutions"],
54
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIdentifyLimitingReagentQuestion, nb),
55
+ qcmTimer: 60,
56
+ freeTimer: 60,
57
+ getPropositions,
58
+ isAnswerValid,
59
+ subject: "Chimie",
60
+ answerType: "QCM",
61
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ firstReagentVariables: number[];
4
+ secondReagentVariables: number[];
5
+ };
6
+ export declare const identifyStoichiometricMixture: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=identifyStoichiometricMixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identifyStoichiometricMixture.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/chemicalReactions/identifyStoichiometricMixture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,sBAAsB,EAAE,MAAM,EAAE,CAAC;CAClC,CAAC;AAmFF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.identifyStoichiometricMixture = 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 round_1 = require("../../../math/utils/round");
8
+ const coinFlip_1 = require("../../../utils/coinFlip");
9
+ const getIdentifyStoichiometricMixtureQuestion = () => {
10
+ const isForcedStoichiometric = (0, coinFlip_1.coinFlip)();
11
+ let firstReagentVariables = [];
12
+ let secondReagentVariables = [];
13
+ let firstXMax;
14
+ let secondXMax;
15
+ if (isForcedStoichiometric) {
16
+ const factor = (0, randint_1.randint)(1, 7);
17
+ const firstMultiplicator = (0, randint_1.randint)(1, 5);
18
+ const secondMultiplicator = (0, randint_1.randint)(1, 5, [firstMultiplicator]);
19
+ firstReagentVariables.push(factor * firstMultiplicator, firstMultiplicator);
20
+ secondReagentVariables.push(factor * secondMultiplicator, secondMultiplicator);
21
+ }
22
+ if (!isForcedStoichiometric) {
23
+ firstReagentVariables.push((0, randint_1.randint)(1, 11));
24
+ firstReagentVariables.push((0, randint_1.randint)(1, 5, [firstReagentVariables[0]]));
25
+ secondReagentVariables.push((0, randint_1.randint)(1, 11, [firstReagentVariables[0], firstReagentVariables[1]]));
26
+ secondReagentVariables.push((0, randint_1.randint)(1, 5, [firstReagentVariables[0], firstReagentVariables[1]]));
27
+ firstXMax = (0, round_1.roundSignificant)(firstReagentVariables[0] / firstReagentVariables[1], 1);
28
+ secondXMax = (0, round_1.roundSignificant)(secondReagentVariables[0] / secondReagentVariables[1], 1);
29
+ }
30
+ const isStoichiometric = isForcedStoichiometric
31
+ ? true
32
+ : firstXMax === secondXMax;
33
+ const instruction = `On considère l'état final d'un système chimique,
34
+ pour lequel il y a eu transformation totale. Les quantités finales des
35
+ deux réactifs $\\text{A}$ et $\\text{B (en mmol)}$, sont $\\text{n}_{\\text{A}} = ${(0, round_1.roundSignificant)(firstReagentVariables[0], 1)} - ${firstReagentVariables[1] === 1 ? "" : firstReagentVariables[1]} x_{\\text{max}}$ et $\\text{n}_{\\text{B}} = ${(0, round_1.roundSignificant)(secondReagentVariables[0], 1)} - ${secondReagentVariables[1] === 1 ? "" : secondReagentVariables[1]} x_{\\text{max}}$. Le mélange initial est-il stoechiométrique ?`;
36
+ const question = {
37
+ answer: isStoichiometric ? "Oui" : "Non",
38
+ instruction,
39
+ keys: [],
40
+ answerFormat: "raw",
41
+ identifiers: { firstReagentVariables, secondReagentVariables },
42
+ };
43
+ return question;
44
+ };
45
+ const getPropositions = (n, { answer }) => {
46
+ const propositions = [];
47
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
48
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
49
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
50
+ return (0, exercise_1.shuffleProps)(propositions, n);
51
+ };
52
+ const isAnswerValid = (ans, { answer }) => {
53
+ return ans === answer;
54
+ };
55
+ exports.identifyStoichiometricMixture = {
56
+ id: "identifyStoichiometricMixture",
57
+ label: "Identifier un mélange stoechiométrique",
58
+ levels: ["1reSpé"],
59
+ isSingleStep: true,
60
+ sections: ["Chimie des solutions"],
61
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIdentifyStoichiometricMixtureQuestion, nb),
62
+ qcmTimer: 60,
63
+ freeTimer: 60,
64
+ getPropositions,
65
+ isAnswerValid,
66
+ subject: "Chimie",
67
+ answerType: "QCM",
68
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./calculateSynthesisEfficiency";
2
+ export * from "./calculateCombustionEnergy";
3
+ export * from "./identifyLimitingReagent";
4
+ export * from "./identifyStoichiometricMixture";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./calculateSynthesisEfficiency"), exports);
18
+ __exportStar(require("./calculateCombustionEnergy"), exports);
19
+ __exportStar(require("./identifyLimitingReagent"), exports);
20
+ __exportStar(require("./identifyStoichiometricMixture"), exports);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ intensity: number;
4
+ seconds: number;
5
+ };
6
+ export declare const electricChargeFromIntensity: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=electricChargeFromIntensity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electricChargeFromIntensity.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/electricity/electricChargeFromIntensity.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAqD1D,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAa7D,CAAC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.electricChargeFromIntensity = void 0;
4
+ const round_1 = require("../../../math/utils/round");
5
+ const exercise_1 = require("../../../exercises/exercise");
6
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
7
+ const randint_1 = require("../../../math/utils/random/randint");
8
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
9
+ const getElectricChargeFromIntensityQuestion = () => {
10
+ const intensity = (0, randfloat_1.randfloat)(0, 6, 1);
11
+ const seconds = (0, randint_1.randint)(1, 30);
12
+ const electricCharge = intensity * seconds;
13
+ const question = {
14
+ answer: (0, round_1.roundSignificant)(electricCharge, 1),
15
+ instruction: `Un conducteur électrique est parcouru par un courant d'intensité $${(0, round_1.roundSignificant)(intensity, 1)}\\ \\text{A}$. Calculer la charge électrique $\\text{Q (en C)}$ ayant traversé la section de ce conducteur durant $${seconds}\\ \\text{s}$.`,
16
+ keys: [],
17
+ answerFormat: "tex",
18
+ identifiers: { intensity, seconds },
19
+ };
20
+ return question;
21
+ };
22
+ const getPropositions = (n, { answer, intensity, seconds }) => {
23
+ const propositions = [];
24
+ (0, exercise_1.addValidProp)(propositions, answer);
25
+ const electricCharge = intensity * seconds;
26
+ const firstDivision = intensity / seconds;
27
+ const secondDivision = seconds / intensity;
28
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(firstDivision, 1)}`);
29
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(secondDivision, 1)}`);
30
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(electricCharge * 0.1, 1)}`);
31
+ while (propositions.length < n) {
32
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, randfloat_1.randfloat)(0, electricCharge, 1).frenchify()}`);
33
+ }
34
+ return (0, exercise_1.shuffleProps)(propositions, n);
35
+ };
36
+ const isAnswerValid = (ans, { answer }) => {
37
+ return ans === answer;
38
+ };
39
+ exports.electricChargeFromIntensity = {
40
+ id: "electricChargeFromIntensity",
41
+ label: "Calculer une charge électrique",
42
+ levels: ["1reSpé"],
43
+ isSingleStep: true,
44
+ sections: ["Électricité"],
45
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getElectricChargeFromIntensityQuestion, nb),
46
+ qcmTimer: 60,
47
+ freeTimer: 60,
48
+ getPropositions,
49
+ isAnswerValid,
50
+ subject: "Physique",
51
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ power: number;
4
+ seconds: number;
5
+ };
6
+ export declare const electricEnergyFromPower: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=electricEnergyFromPower.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"electricEnergyFromPower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/electricity/electricEnergyFromPower.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AA8BlC,KAAK,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAwCtD,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAazD,CAAC"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.electricEnergyFromPower = 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 round_1 = require("../../../math/utils/round");
8
+ const random_1 = require("../../../utils/random");
9
+ // const homeObjects = [
10
+ // { id: "lampLed", label: "ampoule LED", gender: "feminine", power: 7 },
11
+ // { id: "lampLed", label: "ampoule LED", gender: "feminine", power: 7 },
12
+ // {
13
+ // id: "lampLow",
14
+ // label: "ampoule à basse consommation",
15
+ // gender: "feminine",
16
+ // powers: 11,
17
+ // },
18
+ // {
19
+ // id: "lampInc",
20
+ // label: "ampoule à incandescence",
21
+ // gender: "feminine",
22
+ // power: 60,
23
+ // },
24
+ // { id: "wifi", label: "box WiFi", gender: "feminine", power: 13 },
25
+ // { id: "tv", label: "télévision", gender: "feminine", power: 300 },
26
+ // { id: "hairdryer", label: "sèche-cheveux", gender: "masculine", power: 1200 },
27
+ // { id: "fridge", label: "réfrigérateur", gender: "masculine", power: 500 },
28
+ // ];
29
+ // const durations = [{label: "année",gender: "feminine", valueInSeconds: }]
30
+ const powers = [15, 18, 50, 25, 65, 66, 7.5, 10];
31
+ const getElectricEnergyFromPowerQuestion = () => {
32
+ const power = (0, random_1.random)(powers);
33
+ const seconds = (0, randint_1.randint)(10, 61);
34
+ const energy = power * seconds;
35
+ const question = {
36
+ answer: `${energy.toScientific(0).toTex({ scientific: 0 })}`,
37
+ instruction: `Un chargeur a une puissance maximale de $${power}\\ \\text{W}$. Calculer l'énergie électrique qu'il fournit durant $${seconds}\\ \\text{secondes}$ de fonctionnement (en $\\text{J}$).`,
38
+ keys: ["timesTenPower"],
39
+ answerFormat: "tex",
40
+ identifiers: { power, seconds },
41
+ };
42
+ return question;
43
+ };
44
+ const getPropositions = (n, { answer, power, seconds }) => {
45
+ const propositions = [];
46
+ (0, exercise_1.addValidProp)(propositions, answer);
47
+ const energy = power * seconds;
48
+ const firstDivision = power / seconds;
49
+ const secondDivision = seconds / power;
50
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(firstDivision, 1)}`);
51
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(secondDivision, 1)}`);
52
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${(0, round_1.roundSignificant)(energy * 0.1, 0)}`);
53
+ return (0, exercise_1.shuffleProps)(propositions, n);
54
+ };
55
+ const isAnswerValid = (ans, { answer }) => {
56
+ return ans === answer;
57
+ };
58
+ exports.electricEnergyFromPower = {
59
+ id: "electricEnergyFromPower",
60
+ label: "Calculer une énergie électrique",
61
+ levels: ["1reSpé"],
62
+ isSingleStep: true,
63
+ sections: ["Électricité"],
64
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getElectricEnergyFromPowerQuestion, nb),
65
+ qcmTimer: 60,
66
+ freeTimer: 60,
67
+ getPropositions,
68
+ isAnswerValid,
69
+ subject: "Physique",
70
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./electricChargeFromIntensity";
2
+ export * from "./electricEnergyFromPower";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/electricity/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./electricChargeFromIntensity"), exports);
18
+ __exportStar(require("./electricEnergyFromPower"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./mariotte";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/fluids/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./mariotte"), exports);
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ p1: number;
4
+ v1: number;
5
+ p2: number | undefined;
6
+ v2: number | undefined;
7
+ isAskingPressure: boolean;
8
+ };
9
+ export declare const mariotte: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=mariotte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mariotte.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/fluids/mariotte.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAsEF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAa1C,CAAC"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mariotte = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
7
+ const round_1 = require("../../../math/utils/round");
8
+ const measure_1 = require("../../../pc/measure/measure");
9
+ const coinFlip_1 = require("../../../utils/coinFlip");
10
+ const doWhile_1 = require("../../../utils/doWhile");
11
+ const getMariotteQuestion = () => {
12
+ const isAskingPressure = (0, coinFlip_1.coinFlip)();
13
+ const v1 = (0, randfloat_1.randfloat)(2, 10, 1);
14
+ const p1 = new measure_1.Measure((0, randfloat_1.randfloat)(1, 10, 1), 5);
15
+ const v2 = isAskingPressure ? (0, randfloat_1.randfloat)(2, 10, 1, [v1]) : undefined;
16
+ const p2 = isAskingPressure
17
+ ? undefined
18
+ : (0, doWhile_1.doWhile)(() => new measure_1.Measure((0, randfloat_1.randfloat)(1, 10, 1), 5), (m) => m.equals(p1));
19
+ const answer = isAskingPressure
20
+ ? p1
21
+ .times(v1 / v2)
22
+ .toSignificant(1)
23
+ .toTex({ scientific: 1 })
24
+ : (0, round_1.roundSignificant)(p1.divide(p2).times(v1).evaluate(), 1);
25
+ const question = {
26
+ answer,
27
+ instruction: `Un volume d'air $V_1 = ${(0, round_1.roundSignificant)(v1, 1)}\\ \\text{L}$ contenu dans une bouteille hermétique est à la pression $P_1 = ${p1.toTex()}\\ \\text{Pa}$. En considérant que la température reste constante, calculer ${isAskingPressure ? "la pression $P_2$" : "le volume $V_2$"} de cet air lorsque ${isAskingPressure
28
+ ? `le volume est $V_2 = ${(0, round_1.roundSignificant)(v2, 1)}\\ \\text{L}$`
29
+ : `la pression est $P_2 = ${p2?.toTex()}\\ \\text{Pa}$`}.`,
30
+ keys: ["timesTenPower"],
31
+ answerFormat: "tex",
32
+ identifiers: {
33
+ v1,
34
+ p1: p1.significantPart,
35
+ v2,
36
+ p2: p2?.significantPart,
37
+ isAskingPressure,
38
+ },
39
+ };
40
+ return question;
41
+ };
42
+ const getPropositions = (n, { answer, isAskingPressure }) => {
43
+ const propositions = [];
44
+ (0, exercise_1.addValidProp)(propositions, answer);
45
+ while (propositions.length < n) {
46
+ if (isAskingPressure) {
47
+ (0, exercise_1.tryToAddWrongProp)(propositions, new measure_1.Measure((0, randfloat_1.randfloat)(1, 10, 1), 5)
48
+ .toSignificant(1)
49
+ .toTex({ scientific: 1 }));
50
+ }
51
+ else {
52
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.roundSignificant)((0, randfloat_1.randfloat)(0, 10, 1), 1));
53
+ }
54
+ }
55
+ return (0, exercise_1.shuffleProps)(propositions, n);
56
+ };
57
+ const isAnswerValid = (ans, { answer }) => {
58
+ return ans === answer;
59
+ };
60
+ exports.mariotte = {
61
+ id: "mariotte",
62
+ connector: "=",
63
+ label: "Utiliser la loi de Mariotte",
64
+ levels: ["1reSpé"],
65
+ isSingleStep: true,
66
+ sections: ["Fluides"],
67
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getMariotteQuestion, nb),
68
+ qcmTimer: 60,
69
+ freeTimer: 60,
70
+ getPropositions,
71
+ isAnswerValid,
72
+ subject: "Physique",
73
+ };