math-exercises 3.0.65 → 3.0.67

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 (202) hide show
  1. package/lib/exercises/math/calcul/fractions/periodicWritingToFraction.d.ts +1 -0
  2. package/lib/exercises/math/calcul/fractions/periodicWritingToFraction.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/fractions/periodicWritingToFraction.js +41 -20
  4. package/lib/exercises/math/calcul/fractions/simplifyFraction.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/fractions/simplifyFraction.js +4 -4
  6. package/lib/exercises/math/calcul/rounding/rounding.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/rounding/rounding.js +13 -21
  8. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.d.ts.map +1 -1
  9. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.js +4 -0
  10. package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.d.ts.map +1 -1
  11. package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.js +5 -6
  12. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.d.ts.map +1 -1
  13. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.js +4 -4
  14. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map +1 -1
  15. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +4 -4
  16. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts.map +1 -1
  17. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.js +4 -7
  18. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.js +4 -5
  20. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.js +4 -5
  22. package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.d.ts.map +1 -1
  23. package/lib/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.js +4 -4
  24. package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.js +4 -4
  26. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
  27. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +4 -6
  28. package/lib/exercises/math/calculLitteral/equation/equationWithDistributivity.d.ts.map +1 -1
  29. package/lib/exercises/math/calculLitteral/equation/equationWithDistributivity.js +4 -3
  30. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
  31. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.js +4 -6
  32. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.d.ts.map +1 -1
  33. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +4 -4
  34. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.d.ts.map +1 -1
  35. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.js +4 -6
  36. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.d.ts.map +1 -1
  37. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.js +4 -4
  38. package/lib/exercises/math/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
  39. package/lib/exercises/math/calculLitteral/equation/fractionEquation.js +4 -4
  40. package/lib/exercises/math/calculLitteral/factorisation/factoByX.d.ts.map +1 -1
  41. package/lib/exercises/math/calculLitteral/factorisation/factoByX.js +4 -4
  42. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  43. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +4 -6
  44. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  45. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +4 -6
  46. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  47. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +4 -6
  48. package/lib/exercises/math/calculLitteral/factorisation/factoType2.d.ts.map +1 -1
  49. package/lib/exercises/math/calculLitteral/factorisation/factoType2.js +4 -3
  50. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.d.ts.map +1 -1
  51. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.js +4 -4
  52. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts.map +1 -1
  53. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.js +4 -4
  54. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.d.ts.map +1 -1
  55. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.js +4 -7
  56. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.d.ts.map +1 -1
  57. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType2.js +4 -3
  58. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
  59. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +4 -5
  60. package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.d.ts.map +1 -1
  61. package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.js +4 -4
  62. package/lib/exercises/math/calculLitteral/simplifying/distributeAndSimplify.d.ts.map +1 -1
  63. package/lib/exercises/math/calculLitteral/simplifying/distributeAndSimplify.js +4 -2
  64. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
  65. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.js +4 -4
  66. package/lib/exercises/math/functions/variations/varTableExtremaReading.d.ts.map +1 -1
  67. package/lib/exercises/math/functions/variations/varTableExtremaReading.js +4 -5
  68. package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -1
  69. package/lib/exercises/math/geometry/angles/recognizeAngleType.js +4 -5
  70. package/lib/exercises/math/geometry/areas/circleRadiusFromArea.d.ts.map +1 -1
  71. package/lib/exercises/math/geometry/areas/circleRadiusFromArea.js +3 -0
  72. package/lib/exercises/math/geometry/areas/rectangleArea.d.ts.map +1 -1
  73. package/lib/exercises/math/geometry/areas/rectangleArea.js +4 -7
  74. package/lib/exercises/math/geometry/areas/rectangleSideFromArea.d.ts.map +1 -1
  75. package/lib/exercises/math/geometry/areas/rectangleSideFromArea.js +4 -3
  76. package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
  77. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +32 -16
  78. package/lib/exercises/math/geometry/areas/squareSideFromArea.d.ts.map +1 -1
  79. package/lib/exercises/math/geometry/areas/squareSideFromArea.js +3 -0
  80. package/lib/exercises/math/geometry/cartesian/distanceBetweenTwoPoints.d.ts.map +1 -1
  81. package/lib/exercises/math/geometry/cartesian/distanceBetweenTwoPoints.js +4 -4
  82. package/lib/exercises/math/geometry/cartesian/midpoint.d.ts.map +1 -1
  83. package/lib/exercises/math/geometry/cartesian/midpoint.js +4 -4
  84. package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
  85. package/lib/exercises/math/geometry/cartesian/placeAPoint.js +25 -11
  86. package/lib/exercises/math/geometry/cartesian/placeAbscissOnLine.d.ts.map +1 -1
  87. package/lib/exercises/math/geometry/cartesian/placeAbscissOnLine.js +4 -0
  88. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
  89. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +4 -4
  90. package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
  91. package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +4 -0
  92. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -1
  93. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.js +4 -0
  94. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts.map +1 -1
  95. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.js +33 -17
  96. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts.map +1 -1
  97. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +4 -5
  98. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.d.ts.map +1 -1
  99. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +4 -3
  100. package/lib/exercises/math/matrices/matrixGeneralTerm.d.ts.map +1 -1
  101. package/lib/exercises/math/matrices/matrixGeneralTerm.js +0 -2
  102. package/lib/exercises/math/percent/evolutions/index.d.ts +0 -1
  103. package/lib/exercises/math/percent/evolutions/index.d.ts.map +1 -1
  104. package/lib/exercises/math/percent/evolutions/index.js +0 -1
  105. package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
  106. package/lib/exercises/math/percent/findProportion.js +21 -1
  107. package/lib/exercises/math/percent/interests/compoundInterest.d.ts +12 -0
  108. package/lib/exercises/math/percent/interests/compoundInterest.d.ts.map +1 -0
  109. package/lib/exercises/math/percent/interests/compoundInterest.js +127 -0
  110. package/lib/exercises/math/percent/interests/compoundInterestDuration.d.ts +2 -0
  111. package/lib/exercises/math/percent/interests/compoundInterestDuration.d.ts.map +1 -0
  112. package/lib/exercises/math/percent/interests/compoundInterestDuration.js +166 -0
  113. package/lib/exercises/math/percent/interests/compoundInterestStartValue.d.ts +12 -0
  114. package/lib/exercises/math/percent/interests/compoundInterestStartValue.d.ts.map +1 -0
  115. package/lib/exercises/math/percent/interests/compoundInterestStartValue.js +132 -0
  116. package/lib/exercises/math/percent/interests/index.d.ts +3 -0
  117. package/lib/exercises/math/percent/interests/index.d.ts.map +1 -0
  118. package/lib/exercises/math/percent/interests/index.js +2 -0
  119. package/lib/exercises/math/primitive/constantPrimitive.d.ts.map +1 -1
  120. package/lib/exercises/math/primitive/constantPrimitive.js +0 -2
  121. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  122. package/lib/exercises/math/primitive/polynomialPrimitive.js +4 -0
  123. package/lib/exercises/math/primitive/sinCosPrimitive.d.ts.map +1 -1
  124. package/lib/exercises/math/primitive/sinCosPrimitive.js +25 -12
  125. package/lib/exercises/math/probaStat/binomial/binomialInequation.d.ts.map +1 -1
  126. package/lib/exercises/math/probaStat/binomial/binomialInequation.js +4 -3
  127. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.d.ts.map +1 -1
  128. package/lib/exercises/math/probaStat/binomial/expectedValueOfBinomialProba.js +52 -28
  129. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts.map +1 -1
  130. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.js +59 -39
  131. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts.map +1 -1
  132. package/lib/exercises/math/probaStat/diceBasicProbas.js +1 -4
  133. package/lib/exercises/math/sequences/sequencePlot.d.ts.map +1 -1
  134. package/lib/exercises/math/sequences/sequencePlot.js +59 -32
  135. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.d.ts.map +1 -1
  136. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +23 -7
  137. package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.d.ts.map +1 -1
  138. package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.js +23 -8
  139. package/lib/exercises/pc/chemicalElements/calculateVolumetricMass.d.ts +6 -1
  140. package/lib/exercises/pc/chemicalElements/calculateVolumetricMass.d.ts.map +1 -1
  141. package/lib/exercises/pc/chemicalElements/calculateVolumetricMass.js +61 -27
  142. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.d.ts.map +1 -1
  143. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.js +28 -10
  144. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.d.ts.map +1 -1
  145. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.js +43 -17
  146. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.d.ts.map +1 -1
  147. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.js +23 -8
  148. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.d.ts.map +1 -1
  149. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.js +22 -8
  150. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.d.ts.map +1 -1
  151. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +18 -5
  152. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.d.ts +1 -0
  153. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.d.ts.map +1 -1
  154. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.js +49 -24
  155. package/lib/exercises/pc/chemicalElements/weightPercent.d.ts.map +1 -1
  156. package/lib/exercises/pc/chemicalElements/weightPercent.js +42 -13
  157. package/lib/exercises/pc/chemicalReactions/calculateCombustionEnergy.d.ts.map +1 -1
  158. package/lib/exercises/pc/chemicalReactions/calculateCombustionEnergy.js +26 -9
  159. package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.d.ts.map +1 -1
  160. package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.js +48 -15
  161. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.d.ts.map +1 -1
  162. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.js +22 -9
  163. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.d.ts +1 -0
  164. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.d.ts.map +1 -1
  165. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +30 -15
  166. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts +7 -2
  167. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -1
  168. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +49 -33
  169. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.d.ts +1 -2
  170. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.d.ts.map +1 -1
  171. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.js +104 -67
  172. package/lib/exercises/pc/dosage/beerLambertRandomValue.d.ts +1 -1
  173. package/lib/exercises/pc/dosage/beerLambertRandomValue.d.ts.map +1 -1
  174. package/lib/exercises/pc/dosage/beerLambertRandomValue.js +99 -82
  175. package/lib/exercises/pc/dosage/concentrationCalculation.d.ts.map +1 -1
  176. package/lib/exercises/pc/dosage/concentrationCalculation.js +69 -40
  177. package/lib/exercises/pc/dosage/concentrationFromMassCalculation.d.ts.map +1 -1
  178. package/lib/exercises/pc/dosage/concentrationFromMassCalculation.js +78 -40
  179. package/lib/exercises/pc/electricity/calculateIntensity.d.ts.map +1 -1
  180. package/lib/exercises/pc/electricity/calculateIntensity.js +23 -19
  181. package/lib/exercises/pc/electricity/calculateIntensityInSerieOrParallel.d.ts.map +1 -1
  182. package/lib/exercises/pc/electricity/calculateIntensityInSerieOrParallel.js +51 -43
  183. package/lib/exercises/pc/electricity/calculateVoltage.d.ts.map +1 -1
  184. package/lib/exercises/pc/electricity/calculateVoltage.js +0 -2
  185. package/lib/exercises/pc/electricity/electricChargeFromIntensity.d.ts.map +1 -1
  186. package/lib/exercises/pc/electricity/electricChargeFromIntensity.js +19 -6
  187. package/lib/exercises/pc/electricity/electricEnergyFromPower.d.ts.map +1 -1
  188. package/lib/exercises/pc/electricity/electricEnergyFromPower.js +16 -6
  189. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.d.ts +1 -0
  190. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.d.ts.map +1 -1
  191. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.js +54 -24
  192. package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.d.ts.map +1 -1
  193. package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.js +44 -44
  194. package/lib/exercises/pc/electricity/ohmLaw.d.ts.map +1 -1
  195. package/lib/exercises/pc/electricity/ohmLaw.js +67 -24
  196. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts +1 -1
  197. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
  198. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +36 -43
  199. package/lib/index.d.ts +19 -12
  200. package/lib/index.d.ts.map +1 -1
  201. package/lib/latexTester.js +2 -0
  202. package/package.json +1 -1
@@ -3,6 +3,7 @@ type Identifiers = {
3
3
  num: number;
4
4
  denum: number;
5
5
  leadingPart: number;
6
+ periodicPart: number[];
6
7
  };
7
8
  export declare const periodicWritingToFraction: Exercise<Identifiers>;
8
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"periodicWritingToFraction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/periodicWritingToFraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA2EF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
1
+ {"version":3,"file":"periodicWritingToFraction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/periodicWritingToFraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAqGF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}
@@ -8,19 +8,8 @@ import { randint } from "../../../../math/utils/random/randint.js";
8
8
  * 1000x = 123,123123
9
9
  * 999x = 123
10
10
  */
11
- const getPeriodicWritingToFractionQuestion = () => {
12
- const periodicPartLength = randint(1, 4);
13
- const periodicPart = [];
14
- for (let i = 0; i < periodicPartLength; i++) {
15
- periodicPart.push(randint(periodicPartLength === 1 ? 1 : 0, 10, periodicPart));
16
- }
17
- const num = Number("0." + periodicPart.join("")) * 10 ** periodicPartLength;
18
- let denumString = "";
19
- for (let i = 0; i < periodicPartLength; i++) {
20
- denumString += "9";
21
- }
22
- const denum = Number(denumString);
23
- const leadingPart = DecimalConstructor.random(0, 10, randint(0, 3));
11
+ const getInstruction = (identifiers) => {
12
+ const { num, denum, leadingPart, periodicPart } = identifiers;
24
13
  let x = leadingPart.toTree().toTex();
25
14
  if (!x.includes(","))
26
15
  x += ",";
@@ -28,19 +17,52 @@ const getPeriodicWritingToFractionQuestion = () => {
28
17
  x += periodicPart.join("");
29
18
  }
30
19
  x += "\\ldots";
31
- const answer = new Rational(num, denum * 10 ** leadingPart.precision)
32
- .add(leadingPart.toRational())
20
+ return `Écrire sous forme de fraction :
21
+
22
+ $$
23
+ ${x}
24
+ $$`;
25
+ };
26
+ const getAnswer = (identifiers) => {
27
+ const { num, denum, leadingPart } = identifiers;
28
+ const leadingPartDec = new Decimal(leadingPart);
29
+ const answer = new Rational(num, denum * 10 ** leadingPartDec.precision)
30
+ .add(leadingPartDec.toRational())
33
31
  .toTree()
34
32
  .toTex();
33
+ return answer;
34
+ };
35
+ const getQuestionFromIdentifiers = (identifiers) => {
35
36
  const question = {
36
- answer,
37
- instruction: `Écrire sous forme de fraction : $${x}$`,
37
+ answer: getAnswer(identifiers),
38
+ instruction: getInstruction(identifiers),
38
39
  keys: [],
39
40
  answerFormat: "tex",
40
- identifiers: { num, denum, leadingPart: leadingPart.value },
41
+ identifiers,
41
42
  };
42
43
  return question;
43
44
  };
45
+ const getPeriodicWritingToFractionQuestion = () => {
46
+ const periodicPartLength = randint(1, 4);
47
+ const periodicPart = [];
48
+ for (let i = 0; i < periodicPartLength; i++) {
49
+ periodicPart.push(randint(periodicPartLength === 1 ? 1 : 0, 10, periodicPart));
50
+ }
51
+ const num = Number("0." + periodicPart.join("")) * 10 ** periodicPartLength;
52
+ let denumString = "";
53
+ for (let i = 0; i < periodicPartLength; i++) {
54
+ denumString += "9";
55
+ }
56
+ const denum = Number(denumString);
57
+ const leadingPart = DecimalConstructor.random(0, 10, randint(0, 3));
58
+ const identifiers = {
59
+ num,
60
+ denum,
61
+ leadingPart: leadingPart.value,
62
+ periodicPart,
63
+ };
64
+ return getQuestionFromIdentifiers(identifiers);
65
+ };
44
66
  const getPropositions = (n, { answer, num, denum, leadingPart }) => {
45
67
  const propositions = [];
46
68
  addValidProp(propositions, answer);
@@ -66,13 +88,12 @@ export const periodicWritingToFraction = {
66
88
  id: "periodicWritingToFraction",
67
89
  connector: "=",
68
90
  label: "Passer de l'écriture décimale périodique à l'écriture fractionnaire",
69
- levels: ["2nde"],
70
91
  isSingleStep: true,
71
- sections: ["Fractions"],
72
92
  generator: (nb) => getDistinctQuestions(getPeriodicWritingToFractionQuestion, nb),
73
93
  qcmTimer: 60,
74
94
  freeTimer: 60,
75
95
  getPropositions,
76
96
  isAnswerValid,
77
97
  subject: "Mathématiques",
98
+ getQuestionFromIdentifiers,
78
99
  };
@@ -1 +1 @@
1
- {"version":3,"file":"simplifyFraction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/simplifyFraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAgBlD,CAAC"}
1
+ {"version":3,"file":"simplifyFraction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/simplifyFraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAsGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}
@@ -57,6 +57,9 @@ ${alignTex([
57
57
  const getSimplifyFraction = () => {
58
58
  const rational = RationalConstructor.randomSimplifiable(10);
59
59
  const identifiers = { num: rational.num, denum: rational.denum };
60
+ return getQuestionFromIdentifiers(identifiers);
61
+ };
62
+ const getQuestionFromIdentifiers = (identifiers) => {
60
63
  const question = {
61
64
  instruction: getInstruction(identifiers),
62
65
  startStatement: getStartStatement(identifiers),
@@ -97,9 +100,6 @@ export const simplifyFraction = {
97
100
  getPropositions,
98
101
  isAnswerValid,
99
102
  subject: "Mathématiques",
100
- getAnswer,
101
- getInstruction,
102
- getCorrection,
103
- getHint,
103
+ getQuestionFromIdentifiers,
104
104
  hasHintAndCorrection: true,
105
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rounding.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/rounding.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAwBrC,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AACF,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4HF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBtD,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBzD,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiB1D,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiB1D,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAoBvD,CAAC"}
1
+ {"version":3,"file":"rounding.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/rounding/rounding.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAwBrC,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AACF,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAuIF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CActD,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAczD,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAc1D,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAc1D,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBvD,CAAC"}
@@ -16,6 +16,10 @@ const instructions = [
16
16
  "Arrondir au centième :",
17
17
  "Arrondir au millième :",
18
18
  ];
19
+ const getStartStatement = (identifiers) => {
20
+ const dec = new Decimal(identifiers.decimal);
21
+ return dec.toTree().toTex();
22
+ };
19
23
  const getInstruction = (identifiers, opts) => {
20
24
  const { precisionAsked } = identifiers;
21
25
  const dec = new Decimal(identifiers.decimal);
@@ -62,9 +66,12 @@ const getRoundQuestions = (opts) => {
62
66
  decimal: dec.value,
63
67
  precision,
64
68
  };
69
+ return getQuestionFromIdentifiers(identifiers);
70
+ };
71
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
65
72
  const question = {
66
73
  instruction: getInstruction(identifiers, opts),
67
- startStatement: decTex,
74
+ startStatement: getStartStatement(identifiers, opts),
68
75
  answer: getAnswer(identifiers, opts),
69
76
  keys: [],
70
77
  answerFormat: "tex",
@@ -112,10 +119,7 @@ export const roundToUnit = {
112
119
  isAnswerValid,
113
120
  subject: "Mathématiques",
114
121
  hasHintAndCorrection: true,
115
- getInstruction,
116
- getAnswer,
117
- getCorrection,
118
- getHint,
122
+ getQuestionFromIdentifiers,
119
123
  };
120
124
  /**
121
125
  * arrondi à l'unité
@@ -132,10 +136,7 @@ export const roundToDixieme = {
132
136
  isAnswerValid,
133
137
  subject: "Mathématiques",
134
138
  hasHintAndCorrection: true,
135
- getInstruction,
136
- getAnswer,
137
- getCorrection,
138
- getHint,
139
+ getQuestionFromIdentifiers,
139
140
  };
140
141
  /**
141
142
  * arrondi à l'unité
@@ -152,10 +153,7 @@ export const roundToCentieme = {
152
153
  isAnswerValid,
153
154
  subject: "Mathématiques",
154
155
  hasHintAndCorrection: true,
155
- getInstruction,
156
- getAnswer,
157
- getCorrection,
158
- getHint,
156
+ getQuestionFromIdentifiers,
159
157
  };
160
158
  /**
161
159
  * arrondi à l'unité
@@ -172,10 +170,7 @@ export const roundToMillieme = {
172
170
  isAnswerValid,
173
171
  subject: "Mathématiques",
174
172
  hasHintAndCorrection: true,
175
- getInstruction,
176
- getAnswer,
177
- getCorrection,
178
- getHint,
173
+ getQuestionFromIdentifiers,
179
174
  };
180
175
  export const allRoundings = {
181
176
  id: "allRoundings",
@@ -189,8 +184,5 @@ export const allRoundings = {
189
184
  isAnswerValid,
190
185
  subject: "Mathématiques",
191
186
  hasHintAndCorrection: true,
192
- getInstruction,
193
- getAnswer,
194
- getCorrection,
195
- getHint,
187
+ getQuestionFromIdentifiers,
196
188
  };
@@ -1 +1 @@
1
- {"version":3,"file":"canonicalFormDevelopment.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA2FF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAmB1D,CAAC"}
1
+ {"version":3,"file":"canonicalFormDevelopment.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiGF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAoB1D,CAAC"}
@@ -47,6 +47,9 @@ ${alignTex([
47
47
  const getCanonicalFormDevelopmentQuestion = () => {
48
48
  const trinom = TrinomConstructor.randomCanonical();
49
49
  const identifiers = { coeffs: trinom.coefficients };
50
+ return getQuestionFromIdentifiers(identifiers);
51
+ };
52
+ const getQuestionFromIdentifiers = (identifiers) => {
50
53
  const question = {
51
54
  answer: getAnswer(identifiers),
52
55
  instruction: getInstruction(identifiers),
@@ -97,4 +100,5 @@ export const canonicalFormDevelopment = {
97
100
  getAnswer,
98
101
  getHint,
99
102
  getCorrection,
103
+ getQuestionFromIdentifiers,
100
104
  };
@@ -1 +1 @@
1
- {"version":3,"file":"doubleDistri.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistri.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA+JF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAmBtD,CAAC"}
1
+ {"version":3,"file":"doubleDistri.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistri.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAgKF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAgBtD,CAAC"}
@@ -77,14 +77,16 @@ const getDoubleDistributivityQuestion = () => {
77
77
  const affines = AffineConstructor.differentRandoms(2, undefined, {
78
78
  excludes: [0],
79
79
  });
80
- const statementTree = new MultiplyNode(affines[0].toTree(), affines[1].toTree());
81
80
  const identifiers = {
82
81
  affine1Coeffs: affines[0].coefficients,
83
82
  affine2Coeffs: affines[1].coefficients,
84
83
  };
84
+ return getQuestionFromIdentifiers(identifiers);
85
+ };
86
+ const getQuestionFromIdentifiers = (identifiers) => {
85
87
  const question = {
86
88
  instruction: getInstruction(identifiers),
87
- startStatement: statementTree.toTex(),
89
+ startStatement: getStartStatement(identifiers),
88
90
  answer: getAnswer(identifiers),
89
91
  keys: ["x"],
90
92
  answerFormat: "tex",
@@ -148,8 +150,5 @@ export const doubleDistributivity = {
148
150
  isAnswerValid,
149
151
  subject: "Mathématiques",
150
152
  hasHintAndCorrection: true,
151
- getInstruction,
152
- getAnswer,
153
- getCorrection,
154
- getHint,
153
+ getQuestionFromIdentifiers,
155
154
  };
@@ -1 +1 @@
1
- {"version":3,"file":"doubleDistributivitySubstract.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,wBAAwB,EACzB,MAAM,yCAAyC,CAAC;AAQjD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,wBAAwB,CAAC;IAClC,OAAO,EAAE,wBAAwB,CAAC;IAElC,OAAO,EAAE,wBAAwB,CAAC;IAElC,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC,CAAC;AAiIF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAmB/D,CAAC"}
1
+ {"version":3,"file":"doubleDistributivitySubstract.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivitySubstract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,wBAAwB,EACzB,MAAM,yCAAyC,CAAC;AAQjD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,wBAAwB,CAAC;IAClC,OAAO,EAAE,wBAAwB,CAAC;IAElC,OAAO,EAAE,wBAAwB,CAAC;IAElC,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC,CAAC;AAsIF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAgB/D,CAAC"}
@@ -96,6 +96,9 @@ const getDoubleDistributivitySubstractQuestion = (ops) => {
96
96
  affine3: affine3.toIdentifiers(),
97
97
  affine4: affine4?.toIdentifiers(),
98
98
  };
99
+ return getQuestionFromIdentifiers(identifiers);
100
+ };
101
+ const getQuestionFromIdentifiers = (identifiers) => {
99
102
  const question = {
100
103
  answer: getAnswer(identifiers),
101
104
  instruction: getInstruction(identifiers),
@@ -118,8 +121,5 @@ export const doubleDistributivitySubstract = {
118
121
  getPropositions,
119
122
  isAnswerValid,
120
123
  subject: "Mathématiques",
121
- getInstruction,
122
- // getHint,
123
- // getCorrection,
124
- getAnswer,
124
+ getQuestionFromIdentifiers,
125
125
  };
@@ -1 +1 @@
1
- {"version":3,"file":"doubleDistributivityWithCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAyIF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAiB/D,CAAC"}
1
+ {"version":3,"file":"doubleDistributivityWithCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA+IF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
@@ -59,6 +59,9 @@ const getDoubleDistributivityWithCoeffQuestion = () => {
59
59
  affine1: affine1.coefficients,
60
60
  affine2: affine2.coefficients,
61
61
  };
62
+ return getQuestionFromIdentifiers(identifiers);
63
+ };
64
+ const getQuestionFromIdentifiers = (identifiers) => {
62
65
  const question = {
63
66
  answer: getAnswer(identifiers),
64
67
  instruction: getInstruction(identifiers),
@@ -98,8 +101,5 @@ export const doubleDistributivityWithCoeff = {
98
101
  isAnswerValid,
99
102
  subject: "Mathématiques",
100
103
  hasHintAndCorrection: true,
101
- getHint,
102
- getCorrection,
103
- getAnswer,
104
- getInstruction,
104
+ getQuestionFromIdentifiers,
105
105
  };
@@ -1 +1 @@
1
- {"version":3,"file":"idRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/idRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2EF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAwBnE,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAkClE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAgBvD,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAmB/C,CAAC"}
1
+ {"version":3,"file":"idRmq1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/idRmq1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2EF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAcnE,CAAC;AAkBF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAkClE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAgBvD,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAa/C,CAAC"}
@@ -77,6 +77,9 @@ export const getFirstIdentityQuestion = () => {
77
77
  max: 11,
78
78
  });
79
79
  const identifiers = { a: affine.a, b: affine.b };
80
+ return getQuestionFromIdentifiers(identifiers);
81
+ };
82
+ const getQuestionFromIdentifiers = (identifiers) => {
80
83
  const question = {
81
84
  instruction: getInstruction(identifiers),
82
85
  startStatement: getStartStatement(identifiers),
@@ -129,8 +132,6 @@ export const firstIdentity = {
129
132
  id: "idRmq1",
130
133
  connector: "=",
131
134
  label: "Identité remarquable $(a+b)^2$",
132
- levels: ["3ème", "2nde"],
133
- sections: ["Calcul littéral"],
134
135
  isSingleStep: false,
135
136
  generator: (nb) => getDistinctQuestions(getFirstIdentityQuestion, nb),
136
137
  qcmTimer: 60,
@@ -139,9 +140,5 @@ export const firstIdentity = {
139
140
  isAnswerValid: isFirstIdentityAnswerValid,
140
141
  subject: "Mathématiques",
141
142
  hasHintAndCorrection: true,
142
- getAnswer,
143
- getInstruction,
144
- getCorrection,
145
- getHint,
146
- getStartStatement,
143
+ getQuestionFromIdentifiers,
147
144
  };
@@ -1 +1 @@
1
- {"version":3,"file":"idRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/idRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiFF,eAAO,MAAM,yBAAyB,EAAE,iBAAiB,CAAC,WAAW,CAuBpE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,YAAY,CAAC,WAAW,CAqCnE,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,GAAG,CAAC,WAAW,CAgBxD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
1
+ {"version":3,"file":"idRmq2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/idRmq2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiFF,eAAO,MAAM,yBAAyB,EAAE,iBAAiB,CAAC,WAAW,CAapE,CAAC;AAkBF,eAAO,MAAM,6BAA6B,EAAE,YAAY,CAAC,WAAW,CAqCnE,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,GAAG,CAAC,WAAW,CAgBxD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
@@ -83,6 +83,9 @@ export const getSecondIdentityQuestion = () => {
83
83
  max: 0,
84
84
  });
85
85
  const identifiers = { a: affine.a, b: affine.b };
86
+ return getQuestionFromIdentifiers(identifiers);
87
+ };
88
+ const getQuestionFromIdentifiers = (identifiers) => {
86
89
  const question = {
87
90
  instruction: getInstruction(identifiers),
88
91
  startStatement: getStartStatement(identifiers),
@@ -142,9 +145,5 @@ export const secondIdentity = {
142
145
  freeTimer: 60,
143
146
  subject: "Mathématiques",
144
147
  hasHintAndCorrection: true,
145
- getInstruction,
146
- getCorrection,
147
- getHint,
148
- getAnswer,
149
- getStartStatement,
148
+ getQuestionFromIdentifiers,
150
149
  };
@@ -1 +1 @@
1
- {"version":3,"file":"idRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/idRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAoEF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAkBnE,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CA2BlE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAgBvD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAiB/C,CAAC"}
1
+ {"version":3,"file":"idRmq3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/idRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAoEF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAQnE,CAAC;AAiBF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CA2BlE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAgBvD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAa/C,CAAC"}
@@ -78,6 +78,9 @@ export const getThirdIdentityQuestion = () => {
78
78
  affine1Coeffs: affine.coefficients,
79
79
  affine2Coeffs: affine2.coefficients,
80
80
  };
81
+ return getQuestionFromIdentifiers(identifiers);
82
+ };
83
+ const getQuestionFromIdentifiers = (identifiers) => {
81
84
  const question = {
82
85
  instruction: getInstruction(identifiers),
83
86
  startStatement: getStartStatement(identifiers),
@@ -135,9 +138,5 @@ export const thirdIdentity = {
135
138
  freeTimer: 60,
136
139
  subject: "Mathématiques",
137
140
  hasHintAndCorrection: true,
138
- getInstruction,
139
- getCorrection,
140
- getHint,
141
- getAnswer,
142
- getStartStatement,
141
+ getQuestionFromIdentifiers,
143
142
  };
@@ -1 +1 @@
1
- {"version":3,"file":"identitiesWithNonIntegers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAU7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AA2HF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAgB3D,CAAC"}
1
+ {"version":3,"file":"identitiesWithNonIntegers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/identitiesWithNonIntegers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAU7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AAiIF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}
@@ -107,6 +107,9 @@ const getIdentitiesWithNonIntegersQuestion = (ops) => {
107
107
  a: a.toIdentifiers(),
108
108
  b: b.toIdentifiers(),
109
109
  };
110
+ return getQuestionFromIdentifiers(identifiers);
111
+ };
112
+ const getQuestionFromIdentifiers = (identifiers) => {
110
113
  const question = {
111
114
  answer: getAnswer(identifiers),
112
115
  instruction: getInstruction(identifiers),
@@ -129,8 +132,5 @@ export const identitiesWithNonIntegers = {
129
132
  getPropositions,
130
133
  isAnswerValid,
131
134
  subject: "Mathématiques",
132
- getInstruction,
133
- // getHint,
134
- // getCorrection,
135
- getAnswer,
135
+ getQuestionFromIdentifiers,
136
136
  };
@@ -1 +1 @@
1
- {"version":3,"file":"simpleDistriXCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8GF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAkBpD,CAAC"}
1
+ {"version":3,"file":"simpleDistriXCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmHF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
@@ -80,6 +80,9 @@ const getSimpleDistriXCoeffQuestion = () => {
80
80
  const b = randint(-10, 11, [0]);
81
81
  const c = randint(-10, 11, [0]);
82
82
  const identifiers = { a, b, c };
83
+ return getQuestionFromIdentifiers(identifiers);
84
+ };
85
+ const getQuestionFromIdentifiers = (identifiers) => {
83
86
  const question = {
84
87
  answer: getAnswer(identifiers),
85
88
  instruction: getInstruction(identifiers),
@@ -103,9 +106,6 @@ export const simpleDistriXCoeff = {
103
106
  getPropositions,
104
107
  isAnswerValid,
105
108
  subject: "Mathématiques",
106
- getHint,
107
- getCorrection,
108
- getInstruction,
109
- getAnswer,
109
+ getQuestionFromIdentifiers,
110
110
  hasHintAndCorrection: true,
111
111
  };
@@ -1 +1 @@
1
- {"version":3,"file":"equationSimpleSquare.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationSimpleSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AA2BrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA+JF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAkBtD,CAAC"}
1
+ {"version":3,"file":"equationSimpleSquare.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationSimpleSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AA2BrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAqKF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
@@ -83,6 +83,9 @@ const getEquationSimpleSquare = () => {
83
83
  else
84
84
  randNbr = randint(2, 100);
85
85
  const identifiers = { randNbr };
86
+ return getQuestionFromIdentifiers(identifiers);
87
+ };
88
+ const getQuestionFromIdentifiers = (identifiers) => {
86
89
  const question = {
87
90
  instruction: getInstruction(identifiers),
88
91
  answer: getAnswer(identifiers),
@@ -146,8 +149,6 @@ export const equationSimpleSquare = {
146
149
  id: "equationSimpleSquare",
147
150
  connector: "=",
148
151
  label: "Résoudre une équation du second degré du type $x^2 = a$",
149
- levels: ["2nde", "1reESM", "1reSpé", "1reTech"],
150
- sections: ["Équations"],
151
152
  isSingleStep: false,
152
153
  generator: (nb) => getDistinctQuestions(getEquationSimpleSquare, nb),
153
154
  qcmTimer: 60,
@@ -156,8 +157,5 @@ export const equationSimpleSquare = {
156
157
  isAnswerValid,
157
158
  subject: "Mathématiques",
158
159
  hasHintAndCorrection: true,
159
- getAnswer,
160
- getCorrection,
161
- getInstruction,
162
- getHint,
160
+ getQuestionFromIdentifiers,
163
161
  };
@@ -1 +1 @@
1
- {"version":3,"file":"equationWithDistributivity.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationWithDistributivity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuEF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AA0DF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBrE,CAAC"}
1
+ {"version":3,"file":"equationWithDistributivity.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationWithDistributivity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuEF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAgEF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAcrE,CAAC"}
@@ -88,6 +88,9 @@ const getEquationWithDistributivityQuestion = (opts) => {
88
88
  e,
89
89
  f,
90
90
  };
91
+ return getQuestionFromIdentifiers(identifiers, opts);
92
+ };
93
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
91
94
  const question = {
92
95
  answer: getAnswer(identifiers),
93
96
  instruction: getInstruction(identifiers),
@@ -118,8 +121,6 @@ export const equationWithDistributivity = {
118
121
  getPropositions,
119
122
  isAnswerValid,
120
123
  subject: "Mathématiques",
121
- // getHint,
122
- // getCorrection,
123
- getAnswer,
124
+ getQuestionFromIdentifiers,
124
125
  options,
125
126
  };
@@ -1 +1 @@
1
- {"version":3,"file":"firstDegreeEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA4FF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAkBrD,CAAC"}
1
+ {"version":3,"file":"firstDegreeEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkGF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAarD,CAAC"}
@@ -52,6 +52,9 @@ const getFirstDegreeEquation = () => {
52
52
  const a = randint(-30, 30, [0]);
53
53
  const b = randint(-30, 30, [0]);
54
54
  const identifiers = { a, b };
55
+ return getQuestionFromIdentifiers(identifiers);
56
+ };
57
+ const getQuestionFromIdentifiers = (identifiers) => {
55
58
  const question = {
56
59
  instruction: getInstruction(identifiers),
57
60
  startStatement: `x`,
@@ -84,8 +87,6 @@ export const firstDegreeEquation = {
84
87
  id: "firstDegreeEquation",
85
88
  connector: "=",
86
89
  label: "Résoudre une équation du type $\\frac{a}{x} = b$",
87
- levels: ["2nde", "1reESM", "1reSpé"],
88
- sections: ["Équations", "Fonction inverse", "Fonctions de référence"],
89
90
  isSingleStep: false,
90
91
  generator: (nb) => getDistinctQuestions(getFirstDegreeEquation, nb),
91
92
  getPropositions,
@@ -94,8 +95,5 @@ export const firstDegreeEquation = {
94
95
  isAnswerValid,
95
96
  subject: "Mathématiques",
96
97
  hasHintAndCorrection: true,
97
- getHint,
98
- getInstruction,
99
- getCorrection,
100
- getAnswer,
98
+ getQuestionFromIdentifiers,
101
99
  };
@@ -1 +1 @@
1
- {"version":3,"file":"firstDegreeEquationIntType1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+GF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAkB7D,CAAC"}
1
+ {"version":3,"file":"firstDegreeEquationIntType1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqHF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAe7D,CAAC"}
@@ -50,6 +50,9 @@ const getFirstDegreeEquationIntQuestion = () => {
50
50
  const x = randint(-15, 15, [0]);
51
51
  const b = a * x;
52
52
  const identifiers = { a: a, x: x, b: b };
53
+ return getQuestionFromIdentifiers(identifiers);
54
+ };
55
+ const getQuestionFromIdentifiers = (identifiers) => {
53
56
  const question = {
54
57
  answer: getAnswer(identifiers),
55
58
  instruction: getInstruction(identifiers),
@@ -102,8 +105,5 @@ export const firstDegreeEquationIntType1 = {
102
105
  isAnswerValid,
103
106
  subject: "Mathématiques",
104
107
  hasHintAndCorrection: true,
105
- getHint,
106
- getInstruction,
107
- getCorrection,
108
- getAnswer,
108
+ getQuestionFromIdentifiers,
109
109
  };
@@ -1 +1 @@
1
- {"version":3,"file":"firstDegreeEquationIntType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6HF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAkB7D,CAAC"}
1
+ {"version":3,"file":"firstDegreeEquationIntType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkIF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAa7D,CAAC"}
@@ -49,6 +49,9 @@ const getFirstDegreeEquationIntQuestion = () => {
49
49
  const c = randint(-15, 15, [0, a * x]);
50
50
  const b = c - a * x;
51
51
  const identifiers = { a, b, c, x };
52
+ return getQuestionFromIdentifiers(identifiers);
53
+ };
54
+ const getQuestionFromIdentifiers = (identifiers) => {
52
55
  const question = {
53
56
  answer: getAnswer(identifiers),
54
57
  instruction: getInstruction(identifiers),
@@ -93,9 +96,7 @@ const isAnswerValid = (ans, { answer, x }) => {
93
96
  export const firstDegreeEquationIntType2 = {
94
97
  id: "firstDegreeEquationIntType2",
95
98
  label: "Résoudre une équation du type $ax + b = c$ (solution entière)",
96
- levels: ["2nde"],
97
99
  isSingleStep: true,
98
- sections: ["Équations"],
99
100
  generator: (nb) => getDistinctQuestions(getFirstDegreeEquationIntQuestion, nb),
100
101
  qcmTimer: 60,
101
102
  freeTimer: 60,
@@ -103,8 +104,5 @@ export const firstDegreeEquationIntType2 = {
103
104
  isAnswerValid,
104
105
  subject: "Mathématiques",
105
106
  hasHintAndCorrection: true,
106
- getAnswer,
107
- getCorrection,
108
- getHint,
109
- getInstruction,
107
+ getQuestionFromIdentifiers,
110
108
  };