math-exercises 3.0.130 → 3.0.132

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 (100) hide show
  1. package/lib/exercises/exercise.d.ts +37 -30
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +3 -3
  4. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +48 -44
  6. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts +1 -1
  7. package/lib/exercises/math/calcul/ordering/compareA10N.js +3 -3
  8. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +0 -1
  10. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +1 -1
  11. package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +1 -1
  12. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +1 -1
  13. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +2 -0
  15. package/lib/exercises/math/calcul/rounding/rounding.d.ts +1 -1
  16. package/lib/exercises/math/calcul/rounding/rounding.d.ts.map +1 -1
  17. package/lib/exercises/math/calcul/rounding/rounding.js +7 -6
  18. package/lib/exercises/math/calculLitteral/equation/equationWithDistributivity.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/equation/equationWithDistributivity.js +15 -11
  20. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +6 -5
  22. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +0 -1
  23. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  24. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -1
  25. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
  26. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +15 -60
  27. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +14 -10
  28. package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
  29. package/lib/exercises/math/conversion/lengthConversion.js +1 -0
  30. package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -1
  31. package/lib/exercises/math/conversion/prefixToNumber.js +10 -8
  32. package/lib/exercises/math/conversion/secondsToHours.js +1 -1
  33. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -1
  34. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +2 -1
  35. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts +1 -1
  36. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -1
  37. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +4 -5
  38. package/lib/exercises/math/functions/affines/leadingCoefficient.js +1 -1
  39. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts +1 -1
  40. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -1
  41. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +10 -11
  42. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts +1 -1
  43. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts.map +1 -1
  44. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.js +8 -8
  45. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +2 -2
  46. package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.d.ts.map +1 -1
  47. package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.js +29 -16
  48. package/lib/exercises/math/percent/evolutions/globalPercent.d.ts +4 -1
  49. package/lib/exercises/math/percent/evolutions/globalPercent.d.ts.map +1 -1
  50. package/lib/exercises/math/percent/evolutions/globalPercent.js +37 -21
  51. package/lib/exercises/math/percent/findProportion.d.ts +1 -5
  52. package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
  53. package/lib/exercises/math/percent/findProportion.js +67 -75
  54. package/lib/exercises/math/percent/percentToDecimal.d.ts +4 -1
  55. package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
  56. package/lib/exercises/math/percent/percentToDecimal.js +55 -35
  57. package/lib/exercises/math/powers/calculateNegativePower.d.ts +1 -1
  58. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  59. package/lib/exercises/math/powers/calculateNegativePower.js +17 -10
  60. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts +5 -1
  61. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts.map +1 -1
  62. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.js +76 -12
  63. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +1 -1
  64. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +3 -3
  65. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -1
  66. package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +17 -45
  67. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts +12 -5
  68. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  69. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +354 -94
  70. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.js +1 -1
  71. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts +4 -1
  72. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
  73. package/lib/exercises/math/probaStat/stats1var/medianWithList.js +43 -23
  74. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts +1 -1
  75. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  76. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +4 -4
  77. package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
  78. package/lib/exercises/pc/motion/averageSpeed.js +13 -10
  79. package/lib/exercises/pc/optics/lensFormula.d.ts +1 -2
  80. package/lib/exercises/pc/optics/lensFormula.d.ts.map +1 -1
  81. package/lib/exercises/pc/optics/lensFormula.js +7 -10
  82. package/lib/exercises/pc/weight/calculateWeight.d.ts +1 -2
  83. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
  84. package/lib/exercises/pc/weight/calculateWeight.js +15 -14
  85. package/lib/exercises/vea/isNodesEqual.d.ts +3 -0
  86. package/lib/exercises/vea/isNodesEqual.d.ts.map +1 -0
  87. package/lib/exercises/vea/isNodesEqual.js +6 -0
  88. package/lib/exercises/vea/setVEA.d.ts +5 -0
  89. package/lib/exercises/vea/setVEA.d.ts.map +1 -0
  90. package/lib/exercises/vea/setVEA.js +25 -0
  91. package/lib/index.d.ts +932 -934
  92. package/lib/index.d.ts.map +1 -1
  93. package/lib/math/progCalc/progCalc.d.ts +2 -2
  94. package/lib/math/progCalc/progCalc.d.ts.map +1 -1
  95. package/lib/math/progCalc/progCalc.js +4 -11
  96. package/lib/tests/exoTest.d.ts.map +1 -1
  97. package/lib/tests/exoTest.js +13 -0
  98. package/lib/types/keyIds.d.ts +1 -1
  99. package/lib/types/keyIds.d.ts.map +1 -1
  100. package/package.json +1 -1
@@ -8,6 +8,8 @@ import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
8
8
  import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
9
9
  import { alignTex } from "../../../../utils/latex/alignTex.js";
10
10
  import { shuffle } from "../../../../utils/alea/shuffle.js";
11
+ import { SetVEA } from "../../../../exercises/vea/setVEA.js";
12
+ import { discreteSetParser } from "../../../../tree/parsers/discreteSetParser.js";
11
13
  const getStatementNode = (identifiers) => {
12
14
  const { a, b, c, d } = identifiers;
13
15
  const polynome1 = new Polynomial([b, a]);
@@ -110,14 +112,13 @@ const getPropositions = (n, { answer }) => {
110
112
  return shuffle(propositions);
111
113
  };
112
114
  const isAnswerValid = (ans, { a, b, c, d }) => {
115
+ const parsed = discreteSetParser(ans);
116
+ if (!parsed)
117
+ return false;
113
118
  const sol1 = new Rational(-b, a).simplify().toTree();
114
119
  const sol2 = new Rational(-d, c).simplify().toTree();
115
120
  const sortedSols = -b / a < -d / c ? [sol1, sol2] : [sol2, sol1];
116
- const answer = new EquationSolutionNode(new DiscreteSetNode(sortedSols), {
117
- opts: { allowFractionToDecimal: true },
118
- });
119
- const texs = answer.toAllValidTexs();
120
- return texs.includes(ans);
121
+ return SetVEA.isArrayOfNodesValid(parsed.elements, sortedSols);
121
122
  };
122
123
  export const multiplicationEquation = {
123
124
  id: "multiplicationEquation",
@@ -6,5 +6,4 @@ export * from "./factorizeCanonicalForm.js";
6
6
  export * from "./factorizeCanonicalFormWithSqrt.js";
7
7
  export * from "./factoType2.js";
8
8
  export * from "./factoByX.js";
9
- export * from "./factorizeAX2PlusBX.js";
10
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
@@ -6,4 +6,4 @@ export * from "./factorizeCanonicalForm.js";
6
6
  export * from "./factorizeCanonicalFormWithSqrt.js";
7
7
  export * from "./factoType2.js";
8
8
  export * from "./factoByX.js";
9
- export * from "./factorizeAX2PlusBX.js";
9
+ // export * from "./factorizeAX2PlusBX.js"; //! existe déjà
@@ -1 +1 @@
1
- {"version":3,"file":"writeLitExpFromFrenchExp.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAmCrC,KAAK,QAAQ,GACT,UAAU,GACV,SAAS,GACT,KAAK,GACL,UAAU,GACV,UAAU,GACV,QAAQ,CAAC;AAoEb,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,QAAQ,CAAC;IACvB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC;CACnC,CAAC;AAuRF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAkBxD,CAAC"}
1
+ {"version":3,"file":"writeLitExpFromFrenchExp.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAmCrC,KAAK,QAAQ,GACT,UAAU,GACV,SAAS,GACT,KAAK,GACL,UAAU,GACV,UAAU,GACV,QAAQ,CAAC;AAoEb,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,QAAQ,CAAC;IACvB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC;CACnC,CAAC;AAyNF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAkBxD,CAAC"}
@@ -157,77 +157,32 @@ const getHint = (identifiers) => {
157
157
  case "opposite":
158
158
  return `La somme d'un nombre et de son opposé donne $0$.`;
159
159
  case "inverse":
160
- return `L'inverse de $8$ est $0,25$.`;
160
+ return `L'inverse de $8$ est $0.25$.`;
161
161
  case "add":
162
- return `La somme de $8$ et de $6$ est $14$.`;
162
+ return `La somme de $8457$ et de $6567$ est $${8457 + 6567}$.`;
163
163
  case "subtract":
164
- return `La différence entre $8$ et $6$ est $2$.`;
165
- case "multiply": {
166
- const statementString = ExpressionConstructor.fromIdentifiers(identifiers).strFrench;
167
- if (!statementString.includes("produit")) {
168
- const bHint = randint(2, 10, typeof identifiers.b === "number" ? [identifiers.b] : []);
169
- const exprHint1 = ExpressionConstructor.fromIdentifiers(Object.assign({}, identifiers, {
170
- b: "" + bHint,
171
- }));
172
- const exprHint2 = ExpressionConstructor.fromIdentifiers(Object.assign({}, identifiers, {
173
- b: bHint,
174
- }));
175
- return `${capitalize(exprHint1.strFrench)} est $${exprHint2.node
176
- .simplify()
177
- .toTex()}$.`;
178
- }
179
- else {
180
- return `Le produit de $8$ par $6$ est $48$.`;
181
- }
182
- }
183
- case "divide": {
184
- const statementString = ExpressionConstructor.fromIdentifiers(identifiers).strFrench;
185
- if (!statementString.includes("quotient")) {
186
- const aHint = randint(2, 10, typeof identifiers.a === "number" ? [identifiers.a] : []);
187
- const exprHint1 = ExpressionConstructor.fromIdentifiers(Object.assign({}, identifiers, {
188
- a: "" + aHint,
189
- }));
190
- const exprHint2 = ExpressionConstructor.fromIdentifiers(Object.assign({}, identifiers, {
191
- a: aHint,
192
- }));
193
- return `${capitalize(exprHint1.strFrench)} est $${exprHint2.node.toTex()}$.`;
194
- }
195
- else {
196
- return `Le quotient de $200$ par $8$ est $25$.`;
197
- }
198
- }
164
+ return `La différence entre $8457$ est $6567$ est $${8457 - 6567}$.`;
165
+ case "multiply":
166
+ return `Le produit de $8457$ par $6567$ est $${8457 * 6567}$ .`;
167
+ case "divide":
168
+ return `Le quotient de $200$ par $8$ est $25$.`;
199
169
  }
200
170
  };
201
171
  const getCorrection = (identifiers) => {
202
- const { a, operatorName, b } = identifiers;
203
172
  const expression = ExpressionConstructor.fromIdentifiers(identifiers);
204
173
  const statementString = expression.strFrench;
174
+ let outString = `${capitalize(statementString)} est $ ${getAnswer(identifiers)} $.`;
205
175
  //explain rewriting if needed
206
176
  const nodeRaw = expression.node;
207
177
  const nodeRefined = nodeRaw.simplify();
208
- let texRaw;
209
- switch (operatorName) {
210
- case "add":
211
- {
212
- const [texA, texB] = [a, b].map((c) => parseAlgebraic("" + c).toTex());
213
- const isWrapWithParenthesis = ("" + b).startsWith("-");
214
- texRaw = `${texA}+${isWrapWithParenthesis ? `(${texB})` : `${texB}`}`;
215
- }
216
- break;
217
- default:
218
- {
219
- texRaw = nodeRaw.toTex({
220
- allowDoubleMinus: true,
221
- forceTimesSign: true,
222
- forceParenthesis: true,
223
- forceNoSimplification: true,
224
- allowMinusAnywhereInFraction: true,
225
- });
226
- }
227
- break;
228
- }
178
+ const texRaw = nodeRaw.toTex({
179
+ allowDoubleMinus: true,
180
+ forceTimesSign: true,
181
+ forceParenthesis: true,
182
+ forceNoSimplification: true,
183
+ allowMinusAnywhereInFraction: true,
184
+ });
229
185
  const texRefined = nodeRefined.toTex();
230
- let outString = `${capitalize(statementString)} est $ ${texRefined} $.`;
231
186
  if (texRaw !== texRefined) {
232
187
  outString += `
233
188
 
@@ -12,14 +12,15 @@ const getInstruction = (identifiers, optsIn) => {
12
12
  const opts = optsIn ?? optsDefault;
13
13
  const { unitTex } = opts;
14
14
  return `Si on parcourt $${distance.frenchify()} \\ \\textrm{km}$ en $${minutes.frenchify()} \\ \\textrm{min}$,
15
- quelle est la vitesse moyenne en $${unitTex}$ ?`;
15
+ quelle est la vitesse moyenne en ${unitTex} ?`;
16
16
  };
17
17
  const getAnswer = (identifiers, optsIn) => {
18
18
  const { distance, minutes } = identifiers;
19
19
  const opts = optsIn ?? optsDefault;
20
20
  const { unitTex } = opts;
21
+ const unlatexedUnit = unitTex.substring(1, unitTex.length - 1);
21
22
  const nodeAnswer = multiply(distance, frac(60, minutes));
22
- return `${nodeAnswer.simplify().toTex()} \\ ${unitTex}`;
23
+ return `${nodeAnswer.simplify().toTex()} \\ ${unlatexedUnit}`;
23
24
  };
24
25
  const isAnswerValid = (ans, { distance, minutes }) => {
25
26
  const nodeAnswer = multiply(distance, frac(60, minutes));
@@ -33,21 +34,23 @@ const getCorrection = (identifiers, optsIn) => {
33
34
  const { distance, minutes } = identifiers;
34
35
  const opts = optsIn ?? optsDefault;
35
36
  const { unitTex } = opts;
37
+ const unlatexedUnit = unitTex.substring(1, unitTex.length - 1);
36
38
  return `En $60$ minutes, on parcourt $${multiply(distance, frac(60, minutes)).toTex()} \\ \\textrm{km}$
37
39
  donc la vitesse est de $${multiply(distance, frac(60, minutes).simplify()).toTex()} = ${multiply(distance, frac(60, minutes))
38
40
  .simplify()
39
- .toTex()} \\ ${unitTex}$`;
41
+ .toTex()} \\ ${unlatexedUnit}$`;
40
42
  };
41
43
  const getPropositions = (n, { answer, distance, minutes }, optsIn) => {
42
44
  const opts = optsIn ?? optsDefault;
43
45
  const { unitTex } = opts;
46
+ const unlatexedUnit = unitTex.substring(1, unitTex.length - 1);
44
47
  const propositions = [];
45
48
  addValidProp(propositions, answer);
46
- tryToAddWrongProp(propositions, `${multiply(60, minutes).simplify().toTex()} \\ ${unitTex}`);
47
- tryToAddWrongProp(propositions, `${frac(distance, minutes).simplify().toTex()} \\ ${unitTex}`);
49
+ tryToAddWrongProp(propositions, `${multiply(60, minutes).simplify().toTex()} \\ ${unlatexedUnit}`);
50
+ tryToAddWrongProp(propositions, `${frac(distance, minutes).simplify().toTex()} \\ ${unlatexedUnit}`);
48
51
  tryToAddWrongProp(propositions, `${multiply(3.6, frac(distance, minutes))
49
52
  .simplify()
50
- .toTex()} \\ ${unitTex}`);
53
+ .toTex()} \\ ${unlatexedUnit}`);
51
54
  return shuffleProps(propositions, n);
52
55
  };
53
56
  const getKmPerMinToKmPerHourConversionQuestion = (optsIn) => {
@@ -62,17 +65,18 @@ const getKmPerMinToKmPerHourConversionQuestion = (optsIn) => {
62
65
  };
63
66
  const getQuestionFromIdentifiers = (identifiers, optsIn) => {
64
67
  const opts = optsIn ?? optsDefault;
68
+ const unlatexedUnit = opts.unitTex.substring(1, opts.unitTex.length - 1);
65
69
  const question = {
66
70
  answer: getAnswer(identifiers, opts),
67
71
  instruction: getInstruction(identifiers, opts),
68
72
  keys: [
69
73
  {
70
74
  id: "custom",
71
- label: opts.unitTex,
75
+ label: unlatexedUnit,
72
76
  labelType: "tex",
73
77
  mathfieldInstructions: {
74
78
  method: "write",
75
- content: opts.unitTex,
79
+ content: unlatexedUnit,
76
80
  },
77
81
  },
78
82
  ],
@@ -85,7 +89,7 @@ const getQuestionFromIdentifiers = (identifiers, optsIn) => {
85
89
  return question;
86
90
  };
87
91
  const optsDefault = {
88
- unitTex: "\\textrm{km/h}",
92
+ unitTex: "$\\textrm{km/h}$",
89
93
  };
90
94
  const options = [
91
95
  {
@@ -93,7 +97,7 @@ const options = [
93
97
  label: "Unité affichée",
94
98
  target: GeneratorOptionTarget.generation,
95
99
  type: GeneratorOptionType.select,
96
- values: ["\\textrm{km/h}", "\\textrm{km}.\\textrm{h}^{-1}"],
100
+ values: ["$\\textrm{km/h}$", "$\\textrm{km}\\cdot \\textrm{h}^{-1}$"],
97
101
  defaultValue: optsDefault.unitTex,
98
102
  },
99
103
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"lengthConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/lengthConversion.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAuKF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB3D,CAAC"}
1
+ {"version":3,"file":"lengthConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/lengthConversion.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAwKF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB3D,CAAC"}
@@ -126,6 +126,7 @@ const options = [
126
126
  type: GeneratorOptionType.multiselect,
127
127
  target: GeneratorOptionTarget.generation,
128
128
  values: units,
129
+ defaultValue: units,
129
130
  },
130
131
  ];
131
132
  const validateOptions = (opts) => {
@@ -1 +1 @@
1
- {"version":3,"file":"prefixToNumber.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/prefixToNumber.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAoMF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AA+EF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBzD,CAAC"}
1
+ {"version":3,"file":"prefixToNumber.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/prefixToNumber.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAoMF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AA+EF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBzD,CAAC"}
@@ -110,7 +110,7 @@ const getInstruction = (identifiers) => {
110
110
  const prefix = prefixes[prefixIndex];
111
111
  return `Quelle est la valeur du préfixe ${isFromSymbol ? `$${prefix.symbol}$` : prefix.name} ?
112
112
 
113
- Ecrire la réponse sous la forme ${isToPow10 ? `d'une puissance de $10$` : `d'un nombre décimal`}.`;
113
+ Écrire la réponse sous la forme ${isToPow10 ? `d'une puissance de $10$` : `d'un nombre décimal`}.`;
114
114
  };
115
115
  const getHint = (identifiers) => {
116
116
  const { prefixIndexesPool } = identifiers;
@@ -164,8 +164,8 @@ const isAnswerValid = (ans, { answer }) => {
164
164
  };
165
165
  const optionsDefault = {
166
166
  prefixPool: prefixes.map((prefix) => prefix.name),
167
- isToPow10: [true, false],
168
- isFromSymbol: [true, false],
167
+ isToPow10: true,
168
+ isFromSymbol: true,
169
169
  };
170
170
  const options = [
171
171
  {
@@ -174,20 +174,21 @@ const options = [
174
174
  type: GeneratorOptionType.multiselect,
175
175
  target: GeneratorOptionTarget.generation,
176
176
  values: prefixes.map((prefix) => prefix.name),
177
+ defaultValue: optionsDefault.prefixPool,
177
178
  },
178
179
  {
179
180
  id: "isToPow10",
180
181
  label: "Réponse sous forme de puissance de 10 ?",
181
182
  type: GeneratorOptionType.checkbox,
182
183
  target: GeneratorOptionTarget.generation,
183
- values: optionsDefault.isToPow10,
184
+ defaultValue: optionsDefault.isToPow10,
184
185
  },
185
186
  {
186
187
  id: "units",
187
188
  label: "Utiliser le symbole pour la question ?",
188
189
  type: GeneratorOptionType.checkbox,
189
190
  target: GeneratorOptionTarget.generation,
190
- values: optionsDefault.isFromSymbol,
191
+ defaultValue: optionsDefault.isFromSymbol,
191
192
  },
192
193
  ];
193
194
  const getPrefixToNumberQuestion = (optsIn) => {
@@ -202,8 +203,8 @@ const getPrefixToNumberQuestion = (optsIn) => {
202
203
  return prefixIndex;
203
204
  }) ?? optionsDefault.prefixPool;
204
205
  const prefixIndex = random(prefixIndexesPool);
205
- const isFromSymbol = optsIn?.isFromSymbol ?? random(optionsDefault.isFromSymbol);
206
- const isToPow10 = optsIn?.isToPow10 ?? random(optionsDefault.isToPow10);
206
+ const isFromSymbol = optsIn?.isFromSymbol ?? optionsDefault.isFromSymbol;
207
+ const isToPow10 = optsIn?.isToPow10 ?? optionsDefault.isToPow10;
207
208
  const identifiers = {
208
209
  prefixIndexesPool,
209
210
  prefixIndex,
@@ -229,7 +230,8 @@ export const prefixToNumber = {
229
230
  connector: "=",
230
231
  label: "Convertir un préfixe en nombre",
231
232
  isSingleStep: true,
232
- generator: (nb, opts) => getDistinctQuestions(() => getPrefixToNumberQuestion(opts), nb),
233
+ generator: (nb, opts) => getDistinctQuestions(() => getPrefixToNumberQuestion(opts), nb, 10),
234
+ maxAllowedQuestions: 10,
233
235
  qcmTimer: 60,
234
236
  freeTimer: 60,
235
237
  getPropositions,
@@ -102,7 +102,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
102
102
  const question = {
103
103
  answer: getAnswer(identifiers),
104
104
  instruction: getInstruction(identifiers),
105
- keys: ["hours", "minutes"],
105
+ keys: ["hours", "seconds"],
106
106
  answerFormat: "tex",
107
107
  identifiers,
108
108
  hint: getHint(identifiers),
@@ -1 +1 @@
1
- {"version":3,"file":"drawAffineFromPointAndLeadingCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA4FF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CACvD,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"drawAffineFromPointAndLeadingCoeff.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAoJF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA4FF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CACvD,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -14,6 +14,7 @@ import { add } from "../../../../tree/nodes/operators/addNode.js";
14
14
  const getHint = () => {
15
15
  return `Si $f$ est une fonction telle que $f(x) = y$,
16
16
  alors la droite représentative de f passe par le point de coordonnées $(x;y)$.
17
+
17
18
  Si le coefficient directeur vaut $\\frac{v}{h}$ alors le point de coordonnées $(x+h;y+v)$
18
19
  appartient aussi à la droite représentative de $f$.`;
19
20
  };
@@ -50,7 +51,7 @@ const getInstruction = (identifiers) => {
50
51
  const pointA = PointConstructor.fromIdentifiers(pointIdsA);
51
52
  const coeff = NodeConstructor.fromIdentifiers(leadingCoeff);
52
53
  const texCoeff = numberType === "Fraction" ? coeff.toTex() : coeff.evaluate().frenchify();
53
- return `La fonction $${funcName}$ est telle que $f(x)=${texCoeff}x+b$ avec b un nombre réel et
54
+ return `La fonction $${funcName}$ est telle que $f(x)=${texCoeff}x+b$ avec $b$ un nombre réel et
54
55
  $ ${funcName}(${pointA.x.toTex()}) = ${pointA.y.toTex()} $.
55
56
 
56
57
  Dans le repère, tracer la représentation graphique de la fonction $${funcName}$.`;
@@ -5,7 +5,7 @@ type Identifiers = {
5
5
  funcName: string;
6
6
  };
7
7
  type Options = {
8
- nbSteps: Exclude<number, 0>;
8
+ nbSteps: string;
9
9
  isSingleUseOperators: boolean;
10
10
  };
11
11
  export declare const drawAffineFromProgCalc: Exercise<Identifiers, Options>;
@@ -1 +1 @@
1
- {"version":3,"file":"drawAffineFromProgCalc.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromProgCalc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,mBAAmB,EAEpB,MAAM,iCAAiC,CAAC;AAOzC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAkOF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAwBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBjE,CAAC"}
1
+ {"version":3,"file":"drawAffineFromProgCalc.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromProgCalc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,mBAAmB,EAEpB,MAAM,iCAAiC,CAAC;AAOzC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAkOF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAuBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBjE,CAAC"}
@@ -164,7 +164,7 @@ const getDrawAffineFromProgCalcQuestion = (opts) => {
164
164
  const opGenConfigAddsub = random(arrOpGenAddsub);
165
165
  const opGenConfigMuldiv = random(arrOpGenMuldiv);
166
166
  const arrOpGenConfigMandatory = [opGenConfigAddsub, opGenConfigMuldiv];
167
- const progCalc = ProgCalcConstructor.randomWithMandatory(nbSteps, isSingleUseOperators, arrOpGenConfigMandatory, arrOpGenConfigAll);
167
+ const progCalc = ProgCalcConstructor.randomWithMandatory(Number(nbSteps), isSingleUseOperators, arrOpGenConfigMandatory, arrOpGenConfigAll);
168
168
  const identifiers = {
169
169
  progCalcIds: progCalc.toIdentifiers(),
170
170
  funcName: random(["f", "g", "h"]),
@@ -182,7 +182,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
182
182
  };
183
183
  };
184
184
  const optsDefault = {
185
- nbSteps: 2,
185
+ nbSteps: "2",
186
186
  isSingleUseOperators: true,
187
187
  };
188
188
  const options = [
@@ -190,7 +190,7 @@ const options = [
190
190
  id: "nbSteps",
191
191
  label: "Nombre d'étapes de transformation",
192
192
  defaultValue: optsDefault.nbSteps,
193
- values: [2, 3, 4, 5],
193
+ values: ["2", "3", "4", "5"],
194
194
  target: GeneratorOptionTarget.generation,
195
195
  type: GeneratorOptionType.select,
196
196
  },
@@ -198,9 +198,8 @@ const options = [
198
198
  id: "isSingleUseOperators",
199
199
  label: "Opérateurs à usage unique",
200
200
  defaultValue: optsDefault.isSingleUseOperators,
201
- values: [true, false],
202
201
  target: GeneratorOptionTarget.generation,
203
- type: GeneratorOptionType.select,
202
+ type: GeneratorOptionType.checkbox,
204
203
  },
205
204
  ];
206
205
  export const drawAffineFromProgCalc = {
@@ -121,7 +121,7 @@ const options = [
121
121
  target: GeneratorOptionTarget.generation,
122
122
  type: GeneratorOptionType.select,
123
123
  values: ["Affines", "Linéaires", "Les deux"],
124
- defaultValue: ["Les deux"],
124
+ defaultValue: "Les deux",
125
125
  },
126
126
  ];
127
127
  export const leadingCoefficient = {
@@ -16,7 +16,7 @@ type Identifiers = {
16
16
  type Options = {
17
17
  angleTypes: ("alternes-internes" | "correspondants" | "alternes-externes" | "autres")[];
18
18
  isFakeDisplay: boolean;
19
- nbDigits: 0 | 1 | 2;
19
+ nbDigits: "0" | "1" | "2";
20
20
  };
21
21
  export declare const anglesUsingIsParallel: Exercise<Identifiers, Options>;
22
22
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"anglesUsingIsParallel.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/anglesUsingIsParallel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAuItC,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AA6HF,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EACL,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CAAC;IAGb,kBAAkB,EAAE,eAAe,EAAE,CAAC;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IAGxB,gBAAgB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACxC,CAAC;AAwMF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,CACR,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CACX,EAAE,CAAC;IACJ,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACrB,CAAC;AA2NF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBhE,CAAC"}
1
+ {"version":3,"file":"anglesUsingIsParallel.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/anglesUsingIsParallel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAuItC,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AA6HF,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EACL,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CAAC;IAGb,kBAAkB,EAAE,eAAe,EAAE,CAAC;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IAGxB,gBAAgB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACxC,CAAC;AAwMF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,CACR,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CACX,EAAE,CAAC;IACJ,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC3B,CAAC;AAsNF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBhE,CAAC"}
@@ -152,7 +152,7 @@ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
152
152
  tryToAddWrongProp(propositions, substract(180, arrAngleUsed[0]).toTex(), "tex");
153
153
  const arrAngleGeom = getGeomAngles(identifiers);
154
154
  //l'élève fait une mesure sur la figure
155
- tryToAddWrongProp(propositions, round(arrAngleGeom[1].evaluate(), opts.nbDigits).frenchify(), "tex");
155
+ tryToAddWrongProp(propositions, round(arrAngleGeom[1].evaluate(), Number(opts.nbDigits)).frenchify(), "tex");
156
156
  tryToAddWrongProp(propositions, "\\text{On ne peut pas savoir.}", "tex");
157
157
  return shuffleProps(propositions, n);
158
158
  };
@@ -241,7 +241,7 @@ const getGGBOptions = (identifiers, opts) => {
241
241
  `ShowLabel(${a.name}, false)`,
242
242
  ...a.getFitCaptionCommands({
243
243
  text: [
244
- round(arrAngleForLabel ? arrAngleForLabel[i] : a.evaluate(), nbDigits).frenchify(),
244
+ round(arrAngleForLabel ? arrAngleForLabel[i] : a.evaluate(), Number(nbDigits)).frenchify(),
245
245
  "?",
246
246
  ][i],
247
247
  size: "small",
@@ -285,7 +285,7 @@ const isAnswerValid = (ans, { answer }) => {
285
285
  const optsDefault = {
286
286
  angleTypes: ["alternes-internes"],
287
287
  isFakeDisplay: true,
288
- nbDigits: 0,
288
+ nbDigits: "0",
289
289
  };
290
290
  const options = [
291
291
  {
@@ -313,7 +313,7 @@ const options = [
313
313
  label: "Nombre de décimales",
314
314
  target: GeneratorOptionTarget.generation,
315
315
  type: GeneratorOptionType.select,
316
- values: [0, 1, 2],
316
+ values: ["0", "1", "2"],
317
317
  defaultValue: optsDefault.nbDigits,
318
318
  },
319
319
  ];
@@ -325,11 +325,11 @@ const getAnglesUsingIsParallelQuestion = (optsIn) => {
325
325
  function createConfigGeom(isParallelInGeom, isLookingParallel) {
326
326
  const deviation = isLookingParallel ? 1 : 5;
327
327
  const cAngleInDegreesMin = 30;
328
- const cAngleInDegreesTop = randfloat(cAngleInDegreesMin, 180 - cAngleInDegreesMin, opts.nbDigits);
328
+ const cAngleInDegreesTop = randfloat(cAngleInDegreesMin, 180 - cAngleInDegreesMin, Number(opts.nbDigits));
329
329
  const cAngleInDegreesBottom = isParallelInGeom
330
330
  ? cAngleInDegreesTop
331
331
  : cAngleInDegreesTop +
332
- randfloat(-deviation, deviation, opts.nbDigits, [0]);
332
+ randfloat(-deviation, deviation, Number(opts.nbDigits), [0]);
333
333
  return {
334
334
  cAngleInDegreesTop,
335
335
  cAngleInDegreesBottom,
@@ -391,19 +391,18 @@ const getAnglesUsingIsParallelQuestion = (optsIn) => {
391
391
  }
392
392
  }
393
393
  const arrAngleIndex = randomArrAngleIndex(angleType);
394
+ const nbDigits = Number(opts.nbDigits);
394
395
  //this is the fake display part:
395
396
  let arrAngleForLabel;
396
397
  if (opts.isFakeDisplay) {
397
398
  const angleInDegreesMin = 25;
398
- const cAngleInDegreesTop = round(randfloat(angleInDegreesMin, 180 - angleInDegreesMin, opts.nbDigits), opts.nbDigits);
399
+ const cAngleInDegreesTop = round(randfloat(angleInDegreesMin, 180 - angleInDegreesMin, nbDigits), nbDigits);
399
400
  const cAngleInDegreesBottom = isParallel
400
401
  ? cAngleInDegreesTop
401
- : round(cAngleInDegreesTop + randfloat(-25, 50, opts.nbDigits, [0]), opts.nbDigits);
402
+ : round(cAngleInDegreesTop + randfloat(-25, 50, nbDigits, [0]), nbDigits);
402
403
  //angles at angleIndexes 0 and 2 have same value. Same for angleIndexes 1 and 3.
403
404
  arrAngleForLabel = [cAngleInDegreesTop, cAngleInDegreesBottom].map((angle, i) => {
404
- return arrAngleIndex[i] % 2 == 0
405
- ? angle
406
- : round(180 - angle, opts.nbDigits);
405
+ return arrAngleIndex[i] % 2 == 0 ? angle : round(180 - angle, nbDigits);
407
406
  });
408
407
  }
409
408
  const identifiers = {
@@ -16,7 +16,7 @@ type Identifiers = {
16
16
  type Options = {
17
17
  angleTypes: ("alternes-internes" | "correspondants" | "alternes-externes" | "autres")[];
18
18
  isFakeDisplay: boolean;
19
- nbDigits: 0 | 1 | 2;
19
+ nbDigits: "0" | "1" | "2";
20
20
  };
21
21
  export declare const isParallelUsingAngles: Exercise<Identifiers, Options>;
22
22
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"isParallelUsingAngles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/isParallelUsingAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAuItC,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AA6HF,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EACL,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CAAC;IAGb,kBAAkB,EAAE,eAAe,EAAE,CAAC;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IAGxB,gBAAgB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACxC,CAAC;AAuIF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,CACR,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CACX,EAAE,CAAC;IACJ,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACrB,CAAC;AAuNF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBhE,CAAC"}
1
+ {"version":3,"file":"isParallelUsingAngles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/isParallelUsingAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAuItC,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AA6HF,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EACL,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CAAC;IAGb,kBAAkB,EAAE,eAAe,EAAE,CAAC;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IAGxB,gBAAgB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACxC,CAAC;AAuIF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,CACR,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CACX,EAAE,CAAC;IACJ,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC3B,CAAC;AAuNF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBhE,CAAC"}
@@ -178,7 +178,7 @@ const getCorrection = (identifiers) => {
178
178
  };
179
179
  const getGGBOptions = (identifiers, opts) => {
180
180
  const { arrIntersectionIds, arrAngleIndex, arrAngleForLabel } = identifiers;
181
- const nbDigits = opts?.nbDigits ?? 1;
181
+ const nbDigits = opts?.nbDigits ?? "1";
182
182
  const arrIntersection = arrIntersectionIds.map(IntersectionConstructor.fromIdentifiers);
183
183
  const arrAngle = arrAngleIndex.map((angleIndex, i) => arrIntersection[i].getAngle(angleIndex));
184
184
  const arrCommandPoints = arrAngle
@@ -217,7 +217,7 @@ const getGGBOptions = (identifiers, opts) => {
217
217
  //fake or real label
218
218
  `ShowLabel(${a.name}, false)`,
219
219
  ...a.getFitCaptionCommands({
220
- text: round(arrAngleForLabel ? arrAngleForLabel[i] : a.evaluate(), nbDigits).frenchify(),
220
+ text: round(arrAngleForLabel ? arrAngleForLabel[i] : a.evaluate(), Number(nbDigits)).frenchify(),
221
221
  size: "small",
222
222
  color: ["red", "blue"][i],
223
223
  }),
@@ -241,7 +241,7 @@ const isAnswerValid = (ans, { answer }) => {
241
241
  const optsDefault = {
242
242
  angleTypes: ["alternes-internes"],
243
243
  isFakeDisplay: true,
244
- nbDigits: 0,
244
+ nbDigits: "0",
245
245
  };
246
246
  const options = [
247
247
  {
@@ -269,7 +269,7 @@ const options = [
269
269
  label: "Nombre de décimales",
270
270
  target: GeneratorOptionTarget.generation,
271
271
  type: GeneratorOptionType.select,
272
- values: [0, 1, 2],
272
+ values: ["0", "1", "2"],
273
273
  defaultValue: optsDefault.nbDigits,
274
274
  },
275
275
  ];
@@ -281,11 +281,11 @@ const getIsParallelUsingAnglesQuestion = (optsIn) => {
281
281
  function createConfigGeom(isParralelInGeom, isLookingParallel) {
282
282
  const deviation = isLookingParallel ? 1 : 5;
283
283
  const cAngleInDegreesMin = 30;
284
- const cAngleInDegreesTop = randfloat(cAngleInDegreesMin, 180 - cAngleInDegreesMin, opts.nbDigits);
284
+ const cAngleInDegreesTop = randfloat(cAngleInDegreesMin, 180 - cAngleInDegreesMin, Number(opts.nbDigits));
285
285
  const cAngleInDegreesBottom = isParralelInGeom
286
286
  ? cAngleInDegreesTop
287
287
  : cAngleInDegreesTop +
288
- randfloat(-deviation, deviation, opts.nbDigits, [0]);
288
+ randfloat(-deviation, deviation, Number(opts.nbDigits), [0]);
289
289
  return {
290
290
  cAngleInDegreesTop,
291
291
  cAngleInDegreesBottom,
@@ -351,10 +351,10 @@ const getIsParallelUsingAnglesQuestion = (optsIn) => {
351
351
  let arrAngleForLabel;
352
352
  if (opts.isFakeDisplay) {
353
353
  const angleInDegreesMin = 25;
354
- const cAngleInDegreesTop = randfloat(angleInDegreesMin, 180 - angleInDegreesMin, opts.nbDigits);
354
+ const cAngleInDegreesTop = randfloat(angleInDegreesMin, 180 - angleInDegreesMin, Number(opts.nbDigits));
355
355
  const cAngleInDegreesBottom = isParralel
356
356
  ? cAngleInDegreesTop
357
- : cAngleInDegreesTop + randfloat(-25, 50, opts.nbDigits, [0]);
357
+ : cAngleInDegreesTop + randfloat(-25, 50, Number(opts.nbDigits), [0]);
358
358
  //angles at angleIndexes 0 and 2 have same value. Same for angleIndexes 1 and 3.
359
359
  arrAngleForLabel = [cAngleInDegreesTop, cAngleInDegreesBottom].map((angle, i) => {
360
360
  return arrAngleIndex[i] % 2 == 0 ? angle : 180 - angle;
@@ -81,7 +81,7 @@ const getHint = () => {
81
81
  return `Voici les énoncés des théorèmes de Pythagore et de Thalès, et leurs réciproques :
82
82
 
83
83
  - **Théorème de Pythagore** : Dans un triangle rectangle, le carré de l'hypoténuse est égal à la somme des carrés des deux autres côtés.
84
- - **Réciproque du théorème de Pythagore** : Si dans un triangle, le carré de l'hypoténuse est égal à la somme des carrés des deux autres côtés, alors le triangle est rectangle.
84
+ - **Réciproque du théorème de Pythagore** : Si dans un triangle, le carré du plus grand côté est égal à la somme des carrés des deux autres côtés, alors le triangle est rectangle.
85
85
  - **Théorème de Thalès** : Soit un triangle $ABC$, et $D$ un point sur la droite $(AB)$ et $E$ un point sur la droite $(AC)$. Si les droites $(DE)$ et $(BC)$ sont parallèles, alors :
86
86
 
87
87
  $$
@@ -98,7 +98,7 @@ const getCorrection = (identifiers) => {
98
98
  On applique ce théorème dans le triangle $ABD$ rectangle en $D$. En effet, d'après le théorème de Pythagore, on a $AB^2 = AD^2 + DB^2$. Puisqu'on connaît les longueurs $AD$ et $DB$, on peut en déduire la longueur $AB$.`;
99
99
  }
100
100
  else {
101
- return `Il faut utiliser la réciproque du théorème de Pythagore : si dans un triangle, le carré de l'hypoténuse est égal à la somme des carrés des deux autres côtés, alors le triangle est rectangle.
101
+ return `Il faut utiliser la réciproque du théorème de Pythagore : si dans un triangle, le carré du plus grand côté est égal à la somme des carrés des deux autres côtés, alors le triangle est rectangle.
102
102
 
103
103
  On applique cette réciproque dans le triangle $BCD$. En effet, on connaît les longueurs des trois côtés. Il suffit donc de montrer que $BC^2 = BD^2 + CD^2$.`;
104
104
  }
@@ -1 +1 @@
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
+ {"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;AAYrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAyHF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAgBzD,CAAC"}