math-exercises 3.0.10 → 3.0.12

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 (153) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionsOperations.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionsOperations.js +0 -1
  3. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
  4. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +17 -15
  5. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +1 -1
  6. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.d.ts.map +1 -1
  7. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.js +17 -3
  8. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  9. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +6 -2
  10. package/lib/exercises/math/functions/basics/inverseImageFunction.d.ts +2 -2
  11. package/lib/exercises/math/functions/basics/inverseImageFunction.d.ts.map +1 -1
  12. package/lib/exercises/math/functions/basics/inverseImageFunction.js +81 -14
  13. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts +11 -0
  14. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts.map +1 -0
  15. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.js +134 -0
  16. package/lib/exercises/math/functions/trinoms/devForm/index.d.ts +3 -0
  17. package/lib/exercises/math/functions/trinoms/devForm/index.d.ts.map +1 -0
  18. package/lib/exercises/math/functions/trinoms/devForm/index.js +2 -0
  19. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts +9 -0
  20. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -0
  21. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +42 -0
  22. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts +9 -0
  23. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts.map +1 -0
  24. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.js +50 -0
  25. package/lib/exercises/math/functions/trinoms/equation/index.d.ts +5 -0
  26. package/lib/exercises/math/functions/trinoms/equation/index.d.ts.map +1 -0
  27. package/lib/exercises/math/functions/trinoms/equation/index.js +4 -0
  28. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts +11 -0
  29. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts.map +1 -0
  30. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +102 -0
  31. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts +9 -0
  32. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -0
  33. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.js +131 -0
  34. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts +7 -0
  35. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -0
  36. package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.js +69 -0
  37. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.d.ts +8 -0
  38. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.d.ts.map +1 -0
  39. package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.js +72 -0
  40. package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts +2 -0
  41. package/lib/exercises/math/functions/trinoms/factoForm/index.d.ts.map +1 -0
  42. package/lib/exercises/math/functions/trinoms/factoForm/index.js +1 -0
  43. package/lib/exercises/math/functions/trinoms/index.d.ts +7 -23
  44. package/lib/exercises/math/functions/trinoms/index.d.ts.map +1 -1
  45. package/lib/exercises/math/functions/trinoms/index.js +7 -23
  46. package/lib/exercises/math/functions/trinoms/parabole/index.d.ts +3 -0
  47. package/lib/exercises/math/functions/trinoms/parabole/index.d.ts.map +1 -0
  48. package/lib/exercises/math/functions/trinoms/parabole/index.js +2 -0
  49. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts +8 -0
  50. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -0
  51. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.js +285 -0
  52. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.d.ts +9 -0
  53. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.d.ts.map +1 -0
  54. package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.js +112 -0
  55. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.d.ts +10 -0
  56. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.d.ts.map +1 -0
  57. package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.js +124 -0
  58. package/lib/exercises/math/functions/trinoms/roots/index.d.ts +8 -0
  59. package/lib/exercises/math/functions/trinoms/roots/index.d.ts.map +1 -0
  60. package/lib/exercises/math/functions/trinoms/roots/index.js +7 -0
  61. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts +9 -0
  62. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -0
  63. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +54 -0
  64. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts +9 -0
  65. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -0
  66. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +55 -0
  67. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts +9 -0
  68. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.d.ts.map +1 -0
  69. package/lib/exercises/math/functions/trinoms/roots/rootsFromFactorizedForm.js +67 -0
  70. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.d.ts +8 -0
  71. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.d.ts.map +1 -0
  72. package/lib/exercises/math/functions/trinoms/roots/rootsProduct.js +109 -0
  73. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts +9 -0
  74. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -0
  75. package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +63 -0
  76. package/lib/exercises/math/functions/trinoms/roots/rootsSum.d.ts +8 -0
  77. package/lib/exercises/math/functions/trinoms/roots/rootsSum.d.ts.map +1 -0
  78. package/lib/exercises/math/functions/trinoms/roots/rootsSum.js +109 -0
  79. package/lib/exercises/math/functions/trinoms/sign/index.d.ts +3 -0
  80. package/lib/exercises/math/functions/trinoms/sign/index.d.ts.map +1 -0
  81. package/lib/exercises/math/functions/trinoms/sign/index.js +2 -0
  82. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts +8 -0
  83. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -0
  84. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +120 -0
  85. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.d.ts +8 -0
  86. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.d.ts.map +1 -0
  87. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromRoots.js +119 -0
  88. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts +8 -0
  89. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts.map +1 -0
  90. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.js +49 -0
  91. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.d.ts +10 -0
  92. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.d.ts.map +1 -0
  93. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.js +64 -0
  94. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts +9 -0
  95. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map +1 -0
  96. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.js +48 -0
  97. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts +9 -0
  98. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts.map +1 -0
  99. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.js +55 -0
  100. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +9 -0
  101. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -0
  102. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +42 -0
  103. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts +9 -0
  104. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts.map +1 -0
  105. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.js +8 -0
  106. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts +9 -0
  107. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.d.ts.map +1 -0
  108. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromDevForm.js +90 -0
  109. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts +9 -0
  110. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.d.ts.map +1 -0
  111. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitAbscissFromRoots.js +55 -0
  112. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts +9 -0
  113. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts.map +1 -0
  114. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.js +59 -0
  115. package/lib/exercises/math/geometry/areas/triangleArea.d.ts +2 -0
  116. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  117. package/lib/exercises/math/geometry/areas/triangleArea.js +56 -31
  118. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -1
  119. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +34 -14
  120. package/lib/exercises/math/trigonometry/equationCosOnRandomInterval.js +10 -10
  121. package/lib/exercises/math/trigonometry/equationSinOnRandomInterval.js +10 -10
  122. package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -1
  123. package/lib/exercises/math/trigonometry/mainAngleMeasure.js +1 -0
  124. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  125. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +170 -106
  126. package/lib/exercises/vea/numberVEA.d.ts +1 -1
  127. package/lib/exercises/vea/numberVEA.d.ts.map +1 -1
  128. package/lib/exercises/vea/numberVEA.js +2 -2
  129. package/lib/index.d.ts +44 -33
  130. package/lib/index.d.ts.map +1 -1
  131. package/lib/math/geometry/triangle.d.ts +1 -0
  132. package/lib/math/geometry/triangle.d.ts.map +1 -1
  133. package/lib/math/geometry/triangle.js +10 -2
  134. package/lib/math/polynomials/affine.d.ts +2 -0
  135. package/lib/math/polynomials/affine.d.ts.map +1 -1
  136. package/lib/math/polynomials/affine.js +5 -0
  137. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  138. package/lib/tests/questionTest.d.ts.map +1 -1
  139. package/lib/tests/questionTest.js +1 -1
  140. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  141. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  142. package/lib/tree/nodes/equations/equalNode.d.ts +1 -2
  143. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  144. package/lib/tree/nodes/equations/equalNode.js +47 -22
  145. package/lib/tree/nodes/polynomials/trinomNode.d.ts +1 -0
  146. package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -1
  147. package/lib/tree/nodes/polynomials/trinomNode.js +9 -0
  148. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  149. package/lib/tree/nodes/variables/variableNode.js +1 -3
  150. package/lib/tree/parsers/numberParser.d.ts +1 -1
  151. package/lib/tree/parsers/numberParser.d.ts.map +1 -1
  152. package/lib/tree/parsers/numberParser.js +4 -1
  153. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"fractionsOperations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AA4FF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
1
+ {"version":3,"file":"fractionsOperations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionsOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,eAAe,CAAC;CACvC,CAAC;AA2FF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
@@ -17,7 +17,6 @@ const getPropositions = (n, { answer }) => {
17
17
  return shuffleProps(propositions, n);
18
18
  };
19
19
  const getAnswer = (identifiers) => {
20
- console.log("ans", identifiers);
21
20
  const statement = NodeConstructor.fromIdentifiers(identifiers.statementIdentifiers, true);
22
21
  return statement.simplify().toTex();
23
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAerC;;GAEG;AAEH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAiBvD,CAAC"}
1
+ {"version":3,"file":"equationType4Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationType4Exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAkBrC;;GAEG;AAEH,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAoBvD,CAAC"}
@@ -4,7 +4,7 @@ import { equationKeys } from "../../../../exercises/utils/keys/equationKeys.js";
4
4
  import { Rational } from "../../../../math/numbers/rationals/rational.js";
5
5
  import { Affine } from "../../../../math/polynomials/affine.js";
6
6
  import { randint } from "../../../../math/utils/random/randint.js";
7
- import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
7
+ import { EqualNode, equationResolutionTex, } from "../../../../tree/nodes/equations/equalNode.js";
8
8
  import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
9
9
  import { shuffle } from "../../../../utils/alea/shuffle.js";
10
10
  import { equationVEA } from "../../../../exercises/vea/equationVEA.js";
@@ -53,23 +53,22 @@ const getQuestionFromIdentifiers = (identifiers) => {
53
53
  keys: equationKeys,
54
54
  answerFormat: "tex",
55
55
  identifiers,
56
+ hint: getHint(identifiers),
57
+ correction: getCorrection(identifiers),
56
58
  };
57
59
  return question;
58
60
  };
59
- // hint: `Commence par regrouper les termes en $x$ d'un même côté de l'équation. Puis, isole $x$ en effectuant les bonnes opérations.`,
60
- // correction: `On isole $x$ à gauche en soustrayant par $${b}$ puis en divisant par $${a}$ :
61
- // ${alignTex([
62
- // [
63
- // statementTex,
64
- // "\\iff",
65
- // new EqualNode(
66
- // new Affine(a, 0).toTree(),
67
- // affines[1].add(-b).toTree(),
68
- // ).toTex(),
69
- // ],
70
- // ["", "\\iff", answer],
71
- // ])}
72
- // `,
61
+ const getHint = (identifiers) => {
62
+ return `Commence par regrouper les termes en $x$ d'un même côté de l'équation. Puis, isole $x$ en effectuant les bonnes opérations.`;
63
+ };
64
+ const getCorrection = (identifiers) => {
65
+ const { a, b, c, d } = identifiers;
66
+ return `On regroupe les nombres d'un côté, et les termes en $x$ de l'autre :
67
+
68
+ $$
69
+ ${equationResolutionTex(a.toTree(), b.toTree(), c.toTree(), d.toTree())}
70
+ $$`;
71
+ };
73
72
  const getPropositions = (n, { answer, a, b, c, d }) => {
74
73
  const propositions = [];
75
74
  addValidProp(propositions, answer);
@@ -101,4 +100,7 @@ export const equationType4Exercise = {
101
100
  getInstruction,
102
101
  getAnswer,
103
102
  getQuestionFromIdentifiers,
103
+ getHint,
104
+ getCorrection,
105
+ hasHintAndCorrection: true,
104
106
  };
@@ -45,7 +45,7 @@ const getHint = (identifiers) => {
45
45
  return `Il faut isoler $x$ à gauche. Pour cela, effectue l'opération des deux côtés de l'équation qui permet de supprimer la multiplication par $${a}$.`;
46
46
  };
47
47
  const getFirstDegreeEquationIntQuestion = () => {
48
- const a = randint(-15, 15, [0]);
48
+ const a = randint(-15, 15, [0, 1]);
49
49
  const x = randint(-15, 15, [0]);
50
50
  const b = a * x;
51
51
  const identifiers = { a: a, x: x, b: b };
@@ -1 +1 @@
1
- {"version":3,"file":"firstDegreeEquationIntType3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAe7D,CAAC"}
1
+ {"version":3,"file":"firstDegreeEquationIntType3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkHF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAgB7D,CAAC"}
@@ -2,7 +2,7 @@ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exer
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { equationVEA } from "../../../../exercises/vea/equationVEA.js";
4
4
  import { randint } from "../../../../math/utils/random/randint.js";
5
- import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
5
+ import { EqualNode, equationResolutionTex, } from "../../../../tree/nodes/equations/equalNode.js";
6
6
  import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
7
7
  import { FractionNode } from "../../../../tree/nodes/operators/fractionNode.js";
8
8
  import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
@@ -21,6 +21,17 @@ const getAnswer = (identifiers) => {
21
21
  const answer = new EqualNode(new VariableNode("x"), x.toTree()).toTex();
22
22
  return answer;
23
23
  };
24
+ const getHint = (identifiers) => {
25
+ return `Commence par regrouper les termes en $x$ d'un même côté de l'équation. Puis, isole $x$ en effectuant les bonnes opérations.`;
26
+ };
27
+ const getCorrection = (identifiers) => {
28
+ const { a, b, c, d } = identifiers;
29
+ return `On regroupe les nombres d'un côté, et les termes en $x$ de l'autre :
30
+
31
+ $$
32
+ ${equationResolutionTex(a.toTree(), b.toTree(), c.toTree(), d.toTree())}
33
+ $$`;
34
+ };
24
35
  const getFirstDegreeEquationIntQuestion = () => {
25
36
  const a = randint(-15, 15, [0]);
26
37
  const x = randint(-15, 15, [0]);
@@ -34,6 +45,8 @@ const getFirstDegreeEquationIntQuestion = () => {
34
45
  keys: ["x", "equal"],
35
46
  answerFormat: "tex",
36
47
  identifiers,
48
+ hint: getHint(identifiers),
49
+ correction: getCorrection(identifiers),
37
50
  };
38
51
  return question;
39
52
  };
@@ -75,9 +88,7 @@ const isAnswerValid = (ans, { answer, x }) => {
75
88
  export const firstDegreeEquationIntType3 = {
76
89
  id: "firstDegreeEquationIntType3",
77
90
  label: "Résoudre une équation du type $ax + b = cx + d$ (solution entière)",
78
- levels: ["2nde"],
79
91
  isSingleStep: true,
80
- sections: ["Équations"],
81
92
  generator: (nb) => getDistinctQuestions(getFirstDegreeEquationIntQuestion, nb),
82
93
  qcmTimer: 60,
83
94
  freeTimer: 60,
@@ -86,4 +97,7 @@ export const firstDegreeEquationIntType3 = {
86
97
  subject: "Mathématiques",
87
98
  getInstruction,
88
99
  getAnswer,
100
+ getHint,
101
+ getCorrection,
102
+ hasHintAndCorrection: true,
89
103
  };
@@ -1 +1 @@
1
- {"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAmBrC;;;GAGG;AACH,KAAK,WAAW,GAAG;IAEjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAIlB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA8JF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
1
+ {"version":3,"file":"factoType1Exercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType1Exercise.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAuBrC;;;GAGG;AACH,KAAK,WAAW,GAAG;IAEjB,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAIlB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAoKF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
@@ -7,6 +7,7 @@ import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.j
7
7
  import { randint } from "../../../../math/utils/random/randint.js";
8
8
  import { add } from "../../../../tree/nodes/operators/addNode.js";
9
9
  import { MultiplyNode, isMultiplyNode, multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
10
+ import { isPowerNode, isSquareNode, } from "../../../../tree/nodes/operators/powerNode.js";
10
11
  import { substract, } from "../../../../tree/nodes/operators/substractNode.js";
11
12
  import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
12
13
  import { random } from "../../../../utils/alea/random.js";
@@ -48,7 +49,7 @@ const getAnswer = (identifiers) => {
48
49
  const getFactoType1Question = () => {
49
50
  const a = randint(-9, 10, [0]);
50
51
  const b = randint(-9, 10, [0]);
51
- const operation = random(["add", "substract"]);
52
+ let operation = random(["add", "substract"]);
52
53
  let c, d;
53
54
  let e, f;
54
55
  do {
@@ -104,7 +105,10 @@ const isAnswerValid = (ans, { answer, ...identifiers }) => {
104
105
  const parsed = parseAlgebraic(ans);
105
106
  if (!parsed)
106
107
  return false;
107
- if (answer !== "0" && !isMultiplyNode(parsed))
108
+ if (answer !== "0" &&
109
+ !isMultiplyNode(parsed) &&
110
+ !isSquareNode(parsed) &&
111
+ !isPowerNode(parsed))
108
112
  return false;
109
113
  const simp = parsed.simplify({
110
114
  forbidFactorize: true,
@@ -1,7 +1,7 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
2
  type Identifiers = {
3
- poly1: number[];
4
- xValue: number;
3
+ coeffs: number[];
4
+ yValue: number;
5
5
  };
6
6
  export declare const inverseImageFunction: Exercise<Identifiers>;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"inverseImageFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAyCF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
1
+ {"version":3,"file":"inverseImageFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IAIjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA4GF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAoBtD,CAAC"}
@@ -1,34 +1,94 @@
1
1
  import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { AffineConstructor } from "../../../../math/polynomials/affine.js";
3
4
  import { Polynomial } from "../../../../math/polynomials/polynomial.js";
4
5
  import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { equationResolutionTex } from "../../../../tree/nodes/equations/equalNode.js";
7
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
5
8
  import { shuffle } from "../../../../utils/alea/shuffle.js";
9
+ const rebuildIdentifiers = (oldIds) => {
10
+ if (oldIds.coeffs?.length)
11
+ return oldIds;
12
+ const polynome = new Polynomial(oldIds.poly1);
13
+ const yValue = polynome.calculate(oldIds.xValue);
14
+ return {
15
+ coeffs: oldIds.poly1,
16
+ yValue,
17
+ };
18
+ };
19
+ const getStartStatement = (identifiers) => {
20
+ const { yValue } = identifiers;
21
+ return `f(x) = ${yValue}`;
22
+ };
23
+ const getInstruction = (identifiers) => {
24
+ const { yValue, coeffs } = identifiers;
25
+ const polynome = new Polynomial(coeffs);
26
+ const statement = `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
27
+
28
+ $$
29
+ f(x) = ${polynome.toTree().toTex()}
30
+ $$
31
+
32
+ Déterminer le ou les antécédents de $${yValue}$ par $f$.`;
33
+ return statement;
34
+ };
35
+ const getAnswer = (identifiers) => {
36
+ const { yValue, coeffs } = identifiers;
37
+ const polynome = AffineConstructor.fromCoeffs(coeffs);
38
+ const xValue = polynome.solve(yValue);
39
+ const answer = "x=" + xValue.toTex();
40
+ return answer;
41
+ };
6
42
  const getInverseImageFunction = () => {
7
43
  const polynome1 = new Polynomial([randint(-9, 10), randint(-5, 6, [0])]);
8
44
  const xValue = randint(-9, 10);
9
- let image = polynome1.calculate(xValue) + "";
10
- const statement = `Soit $f(x) = ${polynome1
11
- .toTree()
12
- .toTex()}$. Déterminer le ou les antécédents de $${image}$ par $f$.`;
13
- const answer = "x=" + xValue;
45
+ const y = polynome1.calculate(xValue);
46
+ const identifiers = { coeffs: polynome1.coefficients, yValue: y };
14
47
  const question = {
15
- instruction: statement,
16
- startStatement: `f(x) = ${image}`,
17
- answer,
48
+ instruction: getInstruction(identifiers),
49
+ startStatement: getStartStatement(identifiers),
50
+ answer: getAnswer(identifiers),
18
51
  keys: ["x", "equal"],
19
52
  answerFormat: "tex",
20
- identifiers: { poly1: polynome1.coefficients, xValue },
53
+ identifiers,
54
+ hint: getHint(identifiers),
55
+ correction: getCorrection(identifiers),
21
56
  };
22
57
  return question;
23
58
  };
24
- const getPropositions = (n, { answer, poly1, xValue }) => {
59
+ const getHint = (identifiers) => {
60
+ const { yValue, coeffs } = identifiers;
61
+ return `On doit résoudre l'équation :
62
+
63
+ $$
64
+ f(x) = ${yValue}
65
+ $$`;
66
+ };
67
+ const getCorrection = (identifiers) => {
68
+ const { yValue, coeffs } = identifiers;
69
+ const polynome = AffineConstructor.fromCoeffs(coeffs);
70
+ const xValue = polynome.solve(yValue);
71
+ const answer = "x=" + xValue.toTex();
72
+ return `On résout l'équation :
73
+
74
+ $$
75
+ f(x) = ${yValue}
76
+ $$
77
+
78
+ On obtient :
79
+
80
+ $$
81
+ ${equationResolutionTex(coeffs[1].toTree(), coeffs[0].toTree(), (0).toTree(), yValue.toTree())}
82
+ $$`;
83
+ };
84
+ const getPropositions = (n, { answer, coeffs, yValue }) => {
25
85
  const propositions = [];
26
86
  addValidProp(propositions, answer);
27
- const poly = new Polynomial(poly1);
28
- const image = poly.calculate(xValue);
29
- tryToAddWrongProp(propositions, "x=" + image);
87
+ const poly = AffineConstructor.fromCoeffs(coeffs);
88
+ const x = poly.solve(yValue);
89
+ tryToAddWrongProp(propositions, "x=" + yValue);
30
90
  while (propositions.length < n) {
31
- const wrongAnswer = xValue + randint(-10, 11, [0]);
91
+ const wrongAnswer = add(x, randint(-10, 11, [0])).simplify();
32
92
  tryToAddWrongProp(propositions, "x=" + wrongAnswer);
33
93
  }
34
94
  return shuffle(propositions);
@@ -49,4 +109,11 @@ export const inverseImageFunction = {
49
109
  freeTimer: 60,
50
110
  isAnswerValid,
51
111
  subject: "Mathématiques",
112
+ getInstruction,
113
+ getAnswer,
114
+ getStartStatement,
115
+ rebuildIdentifiers,
116
+ getCorrection,
117
+ getHint,
118
+ hasHintAndCorrection: true,
52
119
  };
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ aIdentifiers: NodeIdentifiers;
5
+ bIdentifiers: NodeIdentifiers;
6
+ cIdentifiers: NodeIdentifiers;
7
+ isAsking: string;
8
+ };
9
+ export declare const coefficientsIdentification: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=coefficientsIdentification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coefficientsIdentification.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/devForm/coefficientsIdentification.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAuIF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAgB5D,CAAC"}
@@ -0,0 +1,134 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { RationalConstructor } from "../../../../../math/numbers/rationals/rational.js";
4
+ import { TrinomNode } from "../../../../../tree/nodes/polynomials/trinomNode.js";
5
+ import { randint } from "../../../../../math/utils/random/randint.js";
6
+ import { NodeConstructor, } from "../../../../../tree/nodes/nodeConstructor.js";
7
+ import { isFractionNode } from "../../../../../tree/nodes/operators/fractionNode.js";
8
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
9
+ import { square } from "../../../../../tree/nodes/operators/powerNode.js";
10
+ import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
11
+ import { random } from "../../../../../utils/alea/random.js";
12
+ import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
13
+ const getPropositions = (n, { answer, aIdentifiers, bIdentifiers, cIdentifiers, isAsking }) => {
14
+ const propositions = [];
15
+ addValidProp(propositions, answer);
16
+ const trinom = new TrinomNode(NodeConstructor.fromIdentifiers(aIdentifiers), NodeConstructor.fromIdentifiers(bIdentifiers), NodeConstructor.fromIdentifiers(cIdentifiers));
17
+ if (answer === "1") {
18
+ tryToAddWrongProp(propositions, "0");
19
+ }
20
+ if (answer === "0") {
21
+ tryToAddWrongProp(propositions, "1");
22
+ }
23
+ if (answer === "-1") {
24
+ tryToAddWrongProp(propositions, "-");
25
+ }
26
+ const askedNode = isAsking === "a" ? trinom.a : isAsking === "b" ? trinom.b : trinom.c;
27
+ if (isFractionNode(askedNode)) {
28
+ tryToAddWrongProp(propositions, askedNode.leftChild.toTex());
29
+ }
30
+ // si frac ajouter que le num
31
+ const monom = isAsking === "a"
32
+ ? multiply(trinom.a, square("x")).simplify()
33
+ : isAsking === "b"
34
+ ? multiply(trinom.b, "x").simplify()
35
+ : trinom.c;
36
+ tryToAddWrongProp(propositions, monom.toTex());
37
+ while (propositions.length < n) {
38
+ tryToAddWrongProp(propositions, randint(-10, 10) + "");
39
+ }
40
+ return shuffleProps(propositions, n);
41
+ };
42
+ const getAnswer = (identifiers) => {
43
+ const { aIdentifiers, bIdentifiers, cIdentifiers, isAsking } = identifiers;
44
+ return isAsking === "a"
45
+ ? NodeConstructor.fromIdentifiers(aIdentifiers).toTex()
46
+ : isAsking === "b"
47
+ ? NodeConstructor.fromIdentifiers(bIdentifiers).toTex()
48
+ : NodeConstructor.fromIdentifiers(cIdentifiers).toTex();
49
+ };
50
+ const getInstruction = (identifiers) => {
51
+ const trinom = new TrinomNode(NodeConstructor.fromIdentifiers(identifiers.aIdentifiers), NodeConstructor.fromIdentifiers(identifiers.bIdentifiers), NodeConstructor.fromIdentifiers(identifiers.cIdentifiers));
52
+ return `Soit $f$ la fonction polynôme de degré $2$ définie sur $\\mathbb{R}$ par :
53
+
54
+ $$
55
+ f(x)=${trinom
56
+ .toTree()
57
+ .simplify({
58
+ // forceDistributeFractions: true,
59
+ forbidFactorize: true,
60
+ towardsDistribute: true,
61
+ })
62
+ .toTex()}
63
+ $$
64
+
65
+ Quelle est la valeur du coefficient $${identifiers.isAsking}$ de $f$ ?`;
66
+ };
67
+ // const getHint: GetHint<Identifiers> = (identifiers) => {};
68
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
69
+ const getKeys = (identifiers) => {
70
+ return [];
71
+ };
72
+ const isAnswerValid = (ans, { answer }) => {
73
+ try {
74
+ const parsed = parseAlgebraic(ans);
75
+ if (!parsed)
76
+ return false;
77
+ return parsed.simplify().toTex() === answer;
78
+ }
79
+ catch (err) {
80
+ return handleVEAError(err);
81
+ }
82
+ };
83
+ const getCoefficientsIdentificationQuestion = () => {
84
+ const a = random([
85
+ (-1).toTree(),
86
+ (1).toTree(),
87
+ randint(-10, 11, [-1, 0, 1]).toTree(),
88
+ RationalConstructor.randomIrreductible().toTree(),
89
+ ]);
90
+ const b = random([
91
+ (-1).toTree(),
92
+ (1).toTree(),
93
+ (0).toTree(),
94
+ randint(-10, 10, [-1, 1, 0]).toTree(),
95
+ RationalConstructor.randomIrreductible().toTree(),
96
+ ]);
97
+ const c = random([
98
+ (0).toTree(),
99
+ randint(-10, 11, [0]).toTree(),
100
+ RationalConstructor.randomIrreductible().toTree(),
101
+ ]);
102
+ const isAsking = random(["a", "b", "c"]);
103
+ const identifiers = {
104
+ aIdentifiers: a.toIdentifiers(),
105
+ bIdentifiers: b.toIdentifiers(),
106
+ cIdentifiers: c.toIdentifiers(),
107
+ isAsking,
108
+ };
109
+ const question = {
110
+ answer: getAnswer(identifiers),
111
+ instruction: getInstruction(identifiers),
112
+ keys: getKeys(identifiers),
113
+ answerFormat: "tex",
114
+ identifiers,
115
+ // hint: getHint(identifiers),
116
+ // correction: getCorrection(identifiers),
117
+ };
118
+ return question;
119
+ };
120
+ export const coefficientsIdentification = {
121
+ id: "coefficientsIdentification",
122
+ connector: "=",
123
+ label: "Reconnaître les coefficients $a$, $b$ et $c$ d'un trinôme exprimé sous forme développée",
124
+ isSingleStep: true,
125
+ generator: (nb) => getDistinctQuestions(getCoefficientsIdentificationQuestion, nb),
126
+ qcmTimer: 60,
127
+ freeTimer: 60,
128
+ getPropositions,
129
+ isAnswerValid,
130
+ subject: "Mathématiques",
131
+ // getHint,
132
+ // getCorrection,
133
+ getAnswer,
134
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./coefficientsIdentification.js";
2
+ export * from "./variationsFromAlgebricForm.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/devForm/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./coefficientsIdentification.js";
2
+ export * from "./variationsFromAlgebricForm.js";
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ c: number;
6
+ };
7
+ export declare const variationsFromAlgebricForm: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=variationsFromAlgebricForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variationsFromAlgebricForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwCF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAc5D,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { addValidProp, addWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
4
+ import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
5
+ import { shuffle } from "../../../../../utils/alea/shuffle.js";
6
+ const getVariationsFromAlgebricFormQuestion = () => {
7
+ const isDevForm = coinFlip();
8
+ const trinom = isDevForm
9
+ ? TrinomConstructor.random()
10
+ : TrinomConstructor.randomCanonical();
11
+ const answer = trinom.a > 0
12
+ ? "Décroissante puis croissante"
13
+ : "Croissante puis décroissante";
14
+ const question = {
15
+ answer: answer,
16
+ instruction: `Quelles sont les variations de la fonction $f$ définie par $f(x) = ${isDevForm ? trinom.toTree().toTex() : trinom.getCanonicalForm().toTex()}$ ?`,
17
+ answerFormat: "raw",
18
+ identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
19
+ };
20
+ return question;
21
+ };
22
+ const getPropositions = (n, { answer, a }) => {
23
+ const propositions = [];
24
+ addValidProp(propositions, answer, "raw");
25
+ addWrongProp(propositions, a < 0 ? "Décroissante puis croissante" : "Croissante puis décroissante", "raw");
26
+ addWrongProp(propositions, "Constante", "raw");
27
+ addWrongProp(propositions, "On ne peut pas savoir", "raw");
28
+ return shuffle(propositions);
29
+ };
30
+ export const variationsFromAlgebricForm = {
31
+ id: "variationsFromAlgebricForm",
32
+ label: "Déterminer les variations d'une fonction du second degré via sa forme algébrique",
33
+ levels: ["1reSpé"],
34
+ isSingleStep: true,
35
+ sections: ["Second degré"],
36
+ generator: (nb) => getDistinctQuestions(getVariationsFromAlgebricFormQuestion, nb),
37
+ answerType: "QCU",
38
+ qcmTimer: 60,
39
+ freeTimer: 60,
40
+ getPropositions,
41
+ subject: "Mathématiques",
42
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ c: number;
6
+ };
7
+ export declare const deltaTrinom: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=deltaTrinom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deltaTrinom.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/equation/deltaTrinom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwCF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAc7C,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
4
+ import { randint } from "../../../../../math/utils/random/randint.js";
5
+ import { shuffle } from "../../../../../utils/alea/shuffle.js";
6
+ const getDeltaTrinomQuestion = () => {
7
+ const trinom = TrinomConstructor.random();
8
+ const answer = trinom.getDelta() + "";
9
+ const question = {
10
+ answer: answer,
11
+ instruction: `Soit $f(x) = ${trinom
12
+ .toTree()
13
+ .toTex()}$. Calculer le discriminant $\\Delta$.`,
14
+ keys: [],
15
+ answerFormat: "tex",
16
+ identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
17
+ };
18
+ return question;
19
+ };
20
+ const getPropositions = (n, { answer, a, b, c }) => {
21
+ const propositions = [];
22
+ addValidProp(propositions, answer);
23
+ const bMinus4ac = b - 4 * a * c;
24
+ tryToAddWrongProp(propositions, bMinus4ac + "");
25
+ const bSquarePlus4ac = b ** 2 + a * c;
26
+ tryToAddWrongProp(propositions, bSquarePlus4ac + "");
27
+ while (propositions.length < n) {
28
+ const wrongAnswer = randint(-100, 100) + "";
29
+ tryToAddWrongProp(propositions, wrongAnswer);
30
+ }
31
+ return shuffle(propositions);
32
+ };
33
+ const isAnswerValid = (ans, { a, b, c }) => {
34
+ const delta = b ** 2 - 4 * a * c;
35
+ return ans === delta.toString();
36
+ };
37
+ export const deltaTrinom = {
38
+ id: "deltaTrinom",
39
+ connector: "=",
40
+ getPropositions,
41
+ label: "Calculer le discriminant d'un trinôme",
42
+ levels: ["1reSpé", "TermSpé", "MathComp"],
43
+ isSingleStep: true,
44
+ sections: ["Second degré"],
45
+ generator: (nb) => getDistinctQuestions(getDeltaTrinomQuestion, nb),
46
+ qcmTimer: 60,
47
+ freeTimer: 60,
48
+ isAnswerValid,
49
+ subject: "Mathématiques",
50
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./deltaTrinom.js";
2
+ export * from "./secondDegreeInequation.js";
3
+ export * from "./solveSecondDegreeEquationByFactorisation.js";
4
+ export * from "./solveSecondDegreeEquationFromCano.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./deltaTrinom.js";
2
+ export * from "./secondDegreeInequation.js";
3
+ export * from "./solveSecondDegreeEquationByFactorisation.js";
4
+ export * from "./solveSecondDegreeEquationFromCano.js";
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ import { InegalitySymbols } from "../../../../../math/inequations/inequation.js";
3
+ type Identifiers = {
4
+ a: number;
5
+ b: number;
6
+ c: number;
7
+ ineqType: InegalitySymbols;
8
+ };
9
+ export declare const secondDegreeInequation: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=secondDegreeInequation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secondDegreeInequation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/equation/secondDegreeInequation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,gBAAgB,EAGjB,MAAM,sCAAsC,CAAC;AAiB9C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAwHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}