math-exercises 3.0.128 → 3.0.130

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 (41) hide show
  1. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts +6 -1
  2. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/ordering/compareA10N.js +56 -49
  4. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +3 -18
  6. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +4 -1
  7. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +34 -10
  9. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +2 -6
  10. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -1
  11. package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +81 -197
  12. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -1
  13. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +1 -40
  14. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -1
  15. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +1 -15
  16. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -1
  17. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +1 -13
  18. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +7 -2
  20. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +1 -4
  22. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -1
  23. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +1 -4
  24. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +27 -46
  26. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts.map +1 -1
  27. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.js +25 -42
  28. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +1 -1
  29. package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -1
  30. package/lib/exercises/math/conversion/minutesToHours.js +6 -3
  31. package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -1
  32. package/lib/exercises/math/conversion/secondsToHours.js +6 -3
  33. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -1
  34. package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +27 -17
  35. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts.map +1 -1
  36. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.js +5 -103
  37. package/lib/index.d.ts +11 -9
  38. package/lib/index.d.ts.map +1 -1
  39. package/lib/tests/questionTest.d.ts.map +1 -1
  40. package/lib/tests/questionTest.js +4 -2
  41. package/package.json +1 -1
@@ -2,11 +2,10 @@ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { probaLawFlip } from "../../../../utils/alea/probaLawFlip.js";
4
4
  import { shuffle } from "../../../../utils/alea/shuffle.js";
5
- import { permute } from "../../../../utils/arrays/permutations.js";
6
5
  const getInstruction = () => {
7
- return `Soit a un nombre non nul.
6
+ return `Soit $a$ un nombre non nul.
8
7
 
9
- Parmi les propositions suivantes, lesquelles sont vraies ?`;
8
+ Parmi les propositions suivantes, lesquelles sont égales à $0$ ?`;
10
9
  };
11
10
  const getHint = () => {
12
11
  return `$0$ divisé par un nombre non nul donne $0$.
@@ -17,19 +16,7 @@ const getCorrection = () => {
17
16
  return `
18
17
 
19
18
  $$
20
- 0 \\times a = 0
21
- $$
22
-
23
- et
24
-
25
- $$
26
- \\frac{0}{a} = 0
27
- $$
28
-
29
- donc
30
-
31
- $$
32
- 0 \\times a = \\frac{0}{a} = 0
19
+ 0 = 0 \\times a = a \\times 0 = \\frac{0}{a} = a + (-a)
33
20
  $$
34
21
 
35
22
  `;
@@ -39,10 +26,10 @@ const getPropositions = (_, { answer, ...identifiers }) => {
39
26
  const propositions = [];
40
27
  items.forEach((item) => {
41
28
  if (item.isValidAnswer) {
42
- addValidProp(propositions, item.tex, "raw");
29
+ addValidProp(propositions, item.tex);
43
30
  }
44
31
  else {
45
- tryToAddWrongProp(propositions, item.tex, "raw");
32
+ tryToAddWrongProp(propositions, item.tex);
46
33
  }
47
34
  });
48
35
  return propositions;
@@ -56,35 +43,29 @@ const getCompareATimes0Question = () => {
56
43
  [4, 0.02],
57
44
  ]);
58
45
  const nbInvalid = nbTotal - nbValid;
59
- const arrayOfTex = [`0 \\times a`, `\\frac{0}{a}`, `0`];
60
- const permutations = permute(arrayOfTex);
61
- const validItems = permutations.flatMap(([tex1, tex2, tex3]) => {
62
- return [
63
- `$${[tex1, tex2, tex3].join("=")}$`,
64
- `$${tex1}=${tex2}$ et $${tex2}=${tex3}$`,
65
- ].map((tex) => {
66
- return {
67
- tex,
68
- isValidAnswer: true,
69
- };
70
- });
46
+ const validItems = [
47
+ `0 \\times a`,
48
+ `a \\times 0`,
49
+ `\\frac{0}{a}`,
50
+ `a + (-a)`,
51
+ ].map((tex) => {
52
+ return {
53
+ tex,
54
+ isValidAnswer: true,
55
+ };
71
56
  });
72
- const invalidItems = permutations.flatMap(([tex1, tex2, tex3]) => {
73
- return [
74
- `$${tex1}>${tex2}$ et $${tex2}=${tex3}$`,
75
- `$${tex1}=${tex2}$ et $${tex2}>${tex3}$`,
76
- ...(tex3 === `\\frac{0}{a}`
77
- ? [`$${tex1}=${tex2}$ et $${tex3}$ n'existe pas`]
78
- : []),
79
- ...(tex1 === `\\frac{0}{a}`
80
- ? [`$${tex1}$ n'existe pas et $${tex2}=${tex3}$`]
81
- : []),
82
- ].map((tex) => {
83
- return {
84
- tex,
85
- isValidAnswer: false,
86
- };
87
- });
57
+ const invalidItems = [
58
+ `a \\times (-a)`,
59
+ `(-a) \\times a`,
60
+ `\\frac{a}{a}`,
61
+ `\\frac{a}{-a}`,
62
+ `a - (-a)`,
63
+ `a + (a)`,
64
+ ].map((tex) => {
65
+ return {
66
+ tex,
67
+ isValidAnswer: false,
68
+ };
88
69
  });
89
70
  const items = shuffle([
90
71
  ...shuffle(validItems).slice(0, nbValid),
@@ -1 +1 @@
1
- {"version":3,"file":"compareMinusA.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/compareMinusA.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAkHF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAe/C,CAAC"}
1
+ {"version":3,"file":"compareMinusA.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/simplifying/compareMinusA.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAiGF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAe/C,CAAC"}
@@ -2,11 +2,10 @@ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { probaLawFlip } from "../../../../utils/alea/probaLawFlip.js";
4
4
  import { shuffle } from "../../../../utils/alea/shuffle.js";
5
- import { permute } from "../../../../utils/arrays/permutations.js";
6
5
  const getInstruction = () => {
7
- return `Soit a un nombre non nul.
6
+ return `Soit $a$ un nombre non nul.
8
7
 
9
- Parmi les propositions suivantes, lesquelles sont vraies ?`;
8
+ Parmi les propositions suivantes, lesquelles sont égales à $-a$ ?`;
10
9
  };
11
10
  const getHint = () => {
12
11
  return "La règle des signes est la même pour une multiplication et pour une division.";
@@ -15,19 +14,7 @@ const getCorrection = () => {
15
14
  return `
16
15
 
17
16
  $$
18
- (−1) \\times a = -a
19
- $$
20
-
21
- et
22
-
23
- $$
24
- \\frac{a}{-1} = -a
25
- $$
26
-
27
- donc
28
-
29
- $$
30
- (−1) \\times a = \\frac{a}{-1} = -a
17
+ -a = (−1) \\times a = a \\times (−1) = \\frac{a}{-1} = -\\frac{a}{1}
31
18
  $$
32
19
 
33
20
  `;
@@ -37,10 +24,10 @@ const getPropositions = (_, { answer, ...identifiers }) => {
37
24
  const propositions = [];
38
25
  items.forEach((item) => {
39
26
  if (item.isValidAnswer) {
40
- addValidProp(propositions, item.tex, "raw");
27
+ addValidProp(propositions, item.tex);
41
28
  }
42
29
  else {
43
- tryToAddWrongProp(propositions, item.tex, "raw");
30
+ tryToAddWrongProp(propositions, item.tex);
44
31
  }
45
32
  });
46
33
  return propositions;
@@ -54,31 +41,27 @@ const getCompareMinusAQuestion = () => {
54
41
  [4, 0.02],
55
42
  ]);
56
43
  const nbInvalid = nbTotal - nbValid;
57
- const arrayOfTex = [`(−1) \\times a`, `\\frac{a}{-1}`, `-a`];
58
- const permutations = permute(arrayOfTex);
59
- const validItems = permutations.flatMap(([tex1, tex2, tex3]) => {
60
- return [
61
- `$${[tex1, tex2, tex3].join("=")}$`,
62
- `$${tex1}=${tex2}$ et $${tex2}=${tex3}$`,
63
- ].map((tex) => {
64
- return {
65
- tex,
66
- isValidAnswer: true,
67
- };
68
- });
44
+ const validItems = [
45
+ `(-1) \\times a`,
46
+ `\\frac{a}{-1}`,
47
+ `a \\times (-1)`,
48
+ `-\\frac{a}{1}`,
49
+ ].map((tex) => {
50
+ return {
51
+ tex,
52
+ isValidAnswer: true,
53
+ };
69
54
  });
70
- const invalidItems = permutations.flatMap(([tex1, tex2, tex3]) => {
71
- return [
72
- `$${tex1}>${tex2}$ et $${tex2}=${tex3}$`,
73
- `$${tex1}<${tex2}$ et $${tex2}=${tex3}$`,
74
- `$${tex1}=${tex2}$ et $${tex2}>${tex3}$`,
75
- `$${tex1}=${tex2}$ et $${tex2}<${tex3}$`,
76
- ].map((tex) => {
77
- return {
78
- tex,
79
- isValidAnswer: false,
80
- };
81
- });
55
+ const invalidItems = [
56
+ `(-1) \\times (-a)`,
57
+ `\\frac{-a}{-1}`,
58
+ `(-a) \\times (-1)`,
59
+ `-\\frac{-a}{1}`,
60
+ ].map((tex) => {
61
+ return {
62
+ tex,
63
+ isValidAnswer: false,
64
+ };
82
65
  });
83
66
  const items = shuffle([
84
67
  ...shuffle(validItems).slice(0, nbValid),
@@ -100,7 +100,7 @@ const options = [
100
100
  export const kmPerMinToKmPerHourConversion = {
101
101
  id: "kmPerMinToKmPerHourConversion",
102
102
  connector: "=",
103
- label: "Effectuer des conversions de vitesse ( $x$ km en $y$ min donne une vitesse $V$ en \\textrm{km/h})",
103
+ label: "Effectuer des conversions de vitesse ( $x$ $\\textrm{km}$ en $y$ $\\textrm{min}$ donne une vitesse $V$ en $\\textrm{km/h}$)",
104
104
  isSingleStep: true,
105
105
  generator: (nb, opts) => getDistinctQuestions(() => getKmPerMinToKmPerHourConversionQuestion(opts), nb),
106
106
  options,
@@ -1 +1 @@
1
- {"version":3,"file":"minutesToHours.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/minutesToHours.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,eAAe,CAAC;IAChC,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA2LF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
1
+ {"version":3,"file":"minutesToHours.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/minutesToHours.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,eAAe,CAAC;IAChC,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA8LF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
@@ -76,13 +76,16 @@ const getPropositions = (n, { answer, ...identifiers }) => {
76
76
  addValidProp(propositions, answer);
77
77
  if (isMinutesToHours) {
78
78
  const roundedValue = round(hours.evaluate(), 2);
79
- const texDecimal = roundedValue.frenchify().split(",")[1];
80
79
  tryToAddWrongProp(propositions, `${roundedValue.frenchify()}\\text{h}`);
81
80
  tryToAddWrongProp(propositions, `${multiply(minutes.evaluate(), 60).simplify().toTex()}\\text{h}`);
82
81
  tryToAddWrongProp(propositions, `${frac(60, minutes).toTex()}\\text{h}`);
83
82
  propWhile(propositions, n, () => {
84
- tryToAddWrongProp(propositions, `${0},${texDecimal}\\text{h}`);
85
- tryToAddWrongProp(propositions, `${1},${texDecimal}\\text{h}`);
83
+ const texDecimal = roundedValue.frenchify().split(",")[1];
84
+ if (texDecimal) {
85
+ tryToAddWrongProp(propositions, `${0},${texDecimal}\\text{h}`);
86
+ tryToAddWrongProp(propositions, `${1},${texDecimal}\\text{h}`);
87
+ }
88
+ tryToAddWrongProp(propositions, `${randint(1, 20)}\\text{h}`);
86
89
  });
87
90
  }
88
91
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"secondsToHours.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/secondsToHours.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,eAAe,CAAC;IAChC,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA2LF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAgBhD,CAAC"}
1
+ {"version":3,"file":"secondsToHours.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/secondsToHours.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,eAAe,CAAC;IAChC,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA8LF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAgBhD,CAAC"}
@@ -76,13 +76,16 @@ const getPropositions = (n, { answer, ...identifiers }) => {
76
76
  addValidProp(propositions, answer);
77
77
  if (isSecondsToHours) {
78
78
  const roundedValue = round(hours.evaluate(), 2);
79
- const texDecimal = roundedValue.frenchify().split(",")[1];
80
79
  tryToAddWrongProp(propositions, `${roundedValue.frenchify()}\\text{h}`);
81
80
  tryToAddWrongProp(propositions, `${multiply(seconds.evaluate(), 3600).simplify().toTex()}\\text{h}`);
82
81
  tryToAddWrongProp(propositions, `${frac(3600, seconds).toTex()}\\text{h}`);
83
82
  propWhile(propositions, n, () => {
84
- tryToAddWrongProp(propositions, `${0},${texDecimal}\\text{h}`);
85
- tryToAddWrongProp(propositions, `${1},${texDecimal}\\text{h}`);
83
+ const texDecimal = roundedValue.frenchify().split(",")[1];
84
+ if (texDecimal) {
85
+ tryToAddWrongProp(propositions, `${0},${texDecimal}\\text{h}`);
86
+ tryToAddWrongProp(propositions, `${1},${texDecimal}\\text{h}`);
87
+ }
88
+ tryToAddWrongProp(propositions, `${randint(1, 20)}\\text{h}`);
86
89
  });
87
90
  }
88
91
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"barChartInterpreting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/barChartInterpreting.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,QAAQ,EAKT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,cAAc,GAAG,cAAc,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,GAAG,GAAG;IACT,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAotBF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgB/D,CAAC"}
1
+ {"version":3,"file":"barChartInterpreting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/barChartInterpreting.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,QAAQ,EAKT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,cAAc,GAAG,cAAc,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,GAAG,GAAG;IACT,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AA8tBF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe/D,CAAC"}
@@ -1,4 +1,4 @@
1
- import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../exercises/exercise.js";
1
+ import { addValidProp, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../exercises/exercise.js";
2
2
  import { random, randomMany } from "../../../utils/alea/random.js";
3
3
  import { randfloat } from "../../../math/utils/random/randfloat.js";
4
4
  import { blueMain, greenMain, orange, red } from "../../../geogebra/colors.js";
@@ -8,7 +8,6 @@ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuesti
8
8
  import { randint } from "../../../math/utils/random/randint.js";
9
9
  import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
10
10
  import { capitalize } from "../../../utils/strings/capitalize.js";
11
- import { shuffle } from "../../../utils/alea/shuffle.js";
12
11
  class BarChartConstructor {
13
12
  static stylesPools = {
14
13
  color: [
@@ -98,7 +97,7 @@ class BarChartConstructor {
98
97
  }
99
98
  static createRandomCategories(dictIsUsingCategory, categoryPropsPool, styleType) {
100
99
  const nbCategUsed = Object.keys(dictIsUsingCategory).length;
101
- const styles = shuffle(this.stylesPools[styleType].slice(0, nbCategUsed));
100
+ const styles = this.stylesPools[styleType].slice(0, nbCategUsed);
102
101
  return categoryPropsPool
103
102
  .filter((_, i) => dictIsUsingCategory[i])
104
103
  .map((props, i) => {
@@ -208,28 +207,36 @@ const getAnswer = (identifiers) => {
208
207
  return getAnswerBar(barChart, itemAsked).props.label;
209
208
  }
210
209
  };
211
- const getPropositions = (n, { answer, ...identifiers }) => {
210
+ const getPropositions = (_, { answer, ...identifiers }) => {
212
211
  const { barChart, itemAsked } = identifiers;
213
212
  const propositions = [];
214
213
  switch (itemAsked.type) {
215
214
  case "categoryForX":
216
215
  {
217
- addValidProp(propositions, answer, "raw");
218
216
  barChart.categories.forEach((categ) => {
219
- tryToAddWrongProp(propositions, categ.props.name, "raw");
217
+ if (categ.props.name === answer) {
218
+ addValidProp(propositions, categ.props.name, "raw");
219
+ }
220
+ else {
221
+ tryToAddWrongProp(propositions, categ.props.name, "raw");
222
+ }
220
223
  });
221
224
  }
222
225
  break;
223
226
  case "xForCategory":
224
227
  {
225
- addValidProp(propositions, answer, "raw");
226
228
  barChart.bars.forEach((bar) => {
227
- tryToAddWrongProp(propositions, bar.props.label, "raw");
229
+ if (bar.props.label === answer) {
230
+ addValidProp(propositions, bar.props.label, "raw");
231
+ }
232
+ else {
233
+ tryToAddWrongProp(propositions, bar.props.label, "raw");
234
+ }
228
235
  });
229
236
  }
230
237
  break;
231
238
  }
232
- return shuffleProps(propositions, n);
239
+ return propositions;
233
240
  };
234
241
  const getHint = (identifiers) => {
235
242
  const { barChart, itemAsked } = identifiers;
@@ -346,28 +353,32 @@ const getGGBOptionsVertStacked = (identifiers) => {
346
353
  max: xMin + barWidth,
347
354
  };
348
355
  }
349
- function getYRangeForCategory(barIndex, categIndex) {
356
+ function getYRangeForCategory(barIndex, categIndex, isTopToBottom = true) {
350
357
  const slice = barChart.bars[barIndex].data.slice(0, categIndex);
351
358
  const yMinForCateg = slice.reduce((acc, data) => acc + data, 0);
352
359
  const yMaxForCateg = yMinForCateg + barChart.bars[barIndex].data[categIndex];
353
360
  return {
354
- min: yMinForCateg,
355
- max: yMaxForCateg,
361
+ min: isTopToBottom
362
+ ? arrayOfBarHeights[barIndex] - yMinForCateg
363
+ : yMinForCateg,
364
+ max: isTopToBottom
365
+ ? arrayOfBarHeights[barIndex] - yMaxForCateg
366
+ : yMaxForCateg,
356
367
  };
357
368
  }
358
369
  function createCommandsForBar(barChart, barIndex) {
359
370
  //const bar = barChart.bars[barIndex];
360
371
  const commands = barChart.categories.flatMap((categ, categIndex) => {
361
372
  const xRange = getXRangeForBarIndex(barIndex);
362
- const yRange = getYRangeForCategory(barIndex, categIndex);
373
+ const yRange = getYRangeForCategory(barIndex, categIndex, true);
363
374
  const style = categ.style;
364
375
  const B = `B_{${barIndex}${categIndex}}`;
365
376
  const barChartCommand = [
366
377
  `${B} = Polygon((${xRange.min}, ${yRange.min}), (${xRange.min}, ${yRange.max}),(${xRange.max}, ${yRange.max}),(${xRange.max}, ${yRange.min}))`,
367
378
  `ShowLabel(${B},false)`,
368
379
  style.type === "color"
369
- ? `SetColor(${B}, "${barChart.categories[categIndex].style.color}")`
370
- : `SetDecoration(${B}, ${barChart.categories[categIndex].style.fill})`,
380
+ ? `SetColor(${B}, "${categ.style.color}")`
381
+ : `SetDecoration(${B}, ${categ.style.fill})`,
371
382
  ];
372
383
  return barChartCommand;
373
384
  });
@@ -528,6 +539,5 @@ export const barChartInterpreting = {
528
539
  subject: "Mathématiques",
529
540
  getQuestionFromIdentifiers,
530
541
  hasGeogebra: true,
531
- answerType: "QCM",
532
- isQCM: true,
542
+ answerType: "QCU",
533
543
  };
@@ -1 +1 @@
1
- {"version":3,"file":"scatterPlotCommenting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/scatterPlotCommenting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAK5C,KAAK,WAAW,GAAG;IACjB,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAkZF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAiBvD,CAAC"}
1
+ {"version":3,"file":"scatterPlotCommenting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/scatterPlotCommenting.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAK5C,KAAK,WAAW,GAAG;IACjB,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAmQF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
@@ -60,22 +60,6 @@ il y a des pays avec un taux de chômage faible et une croissance forte,
60
60
  il y a des pays avec un taux de chômage fort et une croissance faible,
61
61
  il y a des pays avec un taux de chômage fort et une croissance forte.
62
62
  `;
63
- }
64
- case "increasingThenDecreasing": {
65
- const [pointLowX, pointHighX] = cloudPoints.points.toSorted((p1, p2) => p1.x.evaluate() - p2.x.evaluate());
66
- return `En particulier :
67
-
68
- Le pays ${pointLowX.name} a un faible taux de chômage et une faible croissance du PIB.
69
-
70
- Le pays ${pointHighX.name} a un fort taux de chômage et une faible croissance du PIB.`;
71
- }
72
- case "decreasingThenIncreasing": {
73
- const [pointLowX, pointHighX] = cloudPoints.points.toSorted((p1, p2) => p1.x.evaluate() - p2.x.evaluate());
74
- return `En particulier :
75
-
76
- Le pays ${pointLowX.name} a un faible taux de chômage et une forte croissance du PIB.
77
-
78
- Le pays ${pointHighX.name} a un fort taux de chômage et une forte croissance du PIB.`;
79
63
  }
80
64
  default:
81
65
  return ``;
@@ -85,25 +69,15 @@ Le pays ${pointHighX.name} a un fort taux de chômage et une forte croissance du
85
69
  const propsForEvolutionType = {
86
70
  increasing: [
87
71
  `Plus le taux de chômage est élevé et plus la croissance du PIB est élevée.`,
88
- `Si le taux de chômage est faible alors la croissance du PIB est faible.`,
89
- `Si le taux de chômage est élevé alors la croissance du PIB est élevée.`,
90
72
  ],
91
73
  decreasing: [
92
74
  `Plus le taux de chômage est élevé et plus la croissance du PIB est faible.`,
93
- `Si le taux de chômage est faible alors la croissance du PIB est élevée.`,
94
- `Si le taux de chômage est élevé alors la croissance du PIB est faible.`,
95
75
  ],
96
76
  unpredictible: [
97
77
  `Il n'y a aucun lien entre le taux de chômage et la croissance du PIB.`,
98
78
  ],
99
- increasingThenDecreasing: [
100
- `Si le taux de chômage est faible alors la croissance du PIB est faible.`,
101
- `Si le taux de chômage est élevé alors la croissance du PIB est faible.`,
102
- ],
103
- decreasingThenIncreasing: [
104
- `Si le taux de chômage est faible alors la croissance du PIB est élevée.`,
105
- `Si le taux de chômage est élevé alors la croissance du PIB est élevée.`,
106
- ],
79
+ increasingThenDecreasing: [],
80
+ decreasingThenIncreasing: [],
107
81
  };
108
82
  const getPropositions = (n, { evolutionType }) => {
109
83
  const propositions = [];
@@ -114,14 +88,7 @@ const getPropositions = (n, { evolutionType }) => {
114
88
  });
115
89
  const invalidProps = [
116
90
  ...Object.values(propsForEvolutionType).flatMap((props) => props),
117
- ]
118
- .filter((prop) => !allValidProps.includes(prop))
119
- //prevent confusion
120
- .filter((prop) => evolutionType === "increasingThenDecreasing" ||
121
- evolutionType === "decreasingThenIncreasing"
122
- ? prop !==
123
- `Il n'y a aucun lien entre le taux de chômage et la croissance du PIB.`
124
- : true);
91
+ ].filter((prop) => !allValidProps.includes(prop));
125
92
  invalidProps.forEach((str) => {
126
93
  tryToAddWrongProp(propositions, str, "raw");
127
94
  });
@@ -170,13 +137,7 @@ const getScatterPlotCommentingQuestion = () => {
170
137
  const nbCountries = 6;
171
138
  const countriesPicked = randomMany(countries, nbCountries);
172
139
  const boxFull = { xMin: 3, xMax: 13, yMin: 0, yMax: 4 };
173
- const evolutionType = random([
174
- "increasing",
175
- "decreasing",
176
- "unpredictible",
177
- "increasingThenDecreasing",
178
- "decreasingThenIncreasing",
179
- ]);
140
+ const evolutionType = random(["increasing", "decreasing", "unpredictible"]);
180
141
  let cloudPointsWithEvoBoxed;
181
142
  switch (evolutionType) {
182
143
  case "increasing":
@@ -210,64 +171,6 @@ const getScatterPlotCommentingQuestion = () => {
210
171
  ]), boxFull);
211
172
  }
212
173
  break;
213
- case "increasingThenDecreasing":
214
- {
215
- const nbCountriesIncr = Math.floor(nbCountries / 2);
216
- const nbCountriesDecr = nbCountries - nbCountriesIncr;
217
- const cloudPointsIncr = CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountriesIncr, "increasing"), {
218
- xMin: 0,
219
- xMax: 0.5,
220
- yMin: 0,
221
- yMax: 1,
222
- });
223
- const cloudPointsDecr = CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountriesDecr, "decreasing"), {
224
- xMin: 0.5,
225
- xMax: 1,
226
- yMin: 0,
227
- yMax: 1,
228
- });
229
- const boxLow = {
230
- xMin: boxFull.xMin,
231
- xMax: boxFull.xMax,
232
- yMin: boxFull.yMin,
233
- yMax: ((boxFull.yMin + boxFull.yMax) * 1) / 3,
234
- };
235
- cloudPointsWithEvoBoxed =
236
- CloudPointsConstructor.cloudPointsByReboxingCloudPoints(new CloudPoints([
237
- ...cloudPointsIncr.points,
238
- ...cloudPointsDecr.points,
239
- ]), boxLow);
240
- }
241
- break;
242
- case "decreasingThenIncreasing":
243
- {
244
- const nbCountriesDecr = Math.floor(nbCountries / 2);
245
- const nbCountriesIncr = nbCountries - nbCountriesDecr;
246
- const cloudPointsDecr = CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountriesDecr, "decreasing"), {
247
- xMin: 0,
248
- xMax: 0.5,
249
- yMin: 0,
250
- yMax: 1,
251
- });
252
- const cloudPointsIncr = CloudPointsConstructor.cloudPointsByReboxingCloudPoints(CloudPointsConstructor.randomWithEvolutionType(nbCountriesIncr, "increasing"), {
253
- xMin: 0.5,
254
- xMax: 1,
255
- yMin: 0,
256
- yMax: 1,
257
- });
258
- const boxHigh = {
259
- xMin: boxFull.xMin,
260
- xMax: boxFull.xMax,
261
- yMin: ((boxFull.yMin + boxFull.yMax) * 2) / 3,
262
- yMax: boxFull.yMax,
263
- };
264
- cloudPointsWithEvoBoxed =
265
- CloudPointsConstructor.cloudPointsByReboxingCloudPoints(new CloudPoints([
266
- ...cloudPointsIncr.points,
267
- ...cloudPointsDecr.points,
268
- ]), boxHigh);
269
- }
270
- break;
271
174
  }
272
175
  const namedPoints = cloudPointsWithEvoBoxed.points.map((point, i) => new Point(countriesPicked[i], point.x, point.y));
273
176
  const cloudPointsNamed = new CloudPoints(namedPoints);
@@ -303,6 +206,5 @@ export const scatterPlotCommenting = {
303
206
  subject: "Mathématiques",
304
207
  getQuestionFromIdentifiers,
305
208
  hasHintAndCorrection: true,
306
- answerType: "QCM",
307
- isQCM: true,
209
+ answerType: "QCU",
308
210
  };
package/lib/index.d.ts CHANGED
@@ -275,17 +275,13 @@ declare const mathExercises: (Exercise<{
275
275
  a: number;
276
276
  b: number;
277
277
  }, object, string | number | boolean | string[] | number[] | boolean[]> | Exercise<{
278
- sign: number;
279
- a: number;
280
- b: number;
281
- c: number;
282
- dictFakeNameToQuestionParam: Record<string, {
283
- fakeName: string;
278
+ questionParams: {
279
+ letter: string;
284
280
  trueName: string;
285
281
  tex: string;
286
282
  nodeIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
287
283
  explainTex: string;
288
- }>;
284
+ }[];
289
285
  items: {
290
286
  tex: string;
291
287
  isValidAnswer: boolean;
@@ -296,10 +292,14 @@ declare const mathExercises: (Exercise<{
296
292
  isAllowingNegativeNumbers: boolean;
297
293
  }, string | number | boolean | string[] | number[] | boolean[]> | Exercise<{
298
294
  signType: string;
299
- items: {
295
+ a10Ns: {
300
296
  a: number;
301
297
  n: number;
302
298
  }[];
299
+ items: {
300
+ tex: string;
301
+ isValid: boolean;
302
+ }[];
303
303
  }, {
304
304
  signTypes: string[];
305
305
  nbCollisions: number[];
@@ -313,7 +313,9 @@ declare const mathExercises: (Exercise<{
313
313
  }, object, string | number | boolean | string[] | number[] | boolean[]> | Exercise<{
314
314
  nodeIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
315
315
  texAnswers: string[];
316
- }, object, string | number | boolean | string[] | number[] | boolean[]> | Exercise<{
316
+ }, {
317
+ isFracOfSums: boolean;
318
+ }, string | number | boolean | string[] | number[] | boolean[]> | Exercise<{
317
319
  a: number;
318
320
  b: number;
319
321
  isAdd: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO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":3,"file":"questionTest.d.ts","sourceRoot":"","sources":["../../src/tests/questionTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAKjE,eAAO,MAAM,YAAY,GACvB,KAAK,QAAQ,CAAC,MAAM,CAAC,EACrB,UAAU,QAAQ,CAAC,MAAM,CAAC;;;CAqP3B,CAAC"}
1
+ {"version":3,"file":"questionTest.d.ts","sourceRoot":"","sources":["../../src/tests/questionTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAKjE,eAAO,MAAM,YAAY,GACvB,KAAK,QAAQ,CAAC,MAAM,CAAC,EACrB,UAAU,QAAQ,CAAC,MAAM,CAAC;;;CA2P3B,CAAC"}
@@ -191,10 +191,12 @@ export const questionTest = (exo, question) => {
191
191
  throw new Error(`exo ${exo.id} has invalid props`);
192
192
  }
193
193
  props.forEach((prop) => {
194
+ if (prop.statement.includes("undefined"))
195
+ throw new Error(`exo ${exo.id} has invalid prop (undefined) : ${prop.statement}`);
194
196
  if (prop.statement.match(dotDecimalPattern))
195
- throw new Error(`exo ${exo.id} has invalid prop (dot) : ${prop}`);
197
+ throw new Error(`exo ${exo.id} has invalid prop (dot) : ${prop.statement}`);
196
198
  if (prop.statement.includes("[object Object]"))
197
- throw new Error(`exo ${exo.id} has invalid prop (objectObject) : ${prop}`);
199
+ throw new Error(`exo ${exo.id} has invalid prop (objectObject) : ${prop.statement}`);
198
200
  if (!props.every((prop2) => prop2.id === prop.id || prop.statement !== prop2.statement))
199
201
  throw new Error(`exo ${exo.id} has invalid prop (duplicate): ${prop.statement}`);
200
202
  if (prop.format !== "raw") {