math-exercises 3.0.108 → 3.0.110

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 (104) hide show
  1. package/lib/exercises/math/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/addAndSubWithoutRelatives.js +5 -1
  3. package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.d.ts +7 -0
  5. package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.d.ts.map +1 -0
  6. package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.js +197 -0
  7. package/lib/exercises/math/calcul/rounding/index.d.ts +1 -0
  8. package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/rounding/index.js +1 -0
  10. package/lib/exercises/math/calcul/writing/numberToFrenchWriting.js +0 -1
  11. package/lib/exercises/math/calculLitteral/factorisation/factoType2.d.ts.map +1 -1
  12. package/lib/exercises/math/calculLitteral/formulas/index.d.ts +2 -0
  13. package/lib/exercises/math/calculLitteral/formulas/index.d.ts.map +1 -0
  14. package/lib/exercises/math/calculLitteral/formulas/index.js +1 -0
  15. package/lib/exercises/math/calculLitteral/formulas/useFormula.d.ts +18 -0
  16. package/lib/exercises/math/calculLitteral/formulas/useFormula.d.ts.map +1 -0
  17. package/lib/exercises/math/calculLitteral/formulas/useFormula.js +208 -0
  18. package/lib/exercises/math/calculLitteral/index.d.ts +1 -0
  19. package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
  20. package/lib/exercises/math/calculLitteral/index.js +1 -0
  21. package/lib/exercises/math/calculLitteral/writing/index.d.ts +2 -0
  22. package/lib/exercises/math/calculLitteral/writing/index.d.ts.map +1 -0
  23. package/lib/exercises/math/calculLitteral/writing/index.js +1 -0
  24. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +33 -0
  25. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -0
  26. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +348 -0
  27. package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -1
  28. package/lib/exercises/math/dataRepresentations/pieChartReading.d.ts.map +1 -1
  29. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +1 -1
  30. package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.d.ts.map +1 -1
  31. package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
  32. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
  33. package/lib/exercises/math/derivation/variations/index.js +1 -0
  34. package/lib/exercises/math/derivation/variations/thirdDegreeDerivativeVariation.d.ts +10 -0
  35. package/lib/exercises/math/derivation/variations/thirdDegreeDerivativeVariation.d.ts.map +1 -0
  36. package/lib/exercises/math/derivation/variations/thirdDegreeDerivativeVariation.js +201 -0
  37. package/lib/exercises/math/functions/basics/graphicInequationAffine.d.ts.map +1 -1
  38. package/lib/exercises/math/functions/logarithm/index.d.ts +1 -0
  39. package/lib/exercises/math/functions/logarithm/index.d.ts.map +1 -1
  40. package/lib/exercises/math/functions/logarithm/index.js +1 -0
  41. package/lib/exercises/math/functions/logarithm/powerEquation.d.ts +11 -0
  42. package/lib/exercises/math/functions/logarithm/powerEquation.d.ts.map +1 -0
  43. package/lib/exercises/math/functions/logarithm/powerEquation.js +148 -0
  44. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -1
  45. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
  46. package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +28 -5
  47. package/lib/exercises/math/functions/variations/varTableExtremaReading.d.ts.map +1 -1
  48. package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -1
  49. package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
  50. package/lib/exercises/math/geometry/cartesian/placeAPoint.js +14 -0
  51. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -1
  52. package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.d.ts.map +1 -1
  53. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
  54. package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
  55. package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.d.ts.map +1 -1
  56. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
  57. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  58. package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -1
  59. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts.map +1 -1
  60. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
  61. package/lib/exercises/math/limits/sequencePolynomLimit.js +2 -2
  62. package/lib/exercises/math/limits/sequencePolynomNoFILimit.js +2 -2
  63. package/lib/exercises/math/limits/sequencePolynomProductLimit.js +4 -4
  64. package/lib/exercises/math/limits/sequenceRationalFracLimit.js +4 -4
  65. package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.d.ts.map +1 -1
  66. package/lib/exercises/math/percent/evolutions/findEndValueAfterEvolution.d.ts.map +1 -1
  67. package/lib/exercises/math/percent/evolutions/findStartValueAfterEvolution.d.ts.map +1 -1
  68. package/lib/exercises/math/percent/populationEffectifFromSubPopulation.d.ts.map +1 -1
  69. package/lib/exercises/math/percent/subPopulationEffectifFromPercent.d.ts.map +1 -1
  70. package/lib/exercises/math/python/conditionIfElifElse.d.ts +1 -0
  71. package/lib/exercises/math/python/conditionIfElifElse.d.ts.map +1 -1
  72. package/lib/exercises/math/python/conditionIfElifElse.js +24 -16
  73. package/lib/exercises/math/python/forLoop.js +1 -1
  74. package/lib/exercises/math/python/inOutCalcul.d.ts.map +1 -1
  75. package/lib/exercises/math/python/inOutCalcul.js +5 -1
  76. package/lib/exercises/math/python/pyWhileLoop1Exercise.js +1 -1
  77. package/lib/exercises/math/python/pythonForLoopInstructionCompletion.d.ts.map +1 -1
  78. package/lib/exercises/math/python/pythonForLoopInstructionCompletion.js +24 -15
  79. package/lib/exercises/math/python/pythonRangeCompletion.d.ts.map +1 -1
  80. package/lib/exercises/math/python/pythonRangeCompletion.js +7 -5
  81. package/lib/exercises/math/python/variableAffectation.js +7 -7
  82. package/lib/exercises/math/python/variableType.d.ts.map +1 -1
  83. package/lib/exercises/math/python/variableType.js +11 -10
  84. package/lib/exercises/math/python/whileLoopCount.js +1 -1
  85. package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.d.ts +9 -0
  86. package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.d.ts.map +1 -0
  87. package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.js +110 -0
  88. package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -0
  89. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  90. package/lib/exercises/math/sequences/arithmetic/index.js +1 -0
  91. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -1
  92. package/lib/exercises/math/trigonometry/arcLength.d.ts.map +1 -1
  93. package/lib/exercises/math/trigonometry/basicEquationCos.d.ts.map +1 -1
  94. package/lib/exercises/math/trigonometry/basicEquationSin.d.ts.map +1 -1
  95. package/lib/exercises/math/trigonometry/basicTrigoSystemEquation.d.ts.map +1 -1
  96. package/lib/exercises/math/trigonometry/degreeToRadians.d.ts.map +1 -1
  97. package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -1
  98. package/lib/index.d.ts +26 -0
  99. package/lib/index.d.ts.map +1 -1
  100. package/lib/playground.d.ts.map +1 -1
  101. package/lib/tree/nodes/equations/equalNode.d.ts +1 -1
  102. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  103. package/lib/tree/nodes/equations/equalNode.js +5 -5
  104. package/package.json +1 -1
@@ -0,0 +1,148 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionType, GeneratorOptionTarget, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../math/utils/random/randint.js";
4
+ import { round } from "../../../../math/utils/round.js";
5
+ import { Log10Node } from "../../../../tree/nodes/functions/log10Node.js";
6
+ import { LogNode } from "../../../../tree/nodes/functions/logNode.js";
7
+ import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
8
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
9
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
10
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
11
+ import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
12
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
13
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
14
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
15
+ const getPropositions = (n, { answer, ...identifiers }, opts) => {
16
+ const { a, b } = identifiers;
17
+ const propositions = [];
18
+ const logNode = opts?.useLog10 ? Log10Node : LogNode;
19
+ addValidProp(propositions, answer);
20
+ tryToAddWrongProp(propositions, frac(a, b).simplify().toTex());
21
+ tryToAddWrongProp(propositions, frac(new logNode(a.toTree()), new logNode(b.toTree())).simplify().toTex());
22
+ tryToAddWrongProp(propositions, frac(new logNode(a.toTree()), b).simplify().toTex());
23
+ tryToAddWrongProp(propositions, frac(a, new logNode(b.toTree())).simplify().toTex());
24
+ return shuffleProps(propositions, n);
25
+ };
26
+ const getAnswer = (identifiers, opts) => {
27
+ const { a, b } = identifiers;
28
+ const logNode = opts?.useLog10 ? Log10Node : LogNode;
29
+ return frac(new logNode(new NumberNode(b)), new logNode(new NumberNode(a)))
30
+ .simplify()
31
+ .toTex();
32
+ };
33
+ const getInstruction = (identifiers) => {
34
+ const { a, b } = identifiers;
35
+ return `Résoudre :
36
+
37
+ $$
38
+ ${a}^x = ${b}
39
+ $$
40
+
41
+ *Donner la valeur exacte ou une valeur arrondie au centième.*`;
42
+ };
43
+ const getHint = (identifiers, opts) => {
44
+ const logNode = opts?.useLog10 ? Log10Node : LogNode;
45
+ return `Utilise la propriété :
46
+
47
+ $$
48
+ ${new logNode(power("a", "x")).toTex()} = ${multiply("x", new logNode(new VariableNode("a"))).toTex()}
49
+ $$`;
50
+ };
51
+ const getCorrection = (identifiers, opts) => {
52
+ const answer = getAnswer(identifiers, opts);
53
+ const { a, b } = identifiers;
54
+ const logNode = opts?.useLog10 ? Log10Node : LogNode;
55
+ const steps = [
56
+ [
57
+ "",
58
+ new logNode(power(a, "x")).toTex(),
59
+ "=",
60
+ new logNode(new NumberNode(b)).toTex(),
61
+ ],
62
+ [
63
+ "\\iff",
64
+ multiply("x", new logNode(new NumberNode(a))).toTex(),
65
+ "=",
66
+ new logNode(new NumberNode(b)).toTex(),
67
+ ],
68
+ [
69
+ "\\iff",
70
+ "x",
71
+ "=",
72
+ frac(new logNode(new NumberNode(b)), new logNode(new NumberNode(a))).toTex(),
73
+ ],
74
+ ];
75
+ const lastStep = frac(new logNode(new NumberNode(b)), new logNode(new NumberNode(a)));
76
+ if (lastStep.toTex() !== answer)
77
+ steps.push(["\\iff", "x", "=", answer]);
78
+ return `En appliquant le logarithme des deux côtés de l'équation, on obtient :
79
+
80
+ ${alignTex(steps)}
81
+
82
+ La solution de l'équation est donc :
83
+
84
+ $$
85
+ ${answer} \\approx ${round(lastStep.evaluate(), 2).frenchify()}
86
+ $$`;
87
+ };
88
+ const isAnswerValid = (ans, { answer }) => {
89
+ try {
90
+ const parsed = parseAlgebraic(ans);
91
+ const value = parsed.evaluate();
92
+ const answerValue = parseAlgebraic(answer).evaluate();
93
+ console.log(value, answerValue);
94
+ if (Math.abs(value - answerValue) < 0.01)
95
+ return true;
96
+ return parsed.simplify().toTex() === answer;
97
+ }
98
+ catch (err) {
99
+ return handleVEAError(err);
100
+ }
101
+ };
102
+ const getKeys = (identifiers, opts) => {
103
+ return opts?.useLog10 ? ["logBrackets"] : ["lnBrackets"];
104
+ };
105
+ const getPowerEquationQuestion = (opts) => {
106
+ const a = randint(2, 20, [10]);
107
+ const b = randint(2, 20, [10, a]);
108
+ const identifiers = { a, b };
109
+ return getQuestionFromIdentifiers(identifiers, opts);
110
+ };
111
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
112
+ return {
113
+ answer: getAnswer(identifiers, opts),
114
+ instruction: getInstruction(identifiers, opts),
115
+ keys: getKeys(identifiers, opts),
116
+ answerFormat: "tex",
117
+ identifiers,
118
+ hint: getHint(identifiers, opts),
119
+ correction: getCorrection(identifiers, opts),
120
+ };
121
+ };
122
+ const options = [
123
+ {
124
+ id: "useLog10",
125
+ label: "Utiliser le logarithme décimal",
126
+ target: GeneratorOptionTarget.answer,
127
+ type: GeneratorOptionType.checkbox,
128
+ defaultValue: false,
129
+ },
130
+ ];
131
+ export const powerEquation = {
132
+ id: "powerEquation",
133
+ label: "Résoudre une équation de type $a^x = b$",
134
+ isSingleStep: true,
135
+ generator: (nb, opts) => getDistinctQuestions(() => getPowerEquationQuestion(opts), nb),
136
+ qcmTimer: 60,
137
+ freeTimer: 60,
138
+ getPropositions,
139
+ isAnswerValid,
140
+ subject: "Mathématiques",
141
+ getInstruction,
142
+ getHint,
143
+ getCorrection,
144
+ getAnswer,
145
+ getQuestionFromIdentifiers,
146
+ hasHintAndCorrection: true,
147
+ options,
148
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"paraboleExpressionReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;CAIpB,CAAC;AA4SF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAe3D,CAAC"}
1
+ {"version":3,"file":"paraboleExpressionReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;CAIpB,CAAC;AA4SF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAe3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAY9C,CAAC"}
1
+ {"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmGF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAY9C,CAAC"}
@@ -4,15 +4,27 @@ import { randomColor } from "../../../../../geogebra/colors.js";
4
4
  import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
5
5
  import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
6
6
  import { randint } from "../../../../../math/utils/random/randint.js";
7
+ import { divide } from "../../../../../tree/nodes/operators/divideNode.js";
8
+ import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
9
+ import { probaLawFlip } from "../../../../../utils/alea/probaLawFlip.js";
7
10
  const getInstruction = (identifiers) => {
8
- return `Déterminer graphiquement le ou les racine(s) du polynôme du second degré représenté ci-dessous : `;
11
+ return `Déterminer graphiquement le ou les racine(s) du polynôme du second degré représenté ci-dessous.
12
+
13
+ S'il n'y en a pas, on écrira "Aucun".`;
9
14
  };
10
15
  const getAnswer = (identifiers) => {
11
16
  const { a, b, c } = identifiers;
12
17
  const trinom = new Trinom(a, b, c);
13
18
  const roots = trinom.getRoots();
14
- const answer = roots.length === 1 ? roots[0].toString() : roots.join("\\text{ et }");
15
- return answer;
19
+ switch (roots.length) {
20
+ case 0:
21
+ return "\\text{Aucun}";
22
+ case 1:
23
+ return roots[0].toString();
24
+ case 2:
25
+ default:
26
+ return roots.join("\\text{ et }");
27
+ }
16
28
  };
17
29
  const getGGBOptions = (identifiers) => {
18
30
  const { a, b, c } = identifiers;
@@ -28,7 +40,12 @@ const getGGBOptions = (identifiers) => {
28
40
  return ggb.getOptions({ coords: trinom.getCoords() });
29
41
  };
30
42
  const getRootsReadingQuestion = () => {
31
- const trinom = TrinomConstructor.randomNiceRoots(randint(1, 3));
43
+ const nbRoots = probaLawFlip([
44
+ [0, 0.2],
45
+ [1, 0.4],
46
+ [2, 0.4],
47
+ ]);
48
+ const trinom = TrinomConstructor.randomNiceRoots(nbRoots);
32
49
  const identifiers = { a: trinom.a, b: trinom.b, c: trinom.c };
33
50
  return getQuestionFromIdentifiers(identifiers);
34
51
  };
@@ -43,9 +60,12 @@ const getQuestionFromIdentifiers = (identifiers) => {
43
60
  };
44
61
  return question;
45
62
  };
46
- const getPropositions = (n, { answer }) => {
63
+ const getPropositions = (n, { answer, ...identifiers }) => {
47
64
  const propositions = [];
48
65
  addValidProp(propositions, answer);
66
+ tryToAddWrongProp(propositions, "\\text{Aucun}");
67
+ const { a, b, c } = identifiers;
68
+ tryToAddWrongProp(propositions, divide(-b, multiply(2, a)).simplify().toTex());
49
69
  while (propositions.length < n) {
50
70
  const x1 = randint(-10, 10);
51
71
  const x2 = randint(-10, 10, [x1]);
@@ -56,6 +76,9 @@ const getPropositions = (n, { answer }) => {
56
76
  };
57
77
  const isAnswerValid = (ans, { answer, a, b, c }) => {
58
78
  const roots = new Trinom(a, b, c).getRoots();
79
+ if (!roots.length) {
80
+ return ans === "\\text{Aucun}";
81
+ }
59
82
  const studentNumbers = ans
60
83
  .replaceAll("\\text{ }", "")
61
84
  .split("\\text{ et }")
@@ -1 +1 @@
1
- {"version":3,"file":"varTableExtremaReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableExtremaReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAsBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAyPF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAWF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjE,CAAC"}
1
+ {"version":3,"file":"varTableExtremaReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableExtremaReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAyPF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAWF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"recognizeAngleType.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/recognizeAngleType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAWtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAwVF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
1
+ {"version":3,"file":"recognizeAngleType.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/recognizeAngleType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAWtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAwVF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"placeAPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAmD5C,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAU/C,CAAC"}
1
+ {"version":3,"file":"placeAPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAiE5C,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAW/C,CAAC"}
@@ -7,6 +7,17 @@ const getInstruction = (identifiers) => {
7
7
  const point = new Point("A", identifiers.x, identifiers.y);
8
8
  return `Placer le point $A$ de coordonnées $${point.toTexWithCoords()}$.`;
9
9
  };
10
+ const getHint = (identifiers) => {
11
+ return `Le point $A(x;y)$ a pour abscisse $x$ et pour ordonnée $y$.
12
+
13
+ L'abscisse se lit sur l'axe horizontal. L'ordonnée se lit sur l'axe verticale.`;
14
+ };
15
+ const getCorrection = (identifiers) => {
16
+ const { x, y } = identifiers;
17
+ return `Le point $A$ a pour abcsisse $${x}$ et pour ordonnée $${y}$.
18
+
19
+ On se place donc à $${x}$ sur l'axe des abscisses (axe horizontal), puis à $${y}$ sur l'axe des ordonnées (axe vertical).`;
20
+ };
10
21
  const getGGBAnswer = (identifiers) => {
11
22
  const { x, y } = identifiers;
12
23
  return [`(${x},${y})`];
@@ -34,6 +45,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
34
45
  keys: [],
35
46
  studentGgbOptions: getStudentGGBOptions(identifiers),
36
47
  identifiers,
48
+ hint: getHint(identifiers),
49
+ correction: getCorrection(identifiers),
37
50
  };
38
51
  return question;
39
52
  };
@@ -54,4 +67,5 @@ export const testGGBAnswer = {
54
67
  isGGBAnswerValid,
55
68
  subject: "Mathématiques",
56
69
  getQuestionFromIdentifiers,
70
+ hasHintAndCorrection: true,
57
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"readAbscissOnLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAgB1D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA6LF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAkBnD,CAAC"}
1
+ {"version":3,"file":"readAbscissOnLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAgB1D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA6LF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAkBnD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"readAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAc1D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqLF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAkBvD,CAAC"}
1
+ {"version":3,"file":"readAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/readAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAc1D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqLF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAkBvD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"pythagoreOrThales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/pythagoreOrThales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAkBtC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IAEzB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CAQnB,CAAC;AA4RF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAuBnD,CAAC"}
1
+ {"version":3,"file":"pythagoreOrThales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/pythagoreOrThales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAkBtC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IAEzB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CAQnB,CAAC;AA4RF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAuBnD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"linesRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/linesRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE/D,WAAW,EAAE,MAAM,CAAC;CAKrB,CAAC;AAyKF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAqBxD,CAAC"}
1
+ {"version":3,"file":"linesRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/linesRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE/D,WAAW,EAAE,MAAM,CAAC;CAKrB,CAAC;AAyKF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAqBxD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"parallelogramAngles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/parallelogramAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,wBAAwB,EACzB,MAAM,qDAAqD,CAAC;AAO7D,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,wBAAwB,CAAC;IAC1C,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AA6IF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAoBrD,CAAC"}
1
+ {"version":3,"file":"parallelogramAngles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/parallelogramAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,wBAAwB,EACzB,MAAM,qDAAqD,CAAC;AAO7D,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,wBAAwB,CAAC;IAC1C,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AA6IF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAoBrD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"quadrilateralRecognition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,wBAAwB,EACzB,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAEL,oBAAoB,EACrB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAGL,kBAAkB,EACnB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAEL,iBAAiB,EAClB,MAAM,8CAA8C,CAAC;AAItD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EACZ,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,wBAAwB,CAAC;CAC9B,CAAC;AA+MF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAqB1D,CAAC"}
1
+ {"version":3,"file":"quadrilateralRecognition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,wBAAwB,EACzB,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAEL,oBAAoB,EACrB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAGL,kBAAkB,EACnB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAEL,iBAAiB,EAClB,MAAM,8CAA8C,CAAC;AAItD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EACZ,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,wBAAwB,CAAC;CAC9B,CAAC;AA+MF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAqB1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAsBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAanD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AA4OF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAqEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA0BvD,CAAC"}
1
+ {"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAanD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AA4OF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAqEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA0BvD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"triangleNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAKnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAoLF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAoBhD,CAAC"}
1
+ {"version":3,"file":"triangleNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAKnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAoLF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAoBhD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"triangleThirdAngleValue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleThirdAngleValue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EAEpB,MAAM,2CAA2C,CAAC;AASnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA0JF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAoBzD,CAAC"}
1
+ {"version":3,"file":"triangleThirdAngleValue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleThirdAngleValue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EAEpB,MAAM,2CAA2C,CAAC;AASnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA0JF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAoBzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductOrthoInSquare.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAsKF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAkB5D,CAAC"}
1
+ {"version":3,"file":"scalarProductOrthoInSquare.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAsKF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAkB5D,CAAC"}
@@ -4,7 +4,7 @@ import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/po
4
4
  import { randint } from "../../../math/utils/random/randint.js";
5
5
  import { shuffle } from "../../../utils/alea/shuffle.js";
6
6
  const getInstruction = (identifiers) => {
7
- const poly = new Polynomial(identifiers.coeffs);
7
+ const poly = new Polynomial(identifiers.coeffs, "n");
8
8
  return `Déterminer la limite de la suite $u$ définie par :
9
9
 
10
10
  $$
@@ -13,7 +13,7 @@ $$`;
13
13
  };
14
14
  const getAnswer = (identifiers) => {
15
15
  const to = "+\\infty";
16
- const poly = new Polynomial(identifiers.coeffs);
16
+ const poly = new Polynomial(identifiers.coeffs, "n");
17
17
  const answer = poly.getLimit(to);
18
18
  return answer;
19
19
  };
@@ -4,7 +4,7 @@ import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/po
4
4
  import { randint } from "../../../math/utils/random/randint.js";
5
5
  import { shuffle } from "../../../utils/alea/shuffle.js";
6
6
  const getInstruction = (identifiers) => {
7
- const poly = new Polynomial(identifiers.coeffs);
7
+ const poly = new Polynomial(identifiers.coeffs, "n");
8
8
  return `Déterminer la limite de la suite $u$ définie par :
9
9
 
10
10
  $$
@@ -13,7 +13,7 @@ $$`;
13
13
  };
14
14
  const getAnswer = (identifiers) => {
15
15
  const to = "+\\infty";
16
- const poly = new Polynomial(identifiers.coeffs);
16
+ const poly = new Polynomial(identifiers.coeffs, "n");
17
17
  const answer = poly.getLimit(to);
18
18
  return answer;
19
19
  };
@@ -7,8 +7,8 @@ import { randint } from "../../../math/utils/random/randint.js";
7
7
  import { shuffle } from "../../../utils/alea/shuffle.js";
8
8
  const getInstruction = (identifiers) => {
9
9
  const { polyNumCoeffs, polyDenumCoeffs } = identifiers;
10
- const polyNum = new Polynomial(polyNumCoeffs);
11
- const polyDenum = new Polynomial(polyDenumCoeffs);
10
+ const polyNum = new Polynomial(polyNumCoeffs, "n");
11
+ const polyDenum = new Polynomial(polyDenumCoeffs, "n");
12
12
  return `Déterminer la limite de la suite $u$ définie par :
13
13
 
14
14
  $$
@@ -17,8 +17,8 @@ $$`;
17
17
  };
18
18
  const getAnswer = (identifiers) => {
19
19
  const { polyNumCoeffs, polyDenumCoeffs } = identifiers;
20
- const polyNum = new Polynomial(polyNumCoeffs);
21
- const polyDenum = new Polynomial(polyDenumCoeffs);
20
+ const polyNum = new Polynomial(polyNumCoeffs, "n");
21
+ const polyDenum = new Polynomial(polyDenumCoeffs, "n");
22
22
  const numLeadingCoeff = polyNum.coefficients[polyNum.degree];
23
23
  const denumLeadingCoeff = polyDenum.coefficients[polyDenum.degree];
24
24
  const product = new Monom(polyNum.degree + polyDenum.degree, numLeadingCoeff * denumLeadingCoeff, "n");
@@ -8,8 +8,8 @@ import { NumberNode } from "../../../tree/nodes/numbers/numberNode.js";
8
8
  import { shuffle } from "../../../utils/alea/shuffle.js";
9
9
  const getInstruction = (identifiers) => {
10
10
  const { numCoeffs, denumCoeffs } = identifiers;
11
- const polyNum = new Polynomial(numCoeffs);
12
- const polyDenum = new Polynomial(denumCoeffs);
11
+ const polyNum = new Polynomial(numCoeffs, "n");
12
+ const polyDenum = new Polynomial(denumCoeffs, "n");
13
13
  return `Déterminer la limite de la suite $u$ définie par :
14
14
 
15
15
  $$
@@ -18,8 +18,8 @@ $$`;
18
18
  };
19
19
  const getAnswer = (identifiers) => {
20
20
  const { numCoeffs, denumCoeffs } = identifiers;
21
- const polyNum = new Polynomial(numCoeffs);
22
- const polyDenum = new Polynomial(denumCoeffs);
21
+ const polyNum = new Polynomial(numCoeffs, "n");
22
+ const polyDenum = new Polynomial(denumCoeffs, "n");
23
23
  let answer = "";
24
24
  const to = "+\\infty";
25
25
  const numLeadingCoeff = polyNum.coefficients[polyNum.degree];
@@ -1 +1 @@
1
- {"version":3,"file":"evolutionRateFromValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/evolutionRateFromValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAyGF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAgBzD,CAAC"}
1
+ {"version":3,"file":"evolutionRateFromValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/evolutionRateFromValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAyGF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAgBzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"findEndValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findEndValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAiGF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
1
+ {"version":3,"file":"findEndValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findEndValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAiGF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"findStartValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findStartValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAiGF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAiB9D,CAAC"}
1
+ {"version":3,"file":"findStartValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findStartValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAiGF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAiB9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsJF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAiBrE,CAAC"}
1
+ {"version":3,"file":"populationEffectifFromSubPopulation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/populationEffectifFromSubPopulation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsJF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC,WAAW,CAiBrE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"subPopulationEffectifFromPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/subPopulationEffectifFromPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA2GF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAgBlE,CAAC"}
1
+ {"version":3,"file":"subPopulationEffectifFromPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/subPopulationEffectifFromPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA2GF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAgBlE,CAAC"}
@@ -3,6 +3,7 @@ type Identifiers = {
3
3
  a: number;
4
4
  b: number;
5
5
  opName: string;
6
+ ineqs: string[];
6
7
  };
7
8
  export declare const conditionIfElifElse: Exercise<Identifiers>;
8
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"conditionIfElifElse.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/conditionIfElifElse.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA+HF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
1
+ {"version":3,"file":"conditionIfElifElse.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/conditionIfElifElse.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAmJF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
@@ -2,36 +2,39 @@ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercis
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { randint } from "../../../math/utils/random/randint.js";
4
4
  import { random } from "../../../utils/alea/random.js";
5
+ import { shuffle } from "../../../utils/alea/shuffle.js";
5
6
  const operations = [
6
7
  { name: "+", func: (x, step) => x + step },
7
8
  { name: "-", func: (x, step) => x - step },
8
9
  { name: "*", func: (x, step) => x * step },
9
10
  { name: "//", func: (x, step) => Math.floor(x / step) },
10
11
  ];
11
- const getAnswer = ({ a, b, opName }) => {
12
+ const getAnswer = ({ a, b, opName, ineqs }) => {
12
13
  const operation = operations.find((op) => op.name === opName);
13
14
  const opresult = operation.func(a, b);
14
- let result;
15
+ const results = [b, opresult + b, opresult + 1];
16
+ const unshuffledIneqs = ["<", "==", ">"];
17
+ const shuffledResults = unshuffledIneqs.map((e) => results[ineqs.indexOf(e)]);
15
18
  if (opresult < b) {
16
- result = b;
19
+ return shuffledResults[0].frenchify();
17
20
  }
18
21
  else if (opresult === b) {
19
- result = opresult + b;
22
+ return shuffledResults[1].frenchify();
20
23
  }
21
24
  else {
22
- result = opresult + 1;
25
+ return shuffledResults[2].frenchify();
23
26
  }
24
- return result.frenchify();
25
27
  };
26
- const getInstruction = ({ a, b, opName }) => `
27
- Quel sera l'affichage du code suivant ?
28
+ const getInstruction = ({ a, b, opName, ineqs, }) => `
29
+ Quel sera l'affichage du script en Python suivant ?
30
+
28
31
  \`\`\`python
29
32
  a = ${a}
30
33
  b = ${b}
31
34
  a = a ${opName} b
32
- if a < b:
35
+ if a ${ineqs[0]} b:
33
36
  a = b
34
- elif a == b:
37
+ elif a ${ineqs[1]} b:
35
38
  a = a + b
36
39
  else:
37
40
  a = a + 1
@@ -39,17 +42,21 @@ print(a)
39
42
  \`\`\`
40
43
  `;
41
44
  const getHint = ({ opName }) => `Calcule la valeur de $a$ avec $a = a ${opName} b$ puis applique la condition if-elif-else.`;
42
- const getCorrection = ({ a, b, opName }) => {
45
+ const getCorrection = ({ a, b, opName, ineqs }) => {
43
46
  const operation = operations.find((op) => op.name === opName);
44
47
  const opresult = operation.func(a, b);
45
48
  let branch;
46
49
  let finalValue;
47
- if (opresult < b) {
48
- branch = `La condition $a < b$ est vraie $(${opresult} < ${b})$, on exécute le bloc if donc : $a = ${b}$.`;
50
+ if ((ineqs[0] === "<" && opresult < b) ||
51
+ (ineqs[0] === ">" && opresult > b) ||
52
+ (ineqs[0] === "==" && opresult === b)) {
53
+ branch = `La condition $a ${ineqs[0]} b$ est vraie $(${opresult} ${ineqs[0]} ${b})$, on exécute le bloc if donc : $a = ${b}$.`;
49
54
  finalValue = b;
50
55
  }
51
- else if (opresult === b) {
52
- branch = `La condition $a < b$ est fausse mais la condition $a == b$ est vraie $(${opresult} == ${b})$, on exécute le bloc elif donc : $a = ${opresult} + ${b} = ${opresult + b}$.`;
56
+ else if ((ineqs[1] === "<" && opresult < b) ||
57
+ (ineqs[1] === ">" && opresult > b) ||
58
+ (ineqs[1] === "==" && opresult === b)) {
59
+ branch = `La condition $a ${ineqs[0]} b$ est fausse mais la condition $a ${ineqs[1]} b$ est vraie $(${opresult} ${ineqs[1]} ${b})$, on exécute le bloc elif donc : $a = ${opresult} + ${b} = ${opresult + b}$.`;
53
60
  finalValue = opresult + b;
54
61
  }
55
62
  else {
@@ -74,7 +81,8 @@ const getConditionIfElifElseQuestion = () => {
74
81
  } while ((target === "lt" && !(opresult < b)) ||
75
82
  (target === "eq" && !(opresult === b)) ||
76
83
  (target === "gt" && !(opresult > b)));
77
- return getQuestionFromIdentifiers({ a, b, opName: operation.name });
84
+ const ineqs = shuffle(["<", "==", ">"]);
85
+ return getQuestionFromIdentifiers({ a, b, opName: operation.name, ineqs });
78
86
  };
79
87
  const getQuestionFromIdentifiers = (identifiers) => {
80
88
  const question = {
@@ -30,7 +30,7 @@ const getAnswer = (identifiers) => {
30
30
  return answer;
31
31
  };
32
32
  const getHint = (identifiers) => {
33
- return `L'instruction \`for i in range(a,b)\` est une boucle dans laquelle $i$ prend d'abord la valeur $a$, puis augmente de $1$ jusqu'à atteindre $b$ (exclus). `;
33
+ return `L'instruction \`for i in range(a,b)\` est une boucle dans laquelle $i$ prend d'abord la valeur $a$, puis augmente de $1$ jusqu'à atteindre $b$ (exclu). `;
34
34
  };
35
35
  const getCorrection = (identifiers) => {
36
36
  const { initialValue, step, iterations, opIndex } = identifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"inOutCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/inOutCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAoHF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAY7C,CAAC"}
1
+ {"version":3,"file":"inOutCalcul.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/inOutCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAsHF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAY7C,CAAC"}
@@ -32,7 +32,11 @@ print(a)
32
32
  };
33
33
  const getHint = (identifiers) => {
34
34
  const { a, b, id1, id2 } = identifiers;
35
- return `Suis le script ligne par ligne, en remplaçant les variables par les valeurs qu'elles ont prises aux lignes précédentes.`;
35
+ let divisionHint = `En Python, l'opération \`//\` est une division entière : \`a // b\` donne le quotient de la division euclidienne de \`a\` par \`b\`. Par exemple, \`20//3 = 6\`, car le quotient de la division euclidienne de $20$ par $3$ est $6$.`;
36
+ let corr = `Suis le script ligne par ligne, en remplaçant les variables par les valeurs qu'elles ont prises aux lignes précédentes.`;
37
+ if (id1 === 3 || id2 === 3)
38
+ return corr + "\n" + divisionHint;
39
+ return corr;
36
40
  };
37
41
  const getCorrection = (identifiers) => {
38
42
  const { a, b, id1, id2 } = identifiers;
@@ -25,7 +25,7 @@ const getAnswer = (identifiers) => {
25
25
  };
26
26
  const getInstruction = (identifiers) => {
27
27
  const { a, b, op } = identifiers;
28
- return `Qu'affichera le script Python suivant, si l'utilisateur entre $${a}$ ?
28
+ return `Qu'affichera le script en Python suivant si l'utilisateur entre $${a}$ ?
29
29
  \`\`\`
30
30
  a=input("Entrez un entier naturel non nul.")
31
31
  a=int(a)
@@ -1 +1 @@
1
- {"version":3,"file":"pythonForLoopInstructionCompletion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/pythonForLoopInstructionCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4HF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,WAAW,CAkBpE,CAAC"}
1
+ {"version":3,"file":"pythonForLoopInstructionCompletion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/pythonForLoopInstructionCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoIF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,WAAW,CAkBpE,CAAC"}