math-exercises 2.2.4 → 2.2.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 (235) 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/calcul/digitDecimalRank.js +4 -4
  4. package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts +8 -0
  5. package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts.map +1 -0
  6. package/lib/exercises/math/calcul/digitDecimalRankNumber.js +60 -0
  7. package/lib/exercises/math/calcul/digitRank.js +4 -4
  8. package/lib/exercises/math/calcul/digitRankNumber.d.ts +8 -0
  9. package/lib/exercises/math/calcul/digitRankNumber.d.ts.map +1 -0
  10. package/lib/exercises/math/calcul/digitRankNumber.js +56 -0
  11. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +34 -0
  13. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +17 -0
  15. package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/fractions/fractionsDivision.js +23 -0
  17. package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
  18. package/lib/exercises/math/calcul/fractions/fractionsProduct.js +15 -0
  19. package/lib/exercises/math/calcul/index.d.ts +2 -0
  20. package/lib/exercises/math/calcul/index.d.ts.map +1 -1
  21. package/lib/exercises/math/calcul/index.js +2 -0
  22. package/lib/exercises/math/calcul/proportionality/scaleUsage.js +1 -1
  23. package/lib/exercises/math/calcul/rounding/rounding.d.ts.map +1 -1
  24. package/lib/exercises/math/calcul/rounding/rounding.js +18 -0
  25. package/lib/exercises/math/calculLitteral/distributivity/allIdentities.d.ts.map +1 -1
  26. package/lib/exercises/math/calculLitteral/distributivity/allIdentities.js +1 -0
  27. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.d.ts.map +1 -1
  28. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.js +1 -0
  29. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
  30. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.js +31 -1
  31. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map +1 -1
  32. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +11 -2
  33. package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
  34. package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.js +21 -2
  35. package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
  36. package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +23 -2
  37. package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
  38. package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.js +17 -2
  39. package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
  40. package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.js +21 -2
  41. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.d.ts.map +1 -1
  42. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +26 -1
  43. package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.d.ts.map +1 -1
  44. package/lib/exercises/math/calculLitteral/equation/equationType1Exercise.js +18 -2
  45. package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
  46. package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +19 -2
  47. package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.d.ts.map +1 -1
  48. package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +15 -2
  49. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
  50. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +20 -5
  51. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
  52. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.js +24 -1
  53. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.d.ts.map +1 -1
  54. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +20 -1
  55. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.d.ts.map +1 -1
  56. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.js +19 -3
  57. package/lib/exercises/math/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
  58. package/lib/exercises/math/calculLitteral/equation/fractionEquation.js +24 -8
  59. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  60. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +21 -2
  61. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  62. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +24 -4
  63. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  64. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +25 -5
  65. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  66. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +19 -0
  67. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  68. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +1 -0
  69. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.d.ts +8 -0
  70. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.d.ts.map +1 -0
  71. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.js +77 -0
  72. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts +8 -0
  73. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts.map +1 -0
  74. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.js +80 -0
  75. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +2 -0
  76. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  77. package/lib/exercises/math/calculLitteral/factorisation/index.js +2 -0
  78. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
  79. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +1 -0
  80. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts +2 -0
  81. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
  82. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +46 -66
  83. package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
  84. package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +12 -2
  85. package/lib/exercises/math/functions/trinoms/index.d.ts +2 -0
  86. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  87. package/lib/exercises/math/functions/trinoms/index.js +2 -0
  88. package/lib/exercises/math/functions/trinoms/solveEquationByFactorisation.d.ts +5 -0
  89. package/lib/exercises/math/functions/trinoms/solveEquationByFactorisation.d.ts.map +1 -0
  90. package/lib/exercises/math/functions/trinoms/solveEquationByFactorisation.js +44 -0
  91. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.d.ts +9 -0
  92. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -0
  93. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.js +134 -0
  94. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.d.ts +7 -0
  95. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.d.ts.map +1 -0
  96. package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.js +59 -0
  97. package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
  98. package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.js +1 -0
  99. package/lib/exercises/math/index.d.ts +1 -0
  100. package/lib/exercises/math/index.d.ts.map +1 -1
  101. package/lib/exercises/math/index.js +1 -0
  102. package/lib/exercises/math/percent/applyPercent.d.ts.map +1 -1
  103. package/lib/exercises/math/percent/applyPercent.js +20 -2
  104. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  105. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +5 -4
  106. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.d.ts +11 -0
  107. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.d.ts.map +1 -0
  108. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.js +49 -0
  109. package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -0
  110. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  111. package/lib/exercises/math/sequences/arithmetic/index.js +1 -0
  112. package/lib/exercises/math/spaceGeometry/index.d.ts +2 -0
  113. package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -0
  114. package/lib/exercises/math/spaceGeometry/index.js +17 -0
  115. package/lib/exercises/math/spaceGeometry/vectors/index.d.ts +4 -0
  116. package/lib/exercises/math/spaceGeometry/vectors/index.d.ts.map +1 -0
  117. package/lib/exercises/math/spaceGeometry/vectors/index.js +19 -0
  118. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts +5 -0
  119. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts.map +1 -0
  120. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +52 -0
  121. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.d.ts +5 -0
  122. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.d.ts.map +1 -0
  123. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.js +62 -0
  124. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts +9 -0
  125. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts.map +1 -0
  126. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +54 -0
  127. package/lib/exercises/math/squareRoots/squareRootIdentities.js +3 -3
  128. package/lib/exercises/math/suites/sequencePlot.d.ts.map +1 -1
  129. package/lib/exercises/math/suites/sequencePlot.js +1 -2
  130. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  131. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +1 -0
  132. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
  133. package/lib/exercises/pc/calibrationCurveOfSolution.js +1 -0
  134. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.d.ts.map +1 -1
  135. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.js +1 -0
  136. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.d.ts.map +1 -1
  137. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.js +1 -0
  138. package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.d.ts.map +1 -1
  139. package/lib/exercises/pc/chemicalReactions/calculateSynthesisEfficiency.js +1 -0
  140. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.d.ts.map +1 -1
  141. package/lib/exercises/pc/chemicalReactions/titrationEquivalenceRelation.js +1 -0
  142. package/lib/exercises/pc/dosage/beerLambertRandomValue.d.ts.map +1 -1
  143. package/lib/exercises/pc/dosage/beerLambertRandomValue.js +1 -0
  144. package/lib/exercises/pc/dosage/concentrationCalculation.d.ts.map +1 -1
  145. package/lib/exercises/pc/dosage/concentrationCalculation.js +1 -0
  146. package/lib/exercises/pc/dosage/concentrationFromMassCalculation.d.ts.map +1 -1
  147. package/lib/exercises/pc/dosage/concentrationFromMassCalculation.js +1 -0
  148. package/lib/exercises/pc/electricity/calculateIntensity.js +1 -1
  149. package/lib/exercises/pc/electricity/calculateVoltage.d.ts.map +1 -1
  150. package/lib/exercises/pc/electricity/calculateVoltage.js +1 -0
  151. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.d.ts.map +1 -1
  152. package/lib/exercises/pc/electricity/electricPowerOrEnergyCalculation.js +1 -0
  153. package/lib/exercises/pc/electricity/ohmLaw.d.ts.map +1 -1
  154. package/lib/exercises/pc/electricity/ohmLaw.js +1 -0
  155. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
  156. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +1 -0
  157. package/lib/exercises/pc/energy/calorificValue.d.ts.map +1 -1
  158. package/lib/exercises/pc/energy/calorificValue.js +1 -0
  159. package/lib/exercises/pc/energy/combustionTransferEnergy.d.ts.map +1 -1
  160. package/lib/exercises/pc/energy/combustionTransferEnergy.js +1 -0
  161. package/lib/exercises/pc/energy/combustionTransferEnergy2.d.ts.map +1 -1
  162. package/lib/exercises/pc/energy/combustionTransferEnergy2.js +1 -0
  163. package/lib/exercises/pc/energy/efficencyOfConverter.d.ts.map +1 -1
  164. package/lib/exercises/pc/energy/efficencyOfConverter.js +1 -0
  165. package/lib/exercises/pc/energy/efficiencyCalculation.d.ts.map +1 -1
  166. package/lib/exercises/pc/energy/efficiencyCalculation.js +1 -0
  167. package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.d.ts.map +1 -1
  168. package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.js +1 -0
  169. package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.d.ts.map +1 -1
  170. package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.js +1 -0
  171. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -1
  172. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +1 -0
  173. package/lib/exercises/pc/forces/electroStaticForce.d.ts.map +1 -1
  174. package/lib/exercises/pc/forces/electroStaticForce.js +1 -0
  175. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.d.ts.map +1 -1
  176. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.js +1 -0
  177. package/lib/exercises/pc/forces/gravitationalForcePlanets.d.ts.map +1 -1
  178. package/lib/exercises/pc/forces/gravitationalForcePlanets.js +1 -0
  179. package/lib/exercises/pc/forces/massWeight.d.ts.map +1 -1
  180. package/lib/exercises/pc/forces/massWeight.js +1 -0
  181. package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
  182. package/lib/exercises/pc/motion/averageSpeed.js +1 -0
  183. package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -1
  184. package/lib/exercises/pc/motion/averageSpeedCalculation.js +1 -0
  185. package/lib/exercises/pc/motion/motionReference.d.ts.map +1 -1
  186. package/lib/exercises/pc/motion/motionReference.js +1 -0
  187. package/lib/exercises/pc/pH.d.ts.map +1 -1
  188. package/lib/exercises/pc/pH.js +1 -0
  189. package/lib/exercises/pc/power/calculatePowerOfLight.d.ts.map +1 -1
  190. package/lib/exercises/pc/power/calculatePowerOfLight.js +1 -0
  191. package/lib/exercises/pc/spectral/spectralEnergy.d.ts.map +1 -1
  192. package/lib/exercises/pc/spectral/spectralEnergy.js +1 -0
  193. package/lib/exercises/pc/waves/lightDistanceConversion.d.ts.map +1 -1
  194. package/lib/exercises/pc/waves/lightDistanceConversion.js +1 -0
  195. package/lib/exercises/pc/waves/periodicWaveCelerity.d.ts.map +1 -1
  196. package/lib/exercises/pc/waves/periodicWaveCelerity.js +1 -0
  197. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
  198. package/lib/exercises/pc/weight/calculateWeight.js +1 -0
  199. package/lib/exercises/pc/weight/weightOnTheMoon.d.ts.map +1 -1
  200. package/lib/exercises/pc/weight/weightOnTheMoon.js +1 -0
  201. package/lib/index.d.ts +33 -64
  202. package/lib/index.d.ts.map +1 -1
  203. package/lib/index.js +4 -0
  204. package/lib/math/geometry/spacePoint.d.ts +27 -0
  205. package/lib/math/geometry/spacePoint.d.ts.map +1 -0
  206. package/lib/math/geometry/spacePoint.js +80 -0
  207. package/lib/math/geometry/spaceVector.d.ts +28 -0
  208. package/lib/math/geometry/spaceVector.d.ts.map +1 -0
  209. package/lib/math/geometry/spaceVector.js +83 -0
  210. package/lib/math/numbers/decimals/decimal.d.ts +1 -0
  211. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  212. package/lib/math/numbers/decimals/decimal.js +8 -0
  213. package/lib/math/numbers/rationals/rational.d.ts +1 -0
  214. package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
  215. package/lib/math/numbers/rationals/rational.js +4 -0
  216. package/lib/math/utils/random/randTupleInt.d.ts +1 -0
  217. package/lib/math/utils/random/randTupleInt.d.ts.map +1 -1
  218. package/lib/math/utils/random/randTupleInt.js +5 -1
  219. package/lib/playground.d.ts +2 -0
  220. package/lib/playground.d.ts.map +1 -0
  221. package/lib/playground.js +20 -0
  222. package/lib/server.d.ts +3 -0
  223. package/lib/server.d.ts.map +1 -1
  224. package/lib/server.js +7 -0
  225. package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
  226. package/lib/tree/nodes/equations/equationSolutionNode.js +8 -0
  227. package/lib/tree/nodes/node.d.ts +1 -0
  228. package/lib/tree/nodes/node.d.ts.map +1 -1
  229. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  230. package/lib/tree/nodes/operators/multiplyNode.js +8 -2
  231. package/lib/tree/nodes/operators/powerNode.js +1 -1
  232. package/lib/utils/alignTex.d.ts +2 -0
  233. package/lib/utils/alignTex.d.ts.map +1 -0
  234. package/lib/utils/alignTex.js +18 -0
  235. package/package.json +1 -1
@@ -2,6 +2,8 @@ import { Exercise } from "../../../../exercises/exercise";
2
2
  type Identifiers = {
3
3
  xValues: number[];
4
4
  imageValues: number[];
5
+ isAskingImage: boolean;
6
+ value: number;
5
7
  };
6
8
  export declare const inverseImageFunctionTable: Exercise<Identifiers>;
7
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"inverseImageFunctionTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA8GF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
1
+ {"version":3,"file":"inverseImageFunctionTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgFF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
@@ -3,91 +3,71 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.inverseImageFunctionTable = void 0;
4
4
  const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
- const polynomial_1 = require("../../../../math/polynomials/polynomial");
6
+ const randTupleInt_1 = require("../../../../math/utils/random/randTupleInt");
7
7
  const randint_1 = require("../../../../math/utils/random/randint");
8
+ const arrayHasSameElement_1 = require("../../../../utils/arrayHasSameElement");
8
9
  const coinFlip_1 = require("../../../../utils/coinFlip");
9
10
  const random_1 = require("../../../../utils/random");
10
11
  const getInverseImageFunctionTableQuestion = () => {
11
- const exercise = generateExercise();
12
- const instruction = `Ci-dessous est donné le tableau de valeurs d'une fonction $f$. Déterminer ${exercise.isAskingImage ? `l'image de` : `le ou les antécédents de`} $${exercise.questionValue}$ par $f$
13
- ${exercise.exoTable.table}`;
12
+ const xValues = (0, randTupleInt_1.randTupleInt)(5, {
13
+ from: -10,
14
+ to: 10,
15
+ allDifferent: true,
16
+ }).sort((a, b) => a - b);
17
+ const yValues = (0, randTupleInt_1.randTupleInt)(5, { from: -10, to: 10 });
18
+ let indexAsked = (0, randint_1.randint)(0, 5);
19
+ const valueAsked = xValues[indexAsked];
20
+ //on force un meme nombre dans les deux lignes pour complexifier
21
+ if (!yValues.includes(valueAsked) || yValues[indexAsked] === valueAsked) {
22
+ yValues[(0, randint_1.randint)(0, 5, [indexAsked])] = valueAsked;
23
+ }
24
+ const isAskingImage = (0, coinFlip_1.coinFlip)();
25
+ const answer = (isAskingImage
26
+ ? yValues[indexAsked]
27
+ : xValues
28
+ .filter((el, index) => yValues[index] === valueAsked)
29
+ .join("\\text{ et }")) + "";
30
+ const instruction = `Ci-dessous est donné le tableau de valeurs d'une fonction $f$. Déterminer ${isAskingImage ? `l'image de` : `le ou les antécédents de`} $${valueAsked}$ par $f$.
31
+
32
+ |$x$|${xValues.map((value) => `$${value}$`).join("|")}|
33
+ |-|-|-|-|-|-|
34
+ |$f(x)$|${yValues.map((value) => `$${value}$`).join("|")}|
35
+ `;
14
36
  const question = {
15
- answer: `${exercise.answer}`,
37
+ answer,
16
38
  instruction,
17
- keys: ["x", "equal"],
39
+ keys: ["et"],
18
40
  answerFormat: "tex",
19
41
  style: { tableHasNoHeader: true },
20
42
  identifiers: {
21
- xValues: exercise.exoTable.xValues,
22
- imageValues: exercise.exoTable.imageValues,
43
+ xValues,
44
+ imageValues: yValues,
45
+ isAskingImage,
46
+ value: valueAsked,
23
47
  },
24
48
  };
25
49
  return question;
26
50
  };
27
- const getPropositions = (n, { answer, xValues, imageValues }) => {
51
+ const getPropositions = (n, { answer, xValues, imageValues, isAskingImage, value }) => {
28
52
  const propositions = [];
29
53
  (0, exercise_1.addValidProp)(propositions, answer);
30
- generatePropositions(xValues, imageValues, answer).forEach((value) => (0, exercise_1.tryToAddWrongProp)(propositions, value));
54
+ if (isAskingImage) {
55
+ (0, exercise_1.tryToAddWrongProp)(propositions, xValues[imageValues.indexOf(value)] + "");
56
+ }
57
+ else {
58
+ (0, exercise_1.tryToAddWrongProp)(propositions, imageValues[xValues.indexOf(value)] + "");
59
+ }
31
60
  while (propositions.length < n) {
32
- let randProp = (0, randint_1.randint)(+answer - 10, +answer + 11, [+answer]);
33
- (0, exercise_1.tryToAddWrongProp)(propositions, randProp + "");
61
+ (0, exercise_1.tryToAddWrongProp)(propositions, ((0, coinFlip_1.coinFlip)() ? (0, random_1.random)(xValues) : (0, random_1.random)(imageValues)) + "");
34
62
  }
35
63
  return (0, exercise_1.shuffleProps)(propositions, n);
36
64
  };
37
- const isAnswerValid = (ans, { answer }) => {
38
- return [ans, ans.split("=")[1]].includes(answer);
39
- };
40
- const generateTable = (f) => {
41
- const xValues = generateXValues();
42
- const imageValues = xValues.map((value) => f.calculate(value));
43
- return {
44
- xValues,
45
- imageValues,
46
- table: `
47
- |$x$|${xValues
48
- .map((value) => `$${value}$`)
49
- .reduce((prev, curr) => prev + "|" + curr)}|
50
- |-|-|-|-|-|-|
51
- |$f(x)$|${imageValues
52
- .map((value) => `$${value}$`)
53
- .reduce((prev, curr) => prev + "|" + curr)}|
54
- `,
55
- };
56
- };
57
- const generateXValues = () => {
58
- const xValues = [];
59
- for (let i = 0; i < 5; i++) {
60
- let value;
61
- do {
62
- value = (0, randint_1.randint)(-11, 11);
63
- } while (xValues.includes(value));
64
- xValues.push(value);
65
- }
66
- xValues.sort((a, b) => {
67
- return a - b;
68
- });
69
- return xValues;
70
- };
71
- const generateExercise = () => {
72
- const polynom = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-5, 6, [0])]);
73
- const exoTable = generateTable(polynom);
74
- const isAskingImage = (0, coinFlip_1.coinFlip)();
75
- const questionValue = isAskingImage
76
- ? (0, random_1.random)(exoTable.xValues)
77
- : (0, random_1.random)(exoTable.imageValues);
78
- const answer = isAskingImage
79
- ? polynom.calculate(questionValue)
80
- : exoTable.xValues.find((value, index) => exoTable.imageValues[index] === questionValue);
81
- return { polynom, exoTable, isAskingImage, questionValue, answer };
82
- };
83
- const generatePropositions = (xValues, imageValues, answer) => {
84
- const filteredXValues = xValues.filter((value) => value !== +answer);
85
- const firstProp = (0, random_1.random)(filteredXValues);
86
- const secondProp = (0, random_1.random)(filteredXValues
87
- .concat(imageValues)
88
- .filter((value) => ![firstProp, +answer].includes(value)));
89
- const thirdProp = (0, random_1.random)(imageValues.filter((value) => value !== secondProp));
90
- return [firstProp + "", secondProp + "", thirdProp + ""];
65
+ const isAnswerValid = (ans, { answer, xValues, imageValues, isAskingImage, value }) => {
66
+ const numbers = ans.split("\\text{ et }").map((el) => Number(el));
67
+ if (numbers.some((n) => isNaN(n)))
68
+ return false;
69
+ const answerNumbers = answer.split("\\text{ et }").map((el) => Number(el));
70
+ return ans === answer || (0, arrayHasSameElement_1.arrayHasSameElements)(numbers, answerNumbers);
91
71
  };
92
72
  exports.inverseImageFunctionTable = {
93
73
  id: "inverseImageFunctionTable",
@@ -1 +1 @@
1
- {"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA+CF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
1
+ {"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAuDF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
@@ -7,6 +7,7 @@ const decimal_1 = require("../../../../math/numbers/decimals/decimal");
7
7
  const randint_1 = require("../../../../math/utils/random/randint");
8
8
  const log10Node_1 = require("../../../../tree/nodes/functions/log10Node");
9
9
  const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
10
+ const alignTex_1 = require("../../../../utils/alignTex");
10
11
  const getLog10PowerSimplifyingQuestion = () => {
11
12
  const tenthPower = (0, randint_1.randint)(-6, 8, [1]);
12
13
  console.log("log10 power simp q");
@@ -38,8 +39,16 @@ const getHint = (nb) => {
38
39
  };
39
40
  const getCorrection = (tenthPower, nb) => {
40
41
  const powerTen = new powerNode_1.PowerNode((10).toTree(), tenthPower.toTree());
41
- return `1 . On exprime $${nb.toTex()}$ en puissance de $10$ : $${nb.toTex()} = ${powerTen.toTex()}$ \n
42
- 2 . On utilise la propriété $\\log(a^{b}) = b\\times \\log(a)$. On a alors $\\log(${nb.toTex()}) = \\log(${powerTen.toTex()}) = ${tenthPower}\\times \\log(10) = ${tenthPower}$.
42
+ return `On exprime $${nb.toTex()}$ en puissance de $10$ :
43
+ ${(0, alignTex_1.alignTex)(`${nb.toTex()} = ${powerTen.toTex()}`)}
44
+ On utilise la propriété $\\log(a^{b}) = b\\times \\log(a)$.
45
+
46
+ On a alors
47
+ ${(0, alignTex_1.alignTex)([
48
+ [`\\log(${nb.toTex()})`, `= \\log(${powerTen.toTex()})`],
49
+ ["", `= ${tenthPower}\\times \\log(10)`],
50
+ ["", `= ${tenthPower}`],
51
+ ])}
43
52
  `;
44
53
  };
45
54
  const isAnswerValid = (ans, { answer, tenthPower }) => {
@@ -59,4 +68,5 @@ exports.log10PowerSimplifying = {
59
68
  isAnswerValid,
60
69
  maxAllowedQuestions: 10,
61
70
  subject: "Mathématiques",
71
+ hasHintAndCorrection: true,
62
72
  };
@@ -15,4 +15,6 @@ export * from "./summitReading";
15
15
  export * from "./summitAbscissFromRoots";
16
16
  export * from "./summitAbscissFromDevForm";
17
17
  export * from "./trinomialMeanValue";
18
+ export * from "./solveSecondDegreeEquationByFactorisation";
19
+ export * from "./solveSecondDegreeEquationFromCano";
18
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC"}
@@ -31,3 +31,5 @@ __exportStar(require("./summitReading"), exports);
31
31
  __exportStar(require("./summitAbscissFromRoots"), exports);
32
32
  __exportStar(require("./summitAbscissFromDevForm"), exports);
33
33
  __exportStar(require("./trinomialMeanValue"), exports);
34
+ __exportStar(require("./solveSecondDegreeEquationByFactorisation"), exports);
35
+ __exportStar(require("./solveSecondDegreeEquationFromCano"), exports);
@@ -0,0 +1,5 @@
1
+ import { Exercise } from '../../../../exercises/exercise';
2
+ type Identifiers = {};
3
+ export declare const solveEquationByFactorisation: Exercise<Identifiers>;
4
+ export {};
5
+ //# sourceMappingURL=solveEquationByFactorisation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solveEquationByFactorisation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/solveEquationByFactorisation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAGlC,KAAK,WAAW,GAAG,EAClB,CAAC;AA+BF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAc9D,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.solveEquationByFactorisation = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const getSolveEquationByFactorisationQuestion = () => {
7
+ const question = {
8
+ answer,
9
+ instruction: ``,
10
+ keys: [],
11
+ answerFormat: 'tex',
12
+ identifiers: {}
13
+ };
14
+ return question;
15
+ };
16
+ const getPropositions = (n, { answer }) => {
17
+ const propositions = [];
18
+ (0, exercise_1.addValidProp)(propositions, answer);
19
+ while (propositions.length < n) {
20
+ throw Error("QCM not implemented");
21
+ }
22
+ return (0, exercise_1.shuffleProps)(propositions, n);
23
+ };
24
+ const isAnswerValid = (ans, { answer }) => {
25
+ throw Error("VEA not implemented");
26
+ };
27
+ const isGGBAnswerValid = (ans, { ggbAnswer }) => {
28
+ throw Error("GGBVea not implemented");
29
+ };
30
+ exports.solveEquationByFactorisation = {
31
+ id: 'solveEquationByFactorisation',
32
+ connector: "",
33
+ label: "",
34
+ levels: [],
35
+ isSingleStep: true,
36
+ sections: [],
37
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSolveEquationByFactorisationQuestion, nb),
38
+ qcmTimer: 60,
39
+ freeTimer: 60,
40
+ getPropositions,
41
+ isAnswerValid,
42
+ isGGBAnswerValid,
43
+ subject: "Mathématiques"
44
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ type: number;
6
+ };
7
+ export declare const solveSecondDegreeEquationByFactorisation: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=solveSecondDegreeEquationByFactorisation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solveSecondDegreeEquationByFactorisation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAgIF,eAAO,MAAM,wCAAwC,EAAE,QAAQ,CAAC,WAAW,CAiB1E,CAAC"}
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.solveSecondDegreeEquationByFactorisation = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
7
+ const rational_1 = require("../../../../math/numbers/rationals/rational");
8
+ const trinom_1 = require("../../../../math/polynomials/trinom");
9
+ const randint_1 = require("../../../../math/utils/random/randint");
10
+ const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
11
+ const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
12
+ const coinFlip_1 = require("../../../../utils/coinFlip");
13
+ /**
14
+ * Equation donnée sous forme ax^2 + bx ou bien forme développée d'une identité remarquable
15
+ * type 1 ax^2 + bx
16
+ * type 2 (ax+b)^2
17
+ * type 3 (ax-b)^2
18
+ * type 4 (ax+b)(ax-b)
19
+ */
20
+ const getSolveSecondDegreeEquationByFactorisationQuestion = () => {
21
+ const type = (0, randint_1.randint)(1, 4);
22
+ let statement = "";
23
+ let roots = [];
24
+ let answer = "";
25
+ let a;
26
+ let b;
27
+ switch (type) {
28
+ case 1:
29
+ {
30
+ //ax^2 + bx
31
+ const trinom = new trinom_1.Trinom((0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10), 0);
32
+ a = trinom.a;
33
+ b = trinom.b;
34
+ statement = trinom.toTex();
35
+ roots = trinom.getRootsNode();
36
+ }
37
+ break;
38
+ case 2:
39
+ {
40
+ //(ax+b)^2
41
+ a = (0, randint_1.randint)(-9, 10, [0]);
42
+ b = (0, randint_1.randint)(1, 10);
43
+ statement = new trinom_1.Trinom(a ** 2, 2 * a * b, b ** 2).toTex();
44
+ roots = [new rational_1.Rational(-b, a).simplify().toTree()];
45
+ }
46
+ break;
47
+ case 3:
48
+ {
49
+ //(ax-b)^2
50
+ a = (0, randint_1.randint)(-9, 10, [0]);
51
+ b = (0, randint_1.randint)(-9, 0, [0]);
52
+ statement = new trinom_1.Trinom(a ** 2, -2 * a * b, b ** 2).toTex();
53
+ roots = [new rational_1.Rational(b, a).simplify().toTree()];
54
+ }
55
+ break;
56
+ case 4:
57
+ default:
58
+ {
59
+ //(ax+b)(ax-b)
60
+ a = (0, randint_1.randint)(-9, 10, [0]);
61
+ b = (0, randint_1.randint)(1, 10);
62
+ statement = new trinom_1.Trinom(a ** 2, 0, -(b ** 2)).toTex();
63
+ roots = [b, -b].sort((a, b) => a - b).map((x) => x.toTree());
64
+ }
65
+ break;
66
+ }
67
+ const instruction = `Soit $f(x) = ${statement}$. Résoudre l'équation $f(x) = 0$.`;
68
+ answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(roots)).toTex();
69
+ const question = {
70
+ answer,
71
+ instruction,
72
+ keys: [...equationKeys_1.equationKeys],
73
+ answerFormat: "tex",
74
+ identifiers: { a, b, type },
75
+ };
76
+ return question;
77
+ };
78
+ const getPropositions = (n, { answer }) => {
79
+ const propositions = [];
80
+ (0, exercise_1.addValidProp)(propositions, answer);
81
+ while (propositions.length < n) {
82
+ const firstRoot = (0, randint_1.randint)(-10, 10);
83
+ (0, exercise_1.tryToAddWrongProp)(propositions, new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode((0, coinFlip_1.coinFlip)()
84
+ ? [firstRoot.toTree()]
85
+ : [firstRoot, (0, randint_1.randint)(-10, 10, [firstRoot])]
86
+ .sort((a, b) => a - b)
87
+ .map((x) => x.toTree()))).toTex());
88
+ }
89
+ return (0, exercise_1.shuffleProps)(propositions, n);
90
+ };
91
+ const isAnswerValid = (ans, { answer, type, a, b }) => {
92
+ let roots = [];
93
+ switch (type) {
94
+ case 1:
95
+ {
96
+ const trinom = new trinom_1.Trinom(a, b, 0);
97
+ roots = trinom.getRootsNode();
98
+ }
99
+ break;
100
+ case 2:
101
+ {
102
+ roots = [new rational_1.Rational(-b, a).simplify().toTree()];
103
+ }
104
+ break;
105
+ case 3:
106
+ {
107
+ roots = [new rational_1.Rational(b, a).simplify().toTree()];
108
+ }
109
+ break;
110
+ case 4:
111
+ {
112
+ roots = [b, -b].sort((a, b) => a - b).map((x) => x.toTree());
113
+ }
114
+ break;
115
+ }
116
+ const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(roots), {
117
+ opts: { allowFractionToDecimal: true, allowRawRightChildAsSolution: true },
118
+ });
119
+ return answerTree.toAllValidTexs().includes(ans);
120
+ };
121
+ exports.solveSecondDegreeEquationByFactorisation = {
122
+ id: "solveSecondDegreeEquationByFactorisation",
123
+ connector: "\\iff",
124
+ label: "Résoudre une équation du second degré par factorisation",
125
+ levels: [],
126
+ isSingleStep: true,
127
+ sections: [],
128
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSolveSecondDegreeEquationByFactorisationQuestion, nb),
129
+ qcmTimer: 60,
130
+ freeTimer: 60,
131
+ getPropositions,
132
+ isAnswerValid,
133
+ subject: "Mathématiques",
134
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ coeffs: number[];
4
+ };
5
+ export declare const solveSecondDegreeEquationFromCano: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=solveSecondDegreeEquationFromCano.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solveSecondDegreeEquationFromCano.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAkDF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,CAenE,CAAC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.solveSecondDegreeEquationFromCano = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const equationKeys_1 = require("../../../../exercises/utils/keys/equationKeys");
7
+ const trinom_1 = require("../../../../math/polynomials/trinom");
8
+ const randint_1 = require("../../../../math/utils/random/randint");
9
+ const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
10
+ const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
11
+ const getSolveSecondDegreeEquationFromCanoQuestion = () => {
12
+ const trinom = trinom_1.TrinomConstructor.randomCanonical();
13
+ const statement = trinom.getCanonicalForm().toTex();
14
+ const roots = trinom.getRootsNode();
15
+ const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(roots)).toTex();
16
+ const question = {
17
+ answer,
18
+ instruction: `Soit $f(x) = ${statement}$. Résoudre l'équation $f(x) = 0$.`,
19
+ keys: [...equationKeys_1.equationKeys],
20
+ answerFormat: "tex",
21
+ identifiers: { coeffs: trinom.coefficients },
22
+ };
23
+ return question;
24
+ };
25
+ const getPropositions = (n, { answer }) => {
26
+ const propositions = [];
27
+ (0, exercise_1.addValidProp)(propositions, answer);
28
+ while (propositions.length < n) {
29
+ (0, exercise_1.tryToAddWrongProp)(propositions, new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([(0, randint_1.randint)(-9, 0), (0, randint_1.randint)(1, 10)].map((e) => e.toTree()))).toTex());
30
+ }
31
+ return (0, exercise_1.shuffleProps)(propositions, n);
32
+ };
33
+ const isAnswerValid = (ans, { answer, coeffs }) => {
34
+ const trinom = trinom_1.TrinomConstructor.fromCoeffs(coeffs);
35
+ const roots = trinom.getRootsNode();
36
+ const answerTree = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(roots), {
37
+ opts: { allowFractionToDecimal: true, allowRawRightChildAsSolution: true },
38
+ });
39
+ const texs = answerTree.toAllValidTexs();
40
+ return texs.includes(ans);
41
+ };
42
+ const isGGBAnswerValid = (ans, { ggbAnswer }) => {
43
+ throw Error("GGBVea not implemented");
44
+ };
45
+ exports.solveSecondDegreeEquationFromCano = {
46
+ id: "solveSecondDegreeEquationFromCano",
47
+ connector: "\\iff",
48
+ label: "Résoudre une équation du type $a(x-b)^2 + c = 0$",
49
+ levels: [],
50
+ isSingleStep: true,
51
+ sections: [],
52
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSolveSecondDegreeEquationFromCanoQuestion, nb),
53
+ qcmTimer: 60,
54
+ freeTimer: 60,
55
+ getPropositions,
56
+ isAnswerValid,
57
+ isGGBAnswerValid,
58
+ subject: "Mathématiques",
59
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductViaCoords.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/scalarProductViaCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAgDF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
1
+ {"version":3,"file":"scalarProductViaCoords.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/scalarProductViaCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAgDF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
@@ -52,4 +52,5 @@ exports.scalarProductViaCoords = {
52
52
  getPropositions,
53
53
  isAnswerValid,
54
54
  subject: "Mathématiques",
55
+ hasHintAndCorrection: true,
55
56
  };
@@ -15,6 +15,7 @@ export * from "./primitive";
15
15
  export * from "./probaStat";
16
16
  export * from "./sequences";
17
17
  export * from "./sets";
18
+ export * from "./spaceGeometry";
18
19
  export * from "./squareRoots";
19
20
  export * from "./trigonometry";
20
21
  export * from "./python";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -31,6 +31,7 @@ __exportStar(require("./primitive"), exports);
31
31
  __exportStar(require("./probaStat"), exports);
32
32
  __exportStar(require("./sequences"), exports);
33
33
  __exportStar(require("./sets"), exports);
34
+ __exportStar(require("./spaceGeometry"), exports);
34
35
  __exportStar(require("./squareRoots"), exports);
35
36
  __exportStar(require("./trigonometry"), exports);
36
37
  __exportStar(require("./python"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"applyPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/applyPercent.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAsDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAuB9C,CAAC"}
1
+ {"version":3,"file":"applyPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/applyPercent.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AA6EF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAwB9C,CAAC"}
@@ -14,14 +14,17 @@ const getApplyPercentQuestion = () => {
14
14
  let instruction = "";
15
15
  let ans = "";
16
16
  let ansNb = 0;
17
+ let cm = 0;
17
18
  const isUp = (0, coinFlip_1.coinFlip)();
18
19
  if (isUp) {
19
- ansNb = (0, round_1.round)(randNbr * (1 + randPercent / 100), 2);
20
+ cm = 1 + randPercent / 100;
21
+ ansNb = (0, round_1.round)(randNbr * cm, 2);
20
22
  ans = (ansNb + "").replace(".", ",");
21
23
  instruction = `Appliquer une hausse de $${randPercent}\\%$ à $${randNbr}$.`;
22
24
  }
23
25
  else {
24
- ansNb = (0, round_1.round)(randNbr * (1 - randPercent / 100), 2);
26
+ cm = 1 - randPercent / 100;
27
+ ansNb = (0, round_1.round)(randNbr * cm, 2);
25
28
  ans = (ansNb + "").replace(".", ",");
26
29
  instruction = `Appliquer une baisse de $${randPercent}\\%$ à $${randNbr}$.`;
27
30
  }
@@ -31,6 +34,20 @@ const getApplyPercentQuestion = () => {
31
34
  answer,
32
35
  keys: ["percent"],
33
36
  answerFormat: "tex",
37
+ hint: isUp
38
+ ? `Augmenter un nombre de $x\\%$ revient à le multiplier par $1 + \\frac{x}{100}$.`
39
+ : `Baisser un nombre de $x\\%$ revient à le multiplier par $1 - \\frac{x}{100}$.`,
40
+ correction: isUp
41
+ ? `Augmenter un nombre de $${randPercent}\\%$ revient à le multiplier par $1 + \\frac{${randPercent}}{100}$, c'est à dire par $${(0, round_1.round)(cm, 2).frenchify()}$.
42
+
43
+ On a donc $${randNbr}\\times ${(0, round_1.round)(cm, 2).frenchify()} = ${answer}$.
44
+
45
+ `
46
+ : `Baisser un nombre de $${randPercent}\\%$ revient à le multiplier par $1 - \\frac{${randPercent}}{100}$, c'est à dire par $${(0, round_1.round)(cm, 2).frenchify()}$.
47
+
48
+ On a donc $${randNbr}\\times ${(0, round_1.round)(cm, 2).frenchify()} = ${answer}$.
49
+
50
+ `,
34
51
  identifiers: { isUp, randNbr, randPercent },
35
52
  };
36
53
  return question;
@@ -76,4 +93,5 @@ exports.applyPercent = {
76
93
  getPropositions,
77
94
  isAnswerValid,
78
95
  subject: "Mathématiques",
96
+ hasHintAndCorrection: true,
79
97
  };
@@ -1 +1 @@
1
- {"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAkHF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAezD,CAAC"}
1
+ {"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAmHF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAezD,CAAC"}
@@ -62,10 +62,11 @@ const getProbaFromTableNoContextQuestion = () => {
62
62
  answer,
63
63
  instruction: `On considère deux événements $A$ et $B$. Le tableau suivant donne le nombre d'issues pour chacun des événements $A\\cap B$, $\\overline A\\cap B$, $A\\cap \\overline B$ et $\\overline A \\cap \\overline B$. Calculer la probabilité $${event}$.
64
64
 
65
- | | $B$ | $\\overline{B}$|
66
- |-|-|-|
67
- |$A$|${aCapB}|${aCapBBarre}|
68
- |$\\overline{A}$|${aBarreCapB}|${aBarreCapBBarre}|
65
+ | | $B$ | $\\overline{B}$| Total
66
+ |-|-|-|-|
67
+ |$A$|${aCapB}|${aCapBBarre}|${aTotal}|
68
+ |$\\overline{A}$|${aBarreCapB}|${aBarreCapBBarre}|${aBarreTotal}|
69
+ |Total|${bTotal}|${bBarreTotal}|${total}|
69
70
 
70
71
  `,
71
72
  keys: [],
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ rank1: number;
4
+ value1: number;
5
+ rank2: number;
6
+ value2: number;
7
+ rankAsked: number;
8
+ };
9
+ export declare const arithmeticFindRandomTermFromTwoTerms: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=arithmeticFindRandomTermFromTwoTerms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arithmeticFindRandomTermFromTwoTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqCF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CAetE,CAAC"}