math-exercises 3.0.68 → 3.0.69

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 (233) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +55 -37
  3. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +4 -4
  5. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +31 -18
  7. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +59 -35
  9. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +1 -1
  10. package/lib/exercises/math/combinatory/anagrams.d.ts.map +1 -1
  11. package/lib/exercises/math/combinatory/anagrams.js +18 -7
  12. package/lib/exercises/math/combinatory/ballsCounting.d.ts.map +1 -1
  13. package/lib/exercises/math/combinatory/ballsCounting.js +8 -6
  14. package/lib/exercises/math/combinatory/diceCounting.d.ts.map +1 -1
  15. package/lib/exercises/math/combinatory/diceCounting.js +62 -27
  16. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.d.ts.map +1 -1
  17. package/lib/exercises/math/functions/absolute/absolueValueAffineEquation.js +4 -0
  18. package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.d.ts.map +1 -1
  19. package/lib/exercises/math/functions/absolute/absolueValueInequationsSup.js +4 -4
  20. package/lib/exercises/math/functions/absolute/absoluteValueEquations.d.ts.map +1 -1
  21. package/lib/exercises/math/functions/absolute/absoluteValueEquations.js +22 -10
  22. package/lib/exercises/math/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
  23. package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +22 -8
  24. package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -1
  25. package/lib/exercises/math/functions/affines/affineAdjustment.js +4 -4
  26. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
  27. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +4 -4
  28. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts.map +1 -1
  29. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +4 -4
  30. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
  31. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +4 -4
  32. package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
  33. package/lib/exercises/math/functions/affines/affineExpressionReading.js +1 -0
  34. package/lib/exercises/math/functions/affines/affineMeanValue.d.ts.map +1 -1
  35. package/lib/exercises/math/functions/affines/affineMeanValue.js +33 -14
  36. package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.d.ts.map +1 -1
  37. package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.js +4 -4
  38. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts.map +1 -1
  39. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +4 -0
  40. package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
  41. package/lib/exercises/math/functions/affines/leadingCoefficient.js +4 -5
  42. package/lib/exercises/math/functions/affines/leadingCoefficientCalculV1.d.ts.map +1 -1
  43. package/lib/exercises/math/functions/affines/leadingCoefficientCalculV1.js +4 -2
  44. package/lib/exercises/math/functions/basics/graphicEquation.d.ts.map +1 -1
  45. package/lib/exercises/math/functions/basics/graphicEquation.js +4 -2
  46. package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
  47. package/lib/exercises/math/functions/basics/graphicInequation.js +4 -2
  48. package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
  49. package/lib/exercises/math/functions/basics/graphicInequationAffine.js +4 -5
  50. package/lib/exercises/math/functions/basics/imageAntecedentFromSentence.d.ts.map +1 -1
  51. package/lib/exercises/math/functions/basics/imageAntecedentFromSentence.js +4 -3
  52. package/lib/exercises/math/functions/basics/inverseImageFunction.d.ts.map +1 -1
  53. package/lib/exercises/math/functions/basics/inverseImageFunction.js +4 -6
  54. package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
  55. package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +0 -2
  56. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
  57. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +16 -15
  58. package/lib/exercises/math/functions/basics/twoFunctionsEquation.d.ts +1 -0
  59. package/lib/exercises/math/functions/basics/twoFunctionsEquation.d.ts.map +1 -1
  60. package/lib/exercises/math/functions/basics/twoFunctionsEquation.js +46 -32
  61. package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
  62. package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +4 -2
  63. package/lib/exercises/math/functions/cube/cubicEquation.d.ts.map +1 -1
  64. package/lib/exercises/math/functions/cube/cubicEquation.js +4 -3
  65. package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -1
  66. package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +4 -1
  67. package/lib/exercises/math/functions/integral/integralAffines.d.ts.map +1 -1
  68. package/lib/exercises/math/functions/integral/integralAffines.js +4 -2
  69. package/lib/exercises/math/functions/integral/integralDerivatedUCosU.d.ts.map +1 -1
  70. package/lib/exercises/math/functions/integral/integralDerivatedUCosU.js +27 -12
  71. package/lib/exercises/math/functions/integral/integralDerivatedUSinU.d.ts.map +1 -1
  72. package/lib/exercises/math/functions/integral/integralDerivatedUSinU.js +26 -11
  73. package/lib/exercises/math/functions/integral/integralExpAxPlusB.d.ts.map +1 -1
  74. package/lib/exercises/math/functions/integral/integralExpAxPlusB.js +26 -11
  75. package/lib/exercises/math/functions/integral/integralExpU.d.ts.map +1 -1
  76. package/lib/exercises/math/functions/integral/integralExpU.js +38 -20
  77. package/lib/exercises/math/functions/integral/integralFractions.d.ts.map +1 -1
  78. package/lib/exercises/math/functions/integral/integralFractions.js +40 -21
  79. package/lib/exercises/math/functions/integral/integralKCosinus.d.ts.map +1 -1
  80. package/lib/exercises/math/functions/integral/integralKCosinus.js +29 -12
  81. package/lib/exercises/math/functions/integral/integralKSinus.d.ts.map +1 -1
  82. package/lib/exercises/math/functions/integral/integralKSinus.js +29 -12
  83. package/lib/exercises/math/functions/integral/integralTrinomials.d.ts.map +1 -1
  84. package/lib/exercises/math/functions/integral/integralTrinomials.js +4 -2
  85. package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts +0 -1
  86. package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
  87. package/lib/exercises/math/functions/logarithm/log10PowerSimplifying.js +36 -15
  88. package/lib/exercises/math/functions/logarithm/log10Simplifying.d.ts.map +1 -1
  89. package/lib/exercises/math/functions/logarithm/log10Simplifying.js +43 -22
  90. package/lib/exercises/math/functions/logarithm/logEquation.d.ts.map +1 -1
  91. package/lib/exercises/math/functions/logarithm/logEquation.js +20 -11
  92. package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
  93. package/lib/exercises/math/functions/logarithm/logPowerEquation.js +26 -14
  94. package/lib/exercises/math/functions/logarithm/logSimplifiying.d.ts.map +1 -1
  95. package/lib/exercises/math/functions/logarithm/logSimplifiying.js +4 -3
  96. package/lib/exercises/math/functions/parity/parityFromAlgebra.d.ts.map +1 -1
  97. package/lib/exercises/math/functions/parity/parityFromAlgebra.js +29 -13
  98. package/lib/exercises/math/functions/parity/parityFromGraph.d.ts.map +1 -1
  99. package/lib/exercises/math/functions/parity/parityFromGraph.js +30 -12
  100. package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.d.ts.map +1 -1
  101. package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.js +27 -14
  102. package/lib/exercises/math/functions/sign/affineProductSign.d.ts.map +1 -1
  103. package/lib/exercises/math/functions/sign/affineProductSign.js +4 -4
  104. package/lib/exercises/math/functions/square/squareImageInterval.d.ts.map +1 -1
  105. package/lib/exercises/math/functions/square/squareImageInterval.js +39 -19
  106. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts.map +1 -1
  107. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.js +4 -3
  108. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts +1 -0
  109. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -1
  110. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +26 -9
  111. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts.map +1 -1
  112. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.js +25 -10
  113. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -1
  114. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.js +4 -2
  115. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -1
  116. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.js +4 -2
  117. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.d.ts.map +1 -1
  118. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.js +4 -4
  119. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -1
  120. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.js +4 -5
  121. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.d.ts.map +1 -1
  122. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.js +4 -4
  123. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.d.ts.map +1 -1
  124. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.js +4 -4
  125. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -1
  126. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +4 -2
  127. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
  128. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +4 -2
  129. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts.map +1 -1
  130. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.js +4 -2
  131. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.d.ts.map +1 -1
  132. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.js +4 -4
  133. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
  134. package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +4 -3
  135. package/lib/exercises/math/functions/trinoms/roots/rootsSum.d.ts.map +1 -1
  136. package/lib/exercises/math/functions/trinoms/roots/rootsSum.js +4 -4
  137. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -1
  138. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +4 -0
  139. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.d.ts.map +1 -1
  140. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.js +4 -0
  141. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts.map +1 -1
  142. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.js +32 -11
  143. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map +1 -1
  144. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.js +24 -9
  145. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts.map +1 -1
  146. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.js +24 -9
  147. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +1 -0
  148. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -1
  149. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +29 -12
  150. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts.map +1 -1
  151. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.js +4 -0
  152. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts.map +1 -1
  153. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +4 -0
  154. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts.map +1 -1
  155. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.js +3 -0
  156. package/lib/exercises/math/functions/trinoms/trinomialMeanValue.d.ts.map +1 -1
  157. package/lib/exercises/math/functions/trinoms/trinomialMeanValue.js +33 -14
  158. package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.js +1 -1
  159. package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts +2 -0
  160. package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts.map +1 -1
  161. package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.js +55 -27
  162. package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map +1 -1
  163. package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.js +4 -0
  164. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.d.ts.map +1 -1
  165. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +4 -0
  166. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -1
  167. package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +6 -2
  168. package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.d.ts.map +1 -1
  169. package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.js +7 -5
  170. package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts.map +1 -1
  171. package/lib/exercises/math/geometry/lines/isPointOnLine.js +4 -0
  172. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.d.ts.map +1 -1
  173. package/lib/exercises/math/geometry/parametric/extractPointFromParametricLine.js +4 -0
  174. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -1
  175. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +4 -0
  176. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -1
  177. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +4 -0
  178. package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.d.ts.map +1 -1
  179. package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.js +4 -0
  180. package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.d.ts.map +1 -1
  181. package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.js +4 -0
  182. package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.d.ts.map +1 -1
  183. package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.js +4 -0
  184. package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
  185. package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +4 -0
  186. package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.d.ts.map +1 -1
  187. package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.js +4 -0
  188. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
  189. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +4 -0
  190. package/lib/exercises/math/geometry/shapes/basicShapesRecognition.d.ts.map +1 -1
  191. package/lib/exercises/math/geometry/shapes/basicShapesRecognition.js +42 -23
  192. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  193. package/lib/exercises/math/geometry/thales/thalesCalcul.js +8 -4
  194. package/lib/exercises/math/geometry/vectors/chasles.d.ts.map +1 -1
  195. package/lib/exercises/math/geometry/vectors/chasles.js +36 -12
  196. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
  197. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +4 -0
  198. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.d.ts.map +1 -1
  199. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.js +4 -2
  200. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts.map +1 -1
  201. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +4 -0
  202. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts.map +1 -1
  203. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.js +4 -0
  204. package/lib/exercises/pc/energy/calorificValue.d.ts.map +1 -1
  205. package/lib/exercises/pc/energy/calorificValue.js +58 -29
  206. package/lib/exercises/pc/energy/combustionTransferEnergy.d.ts.map +1 -1
  207. package/lib/exercises/pc/energy/combustionTransferEnergy.js +52 -29
  208. package/lib/exercises/pc/energy/combustionTransferEnergy2.d.ts.map +1 -1
  209. package/lib/exercises/pc/energy/combustionTransferEnergy2.js +96 -67
  210. package/lib/exercises/pc/energy/efficencyOfConverter.d.ts.map +1 -1
  211. package/lib/exercises/pc/energy/efficencyOfConverter.js +53 -40
  212. package/lib/exercises/pc/energy/efficiencyCalculation.d.ts.map +1 -1
  213. package/lib/exercises/pc/energy/efficiencyCalculation.js +66 -38
  214. package/lib/exercises/pc/energy/energyTransfer.d.ts +0 -2
  215. package/lib/exercises/pc/energy/energyTransfer.d.ts.map +1 -1
  216. package/lib/exercises/pc/energy/energyTransfer.js +27 -11
  217. package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.d.ts.map +1 -1
  218. package/lib/exercises/pc/energy/kineticEnergyOrMassOrSpeed.js +111 -64
  219. package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.d.ts.map +1 -1
  220. package/lib/exercises/pc/energy/thermalEnergyTransferCalculation.js +86 -38
  221. package/lib/exercises/pc/fluids/mariotte.d.ts.map +1 -1
  222. package/lib/exercises/pc/fluids/mariotte.js +40 -23
  223. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -1
  224. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +81 -52
  225. package/lib/exercises/pc/forces/electroStaticForce.d.ts.map +1 -1
  226. package/lib/exercises/pc/forces/electroStaticForce.js +73 -58
  227. package/lib/exercises/pc/forces/forceWork.d.ts.map +1 -1
  228. package/lib/exercises/pc/forces/forceWork.js +22 -7
  229. package/lib/exercises/pc/math/proportionnalityCoeffFromLine.d.ts.map +1 -1
  230. package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +0 -2
  231. package/lib/index.d.ts +5 -4
  232. package/lib/index.d.ts.map +1 -1
  233. package/package.json +1 -1
@@ -46,6 +46,9 @@ const getInverseImageFunction = () => {
46
46
  const xValue = randint(-9, 10);
47
47
  const y = polynome1.calculate(xValue);
48
48
  const identifiers = { coeffs: polynome1.coefficients, yValue: y };
49
+ return getQuestionFromIdentifiers(identifiers);
50
+ };
51
+ const getQuestionFromIdentifiers = (identifiers) => {
49
52
  const question = {
50
53
  instruction: getInstruction(identifiers),
51
54
  startStatement: getStartStatement(identifiers),
@@ -122,11 +125,6 @@ export const inverseImageFunction = {
122
125
  freeTimer: 60,
123
126
  isAnswerValid,
124
127
  subject: "Mathématiques",
125
- getInstruction,
126
- getAnswer,
127
- getStartStatement,
128
- rebuildIdentifiers,
129
- getCorrection,
130
- getHint,
128
+ getQuestionFromIdentifiers,
131
129
  hasHintAndCorrection: true,
132
130
  };
@@ -1 +1 @@
1
- {"version":3,"file":"inverseImageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IAEjB,MAAM,EAAE,MAAM,CAAC;IAIf,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;CACpB,CAAC;AAmNF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAoB9D,CAAC"}
1
+ {"version":3,"file":"inverseImageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IAEjB,MAAM,EAAE,MAAM,CAAC;IAIf,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;CACpB,CAAC;AAmNF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAkB9D,CAAC"}
@@ -205,8 +205,6 @@ export const inverseImageFunctionGeogebra = {
205
205
  id: "inverseImageFunctionGeogebra",
206
206
  connector: "\\iff",
207
207
  label: "Lecture d'antécédents",
208
- levels: ["3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
209
- sections: ["Fonctions"],
210
208
  isSingleStep: true,
211
209
  generator: (nb) => getDistinctQuestions(getInverseImageFunctionGeogebra, nb),
212
210
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"inverseImageFunctionTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAYrC,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;AA8FF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAe3D,CAAC"}
1
+ {"version":3,"file":"inverseImageFunctionTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,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;AA2GF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}
@@ -16,6 +16,16 @@ ${mdTable([
16
16
  ])}
17
17
  `;
18
18
  };
19
+ const getAnswer = (identifiers) => {
20
+ const { xValues, imageValues, isAskingImage, value: valueAsked, } = identifiers;
21
+ const indexAsked = xValues.indexOf(valueAsked);
22
+ const answer = (isAskingImage
23
+ ? imageValues[indexAsked]
24
+ : xValues
25
+ .filter((el, index) => imageValues[index] === valueAsked)
26
+ .join("\\text{ et }")) + "";
27
+ return answer;
28
+ };
19
29
  const getInverseImageFunctionTableQuestion = () => {
20
30
  const xValues = randTupleInt(5, {
21
31
  from: -10,
@@ -30,29 +40,22 @@ const getInverseImageFunctionTableQuestion = () => {
30
40
  yValues[randint(0, 5, [indexAsked])] = valueAsked;
31
41
  }
32
42
  const isAskingImage = coinFlip();
33
- const answer = (isAskingImage
34
- ? yValues[indexAsked]
35
- : xValues
36
- .filter((el, index) => yValues[index] === valueAsked)
37
- .join("\\text{ et }")) + "";
38
43
  const identifiers = {
39
44
  xValues,
40
45
  imageValues: yValues,
41
46
  isAskingImage,
42
47
  value: valueAsked,
43
48
  };
49
+ return getQuestionFromIdentifiers(identifiers);
50
+ };
51
+ const getQuestionFromIdentifiers = (identifiers) => {
44
52
  const question = {
45
- answer,
53
+ answer: getAnswer(identifiers),
46
54
  instruction: getInstruction(identifiers),
47
55
  keys: ["et"],
48
56
  answerFormat: "tex",
49
57
  style: { tableHasNoHeader: true },
50
- identifiers: {
51
- xValues,
52
- imageValues: yValues,
53
- isAskingImage,
54
- value: valueAsked,
55
- },
58
+ identifiers,
56
59
  };
57
60
  return question;
58
61
  };
@@ -80,14 +83,12 @@ const isAnswerValid = (ans, { answer, xValues, imageValues, isAskingImage, value
80
83
  export const inverseImageFunctionTable = {
81
84
  id: "inverseImageFunctionTable",
82
85
  label: "Déterminer une image ou un antécédent à partir d'un tableau de valeurs",
83
- levels: ["3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
84
86
  isSingleStep: true,
85
- sections: ["Fonctions"],
86
87
  generator: (nb) => getDistinctQuestions(getInverseImageFunctionTableQuestion, nb),
87
88
  qcmTimer: 60,
88
89
  freeTimer: 60,
89
90
  getPropositions,
90
91
  isAnswerValid,
91
92
  subject: "Mathématiques",
92
- getInstruction,
93
+ getQuestionFromIdentifiers,
93
94
  };
@@ -3,6 +3,7 @@ type Identifiers = {
3
3
  yValue: number;
4
4
  fSplinePoints: number[][];
5
5
  gSplinePoints: number[][];
6
+ xSolutions: number[];
6
7
  };
7
8
  export declare const twoFunctionsEquation: Exercise<Identifiers>;
8
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"twoFunctionsEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/twoFunctionsEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;CAC3B,CAAC;AAyIF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
1
+ {"version":3,"file":"twoFunctionsEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/twoFunctionsEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAiKF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
@@ -9,6 +9,43 @@ import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
9
9
  import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
10
10
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
11
11
  import { random } from "../../../../utils/alea/random.js";
12
+ const getInstruction = (identifiers) => {
13
+ return `Déterminer graphiquement les solutions de l'équation $f(x) = g(x)$ où $f$ et $g$ sont les fonctions représentées ci-dessous.`;
14
+ };
15
+ const getAnswer = (identifiers) => {
16
+ const { xSolutions } = identifiers;
17
+ const answer = new EquationSolutionNode(new DiscreteSetNode(xSolutions.map((sol) => new NumberNode(sol)))).toTex();
18
+ return answer;
19
+ };
20
+ const getGGBOptions = (identifiers) => {
21
+ const { fSplinePoints, gSplinePoints, yValue } = identifiers;
22
+ const fColor = random(blues);
23
+ const gColor = random(oranges);
24
+ const commands = [
25
+ `S = Spline(${fSplinePoints
26
+ .map((point) => `(${point[0]},${point[1]})`)
27
+ .join(",")})`,
28
+ "SetFixed(S, true)",
29
+ `SetColor(S, "${fColor}")`,
30
+ `SetCaption(S, "$f$")`,
31
+ `ShowLabel(S, true)`,
32
+ `T = Spline(${gSplinePoints
33
+ .map((point) => `(${point[0]},${point[1]})`)
34
+ .join(",")})`,
35
+ "SetFixed(T, true)",
36
+ `SetColor(T, "${gColor}")`,
37
+ `SetCaption(T, "$g$")`,
38
+ `ShowLabel(T, true)`,
39
+ ];
40
+ const ggb = new GeogebraConstructor({ commands });
41
+ const xMin = Math.min(...[...fSplinePoints, ...gSplinePoints].map((point) => point[0]));
42
+ const yMin = Math.min(...[...fSplinePoints, ...gSplinePoints].map((point) => point[1]));
43
+ const xMax = Math.max(...[...fSplinePoints, ...gSplinePoints].map((point) => point[0]));
44
+ const yMax = Math.max(...[...fSplinePoints, ...gSplinePoints].map((point) => point[1]));
45
+ return ggb.getOptions({
46
+ coords: ggb.getAdaptedCoords({ xMax, xMin, yMax, yMin }),
47
+ });
48
+ };
12
49
  const getTwoFunctionsEquationQuestion = () => {
13
50
  const yValue = randint(-5, 5);
14
51
  let xSolutions = [];
@@ -17,7 +54,6 @@ const getTwoFunctionsEquationQuestion = () => {
17
54
  xSolutions.push(randint(-9, 10, xSolutions));
18
55
  }
19
56
  xSolutions.sort((a, b) => a - b);
20
- const answer = new EquationSolutionNode(new DiscreteSetNode(xSolutions.map((sol) => new NumberNode(sol)))).toTex();
21
57
  const fSplinePoints = [];
22
58
  const gSplinePoints = [];
23
59
  let prevYWasAbove = coinFlip();
@@ -56,38 +92,17 @@ const getTwoFunctionsEquationQuestion = () => {
56
92
  xSolutions[xSolutions.length - 1] + (1 + Math.random() * 3),
57
93
  yValue - (prevYWasAbove ? randint(-2, 0) : randint(1, 3)),
58
94
  ]);
59
- const xMin = Math.min(...[...fSplinePoints, ...gSplinePoints].map((point) => point[0]));
60
- const yMin = Math.min(...[...fSplinePoints, ...gSplinePoints].map((point) => point[1]));
61
- const xMax = Math.max(...[...fSplinePoints, ...gSplinePoints].map((point) => point[0]));
62
- const yMax = Math.max(...[...fSplinePoints, ...gSplinePoints].map((point) => point[1]));
63
- const fColor = random(blues);
64
- const gColor = random(oranges);
65
- const commands = [
66
- `S = Spline(${fSplinePoints
67
- .map((point) => `(${point[0]},${point[1]})`)
68
- .join(",")})`,
69
- "SetFixed(S, true)",
70
- `SetColor(S, "${fColor}")`,
71
- `SetCaption(S, "$f$")`,
72
- `ShowLabel(S, true)`,
73
- `T = Spline(${gSplinePoints
74
- .map((point) => `(${point[0]},${point[1]})`)
75
- .join(",")})`,
76
- "SetFixed(T, true)",
77
- `SetColor(T, "${gColor}")`,
78
- `SetCaption(T, "$g$")`,
79
- `ShowLabel(T, true)`,
80
- ];
81
- const ggb = new GeogebraConstructor({ commands });
95
+ const identifiers = { yValue, fSplinePoints, gSplinePoints, xSolutions };
96
+ return getQuestionFromIdentifiers(identifiers);
97
+ };
98
+ const getQuestionFromIdentifiers = (identifiers) => {
82
99
  const question = {
83
- answer,
84
- instruction: `Déterminer graphiquement les solutions de l'équation $f(x) = g(x)$ où $f$ et $g$ sont les fonctions représentées ci-dessous.`,
100
+ answer: getAnswer(identifiers),
101
+ instruction: getInstruction(identifiers),
85
102
  keys: discreteSetKeys,
86
103
  answerFormat: "tex",
87
- identifiers: { yValue, fSplinePoints, gSplinePoints },
88
- ggbOptions: ggb.getOptions({
89
- coords: ggb.getAdaptedCoords({ xMax, xMin, yMax, yMin }),
90
- }),
104
+ identifiers,
105
+ ggbOptions: getGGBOptions(identifiers),
91
106
  };
92
107
  return question;
93
108
  };
@@ -118,9 +133,7 @@ const isAnswerValid = (ans, { answer, fSplinePoints, yValue }) => {
118
133
  export const twoFunctionsEquation = {
119
134
  id: "twoFunctionsEquation",
120
135
  label: "Résoudre graphiquement une équation du type $f(x)=g(x)$",
121
- levels: ["2nde"],
122
136
  isSingleStep: true,
123
- sections: ["Fonctions"],
124
137
  generator: (nb) => getDistinctQuestions(getTwoFunctionsEquationQuestion, nb),
125
138
  qcmTimer: 60,
126
139
  freeTimer: 60,
@@ -128,4 +141,5 @@ export const twoFunctionsEquation = {
128
141
  isAnswerValid,
129
142
  hasGeogebra: true,
130
143
  subject: "Mathématiques",
144
+ getQuestionFromIdentifiers,
131
145
  };
@@ -1 +1 @@
1
- {"version":3,"file":"twoFunctionsInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/twoFunctionsInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,gBAAgB,EAGjB,MAAM,sCAAsC,CAAC;AAK9C,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAU/D,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC;CAC7D,CAAC;AAyPF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
1
+ {"version":3,"file":"twoFunctionsInequation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/twoFunctionsInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,gBAAgB,EAGjB,MAAM,sCAAsC,CAAC;AAK9C,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAU/D,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,EAAE,CAAC;CAC7D,CAAC;AA+PF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
@@ -140,6 +140,9 @@ const getTwoFunctionsInequationQuestion = () => {
140
140
  ineqSymbol: ineq.symbol,
141
141
  intervals,
142
142
  };
143
+ return getQuestionFromIdentifiers(identifiers);
144
+ };
145
+ const getQuestionFromIdentifiers = (identifiers) => {
143
146
  const question = {
144
147
  answer: getAnswer(identifiers),
145
148
  instruction: getInstruction(identifiers),
@@ -192,9 +195,7 @@ const isAnswerValid = (ans, { answer, fSplinePoints, yValue, intervals }) => {
192
195
  export const twoFunctionsInequation = {
193
196
  id: "twoFunctionsInequation",
194
197
  label: "Résoudre graphiquement une inéquation du type $f(x)<g(x)$",
195
- levels: ["2nde"],
196
198
  isSingleStep: true,
197
- sections: ["Fonctions"],
198
199
  generator: (nb) => getDistinctQuestions(getTwoFunctionsInequationQuestion, nb),
199
200
  qcmTimer: 60,
200
201
  freeTimer: 60,
@@ -202,4 +203,5 @@ export const twoFunctionsInequation = {
202
203
  isAnswerValid,
203
204
  hasGeogebra: true,
204
205
  subject: "Mathématiques",
206
+ getQuestionFromIdentifiers,
205
207
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cubicEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/cube/cubicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA4DF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAkB/C,CAAC"}
1
+ {"version":3,"file":"cubicEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/cube/cubicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAgB/C,CAAC"}
@@ -28,6 +28,9 @@ const getCubicEquationQuestion = () => {
28
28
  const x = randint(-10, 11);
29
29
  const k = x ** 3;
30
30
  const identifiers = { k };
31
+ return getQuestionFromIdentifiers(identifiers);
32
+ };
33
+ const getQuestionFromIdentifiers = (identifiers) => {
31
34
  const question = {
32
35
  answer: getAnswer(identifiers),
33
36
  instruction: getInstruction(identifiers),
@@ -66,7 +69,5 @@ export const cubicEquation = {
66
69
  subject: "Mathématiques",
67
70
  getInstruction,
68
71
  getAnswer,
69
- // getCorrection,
70
- // getHint,
71
- // hasHintAndCorrection: true,
72
+ getQuestionFromIdentifiers,
72
73
  };
@@ -1 +1 @@
1
- {"version":3,"file":"exponentialsVariations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/exponentialsVariations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAmBxD,CAAC"}
1
+ {"version":3,"file":"exponentialsVariations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/exponentialsVariations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAmBxD,CAAC"}
@@ -91,6 +91,9 @@ const getExponentialsVariationsQuestion = (ops) => {
91
91
  a,
92
92
  q: q.toIdentifiers(),
93
93
  };
94
+ return getQuestionFromIdentifiers(identifiers);
95
+ };
96
+ const getQuestionFromIdentifiers = (identifiers) => {
94
97
  const question = {
95
98
  answer: getAnswer(identifiers),
96
99
  instruction: getInstruction(identifiers),
@@ -118,5 +121,5 @@ export const exponentialsVariations = {
118
121
  getAnswer,
119
122
  answerType: "QCU",
120
123
  hasHintAndCorrection: true,
121
- getKeys,
124
+ getQuestionFromIdentifiers,
122
125
  };
@@ -1 +1 @@
1
- {"version":3,"file":"integralAffines.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralAffines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA6FF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
1
+ {"version":3,"file":"integralAffines.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralAffines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAkGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAYjD,CAAC"}
@@ -36,6 +36,9 @@ const getIntegralAffinesQuestion = () => {
36
36
  upperBound,
37
37
  trinomial: [trinomial.a, trinomial.b, trinomial.c],
38
38
  };
39
+ return getQuestionFromIdentifiers(identifiers);
40
+ };
41
+ const getQuestionFromIdentifiers = (identifiers) => {
39
42
  const question = {
40
43
  answer: getAnswer(identifiers),
41
44
  instruction: getInstruction(identifiers),
@@ -80,6 +83,5 @@ export const integralAffines = {
80
83
  getPropositions,
81
84
  isAnswerValid,
82
85
  subject: "Mathématiques",
83
- getAnswer,
84
- getInstruction,
86
+ getQuestionFromIdentifiers,
85
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"integralDerivatedUCosU.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralDerivatedUCosU.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAmFF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
1
+ {"version":3,"file":"integralDerivatedUCosU.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralDerivatedUCosU.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,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAuGF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAYxD,CAAC"}
@@ -8,19 +8,34 @@ import { SinNode } from "../../../../tree/nodes/functions/sinNode.js";
8
8
  import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
9
9
  import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
10
10
  import { SubstractNode } from "../../../../tree/nodes/operators/substractNode.js";
11
+ const getInstruction = (identifiers) => {
12
+ const { a, b, aU, bU } = identifiers;
13
+ const u = new Affine(aU, bU, "x");
14
+ const cosU = new CosNode(u.toTree());
15
+ const integral = new IntegralNode(new MultiplyNode(u.derivate().toTree(), cosU), a.toTree(), b.toTree(), "x");
16
+ return `Calculer :
17
+
18
+ $$
19
+ ${integral.toTex()}
20
+ $$`;
21
+ };
22
+ const getAnswer = (identifiers) => {
23
+ return getAnswerNode(identifiers).simplify().toTex();
24
+ };
11
25
  const getIntegralDerivatedUCosUQuestion = () => {
12
26
  const u = AffineConstructor.random();
13
- const cosU = new CosNode(u.toTree());
14
27
  const b = randint(-4, 6);
15
28
  const a = randint(-5, b);
16
- const integral = new IntegralNode(new MultiplyNode(u.derivate().toTree(), cosU), a.toTree(), b.toTree(), "x");
17
- const correctAns = getCorrectAnswer(a, b, u);
29
+ const identifiers = { a, b, aU: u.a, bU: u.b };
30
+ return getQuestionFromIdentifiers(identifiers);
31
+ };
32
+ const getQuestionFromIdentifiers = (identifiers) => {
18
33
  const question = {
19
- answer: correctAns.simplify().toTex(),
20
- instruction: `Calculer : $${integral.toTex()}$`,
34
+ answer: getAnswer(identifiers),
35
+ instruction: getInstruction(identifiers),
21
36
  keys: ["sin", "cos"],
22
37
  answerFormat: "tex",
23
- identifiers: { a, b, aU: u.a, bU: u.b },
38
+ identifiers,
24
39
  };
25
40
  return question;
26
41
  };
@@ -38,12 +53,13 @@ const getPropositions = (n, { answer, a, b, aU, bU }) => {
38
53
  }
39
54
  return shuffleProps(propositions, n);
40
55
  };
41
- const isAnswerValid = (ans, { a, b, aU, bU }) => {
42
- const u = new Affine(aU, bU, "x");
43
- const correctAns = getCorrectAnswer(a, b, u).simplify();
56
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
57
+ const correctAns = getAnswerNode(identifiers).simplify();
44
58
  return correctAns.toAllValidTexs().includes(ans);
45
59
  };
46
- const getCorrectAnswer = (a, b, u) => {
60
+ const getAnswerNode = (identifiers) => {
61
+ const { a, b, aU, bU } = identifiers;
62
+ const u = new Affine(aU, bU, "x");
47
63
  const uTree = u.toTree();
48
64
  const primitiveA = new SinNode(uTree.evaluate({ x: a }).toTree());
49
65
  const primitiveB = new SinNode(uTree.evaluate({ x: b }).toTree());
@@ -66,13 +82,12 @@ const generatePropositions = (a, b, u) => {
66
82
  export const IntegralDerivatedUCosU = {
67
83
  id: "IntegralDerivatedUCosU",
68
84
  label: "Calcul d'intégrales de fonctions du type $u'\\cos(u)$",
69
- levels: ["TermSpé"],
70
85
  isSingleStep: true,
71
- sections: ["Intégration"],
72
86
  generator: (nb) => getDistinctQuestions(getIntegralDerivatedUCosUQuestion, nb),
73
87
  qcmTimer: 60,
74
88
  freeTimer: 60,
75
89
  getPropositions,
76
90
  isAnswerValid,
77
91
  subject: "Mathématiques",
92
+ getQuestionFromIdentifiers,
78
93
  };
@@ -1 +1 @@
1
- {"version":3,"file":"integralDerivatedUSinU.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralDerivatedUSinU.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAgHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
1
+ {"version":3,"file":"integralDerivatedUSinU.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralDerivatedUSinU.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,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAiIF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAYxD,CAAC"}
@@ -8,18 +8,33 @@ import { SinNode } from "../../../../tree/nodes/functions/sinNode.js";
8
8
  import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
9
9
  import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
10
10
  import { SubstractNode } from "../../../../tree/nodes/operators/substractNode.js";
11
+ const getInstruction = (identifiers) => {
12
+ const { a, b, aU, bU } = identifiers;
13
+ const u = new Affine(aU, bU, "x");
14
+ const integral = new IntegralNode(new MultiplyNode(u.derivate().toTree(), new SinNode(u.toTree())), a.toTree(), b.toTree(), "x");
15
+ return `Calculer :
16
+
17
+ $$
18
+ ${integral.toTex()}
19
+ $$`;
20
+ };
21
+ const getAnswer = (identifiers) => {
22
+ return getAnswerNode(identifiers).simplify().toTex();
23
+ };
11
24
  const getIntegralDerivatedUSinUQuestion = () => {
12
25
  const u = AffineConstructor.random();
13
26
  const b = randint(-4, 6);
14
27
  const a = randint(-5, b);
15
- const integral = new IntegralNode(new MultiplyNode(u.derivate().toTree(), new SinNode(u.toTree())), a.toTree(), b.toTree(), "x");
16
- const correctAns = getCorrectAnswer(a, b, u);
28
+ const identifiers = { a, b, aU: u.a, bU: u.b };
29
+ return getQuestionFromIdentifiers(identifiers);
30
+ };
31
+ const getQuestionFromIdentifiers = (identifiers) => {
17
32
  const question = {
18
- answer: correctAns.simplify().toTex(),
19
- instruction: `Calculer : $${integral.toTex()}$`,
33
+ answer: getAnswer(identifiers),
34
+ instruction: getInstruction(identifiers),
20
35
  keys: ["sin", "cos"],
21
36
  answerFormat: "tex",
22
- identifiers: { a, b, aU: u.a, bU: u.b },
37
+ identifiers,
23
38
  };
24
39
  return question;
25
40
  };
@@ -38,12 +53,13 @@ const getPropositions = (n, { answer, a, b, aU, bU }) => {
38
53
  }
39
54
  return shuffleProps(propositions, n);
40
55
  };
41
- const isAnswerValid = (ans, { a, b, aU, bU }) => {
42
- const u = new Affine(aU, bU, "x");
43
- const correctAns = getCorrectAnswer(a, b, u).simplify();
56
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
57
+ const correctAns = getAnswerNode(identifiers).simplify();
44
58
  return correctAns.toAllValidTexs().includes(ans);
45
59
  };
46
- const getCorrectAnswer = (a, b, u) => {
60
+ const getAnswerNode = (identifiers) => {
61
+ const { a, b, aU, bU } = identifiers;
62
+ const u = new Affine(aU, bU, "x");
47
63
  const minusOne = (-1).toTree();
48
64
  const uTree = u.toTree();
49
65
  const primitiveA = new MultiplyNode(minusOne, new CosNode(uTree.evaluate({ x: a }).toTree())).simplify();
@@ -71,13 +87,12 @@ const generatePropositions = (a, b, u) => {
71
87
  export const integralDerivatedUSinU = {
72
88
  id: "integralDerivatedUSinU",
73
89
  label: "Calcul d'intégrales de fonctions du type $u'\\sin(u)$",
74
- levels: ["TermSpé"],
75
90
  isSingleStep: true,
76
- sections: ["Intégration"],
77
91
  generator: (nb) => getDistinctQuestions(getIntegralDerivatedUSinUQuestion, nb),
78
92
  qcmTimer: 60,
79
93
  freeTimer: 60,
80
94
  getPropositions,
81
95
  isAnswerValid,
82
96
  subject: "Mathématiques",
97
+ getQuestionFromIdentifiers,
83
98
  };
@@ -1 +1 @@
1
- {"version":3,"file":"integralExpAxPlusB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralExpAxPlusB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA2GF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAapD,CAAC"}
1
+ {"version":3,"file":"integralExpAxPlusB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralExpAxPlusB.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,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAwHF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAYpD,CAAC"}
@@ -8,19 +8,34 @@ import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
8
8
  import { FractionNode } from "../../../../tree/nodes/operators/fractionNode.js";
9
9
  import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
10
10
  import { SubstractNode } from "../../../../tree/nodes/operators/substractNode.js";
11
+ const getInstruction = (identifiers) => {
12
+ const { a, b, aX, bX } = identifiers;
13
+ const f = new Affine(aX, bX, "x");
14
+ const e = new ExpNode(new Affine(f.a, f.b, "x").toTree());
15
+ const integral = new IntegralNode(e, a.toTree(), b.toTree(), "x");
16
+ return `Calculer :
17
+
18
+ $$
19
+ ${integral.toTex()}
20
+ $$`;
21
+ };
22
+ const getAnswer = (identifiers) => {
23
+ return getAnswerNode(identifiers).toTex();
24
+ };
11
25
  const getIntegralExpAxPlusBQuestion = () => {
12
26
  const f = AffineConstructor.random();
13
27
  const b = randint(-4, 6);
14
28
  const a = randint(-5, b);
15
- const e = new ExpNode(new Affine(f.a, f.b, "x").toTree());
16
- const integral = new IntegralNode(e, a.toTree(), b.toTree(), "x");
17
- const correctAns = getCorrectAnswer(a, b, f.a, f.b);
29
+ const identifiers = { a, b, aX: f.a, bX: f.b };
30
+ return getQuestionFromIdentifiers(identifiers);
31
+ };
32
+ const getQuestionFromIdentifiers = (identifiers) => {
18
33
  const question = {
19
- answer: correctAns.toTex(),
20
- instruction: `Calculer : $${integral.toTex()}$`,
34
+ answer: getAnswer(identifiers),
35
+ instruction: getInstruction(identifiers),
21
36
  keys: ["epower"],
22
37
  answerFormat: "tex",
23
- identifiers: { a, b, aX: f.a, bX: f.b },
38
+ identifiers,
24
39
  };
25
40
  return question;
26
41
  };
@@ -38,11 +53,12 @@ const getPropositions = (n, { answer, a, b, aX, bX }) => {
38
53
  }
39
54
  return shuffleProps(propositions, n);
40
55
  };
41
- const isAnswerValid = (ans, { a, b, aX, bX }) => {
42
- const correctAns = getCorrectAnswer(a, b, aX, bX);
56
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
57
+ const correctAns = getAnswerNode(identifiers);
43
58
  return correctAns.toAllValidTexs().includes(ans);
44
59
  };
45
- const getCorrectAnswer = (a, b, aX, bX) => {
60
+ const getAnswerNode = (identifiers) => {
61
+ const { a, b, aX, bX } = identifiers;
46
62
  const f = new Affine(aX, bX, "x").toTree();
47
63
  const oneDivAx = new FractionNode((1).toTree(), aX.toTree()).simplify();
48
64
  return new MultiplyNode(oneDivAx, new SubstractNode(new ExpNode(f.evaluate({ x: b }).toTree()).simplify(), new ExpNode(f.evaluate({ x: a }).toTree()).simplify()).simplify());
@@ -68,13 +84,12 @@ const generatePropositions = (a, b, aX, bX) => {
68
84
  export const integralExpAxPlusB = {
69
85
  id: "integralExpAxPlusB",
70
86
  label: "Calcul d'intégrales de fonctions du type $\\exp(ax+b)$",
71
- levels: ["TermSpé"],
72
87
  isSingleStep: true,
73
- sections: ["Intégration"],
74
88
  generator: (nb) => getDistinctQuestions(getIntegralExpAxPlusBQuestion, nb),
75
89
  qcmTimer: 60,
76
90
  freeTimer: 60,
77
91
  getPropositions,
78
92
  isAnswerValid,
79
93
  subject: "Mathématiques",
94
+ getQuestionFromIdentifiers,
80
95
  };
@@ -1 +1 @@
1
- {"version":3,"file":"integralExpU.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralExpU.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAoIF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAY9C,CAAC"}
1
+ {"version":3,"file":"integralExpU.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralExpU.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA2JF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAW9C,CAAC"}