math-exercises 3.0.24 → 3.0.25

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 (45) hide show
  1. package/lib/exercises/exercise.d.ts +1 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +40 -15
  5. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +1 -1
  7. package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +1 -1
  8. package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +1 -1
  9. package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +1 -1
  10. package/lib/exercises/math/calculLitteral/factorisation/factoType2.d.ts.map +1 -1
  11. package/lib/exercises/math/conversion/aeraConversion.js +1 -1
  12. package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -1
  13. package/lib/exercises/math/dataRepresentations/functionGraphReading.js +12 -4
  14. package/lib/exercises/math/dataRepresentations/index.d.ts +1 -0
  15. package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
  16. package/lib/exercises/math/dataRepresentations/index.js +1 -0
  17. package/lib/exercises/math/dataRepresentations/testGen.d.ts +8 -0
  18. package/lib/exercises/math/dataRepresentations/testGen.d.ts.map +1 -0
  19. package/lib/exercises/math/dataRepresentations/testGen.js +64 -0
  20. package/lib/exercises/math/geometry/areas/circleArea.d.ts.map +1 -1
  21. package/lib/exercises/math/geometry/areas/circleArea.js +19 -8
  22. package/lib/exercises/math/geometry/cartesian/placeAbscissOnLine.js +2 -2
  23. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +2 -2
  24. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -1
  25. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.js +48 -25
  26. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +3 -3
  27. package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +3 -3
  28. package/lib/exercises/math/geometry/volumes/sphereVolume.d.ts.map +1 -1
  29. package/lib/exercises/math/geometry/volumes/sphereVolume.js +31 -16
  30. package/lib/exercises/math/percent/findProportion.js +1 -1
  31. package/lib/exercises/math/percent/valuePercent.js +1 -1
  32. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
  33. package/lib/exercises/math/probaStat/stats1var/averageList.js +32 -18
  34. package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -1
  35. package/lib/geogebra/geogebraConstructor.d.ts +1 -0
  36. package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
  37. package/lib/geogebra/geogebraConstructor.js +3 -0
  38. package/lib/index.d.ts +3 -0
  39. package/lib/index.d.ts.map +1 -1
  40. package/lib/math/utils/random/randTupleInt.d.ts +4 -4
  41. package/lib/math/utils/random/randTupleInt.d.ts.map +1 -1
  42. package/lib/math/utils/random/randTupleInt.js +12 -8
  43. package/lib/tests/questionTest.d.ts.map +1 -1
  44. package/lib/tests/questionTest.js +2 -2
  45. package/package.json +1 -1
@@ -59,6 +59,7 @@ export type GeogebraOptions = {
59
59
  yAxis?: GeogebraAxisOptions;
60
60
  zAxis?: GeogebraAxisOptions;
61
61
  viewDirectionVector?: number[];
62
+ fontSize?: number;
62
63
  };
63
64
  export type KeyboardOptions = {
64
65
  parenthesisShouldNotProduceLeftRight?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD,eAAO,MAAM,YAAY,UAChB,WAAW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ACZ,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,oBAAoB,GACpB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"multiplyDecimalByTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAqEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
1
+ {"version":3,"file":"multiplyDecimalByTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAmGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAmBvD,CAAC"}
@@ -6,29 +6,50 @@ import { DivideNode } from "../../../../tree/nodes/operators/divideNode.js";
6
6
  import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
7
7
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
8
8
  import { pluralize } from "../../../../utils/strings/pluralize.js";
9
- const getMultiplyDecimalByTensQuestion = () => {
10
- const dec = DecimalConstructor.random(1, 200, randint(1, 5));
11
- const pow = randint(1, 4);
9
+ const getInstruction = (identifiers) => {
10
+ const { dec, pow, isDivide } = identifiers;
12
11
  const factor = Math.pow(10, pow);
13
- const isDivide = coinFlip();
14
- const answer = dec
12
+ const statement = new (isDivide ? DivideNode : MultiplyNode)(dec.toTree(), factor.toTree());
13
+ return `Calculer : $${statement.toTex()}$`;
14
+ };
15
+ const getHint = (identifiers) => {
16
+ const { dec, pow, isDivide } = identifiers;
17
+ const factor = Math.pow(10, pow);
18
+ return `${isDivide ? "Diviser" : "Multiplier"} par $${factor.frenchify()}$ revient à déplacer la virgule de $${pow}$ ${pluralize("position", pow)} vers la ${isDivide ? "gauche" : "droite"}.`;
19
+ };
20
+ const getAnswer = (identifiers) => {
21
+ const { dec, pow, isDivide } = identifiers;
22
+ const answer = new Decimal(dec)
15
23
  .multiplyByPowerOfTen(isDivide ? -pow : pow)
16
24
  .toTree()
17
25
  .toTex();
26
+ return answer;
27
+ };
28
+ const getCorrection = (identifiers) => {
29
+ const { dec, pow, isDivide } = identifiers;
30
+ const factor = Math.pow(10, pow);
18
31
  const statement = new (isDivide ? DivideNode : MultiplyNode)(dec.toTree(), factor.toTree());
19
- const question = {
20
- answer,
21
- instruction: `Calculer : $${statement.toTex()}$`,
22
- keys: [],
23
- answerFormat: "tex",
24
- identifiers: { dec: dec.value, pow, isDivide },
25
- hint: `${isDivide ? "Diviser" : "Multiplier"} par $${factor.frenchify()}$ revient à déplacer la virgule de $${pow}$ ${pluralize("position", pow)} vers la ${isDivide ? "gauche" : "droite"}.`,
26
- correction: `On déplace la virgule de $${pow}$ ${pluralize("position", pow)} vers la ${isDivide ? "gauche" : "droite"} :
32
+ const answer = getAnswer(identifiers);
33
+ return `On déplace la virgule de $${pow}$ ${pluralize("position", pow)} vers la ${isDivide ? "gauche" : "droite"} :
27
34
 
28
35
  $$
29
36
  ${statement.toTex()} = ${answer}
30
37
  $$
31
- `,
38
+ `;
39
+ };
40
+ const getMultiplyDecimalByTensQuestion = () => {
41
+ const dec = DecimalConstructor.random(1, 200, randint(1, 5));
42
+ const pow = randint(1, 4);
43
+ const isDivide = coinFlip();
44
+ const identifiers = { dec: dec.value, pow, isDivide };
45
+ const question = {
46
+ answer: getAnswer(identifiers),
47
+ instruction: getInstruction(identifiers),
48
+ keys: [],
49
+ answerFormat: "tex",
50
+ identifiers,
51
+ hint: getHint(identifiers),
52
+ correction: getCorrection(identifiers),
32
53
  };
33
54
  return question;
34
55
  };
@@ -55,7 +76,7 @@ const isAnswerValid = (ans, { answer }) => {
55
76
  export const multiplyDecimalByTens = {
56
77
  id: "multiplyDecimalByTens",
57
78
  connector: "=",
58
- label: "Multiplier/diviser un décimal par une puissance de $10$",
79
+ label: "Multiplier/diviser un décimal par $10$, $100$, ou $1000$",
59
80
  levels: [],
60
81
  isSingleStep: true,
61
82
  sections: [],
@@ -66,4 +87,8 @@ export const multiplyDecimalByTens = {
66
87
  isAnswerValid,
67
88
  subject: "Mathématiques",
68
89
  hasHintAndCorrection: true,
90
+ getInstruction,
91
+ getCorrection,
92
+ getHint,
93
+ getAnswer,
69
94
  };
@@ -132,7 +132,7 @@ const isAnswerValid = (ans, { integer, integerFirst, rational }) => {
132
132
  export const fractionAndIntegerDivision = {
133
133
  id: "fractionAndIntegerDivision",
134
134
  connector: "=",
135
- label: "Division d'un entier et d'une fraction",
135
+ label: "Division d'un entier par une fraction et vice-versa",
136
136
  levels: ["4ème", "3ème", "2nde", "2ndPro", "1rePro", "CAP"],
137
137
  isSingleStep: false,
138
138
  sections: ["Fractions"],
@@ -114,7 +114,7 @@ const isAnswerValid = (ans, { integer, rational, integerFirst, answer }, opts) =
114
114
  export const fractionAndIntegerProduct = {
115
115
  id: "fractionAndIntegerProduct",
116
116
  connector: "=",
117
- label: "Produit d'un entier et d'une fraction",
117
+ label: "Produit d'un entier par une fraction",
118
118
  levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro"],
119
119
  isSingleStep: false,
120
120
  sections: ["Fractions"],
@@ -142,7 +142,7 @@ const options = [
142
142
  export const equationType2Exercise = {
143
143
  id: "equa2",
144
144
  connector: "\\iff",
145
- label: "Équations $ax=b$",
145
+ label: "Résoudre une équation du type $ax=b$",
146
146
  levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
147
147
  sections: ["Équations"],
148
148
  isSingleStep: true,
@@ -93,7 +93,7 @@ const isAnswerValid = (ans, { answer, a, b, c }) => {
93
93
  export const equationType3Exercise = {
94
94
  id: "equa3",
95
95
  connector: "\\iff",
96
- label: "Équations $ax+b=c$",
96
+ label: "Résoudre une équation du type $ax+b=c$",
97
97
  levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
98
98
  sections: ["Équations"],
99
99
  isSingleStep: false,
@@ -87,7 +87,7 @@ const isAnswerValid = (ans, { a, b, c, d }) => {
87
87
  export const equationType4Exercise = {
88
88
  id: "equa4",
89
89
  connector: "\\iff",
90
- label: "Équations $ax+b=cx+d$",
90
+ label: "Résoudre une équation du type $ax+b=cx+d$",
91
91
  levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
92
92
  sections: ["Équations"],
93
93
  isSingleStep: false,
@@ -1 +1 @@
1
- {"version":3,"file":"factoType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAkIF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAiB5C,CAAC"}
1
+ {"version":3,"file":"factoType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAkIF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAiB5C,CAAC"}
@@ -104,7 +104,7 @@ export const aeraConversion = {
104
104
  connector: "=",
105
105
  getPropositions,
106
106
  isAnswerValid,
107
- label: "Conversion des aires",
107
+ label: "Conversion d'aires",
108
108
  isSingleStep: true,
109
109
  generator: (nb) => getDistinctQuestions(getAeraConversion, nb),
110
110
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"functionGraphReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/functionGraphReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqFF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAiBtD,CAAC;;AAEF,UAAU;AACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGE"}
1
+ {"version":3,"file":"functionGraphReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/functionGraphReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8FF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAiBtD,CAAC;;AAEF,UAAU;AACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGE"}
@@ -30,9 +30,11 @@ const getGGBOptions = (identifiers) => {
30
30
  const xValue = (yValue - b) / a;
31
31
  const ggb = new GeogebraConstructor({
32
32
  commands: [
33
- `Function(${a}*x+${b}, 0, 10000)`,
34
- `Text("\\tiny Nombre \\ de \\ participants", (x(Corner(2)), -200), true, true, -1, -1)`,
35
- `Text("\\tiny Coût \\ en \\ €", (-5, y(Corner(4))), true, true)`,
33
+ `f = Function(${a}*x+${b}, 0, 1000)`,
34
+ `SetCaption(f, "$(d_1)$")`,
35
+ `ShowLabel(f,true)`,
36
+ `Text("Nombre \\ de \\ participants", (x(Corner(2)),50), true, true, -1)`,
37
+ `Text("Coût \\ en \\ €", (1, y(Corner(4))), true, true)`,
36
38
  ],
37
39
  forbidShiftDragZoom: false,
38
40
  gridDistance: [2, 500],
@@ -47,9 +49,15 @@ const getGGBOptions = (identifiers) => {
47
49
  steps: 500,
48
50
  showPositive: true,
49
51
  },
52
+ fontSize: 14,
50
53
  });
54
+ const xMin = -2;
55
+ const xMax = xValue + 6;
56
+ const xDelta = xMax - xMin;
57
+ const yMin = -100;
58
+ const yMax = Math.max(yValue + 500, xDelta);
51
59
  return ggb.getOptions({
52
- coords: [-5, xValue + 10, -500, yValue + 500],
60
+ coords: [-1, xValue + 6, -100, yValue + 500],
53
61
  });
54
62
  };
55
63
  const getKeys = (identifiers) => {
@@ -1,3 +1,4 @@
1
1
  export * from "./tableReading.js";
2
2
  export * from "./pieChartReading.js";
3
+ export * from "./testGen.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAGlC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAGlC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC"}
@@ -2,3 +2,4 @@ export * from "./tableReading.js";
2
2
  // export * from "./barChartReading.js";
3
3
  // export * from "./functionGraphReading.js";
4
4
  export * from "./pieChartReading.js";
5
+ export * from "./testGen.js";
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ rand: number;
4
+ hasTwoAnswers: boolean;
5
+ };
6
+ export declare const testGen: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=testGen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testGen.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/testGen.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAsDF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAezC,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { coinFlip } from "../../../utils/alea/coinFlip.js";
4
+ import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
5
+ const getPropositions = (n, { answer, hasTwoAnswers, rand }) => {
6
+ const propositions = [];
7
+ // addValidProp(propositions, answer);
8
+ addValidProp(propositions, "vrai", "raw");
9
+ tryToAddWrongProp(propositions, "faux un", "raw");
10
+ tryToAddWrongProp(propositions, "faux deux", "raw");
11
+ if (hasTwoAnswers) {
12
+ addValidProp(propositions, "vrai deux", "raw");
13
+ }
14
+ else {
15
+ tryToAddWrongProp(propositions, "faux trois", "raw");
16
+ }
17
+ return shuffleProps(propositions, n);
18
+ };
19
+ const getAnswer = (identifiers) => {
20
+ return "bizarre d'avoir answer dans QCM";
21
+ };
22
+ const getInstruction = (identifiers) => {
23
+ return "Test qcm";
24
+ };
25
+ const getKeys = (identifiers) => {
26
+ return [];
27
+ };
28
+ const isAnswerValid = (ans, { answer }) => {
29
+ try {
30
+ throw Error("VEA not implemented");
31
+ }
32
+ catch (err) {
33
+ return handleVEAError(err);
34
+ }
35
+ };
36
+ const getTestGenQuestion = (ops) => {
37
+ const identifiers = {
38
+ rand: Math.random(),
39
+ hasTwoAnswers: coinFlip(),
40
+ };
41
+ const question = {
42
+ answer: getAnswer(identifiers),
43
+ instruction: getInstruction(identifiers),
44
+ keys: getKeys(identifiers),
45
+ answerFormat: "tex",
46
+ identifiers,
47
+ };
48
+ return question;
49
+ };
50
+ export const testGen = {
51
+ id: "testGen",
52
+ label: "test qcm",
53
+ isSingleStep: true,
54
+ generator: (nb, opts) => getDistinctQuestions(() => getTestGenQuestion(opts), nb),
55
+ qcmTimer: 60,
56
+ freeTimer: 60,
57
+ getPropositions,
58
+ isAnswerValid,
59
+ subject: "Mathématiques",
60
+ getInstruction,
61
+ getAnswer,
62
+ isQCM: true,
63
+ answerType: "QCM",
64
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"circleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/circleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAwCF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAa5C,CAAC"}
1
+ {"version":3,"file":"circleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/circleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAmDF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAe5C,CAAC"}
@@ -4,21 +4,30 @@ import { randint } from "../../../../math/utils/random/randint.js";
4
4
  import { round } from "../../../../math/utils/round.js";
5
5
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
6
6
  import { shuffle } from "../../../../utils/alea/shuffle.js";
7
- const getCircleArea = () => {
8
- const radius = randint(1, 13);
9
- const diametre = randint(1, 21);
10
- const coin = coinFlip();
7
+ const getInstruction = (identifiers) => {
8
+ const { coin, radius, diametre } = identifiers;
9
+ return `Calculer l'aire d'un disque de ${coin ? "rayon " + `$${radius}$` : "diamètre " + `$${diametre}$`} cm (arrondir au centième).`;
10
+ };
11
+ const getAnswer = (identifiers) => {
12
+ const { coin, radius, diametre } = identifiers;
11
13
  const answerNb = coin
12
14
  ? round(Math.PI * radius ** 2, 2)
13
15
  : round(Math.PI * (diametre / 2) ** 2, 2);
14
16
  const answer = (answerNb + "").replace(".", ",");
15
17
  const answerTex = answer + "\\text{cm}^2";
18
+ return answerTex;
19
+ };
20
+ const getCircleArea = () => {
21
+ const radius = randint(1, 13);
22
+ const diametre = randint(1, 21);
23
+ const coin = coinFlip();
24
+ const identifiers = { coin, diametre, radius };
16
25
  const question = {
17
- instruction: `Calculer l'aire d'un cercle de ${coin ? "rayon " + `$${radius}$` : "diamètre " + `$${diametre}$`} cm (arrondir au centième).`,
18
- answer: answerTex,
26
+ instruction: getInstruction(identifiers),
27
+ answer: getAnswer(identifiers),
19
28
  answerFormat: "tex",
20
29
  keys: ["cm", "cm2"],
21
- identifiers: { coin, diametre, radius },
30
+ identifiers,
22
31
  };
23
32
  return question;
24
33
  };
@@ -37,7 +46,7 @@ const isAnswerValid = (ans, { answer }) => {
37
46
  export const circleArea = {
38
47
  id: "circleArea",
39
48
  connector: "=",
40
- label: "Calculer l'aire d'un cercle",
49
+ label: "Calculer l'aire d'un disque",
41
50
  levels: ["4ème", "3ème", "2nde"],
42
51
  isSingleStep: false,
43
52
  sections: ["Aires", "Géométrie euclidienne"],
@@ -47,4 +56,6 @@ export const circleArea = {
47
56
  getPropositions,
48
57
  isAnswerValid,
49
58
  subject: "Mathématiques",
59
+ getInstruction,
60
+ getAnswer,
50
61
  };
@@ -25,9 +25,9 @@ const getStudentGGBOptions = ({ coeff, oneUnitTex, abscissType, }) => {
25
25
  const A = new Point("A", coeff.toTree(), (0).toTree());
26
26
  const commands = [
27
27
  ...O.toGGBCommand(),
28
- `Text("\\small 0", (0, -0.5), false, true, 0, 0)`,
28
+ `Text("\\footnotesize 0", (0, -0.5), false, true, 0, 0)`,
29
29
  ...I.toGGBCommand(),
30
- `Text("\\small ${oneUnitTex}", (1, ${abscissType === NumberType.Rational ? -1 : -0.5}), false, true, 0, 0)`,
30
+ `Text("\\footnotesize ${oneUnitTex}", (1, ${abscissType === NumberType.Rational ? -1 : -0.5}), false, true, 0, 0)`,
31
31
  ];
32
32
  const ggb = new GeogebraConstructor({
33
33
  commands,
@@ -24,9 +24,9 @@ const getStudentGGBOptions = ({ coeff, oneUnitTex, abscissType, }) => {
24
24
  const I = new Point("I", (1).toTree(), (0).toTree());
25
25
  const commands = [
26
26
  ...O.toGGBCommand(),
27
- `Text("\\small 0", (0, -0.5), false, true, 0, 0)`,
27
+ `Text("\\footnotesize 0", (0, -0.5), false, true, 0, 0)`,
28
28
  ...I.toGGBCommand(),
29
- `Text("\\small ${oneUnitTex}", (1, ${abscissType === NumberType.Rational ? -1 : -0.5}), false, true, 0, 0)`,
29
+ `Text("\\footnotesize ${oneUnitTex}", (1, ${abscissType === NumberType.Rational ? -1 : -0.5}), false, true, 0, 0)`,
30
30
  ];
31
31
  const ggb = new GeogebraConstructor({
32
32
  commands,
@@ -1 +1 @@
1
- {"version":3,"file":"pointCoordinatesNoAxisNumbers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyGF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
1
+ {"version":3,"file":"pointCoordinatesNoAxisNumbers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6HF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
@@ -3,18 +3,17 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { Point } from "../../../../math/geometry/point.js";
5
5
  import { randint } from "../../../../math/utils/random/randint.js";
6
- const getPointCoordinatesNoAxisNumbersQuestion = () => {
7
- const x = randint(-10, 10);
8
- const y = randint(-10, 10);
9
- let xMin = x - 2;
10
- let xMax = x + 2;
11
- let yMin = y - 2;
12
- let yMax = y + 2;
13
- yMax = yMax < 2 ? 2 : yMax;
14
- yMin = yMin > -2 ? -2 : yMin;
15
- xMin = xMin > -2 ? -2 : xMin;
16
- xMax = xMax < 2 ? 2 : xMax;
17
- const instruction = `Lire les coordonnées du point $A$ représenté dans le repère ci-dessous : `;
6
+ import { randTupleInt } from "../../../../math/utils/random/randTupleInt.js";
7
+ const getInstruction = (identifiers) => {
8
+ return `Lire les coordonnées du point $A$ représenté dans le repère ci-dessous : `;
9
+ };
10
+ const getAnswer = (identifiers) => {
11
+ const { x, y } = identifiers;
12
+ const A = new Point("A", x.toTree(), y.toTree());
13
+ return A.toCoords();
14
+ };
15
+ const getGGBOptions = (identifiers) => {
16
+ const { x, y } = identifiers;
18
17
  const commands = [
19
18
  `A = (${x}, ${y})`,
20
19
  `ShowLabel(A, true)`,
@@ -23,15 +22,18 @@ const getPointCoordinatesNoAxisNumbersQuestion = () => {
23
22
  `SetFixed(A, true)`,
24
23
  "O = (0,0)",
25
24
  `SetFixed(O, true)`,
25
+ `SetCaption(O, "0")`,
26
26
  `ShowLabel(O, true)`,
27
27
  `SetPointSize(O, 4)`,
28
28
  "I = (1,0)",
29
29
  `SetFixed(I, true)`,
30
+ `SetCaption(I, "1")`,
30
31
  `ShowLabel(I, true)`,
31
32
  `SetPointSize(I, 4)`,
32
33
  "J = (0,1)",
33
34
  `SetFixed(J, true)`,
34
35
  `ShowLabel(J, true)`,
36
+ `SetCaption(J, "1")`,
35
37
  `SetPointSize(J, 4)`,
36
38
  ];
37
39
  const ggb = new GeogebraConstructor({
@@ -43,22 +45,43 @@ const getPointCoordinatesNoAxisNumbersQuestion = () => {
43
45
  hideNumbers: true,
44
46
  },
45
47
  });
46
- const A = new Point("A", x.toTree(), y.toTree());
47
- const question = {
48
- answer: A.toCoords(),
49
- instruction,
50
- ggbOptions: ggb.getOptions({
51
- coords: ggb.getAdaptedCoords({
52
- xMin,
53
- xMax,
54
- yMin,
55
- yMax,
56
- forceShowAxes: true,
57
- }),
48
+ let xMin = x - 2;
49
+ let xMax = x + 2;
50
+ let yMin = y - 2;
51
+ let yMax = y + 2;
52
+ yMax = yMax < 2 ? 2 : yMax;
53
+ yMin = yMin > -2 ? -2 : yMin;
54
+ xMin = xMin > -2 ? -2 : xMin;
55
+ xMax = xMax < 2 ? 2 : xMax;
56
+ return ggb.getOptions({
57
+ coords: ggb.getAdaptedCoords({
58
+ xMin,
59
+ xMax,
60
+ yMin,
61
+ yMax,
62
+ forceShowAxes: true,
58
63
  }),
64
+ });
65
+ };
66
+ const getPointCoordinatesNoAxisNumbersQuestion = () => {
67
+ const [x, y] = randTupleInt(2, {
68
+ from: -10,
69
+ to: 10,
70
+ allDifferent: true,
71
+ excludes: [
72
+ [0, 0],
73
+ [1, 0],
74
+ [0, 1],
75
+ ],
76
+ });
77
+ const identifiers = { x, y };
78
+ const question = {
79
+ answer: getAnswer(identifiers),
80
+ instruction: getInstruction(identifiers),
81
+ ggbOptions: getGGBOptions(identifiers),
59
82
  keys: ["x", "y", "semicolon"],
60
83
  answerFormat: "tex",
61
- identifiers: { x, y },
84
+ identifiers,
62
85
  };
63
86
  return question;
64
87
  };
@@ -33,9 +33,9 @@ const getGGBOptions = ({ absciss, abscissType, axisUnit, oneUnitTex, coeff, }) =
33
33
  const A = new Point("A", coeff.toTree(), (0).toTree());
34
34
  const commands = [
35
35
  ...O.toGGBCommand(),
36
- `Text("\\small 0", (0, -0.5), false, true, 0, 0)`,
36
+ `Text("\\footnotesize 0", (0, -0.5), false, true, 0, 0)`,
37
37
  ...I.toGGBCommand(),
38
- `Text("\\small ${oneUnitTex}", (1, ${abscissType === NumberType.Rational ? -1 : -0.5}), false, true, 0, 0)`,
38
+ `Text("\\footnotesize ${oneUnitTex}", (1, ${abscissType === NumberType.Rational ? -1 : -0.55}), false, true, 0, 0)`,
39
39
  ...A.toGGBCommand(),
40
40
  ];
41
41
  const ggb = new GeogebraConstructor({
@@ -131,7 +131,7 @@ const getReadAbscissOnLineQuestion = () => {
131
131
  export const readAbscissOnLine = {
132
132
  id: "readAbscissOnLine",
133
133
  connector: "=",
134
- label: "Lire une abscisse sur une droite graduée",
134
+ label: "Lire l'abscisse d'un point sur une droite graduée",
135
135
  isSingleStep: true,
136
136
  generator: (nb) => getDistinctQuestions(getReadAbscissOnLineQuestion, nb),
137
137
  qcmTimer: 60,
@@ -33,9 +33,9 @@ const getGGBOptions = ({ absciss, abscissType, axisUnit, oneUnitTex, coeff, }) =
33
33
  const A = new Point("A", coeff.toTree(), (0).toTree());
34
34
  const commands = [
35
35
  ...O.toGGBCommand(),
36
- `Text("\\small 0", (0, -0.5), false, true, 0, 0)`,
36
+ `Text("\\footnotesize 0", (0, -0.5), false, true, 0, 0)`,
37
37
  ...I.toGGBCommand(),
38
- `Text("\\small ${oneUnitTex}", (1, ${abscissType === NumberType.Rational ? -1 : -0.5}), false, true, 0, 0)`,
38
+ `Text("\\footnotesize ${oneUnitTex}", (1, ${abscissType === NumberType.Rational ? -1 : -0.5}), false, true, 0, 0)`,
39
39
  ...A.toGGBCommand(),
40
40
  ];
41
41
  const ggb = new GeogebraConstructor({
@@ -132,7 +132,7 @@ const getReadAbscissOnSemiLineQuestion = () => {
132
132
  export const readAbscissOnSemiLine = {
133
133
  id: "readAbscissOnSemiLine",
134
134
  connector: "=",
135
- label: "Lire une abscisse sur une demi-droite graduée",
135
+ label: "Lire l'abscisse d'un point sur une demi-droite graduée",
136
136
  isSingleStep: true,
137
137
  generator: (nb) => getDistinctQuestions(getReadAbscissOnSemiLineQuestion, nb),
138
138
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"sphereVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/sphereVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAqFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAa9C,CAAC"}
1
+ {"version":3,"file":"sphereVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/sphereVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAkGF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAgB9C,CAAC"}
@@ -3,17 +3,25 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { randint } from "../../../../math/utils/random/randint.js";
4
4
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
5
  import { round } from "../../../../math/utils/round.js";
6
- const getSphereVolumeQuestion = () => {
7
- const radius = randint(10, 110) / 10;
6
+ const getInstruction = (identifiers) => {
7
+ const { radius } = identifiers;
8
+ return `La boule ci-dessous a un rayon de $${radius.frenchify()}$. Calculer son volume (arrondir au centième).`;
9
+ };
10
+ const getAnswer = (identifiers) => {
11
+ const { radius } = identifiers;
8
12
  const volume = round((4 / 3) * Math.PI * Math.pow(radius, 3), 2)
9
13
  .toTree()
10
14
  .toTex();
11
- const xMin = -radius - 5;
12
- const xMax = radius + 5;
13
- const yMin = -radius - 5;
14
- const yMax = radius + 5;
15
- const zMax = radius + 5;
16
- const zMin = -radius - 5;
15
+ return volume;
16
+ };
17
+ const getGGBOptions = (identifiers) => {
18
+ const { radius } = identifiers;
19
+ const xMin = -radius - 2;
20
+ const xMax = radius + 2;
21
+ const yMin = -radius - 2;
22
+ const yMax = radius + 2;
23
+ const zMax = radius + 2;
24
+ const zMin = -radius - 2;
17
25
  const commands = [
18
26
  `A = (0, 0, 0)`,
19
27
  `Sphere(A, ${radius})`,
@@ -22,20 +30,24 @@ const getSphereVolumeQuestion = () => {
22
30
  ];
23
31
  const ggb = new GeogebraConstructor({
24
32
  commands,
25
- lockedAxesRatio: false,
26
33
  is3D: true,
27
34
  hideAxes: true,
28
35
  hideGrid: true,
29
36
  });
37
+ return ggb.getOptions({
38
+ coords: [xMin, xMax, yMin, yMax, zMin, zMax],
39
+ });
40
+ };
41
+ const getSphereVolumeQuestion = () => {
42
+ const radius = randint(10, 110) / 10;
43
+ const identifiers = { radius };
30
44
  const question = {
31
- answer: volume,
32
- instruction: `La sphère ci-dessous a un rayon de $${radius.frenchify()}$. Calculer son volume (arrondir au centième).`,
33
- ggbOptions: ggb.getOptions({
34
- coords: [xMin, xMax, yMin, yMax, zMin, zMax],
35
- }),
45
+ answer: getAnswer(identifiers),
46
+ instruction: getInstruction(identifiers),
47
+ ggbOptions: getGGBOptions(identifiers),
36
48
  keys: [],
37
49
  answerFormat: "tex",
38
- identifiers: { radius },
50
+ identifiers,
39
51
  };
40
52
  return question;
41
53
  };
@@ -70,7 +82,7 @@ const isAnswerValid = (ans, { answer, radius }) => {
70
82
  };
71
83
  export const sphereVolume = {
72
84
  id: "sphereVolume",
73
- label: "Calculer le volume d'une sphère",
85
+ label: "Calculer le volume d'une boule",
74
86
  levels: ["2nde"],
75
87
  isSingleStep: true,
76
88
  sections: ["Géométrie euclidienne"],
@@ -81,4 +93,7 @@ export const sphereVolume = {
81
93
  isAnswerValid,
82
94
  hasGeogebra: true,
83
95
  subject: "Mathématiques",
96
+ getInstruction,
97
+ getAnswer,
98
+ getGGBOptions,
84
99
  };
@@ -60,7 +60,7 @@ const isAnswerValid = (ans, { answer }) => {
60
60
  export const findProportion = {
61
61
  id: "findProportion",
62
62
  connector: "=",
63
- label: "Calculer une proportion",
63
+ label: "Calculer une proportion en pourcentage",
64
64
  levels: ["4ème", "3ème", "2nde"],
65
65
  isSingleStep: true,
66
66
  sections: ["Pourcentages"],
@@ -36,7 +36,7 @@ const isAnswerValid = (ans, { answer, percent, nb }) => {
36
36
  export const valuePercent = {
37
37
  id: "valuePercent",
38
38
  connector: "=",
39
- label: "Calculer un pourcentage",
39
+ label: "Appliquer un pourcentage",
40
40
  levels: ["3ème", "2ndPro", "2nde", "1reESM", "1rePro"],
41
41
  isSingleStep: true,
42
42
  sections: ["Pourcentages"],
@@ -1 +1 @@
1
- {"version":3,"file":"averageList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA0EF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAe7C,CAAC"}
1
+ {"version":3,"file":"averageList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAqFF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAkB7C,CAAC"}
@@ -15,25 +15,17 @@ $$
15
15
 
16
16
  Calculer la moyenne de cette liste de valeurs (arrondir au centième).`;
17
17
  };
18
- const getAverageListQuestion = () => {
19
- let randomValues = [];
20
- const length = randint(6, 10);
21
- for (let i = 0; i < length; i++)
22
- randomValues.push(randint(1, 20));
23
- const sortedValues = randomValues.sort((a, b) => a - b);
24
- const avg = average(sortedValues);
18
+ const getAnswer = (identifiers) => {
19
+ const { sortedValues } = identifiers;
25
20
  const answer = round(average(sortedValues), 2).frenchify();
21
+ return answer;
22
+ };
23
+ const getCorrection = (identifiers) => {
24
+ const { sortedValues } = identifiers;
25
+ const answer = getAnswer(identifiers);
26
+ const avg = average(sortedValues);
26
27
  const hasRounded = avg.frenchify() !== answer;
27
- const identifiers = { sortedValues };
28
- const question = {
29
- answer,
30
- instruction: getInstruction(identifiers),
31
- keys: [],
32
- answerFormat: "tex",
33
- identifiers,
34
- hint: "La moyenne d'une liste de valeurs est la somme des valeurs divisée par le nombre de valeurs.",
35
- correction: `
36
- On additionne toutes les valeurs :
28
+ return `On additionne toutes les valeurs :
37
29
 
38
30
  $$
39
31
  ${operatorComposition(AddNode, sortedValues.map((e) => e.toTree())).toTex()} = ${sortedValues.reduce((acc, curr) => acc + curr)}
@@ -46,7 +38,26 @@ ${sortedValues.reduce((acc, curr) => acc + curr)}\\div ${sortedValues.length} ${
46
38
  $$
47
39
 
48
40
  La moyenne ${hasRounded ? "arrondie au centième" : ""} est donc $${answer}$.
49
- `,
41
+ `;
42
+ };
43
+ const getHint = (identifiers) => {
44
+ return "La moyenne d'une liste de valeurs est la somme des valeurs divisée par le nombre de valeurs.";
45
+ };
46
+ const getAverageListQuestion = () => {
47
+ let randomValues = [];
48
+ const length = randint(6, 10);
49
+ for (let i = 0; i < length; i++)
50
+ randomValues.push(randint(1, 20));
51
+ const sortedValues = randomValues.sort((a, b) => a - b);
52
+ const identifiers = { sortedValues };
53
+ const question = {
54
+ answer: getAnswer(identifiers),
55
+ instruction: getInstruction(identifiers),
56
+ keys: [],
57
+ answerFormat: "tex",
58
+ identifiers,
59
+ hint: getHint(identifiers),
60
+ correction: getCorrection(identifiers),
50
61
  };
51
62
  return question;
52
63
  };
@@ -77,4 +88,7 @@ export const averageList = {
77
88
  subject: "Mathématiques",
78
89
  hasHintAndCorrection: true,
79
90
  getInstruction,
91
+ getAnswer,
92
+ getHint,
93
+ getCorrection,
80
94
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceEvaluation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/sequenceEvaluation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoLF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAapD,CAAC"}
1
+ {"version":3,"file":"sequenceEvaluation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/sequenceEvaluation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoLF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAapD,CAAC"}
@@ -27,6 +27,7 @@ export declare class GeogebraConstructor {
27
27
  yAxis?: GeogebraAxisOptions;
28
28
  zAxis?: GeogebraAxisOptions;
29
29
  viewDirectionVector?: number[];
30
+ fontSize?: number;
30
31
  constructor(options: Omit<GeogebraOptions, "coords">);
31
32
  getCoordsForPoints(points: Point[]): number[];
32
33
  getAdaptedCoords({ xMin, xMax, yMin, yMax, zMin, zMax, forceShowAxes, }: GetAdaptedCoords): number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AmB,CAAC;IAC5B,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAEN,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC;IAiBpD,kBAAkB,CAAC,MAAM,EAAE,KAAK,EAAE;IAOlC,gBAAgB,CAAC,EACf,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,aAAa,GACd,EAAE,gBAAgB;IAiDnB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,eAAe,GAAG,eAAe;CAoBzD"}
@@ -14,6 +14,7 @@ export class GeogebraConstructor {
14
14
  yAxis;
15
15
  zAxis;
16
16
  viewDirectionVector;
17
+ fontSize;
17
18
  constructor(options) {
18
19
  this.customToolBar = options?.customToolBar ?? toolBarConstructor({});
19
20
  this.forbidShiftDragZoom = options?.forbidShiftDragZoom ?? false;
@@ -29,6 +30,7 @@ export class GeogebraConstructor {
29
30
  this.yAxis = options?.yAxis;
30
31
  this.zAxis = options?.zAxis;
31
32
  this.viewDirectionVector = options?.viewDirectionVector;
33
+ this.fontSize = options?.fontSize;
32
34
  }
33
35
  getCoordsForPoints(points) {
34
36
  const xMin = Math.min(...points.map((p) => p.x.evaluate()));
@@ -103,6 +105,7 @@ export class GeogebraConstructor {
103
105
  yAxis: this.yAxis,
104
106
  zAxis: this.zAxis,
105
107
  viewDirectionVector: this.viewDirectionVector,
108
+ fontSize: this.fontSize,
106
109
  };
107
110
  }
108
111
  }
package/lib/index.d.ts CHANGED
@@ -1888,6 +1888,9 @@ declare const mathExercises: (Exercise<{
1888
1888
  }, {}> | Exercise<{
1889
1889
  points: number[][];
1890
1890
  labels: string[];
1891
+ }, {}> | Exercise<{
1892
+ rand: number;
1893
+ hasTwoAnswers: boolean;
1891
1894
  }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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
- interface randTupleIntOptions {
1
+ interface RandTupleIntOptions {
2
2
  from: number;
3
3
  to?: number;
4
- excludes?: number[];
4
+ excludes?: number[][];
5
5
  allDifferent?: boolean;
6
6
  }
7
7
  /**
@@ -9,7 +9,7 @@ interface randTupleIntOptions {
9
9
  * @param options
10
10
  * @returns array of size "size" with elements = randint(from, to, exxcludes)
11
11
  */
12
- export declare const randTupleInt: (size: number, options: randTupleIntOptions) => number[];
13
- export declare const distinctRandTupleInt: (nb: number, size: number, options: randTupleIntOptions) => number[][];
12
+ export declare const randTupleInt: (size: number, options: RandTupleIntOptions) => number[];
13
+ export declare const distinctRandTupleInt: (nb: number, size: number, options: RandTupleIntOptions) => number[][];
14
14
  export {};
15
15
  //# sourceMappingURL=randTupleInt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"randTupleInt.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/random/randTupleInt.ts"],"names":[],"mappings":"AAGA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,SACjB,MAAM,WACH,mBAAmB,KAC3B,MAAM,EAUR,CAAC;AAEF,eAAO,MAAM,oBAAoB,OAC3B,MAAM,QACJ,MAAM,WACH,mBAAmB,KAC3B,MAAM,EAAE,EAUV,CAAC"}
1
+ {"version":3,"file":"randTupleInt.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/random/randTupleInt.ts"],"names":[],"mappings":"AAGA,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,SACjB,MAAM,WACH,mBAAmB,KAC3B,MAAM,EAiBR,CAAC;AAEF,eAAO,MAAM,oBAAoB,OAC3B,MAAM,QACJ,MAAM,WACH,mBAAmB,KAC3B,MAAM,EAAE,EAUV,CAAC"}
@@ -6,14 +6,18 @@ import { randint } from "./randint.js";
6
6
  * @returns array of size "size" with elements = randint(from, to, exxcludes)
7
7
  */
8
8
  export const randTupleInt = (size, options) => {
9
- const res = [];
10
- for (let i = 0; i < size; i++) {
11
- let x;
12
- do {
13
- x = randint(options.from, options.to, options.excludes);
14
- } while (options.allDifferent && res.includes(x));
15
- res.push(x);
16
- }
9
+ let res = [];
10
+ do {
11
+ res = [];
12
+ for (let i = 0; i < size; i++) {
13
+ let x;
14
+ do {
15
+ x = randint(options.from, options.to);
16
+ } while (options.allDifferent && res.includes(x));
17
+ res.push(x);
18
+ }
19
+ } while (options?.excludes &&
20
+ options.excludes.some((el) => arrayEqual(el, res)));
17
21
  return res;
18
22
  };
19
23
  export const distinctRandTupleInt = (nb, size, options) => {
@@ -1 +1 @@
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;AAIjE,eAAO,MAAM,YAAY,QAAS,QAAQ,YAAY,QAAQ;;;CA2K7D,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;AAIjE,eAAO,MAAM,YAAY,QAAS,QAAQ,YAAY,QAAQ;;;CA8K7D,CAAC"}
@@ -123,8 +123,8 @@ export const questionTest = (exo, question) => {
123
123
  throw new Error(`exo ${exo.id} has too many props`);
124
124
  const rightAnswers = props.filter((prop) => prop.isRightAnswer).length;
125
125
  if (exo.isQCM) {
126
- if (rightAnswers < 2)
127
- throw new Error(`exo ${exo.id} has invalid props`);
126
+ if (rightAnswers < 1)
127
+ throw new Error(`exo ${exo.id} has invalid props, ${props.map((p) => p.statement)}`);
128
128
  }
129
129
  else {
130
130
  if (rightAnswers !== 1)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.24",
4
+ "version": "3.0.25",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [