math-exercises 1.4.14 → 1.4.16

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 (90) hide show
  1. package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.d.ts +4 -0
  2. package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.d.ts.map +1 -0
  3. package/lib/exercises/calcul/arithmetics/paritySumsAndProducts.js +113 -0
  4. package/lib/exercises/calcul/arithmetics/primeNumbers.js +1 -1
  5. package/lib/exercises/calcul/fractions/fractionToPercentToDecimal.js +1 -1
  6. package/lib/exercises/calcul/mentalCaluls.ts/mentalAddAndSub.js +1 -1
  7. package/lib/exercises/calcul/mentalCaluls.ts/mentalDivisions.js +1 -1
  8. package/lib/exercises/calcul/mentalCaluls.ts/mentalMultiplications.js +1 -1
  9. package/lib/exercises/calcul/mentalCaluls.ts/mentalPercentage.js +1 -1
  10. package/lib/exercises/calculLitteral/equation/equationSimpleSquare.js +1 -1
  11. package/lib/exercises/calculLitteral/equation/firstDegreeEquation.d.ts.map +1 -1
  12. package/lib/exercises/calculLitteral/equation/firstDegreeEquation.js +2 -1
  13. package/lib/exercises/calculLitteral/equation/fractionEquation.d.ts.map +1 -1
  14. package/lib/exercises/calculLitteral/equation/fractionEquation.js +2 -3
  15. package/lib/exercises/calculLitteral/equation/logEquation.d.ts.map +1 -1
  16. package/lib/exercises/calculLitteral/equation/logEquation.js +2 -1
  17. package/lib/exercises/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  18. package/lib/exercises/calculLitteral/equation/multiplicationEquation.js +6 -2
  19. package/lib/exercises/combinatory/anagrams.d.ts +4 -0
  20. package/lib/exercises/combinatory/anagrams.d.ts.map +1 -0
  21. package/lib/exercises/combinatory/anagrams.js +128 -0
  22. package/lib/exercises/combinatory/ballsCounting.d.ts +4 -0
  23. package/lib/exercises/combinatory/ballsCounting.d.ts.map +1 -0
  24. package/lib/exercises/combinatory/ballsCounting.js +124 -0
  25. package/lib/exercises/combinatory/diceCounting.d.ts +4 -0
  26. package/lib/exercises/combinatory/diceCounting.d.ts.map +1 -0
  27. package/lib/exercises/combinatory/diceCounting.js +134 -0
  28. package/lib/exercises/conversion/aeraConversion.d.ts.map +1 -1
  29. package/lib/exercises/conversion/aeraConversion.js +1 -1
  30. package/lib/exercises/conversion/capacityConversion.d.ts.map +1 -1
  31. package/lib/exercises/conversion/capacityConversion.js +1 -1
  32. package/lib/exercises/conversion/lengthConversion.d.ts.map +1 -1
  33. package/lib/exercises/conversion/lengthConversion.js +1 -1
  34. package/lib/exercises/conversion/massConversion.d.ts.map +1 -1
  35. package/lib/exercises/conversion/massConversion.js +1 -1
  36. package/lib/exercises/conversion/volumeCapacityConversion.js +1 -1
  37. package/lib/exercises/conversion/volumeConversion.d.ts.map +1 -1
  38. package/lib/exercises/conversion/volumeConversion.js +1 -1
  39. package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +1 -1
  40. package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +2 -2
  41. package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +1 -1
  42. package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +3 -2
  43. package/lib/exercises/exercise.d.ts +1 -1
  44. package/lib/exercises/exercise.d.ts.map +1 -1
  45. package/lib/exercises/exercises.d.ts.map +1 -1
  46. package/lib/exercises/exercises.js +39 -26
  47. package/lib/exercises/functions/affines/leadingCoefficientCalculV1.d.ts.map +1 -1
  48. package/lib/exercises/functions/affines/leadingCoefficientCalculV1.js +2 -1
  49. package/lib/exercises/functions/affines/leadingCoefficientCalculV2.d.ts.map +1 -1
  50. package/lib/exercises/functions/affines/leadingCoefficientCalculV2.js +4 -2
  51. package/lib/exercises/functions/basics/inverseImageFunction.js +1 -1
  52. package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +2 -2
  53. package/lib/exercises/functions/cube/cubicEquation.js +1 -1
  54. package/lib/exercises/geometry/cartesian/midpoint.js +1 -1
  55. package/lib/exercises/geometry/euclidean/circleArea.js +1 -1
  56. package/lib/exercises/geometry/euclidean/circleCircumference.js +1 -1
  57. package/lib/exercises/geometry/euclidean/rightTriangleArea.js +1 -1
  58. package/lib/exercises/geometry/euclidean/thales.d.ts.map +1 -1
  59. package/lib/exercises/geometry/euclidean/thales.js +1 -3
  60. package/lib/exercises/geometry/euclidean/triangleArea.js +1 -1
  61. package/lib/exercises/geometry/euclidean/trigonometrySideCalcul.js +1 -1
  62. package/lib/exercises/geometry/vectors/coordinatesReading.d.ts +4 -0
  63. package/lib/exercises/geometry/vectors/coordinatesReading.d.ts.map +1 -0
  64. package/lib/exercises/geometry/vectors/coordinatesReading.js +81 -0
  65. package/lib/exercises/percent/applyPercent.js +8 -7
  66. package/lib/exercises/percent/averageEvolutionRate.js +1 -1
  67. package/lib/exercises/percent/globalPercent.js +1 -1
  68. package/lib/exercises/percent/reciprocalPercentage.js +1 -1
  69. package/lib/exercises/powers/powersOfTenToDecimal.js +1 -1
  70. package/lib/exercises/primitve/logarithmePrimitive.js +1 -1
  71. package/lib/exercises/primitve/polynomialPrimitive.d.ts.map +1 -1
  72. package/lib/exercises/primitve/polynomialPrimitive.js +12 -4
  73. package/lib/exercises/probaStat/averageWithTable.js +1 -1
  74. package/lib/exercises/probaStat/cardBasicProbas.d.ts.map +1 -1
  75. package/lib/exercises/probaStat/cardBasicProbas.js +0 -1
  76. package/lib/exercises/probaStat/conditionalProbability.js +1 -1
  77. package/lib/exercises/probaStat/median.js +1 -1
  78. package/lib/exercises/probaStat/medianList.js +1 -1
  79. package/lib/exercises/sets/setBelonging.js +1 -1
  80. package/lib/exercises/squareRoots/squareRootEquation.js +1 -1
  81. package/lib/exercises/utils/geogebra/getAdaptedCoords.d.ts +1 -0
  82. package/lib/exercises/utils/geogebra/getAdaptedCoords.d.ts.map +1 -0
  83. package/lib/exercises/utils/geogebra/getAdaptedCoords.js +1 -0
  84. package/lib/math/complex/complex.d.ts +1 -1
  85. package/lib/math/complex/complex.d.ts.map +1 -1
  86. package/lib/math/complex/complex.js +9 -0
  87. package/lib/tree/nodes/numbers/numberNode.js +3 -3
  88. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  89. package/lib/tree/nodes/operators/fractionNode.js +7 -0
  90. package/package.json +1 -1
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDiceCountingQuestion = exports.diceCounting = void 0;
4
+ const exercise_1 = require("../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
6
+ const randint_1 = require("../../math/utils/random/randint");
7
+ const uuid_1 = require("uuid");
8
+ exports.diceCounting = {
9
+ id: 'diceCounting',
10
+ connector: '=',
11
+ instruction: '',
12
+ label: 'Dénombrement avec des dés',
13
+ levels: ['TermSpé'],
14
+ isSingleStep: true,
15
+ sections: ['Combinatoire et dénombrement'],
16
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDiceCountingQuestion, nb),
17
+ qcmTimer: 60,
18
+ freeTimer: 60,
19
+ };
20
+ function getDiceCountingQuestion() {
21
+ const type = (0, randint_1.randint)(0, 8);
22
+ let instruction = '';
23
+ let answer = '';
24
+ let face1, face2, face3;
25
+ switch (type) {
26
+ case 0:
27
+ instruction = `avec exactement deux chiffres identiques`;
28
+ answer = 6 * 3 * 5 + '';
29
+ break;
30
+ case 1:
31
+ instruction = `avec trois chiffres identiques`;
32
+ answer = 6 + '';
33
+ break;
34
+ case 2:
35
+ face1 = (0, randint_1.randint)(1, 7);
36
+ instruction = `avec exactement une fois la face ${face1}`;
37
+ answer = 3 * 5 * 5 + '';
38
+ break;
39
+ case 3:
40
+ face1 = (0, randint_1.randint)(1, 7);
41
+ instruction = `avec exactement deux fois la face ${face1}`;
42
+ answer = 3 * 5 + '';
43
+ break;
44
+ case 4:
45
+ face1 = (0, randint_1.randint)(1, 7);
46
+ face2 = (0, randint_1.randint)(1, 7, [face1]);
47
+ face3 = (0, randint_1.randint)(1, 7, [face1, face2]);
48
+ instruction = `avec exactement les faces ${face1}, ${face2} et ${face3}`;
49
+ answer = 6 + '';
50
+ break;
51
+ case 5:
52
+ face1 = (0, randint_1.randint)(1, 7);
53
+ face2 = (0, randint_1.randint)(1, 7, [face1]);
54
+ face3 = (0, randint_1.randint)(1, 7, [face1, face2]);
55
+ instruction = `avec exactement une fois la face ${face1} et une fois la face ${face2}`;
56
+ answer = 3 * 5 + '';
57
+ break;
58
+ case 6:
59
+ instruction = `dans lesquels toutes les faces sont différentes`;
60
+ answer = 6 * 5 * 4 + '';
61
+ break;
62
+ }
63
+ const getPropositions = (n) => {
64
+ const res = [];
65
+ res.push({
66
+ id: (0, uuid_1.v4)(),
67
+ statement: answer,
68
+ isRightAnswer: true,
69
+ format: 'tex',
70
+ });
71
+ switch (type) {
72
+ case 0:
73
+ (0, exercise_1.tryToAddWrongProp)(res, 3 * 5 + '');
74
+ (0, exercise_1.tryToAddWrongProp)(res, 6 * 6 * 3 + '');
75
+ (0, exercise_1.tryToAddWrongProp)(res, 6 * 3 + '');
76
+ break;
77
+ case 1:
78
+ (0, exercise_1.tryToAddWrongProp)(res, 6 * 3 + '');
79
+ (0, exercise_1.tryToAddWrongProp)(res, 1 + '');
80
+ break;
81
+ case 2:
82
+ (0, exercise_1.tryToAddWrongProp)(res, 3 * 6 * 6 + '');
83
+ (0, exercise_1.tryToAddWrongProp)(res, 6 + '');
84
+ (0, exercise_1.tryToAddWrongProp)(res, 5 * 5 + '');
85
+ break;
86
+ case 3:
87
+ (0, exercise_1.tryToAddWrongProp)(res, 6 * 3 + '');
88
+ (0, exercise_1.tryToAddWrongProp)(res, 6 * 5 + '');
89
+ (0, exercise_1.tryToAddWrongProp)(res, 5 + '');
90
+ break;
91
+ case 4:
92
+ (0, exercise_1.tryToAddWrongProp)(res, 3 + '');
93
+ (0, exercise_1.tryToAddWrongProp)(res, 1 + '');
94
+ (0, exercise_1.tryToAddWrongProp)(res, 6 * 6 * 6 + '');
95
+ break;
96
+ case 5:
97
+ (0, exercise_1.tryToAddWrongProp)(res, 6 * 3 + '');
98
+ (0, exercise_1.tryToAddWrongProp)(res, 6 * 5 + '');
99
+ (0, exercise_1.tryToAddWrongProp)(res, 5 + '');
100
+ break;
101
+ case 6:
102
+ (0, exercise_1.tryToAddWrongProp)(res, 6 * 6 * 6 + '');
103
+ (0, exercise_1.tryToAddWrongProp)(res, 6 * 5 + '');
104
+ (0, exercise_1.tryToAddWrongProp)(res, 6 + '');
105
+ break;
106
+ }
107
+ const missing = n - res.length;
108
+ for (let i = 0; i < missing; i++) {
109
+ let isDuplicate;
110
+ let proposition;
111
+ do {
112
+ const wrongAnswer = (0, randint_1.randint)(1, 100) + '';
113
+ proposition = {
114
+ id: (0, uuid_1.v4)() + ``,
115
+ statement: wrongAnswer,
116
+ isRightAnswer: false,
117
+ format: 'tex',
118
+ };
119
+ isDuplicate = res.some((p) => p.statement === proposition.statement);
120
+ } while (isDuplicate);
121
+ res.push(proposition);
122
+ }
123
+ return (0, exercise_1.shuffleProps)(res, n);
124
+ };
125
+ const question = {
126
+ answer: answer,
127
+ instruction: `On tire 3 fois consécutivement un dé à six faces numérotées de 1 à 6. Combien de tirages ${instruction} sont possibles ?`,
128
+ keys: [],
129
+ getPropositions,
130
+ answerFormat: 'tex',
131
+ };
132
+ return question;
133
+ }
134
+ exports.getDiceCountingQuestion = getDiceCountingQuestion;
@@ -1 +1 @@
1
- {"version":3,"file":"aeraConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/aeraConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,cAAc,EAAE,YAY5B,CAAC;AAEF,wBAAgB,iBAAiB,IAAI,QAAQ,CAuD5C"}
1
+ {"version":3,"file":"aeraConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/aeraConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,cAAc,EAAE,YAY5B,CAAC;AAEF,wBAAgB,iBAAiB,IAAI,QAAQ,CA0D5C"}
@@ -54,7 +54,7 @@ function getAeraConversion() {
54
54
  };
55
55
  const question = {
56
56
  instruction: `$${randomAera.value}$ $${units[randomUnitIndex]}$ = ... $${units[randomUnitInstructionIndex]}$`,
57
- answer: randomAera.multiplyByPowerOfTen(2 * (randomUnitIndex - randomUnitInstructionIndex)).value + '',
57
+ answer: (randomAera.multiplyByPowerOfTen(2 * (randomUnitIndex - randomUnitInstructionIndex)).value + '').replace('.', ','),
58
58
  keys: [],
59
59
  getPropositions,
60
60
  answerFormat: 'tex',
@@ -1 +1 @@
1
- {"version":3,"file":"capacityConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/capacityConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,kBAAkB,EAAE,YAYhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CAkDhD"}
1
+ {"version":3,"file":"capacityConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/capacityConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,kBAAkB,EAAE,YAYhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CAqDhD"}
@@ -52,7 +52,7 @@ function getCapacityConversion() {
52
52
  };
53
53
  const question = {
54
54
  instruction: `$${randomCapacity.value}$ $${units[randomUnitIndex]}$ = ... $${units[randomUnitInstructionIndex]}$`,
55
- answer: randomCapacity.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + '',
55
+ answer: (randomCapacity.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + '').replace('.', ','),
56
56
  keys: [],
57
57
  getPropositions,
58
58
  answerFormat: 'tex',
@@ -1 +1 @@
1
- {"version":3,"file":"lengthConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/lengthConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,gBAAgB,EAAE,YAY9B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CAiD9C"}
1
+ {"version":3,"file":"lengthConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/lengthConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,gBAAgB,EAAE,YAY9B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CAoD9C"}
@@ -51,7 +51,7 @@ function getLengthConversion() {
51
51
  };
52
52
  const question = {
53
53
  instruction: `$${randomlength.value}$ $${units[randomUnitIndex]}$ = ... $${units[randomUnitInstructionIndex]}$`,
54
- answer: randomlength.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + '',
54
+ answer: (randomlength.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + '').replace('.', ','),
55
55
  keys: [],
56
56
  getPropositions,
57
57
  answerFormat: 'tex',
@@ -1 +1 @@
1
- {"version":3,"file":"massConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/massConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,cAAc,EAAE,YAY5B,CAAC;AAEF,wBAAgB,iBAAiB,IAAI,QAAQ,CAiD5C"}
1
+ {"version":3,"file":"massConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/massConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,cAAc,EAAE,YAY5B,CAAC;AAEF,wBAAgB,iBAAiB,IAAI,QAAQ,CAoD5C"}
@@ -51,7 +51,7 @@ function getMassConversion() {
51
51
  };
52
52
  const question = {
53
53
  instruction: `$${randomMass.value}$ $${units[randomUnitIndex]}$ = ... $${units[randomUnitInstructionIndex]}$`,
54
- answer: randomMass.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + '',
54
+ answer: (randomMass.multiplyByPowerOfTen(randomUnitIndex - randomUnitInstructionIndex).value + '').replace('.', ','),
55
55
  keys: [],
56
56
  getPropositions,
57
57
  answerFormat: 'tex',
@@ -68,7 +68,7 @@ function getVolumeCapacityConversion() {
68
68
  };
69
69
  const question = {
70
70
  instruction: `$${random.value}$ $${instructionUnit}$ = ... $${AsnwerUnit}$`,
71
- answer: answer.value + '',
71
+ answer: (answer.value + '').replace('.', ','),
72
72
  keys: [],
73
73
  getPropositions,
74
74
  answerFormat: 'tex',
@@ -1 +1 @@
1
- {"version":3,"file":"volumeConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/volumeConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,gBAAgB,EAAE,YAY9B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CAsD9C"}
1
+ {"version":3,"file":"volumeConversion.d.ts","sourceRoot":"","sources":["../../../src/exercises/conversion/volumeConversion.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlE,eAAO,MAAM,gBAAgB,EAAE,YAY9B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,QAAQ,CAyD9C"}
@@ -53,7 +53,7 @@ function getVolumeConversion() {
53
53
  };
54
54
  const question = {
55
55
  instruction: `$${randomVolume.value}$ $${units[randomUnitIndex]}$ = ... $${units[randomUnitInstructionIndex]}$`,
56
- answer: randomVolume.multiplyByPowerOfTen(3 * (randomUnitIndex - randomUnitInstructionIndex)).value + '',
56
+ answer: (randomVolume.multiplyByPowerOfTen(3 * (randomUnitIndex - randomUnitInstructionIndex)).value + '').replace('.', ','),
57
57
  keys: [],
58
58
  getPropositions,
59
59
  answerFormat: 'tex',
@@ -53,7 +53,7 @@ function getInverseFunctionDerivative() {
53
53
  const question = {
54
54
  instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) =\\frac{${a}}{x}$.`,
55
55
  startStatement: `f'(x)`,
56
- answer: `\\frac{${-a}}{x^2}`,
56
+ answer: `${a > 0 ? '-' : ''}\\frac{${Math.abs(a)}}{x^2}`,
57
57
  keys: ['x'],
58
58
  getPropositions,
59
59
  answerFormat: 'tex',
@@ -31,9 +31,9 @@ function getRootFunctionDerivative() {
31
31
  else
32
32
  instruction += `$${a}\\sqrt{x}$.`;
33
33
  if (a % 2 === 0)
34
- answer = `\\frac{${a / 2}}{\\sqrt{x}}`;
34
+ answer = `${a < 0 ? '-' : ''}\\frac{${Math.abs(a / 2)}}{\\sqrt{x}}`;
35
35
  else
36
- answer = `\\frac{${a}}{2\\sqrt{x}}`;
36
+ answer = `${a < 0 ? '-' : ''}\\frac{${Math.abs(a)}}{2\\sqrt{x}}`;
37
37
  const getPropositions = (numOptions) => {
38
38
  const propositions = [];
39
39
  propositions.push({
@@ -62,7 +62,7 @@ function getSecondDegreeDerivative() {
62
62
  const question = {
63
63
  instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial.toString()}$.`,
64
64
  startStatement: `f'(x)`,
65
- answer: derivative.toString(),
65
+ answer: derivative.toTree().toTex(),
66
66
  keys: ['x'],
67
67
  getPropositions,
68
68
  answerFormat: 'tex',
@@ -26,11 +26,12 @@ function getThirdDegreeDerivative() {
26
26
  coefficients.push((0, randint_1.randint)(-9, 10, [0]));
27
27
  const polynomial = new polynomial_1.Polynomial(coefficients);
28
28
  const derivative = polynomial.derivate();
29
+ const answer = derivative.toTree().toTex();
29
30
  const getPropositions = (numOptions) => {
30
31
  const propositions = [];
31
32
  propositions.push({
32
33
  id: (0, uuid_1.v4)(),
33
- statement: derivative.toString(),
34
+ statement: answer,
34
35
  isRightAnswer: true,
35
36
  format: 'tex',
36
37
  });
@@ -63,7 +64,7 @@ function getThirdDegreeDerivative() {
63
64
  const question = {
64
65
  instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial.toString()}$.`,
65
66
  startStatement: `f'(x)`,
66
- answer: derivative.toString(),
67
+ answer: answer,
67
68
  keys: ['x'],
68
69
  getPropositions,
69
70
  answerFormat: 'tex',
@@ -36,5 +36,5 @@ export interface MathExercise {
36
36
  freeTimer: number;
37
37
  }
38
38
  export type MathLevel = '6ème' | '5ème' | '4ème' | '3ème' | '2nde' | '1reTech' | '1reESM' | '1reSpé' | 'TermSpé' | 'TermTech' | 'MathExp' | 'MathComp' | 'CAP' | '2ndPro' | '1rePro' | 'TermPro';
39
- export type MathSection = 'Arithmétique' | 'Calcul littéral' | 'Calculs' | 'Conversions' | 'Dérivation' | 'Droites' | 'Ensembles et intervalles' | 'Équations' | 'Équations différentielles' | 'Exponentielle' | 'Fonction cube' | 'Fonction inverse' | 'Fonctions' | 'Fonctions affines' | 'Fonctions de référence' | 'Fractions' | 'Géométrie cartésienne' | 'Géométrie euclidienne' | 'Inéquations' | 'Intégration' | 'Limites' | 'Logarithme népérien' | 'Nombres complexes' | 'Pourcentages' | 'Primitives' | 'Probabilités' | 'Proportionnalité' | 'Puissances' | 'Racines carrées' | 'Second degré' | 'Statistiques' | 'Suites' | 'Trigonométrie' | 'Vecteurs';
39
+ export type MathSection = 'Arithmétique' | 'Calcul littéral' | 'Calculs' | 'Combinatoire et dénombrement' | 'Conversions' | 'Dérivation' | 'Droites' | 'Ensembles et intervalles' | 'Équations' | 'Équations différentielles' | 'Exponentielle' | 'Fonction cube' | 'Fonction inverse' | 'Fonctions' | 'Fonctions affines' | 'Fonctions de référence' | 'Fractions' | 'Géométrie cartésienne' | 'Géométrie euclidienne' | 'Inéquations' | 'Intégration' | 'Limites' | 'Logarithme népérien' | 'Nombres complexes' | 'Pourcentages' | 'Primitives' | 'Probabilités' | 'Proportionnalité' | 'Puissances' | 'Racines carrées' | 'Second degré' | 'Statistiques' | 'Suites' | 'Trigonométrie' | 'Vecteurs';
40
40
  //# sourceMappingURL=exercise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,eAAO,MAAM,iBAAiB,UAAW,WAAW,EAAE,aAAa,MAAM,WAAU,KAAK,GAAG,KAAK,SAS/F,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,WAAW,EAAE,KAAK,MAAM,kBAE3D,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,cAAc,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;IAC9D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,eAAe,GACf,UAAU,CAAC"}
1
+ {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,eAAO,MAAM,iBAAiB,UAAW,WAAW,EAAE,aAAa,MAAM,WAAU,KAAK,GAAG,KAAK,SAS/F,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,WAAW,EAAE,KAAK,MAAM,kBAE3D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,cAAc,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;IAC9D,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,8BAA8B,GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,eAAe,GACf,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AAkLA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAc1C,eAAO,MAAM,SAAS,EAAE,YAAY,EA+QnC,CAAC"}
1
+ {"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AAkLA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAmB1C,eAAO,MAAM,SAAS,EAAE,YAAY,EAwRnC,CAAC"}
@@ -182,6 +182,11 @@ const niceRootsFromDevForm_1 = require("./functions/trinoms/niceRootsFromDevForm
182
182
  const diceBasicProbas_1 = require("./probaStat/diceBasicProbas");
183
183
  const cardBasicProbas_1 = require("./probaStat/cardBasicProbas");
184
184
  const ballsBasicProbas_1 = require("./probaStat/ballsBasicProbas");
185
+ const coordinatesReading_1 = require("./geometry/vectors/coordinatesReading");
186
+ const anagrams_1 = require("./combinatory/anagrams");
187
+ const ballsCounting_1 = require("./combinatory/ballsCounting");
188
+ const diceCounting_1 = require("./combinatory/diceCounting");
189
+ const paritySumsAndProducts_1 = require("./calcul/arithmetics/paritySumsAndProducts");
185
190
  exports.exercises = [
186
191
  /**
187
192
  * calcul litteral
@@ -205,6 +210,8 @@ exports.exercises = [
205
210
  equationType4Exercise_1.equationType4Exercise,
206
211
  firstDegreeEquation_1.firstDegreeEquation,
207
212
  equationSimpleSquare_1.equationSimpleSquare,
213
+ multiplicationEquation_1.multiplicationEquation,
214
+ fractionEquation_1.fractionEquation,
208
215
  /**
209
216
  * inequations
210
217
  */
@@ -234,6 +241,10 @@ exports.exercises = [
234
241
  addAndSubWithoutRelatives_1.addAndSubWithoutRelatives,
235
242
  operationsPriorities_1.operationsPriorities,
236
243
  operationsPrioritiesWithoutRelative_1.operationsPrioritiesWithoutRelative,
244
+ mentalAddAndSub_1.mentalAddAndSub,
245
+ mentalMultiplications_1.mentalMultiplications,
246
+ mentalDivisions_1.mentalDivisions,
247
+ mentalPercentage_1.mentalPercentage,
237
248
  /**
238
249
  * rounding
239
250
  */
@@ -264,12 +275,22 @@ exports.exercises = [
264
275
  trigonometrySideCalcul_1.trigonometrySideCalcul,
265
276
  rightTriangleArea_1.rightTriangleArea,
266
277
  triangleArea_1.triangleArea,
278
+ rectangleArea_1.rectangleArea,
279
+ rectanglePerimeter_1.rectanglePerimeter,
280
+ squareArea_1.squareArea,
281
+ squarePerimeter_1.squarePerimeter,
282
+ triangleAreaV2_1.triangleAreaV2,
283
+ trianglePerimeter_1.trianglePerimeter,
284
+ circleArea_1.circleArea,
285
+ circleCircumference_1.circleCircumference,
286
+ distanceBetweenTwoPoints_1.distanceBetweenTwoPoints,
267
287
  /**
268
288
  * vectors
269
289
  */
270
290
  scalarProductViaCoords_1.scalarProductViaCoords,
271
291
  determinant_1.determinant,
272
292
  chasles_1.chasles,
293
+ coordinatesReading_1.coordinatesReading,
273
294
  /**
274
295
  * puissances
275
296
  */
@@ -328,7 +349,7 @@ exports.exercises = [
328
349
  expDerivativeTwo_1.expDerivativeTwo,
329
350
  expDerivativeThree_1.expDerivativeThree,
330
351
  /**
331
- * primitive
352
+ * primitive and equa diff
332
353
  */
333
354
  constantPrimitive_1.constantPrimitive,
334
355
  polynomialPrimitive_1.polynomialPrimitive,
@@ -336,6 +357,8 @@ exports.exercises = [
336
357
  exponentialPrimitive_1.exponentialPrimitive,
337
358
  logarithmePrimitive_1.logarithmePrimitive,
338
359
  usualPrimitives_1.usualPrimitives,
360
+ equaDiffGeneralForme_1.exponentialDifferentialEquation,
361
+ equaDiffGeneralFormeWithIC_1.exponentialDifferentialEquationWithIC,
339
362
  /**
340
363
  * probabilités
341
364
  */
@@ -344,39 +367,21 @@ exports.exercises = [
344
367
  diceBasicProbas_1.diceBasicProbas,
345
368
  cardBasicProbas_1.cardBasicProbas,
346
369
  ballsBasicProbas_1.ballsBasicProbas,
370
+ /**arithmetic */
371
+ primeNumbers_1.primeNumbers,
372
+ paritySumsAndProducts_1.paritySumsAndProducts,
373
+ euclideanDivision_1.euclideanDivision,
347
374
  /**
348
375
  * islam
349
376
  */
350
377
  leadingCoefficient_1.leadingCoefficient,
351
378
  fractionToPercentToDecimal_1.fractionToPercentToDecimal,
352
379
  marginalAndConditionalFrequency_1.marginalAndConditionalFrequency,
353
- mentalAddAndSub_1.mentalAddAndSub,
354
- mentalMultiplications_1.mentalMultiplications,
355
- mentalDivisions_1.mentalDivisions,
356
- mentalPercentage_1.mentalPercentage,
357
380
  /**
358
381
  * nv generateurs
359
382
  */
360
- capacityConversion_1.capacityConversion,
361
- lengthConversion_1.lengthConversion,
362
- massConversion_1.massConversion,
363
- aeraConversion_1.aeraConversion,
364
- volumeConversion_1.volumeConversion,
365
- volumeCapacityConversion_1.volumeCapacityConversion,
366
- primeNumbers_1.primeNumbers,
367
- multiplicationEquation_1.multiplicationEquation,
368
- fractionEquation_1.fractionEquation,
369
383
  leadingCoefficientCalculV1_1.leadingCoefficientCalculV1,
370
384
  leadingCoefficientCalculV2_1.leadingCoefficientCalculV2,
371
- rectangleArea_1.rectangleArea,
372
- rectanglePerimeter_1.rectanglePerimeter,
373
- squareArea_1.squareArea,
374
- squarePerimeter_1.squarePerimeter,
375
- triangleAreaV2_1.triangleAreaV2,
376
- trianglePerimeter_1.trianglePerimeter,
377
- circleArea_1.circleArea,
378
- circleCircumference_1.circleCircumference,
379
- distanceBetweenTwoPoints_1.distanceBetweenTwoPoints,
380
385
  reduceExpression_1.reduceExpression,
381
386
  evaluateExpression_1.evaluateExpression,
382
387
  proportionalityTable_1.proportionalityTable,
@@ -384,11 +389,15 @@ exports.exercises = [
384
389
  expEquation_1.expEquation,
385
390
  expSimplifiying_1.expSimplifiying,
386
391
  logSimplifiying_1.logSimplifiying,
387
- euclideanDivision_1.euclideanDivision,
388
392
  signFunction_1.signFunction,
389
393
  thirdDegreeFunctionVariation_1.thirdDegreeFunctionVariation,
390
- equaDiffGeneralForme_1.exponentialDifferentialEquation,
391
- equaDiffGeneralFormeWithIC_1.exponentialDifferentialEquationWithIC,
394
+ /**conversions */
395
+ capacityConversion_1.capacityConversion,
396
+ lengthConversion_1.lengthConversion,
397
+ massConversion_1.massConversion,
398
+ aeraConversion_1.aeraConversion,
399
+ volumeConversion_1.volumeConversion,
400
+ volumeCapacityConversion_1.volumeCapacityConversion,
392
401
  /**Stats */
393
402
  averageWithTable_1.averageWithTable,
394
403
  medianList_1.medianWithList,
@@ -430,4 +439,8 @@ exports.exercises = [
430
439
  sequenceRationalFracLimit_1.sequenceRationalFracLimit,
431
440
  sequencePolynomProductLimit_1.sequencePolynomProductLimit,
432
441
  sequenceGeometricLimit_1.sequenceGeometricLimit,
442
+ /**combinatory */
443
+ anagrams_1.anagrams,
444
+ ballsCounting_1.ballsCounting,
445
+ diceCounting_1.diceCounting,
433
446
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"leadingCoefficientCalculV1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficientCalculV1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS/E,eAAO,MAAM,0BAA0B,EAAE,YAWxC,CAAC;AAEF,wBAAgB,qCAAqC,IAAI,QAAQ,CAoDhE"}
1
+ {"version":3,"file":"leadingCoefficientCalculV1.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficientCalculV1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAU/E,eAAO,MAAM,0BAA0B,EAAE,YAWxC,CAAC;AAEF,wBAAgB,qCAAqC,IAAI,QAAQ,CAoDhE"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLeadingCoefficientCalculV1Question = exports.leadingCoefficientCalculV1 = void 0;
4
4
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
+ const rational_1 = require("../../../math/numbers/rationals/rational");
5
6
  const randint_1 = require("../../../math/utils/random/randint");
6
7
  const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
7
8
  const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
@@ -52,7 +53,7 @@ function getLeadingCoefficientCalculV1Question() {
52
53
  const question = {
53
54
  instruction: `Soit $f$ une fonction affine telle que $f(${xA})$ = $${yA}$ et $f(${xB})$ = $${yB}$.$\\\\$Quel est le coefficient directeur de $f$ ?`,
54
55
  startStatement: 'a',
55
- answer: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
56
+ answer: new rational_1.Rational(yB - yA, xB - xA).simplify().toTree().toTex(),
56
57
  getPropositions,
57
58
  answerFormat: 'tex',
58
59
  keys: [],
@@ -1 +1 @@
1
- {"version":3,"file":"leadingCoefficientCalculV2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficientCalculV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS/E,eAAO,MAAM,0BAA0B,EAAE,YAWxC,CAAC;AAEF,wBAAgB,qCAAqC,IAAI,QAAQ,CAmDhE"}
1
+ {"version":3,"file":"leadingCoefficientCalculV2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/affines/leadingCoefficientCalculV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAU/E,eAAO,MAAM,0BAA0B,EAAE,YAWxC,CAAC;AAEF,wBAAgB,qCAAqC,IAAI,QAAQ,CAmDhE"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLeadingCoefficientCalculV1Question = exports.leadingCoefficientCalculV2 = void 0;
4
4
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
+ const rational_1 = require("../../../math/numbers/rationals/rational");
5
6
  const randint_1 = require("../../../math/utils/random/randint");
6
7
  const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
7
8
  const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
@@ -24,11 +25,12 @@ function getLeadingCoefficientCalculV1Question() {
24
25
  const [xA, yA] = [1, 2].map((el) => (0, randint_1.randint)(-9, 10));
25
26
  const xB = (0, randint_1.randint)(-9, 10, [xA]);
26
27
  const yB = (0, randint_1.randint)(-9, 10);
28
+ const answer = new rational_1.Rational(yB - yA, xB - xA).simplify().toTree().toTex();
27
29
  const getPropositions = (n) => {
28
30
  const res = [];
29
31
  res.push({
30
32
  id: (0, uuid_1.v4)() + '',
31
- statement: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
33
+ statement: answer,
32
34
  isRightAnswer: true,
33
35
  format: 'tex',
34
36
  });
@@ -51,7 +53,7 @@ function getLeadingCoefficientCalculV1Question() {
51
53
  };
52
54
  const question = {
53
55
  instruction: `Soit $d$ une droite passant par les points $A(${xA};${yA})$ et $B(${xB};${yB})$.$\\\\$Déterminer le coefficient directeur de $d$.`,
54
- answer: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(yB - yA), new numberNode_1.NumberNode(xB - xA))).toTex(),
56
+ answer: answer,
55
57
  getPropositions,
56
58
  answerFormat: 'tex',
57
59
  keys: [],
@@ -54,7 +54,7 @@ function getInverseImageFunction() {
54
54
  const question = {
55
55
  instruction: statement,
56
56
  startStatement: `f(x) = ${answer}`,
57
- answer: xValue + '',
57
+ answer: 'x=' + xValue,
58
58
  keys: ['x', 'equal'],
59
59
  getPropositions,
60
60
  answerFormat: 'tex',
@@ -47,7 +47,7 @@ function getInverseImageFunctionGeogebra() {
47
47
  const answer = rand
48
48
  ? xValue
49
49
  : roots.length === 2
50
- ? `\\{${(0, round_1.round)(roots[0], 1)};${(0, round_1.round)(roots[1], 1)}\\}`
50
+ ? `\\left\\{${(0, round_1.round)(roots[0], 1)};${(0, round_1.round)(roots[1], 1)}\\right\\}`
51
51
  : roots.length === 1
52
52
  ? roots[0]
53
53
  : `\\emptyset`;
@@ -149,7 +149,7 @@ function getInverseImageFunctionGeogebra() {
149
149
  ];
150
150
  const question = {
151
151
  instruction: statement,
152
- answer: answer + '',
152
+ answer: (answer + '').replaceAll('.', ','),
153
153
  keys: ['S', 'equal', 'lbrace', 'rbrace', 'semicolon', 'emptyset'],
154
154
  commands,
155
155
  coords: [xmin, xmax, ymin, ymax],
@@ -21,7 +21,7 @@ exports.cubicEquation = {
21
21
  function getCubicEquationQuestion() {
22
22
  const x = (0, randint_1.randint)(-10, 11);
23
23
  const k = x ** 3;
24
- const answer = `S=\\{${x}\\}`;
24
+ const answer = `S=\\left\\{${x}\\right\\}`;
25
25
  const getPropositions = (n) => {
26
26
  const res = [];
27
27
  res.push({
@@ -56,7 +56,7 @@ function getMidpointQuestion() {
56
56
  instruction: `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$. Quelles sont les coordonnées du milieu $I$ de $[AB]$ ?`,
57
57
  startStatement: 'I',
58
58
  answer: A.midpoint(B).toTexWithCoords(),
59
- keys: ['semicolon'],
59
+ keys: ['I', 'semicolon'],
60
60
  getPropositions,
61
61
  answerFormat: 'tex',
62
62
  };
@@ -51,7 +51,7 @@ function getCircleArea() {
51
51
  };
52
52
  const question = {
53
53
  instruction: `Calculer l'aire d'un cercle de ${coin ? 'rayon ' + radius : 'diamètre ' + diametre} cm.`,
54
- answer: correctAnswer,
54
+ answer: correctAnswer.replace('.', ','),
55
55
  getPropositions,
56
56
  answerFormat: 'tex',
57
57
  keys: [],
@@ -51,7 +51,7 @@ function getCircleCircumference() {
51
51
  };
52
52
  const question = {
53
53
  instruction: `Calculer la circonférence d'un cercle de ${coin ? 'rayon ' + radius : 'diamètre ' + diametre} cm.`,
54
- answer: correctAnswer,
54
+ answer: correctAnswer.replace('.', ','),
55
55
  getPropositions,
56
56
  answerFormat: 'tex',
57
57
  keys: [],
@@ -57,7 +57,7 @@ function getRightTriangleArea() {
57
57
  };
58
58
  const question = {
59
59
  instruction: `Calculer l'aire du triangle ${triangle.getTriangleName()} rectangle en ${triangle.getRightAngle()} sachant que ${triangle.getSideBName()} = $${sidesLength[0]}$ cm et ${triangle.getSideCName()} = $${sidesLength[1]}$ cm.`,
60
- answer: (sidesLength[0] * sidesLength[1]) / 2 + '',
60
+ answer: ((sidesLength[0] * sidesLength[1]) / 2 + '').replace('.', ','),
61
61
  keys: [...vertices, 'equal', 'cm2'],
62
62
  commands,
63
63
  coords: triangle.generateCoords(),
@@ -1 +1 @@
1
- {"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO/E,eAAO,MAAM,MAAM,EAAE,YAWpB,CAAC;AAEF,wBAAgB,SAAS,IAAI,QAAQ,CA8GpC"}
1
+ {"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/euclidean/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO/E,eAAO,MAAM,MAAM,EAAE,YAWpB,CAAC;AAEF,wBAAgB,SAAS,IAAI,QAAQ,CA4GpC"}
@@ -101,9 +101,7 @@ function getThales() {
101
101
  };
102
102
  const question = {
103
103
  instruction: `En utilisant le théoreme de Thalès, Écrire l'égalité des quotients sachant que :$\\\\$ (${vertices[3]}${vertices[4]})//(${vertices[1]}${vertices[2]})`,
104
- answer: `\\frac{${vertices[0]}${vertices[3]}}{${vertices[0]}${vertices[1]}}=
105
- \\frac{${vertices[0]}${vertices[4]}}{${vertices[0]}${vertices[2]}}=
106
- \\frac{${vertices[3]}${vertices[4]}}{${vertices[1]}${vertices[2]}}`,
104
+ answer: `\\frac{${vertices[0]}${vertices[3]}}{${vertices[0]}${vertices[1]}}=\\frac{${vertices[0]}${vertices[4]}}{${vertices[0]}${vertices[2]}}=\\frac{${vertices[3]}${vertices[4]}}{${vertices[1]}${vertices[2]}}`,
107
105
  keys: [...vertices, 'equal'],
108
106
  commands,
109
107
  coords: [xMin - 1, xMax + 1, yMin - 1, yMax + 1],
@@ -70,7 +70,7 @@ function getTriangleArea() {
70
70
  };
71
71
  const question = {
72
72
  instruction: `Calculer l'aire du triangle ${triangle.getTriangleName()} sachant que ${sides[randoms[0]]} = $${sidesLength[randoms[0]]}$ cm et la hauteur ${vertices[randoms[0]]}${String.fromCharCode(code + 3)} = $${height}$ cm.`,
73
- answer: (sidesLength[randoms[0]] * height) / 2 + '',
73
+ answer: ((sidesLength[randoms[0]] * height) / 2 + '').replace('.', ','),
74
74
  keys: [...vertices, 'equal', 'cm2'],
75
75
  commands,
76
76
  coords: triangle.generateCoords(),
@@ -70,7 +70,7 @@ function getTrigonometrySideCalcul() {
70
70
  };
71
71
  const question = {
72
72
  instruction: `Le triangle ${triangle.getTriangleName()} rectangle en ${triangle.getRightAngle()} tel que ${sides[randside]} = $${sideLengths[randside]}$ cm et $\\widehat{${angle[randAngle]}}$ = $${angleValue[randAngle]}$°.$\\\\$ Calculer ${sides[randsideQuestion]} à $0,1$ cm près.`,
73
- answer: `${(0, round_1.round)(sideLengths[randsideQuestion], 1)}`,
73
+ answer: `${((0, round_1.round)(sideLengths[randsideQuestion], 1) + '').replace('.', ',')}`,
74
74
  keys: [...vertices, 'equal', 'degree', 'cos', 'sin', 'tan', 'arccos', 'arcsin', 'arctan'],
75
75
  commands,
76
76
  coords: triangle.generateCoords(),