math-exercises 2.1.17 → 2.1.19

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.
@@ -1 +1 @@
1
- {"version":3,"file":"capacityConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/capacityConversion.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAyDF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
1
+ {"version":3,"file":"capacityConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/capacityConversion.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,0BAA0B,EAAE,MAAM,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAwDF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
@@ -33,9 +33,8 @@ const getPropositions = (n, { answer, randomCapacity, randomUnitIndex, randomUni
33
33
  (0, exercise_1.addValidProp)(propositions, answer);
34
34
  const capacityDecimal = new decimal_1.Decimal(randomCapacity);
35
35
  while (propositions.length < n) {
36
- console.log("capactiy conv qcm");
37
36
  const wrongAnswer = capacityDecimal
38
- .multiplyByPowerOfTen((0, randint_1.randint)(-3, 4, [randomUnitIndex - randomUnitInstructionIndex]))
37
+ .multiplyByPowerOfTen((0, randint_1.randint)(-4, 5, [randomUnitIndex - randomUnitInstructionIndex]))
39
38
  .value.toString()
40
39
  .replace(".", ",");
41
40
  (0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer);
@@ -1 +1 @@
1
- {"version":3,"file":"integralFractions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralFractions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA6LF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAanD,CAAC"}
1
+ {"version":3,"file":"integralFractions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/integral/integralFractions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAgMF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAanD,CAAC"}
@@ -35,7 +35,8 @@ const getIntegralFractionsQuestion = () => {
35
35
  lowerBound = (0, randint_1.randint)(-5, 5, [0]);
36
36
  upperBound = (0, randint_1.randint)(-5, 5, [0]);
37
37
  }
38
- } while (doesTrinomialVanishInInterval(trinomial, lowerBound, upperBound));
38
+ } while (doesTrinomialVanishInInterval(trinomial, lowerBound, upperBound) ||
39
+ affine.calculate(lowerBound) === 0);
39
40
  const fraction = questionType === "Trinomial"
40
41
  ? new fractionNode_1.FractionNode(affine.toTree(), trinomial.toTree())
41
42
  : new fractionNode_1.FractionNode(affine.coefficients[1].toTree(), affine.toTree());
@@ -44,8 +44,8 @@ const getHint = (nb) => {
44
44
  const getCorrection = (tenthPower, nb) => {
45
45
  const powerTen = new powerNode_1.PowerNode((10).toTree(), tenthPower.toTree());
46
46
  return `1 . Exprimez $${nb.toTex()}$ en puissance de $10$ : $${powerTen.toTex()}$ \n
47
- 2 . Utilisez la propriété des logarithmes qui stipule que $log(a^{b}) = b*log(a) \\Leftrightarrow \\log(${powerTen.toTex()}) = ${tenthPower}*log(10)
48
- \\Leftrightarrow log(${nb.toTex()}) = ${tenthPower}$.
47
+ 2 . Utilisez la propriété des logarithmes qui stipule que $\\log(a^{b}) = b\\times \\log(a) \\Leftrightarrow \\log(${powerTen.toTex()}) = ${tenthPower}\\times \\log(10)
48
+ \\Leftrightarrow \\log(${nb.toTex()}) = ${tenthPower}$.
49
49
  `;
50
50
  };
51
51
  const isAnswerValid = (ans, { answer, tenthPower }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAkEtB,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAerD,CAAC"}
1
+ {"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAkEtB,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
@@ -9,7 +9,7 @@ const getIsTableProportionalQuestion = () => {
9
9
  const table = generateTable();
10
10
  const question = {
11
11
  answer: table.coeff ? "Oui" : "Non",
12
- instruction: `On considere le tableau ci-dessous, est-il proportionnel ?${table.table}`,
12
+ instruction: `On considère le tableau ci-dessous. Est-ce un tableau de proportionnalité ?${table.table}`,
13
13
  keys: [],
14
14
  answerFormat: "raw",
15
15
  style: { tableHasNoHeader: true },
@@ -22,7 +22,7 @@ const getPropositions = (n, { answer }) => {
22
22
  (0, exercise_1.addValidProp)(propositions, answer, "raw");
23
23
  (0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
24
24
  (0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
25
- (0, exercise_1.tryToAddWrongProp)(propositions, "On peut pas savoir", "raw");
25
+ (0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
26
26
  return (0, exercise_1.shuffleProps)(propositions, n);
27
27
  };
28
28
  const isAnswerValid = (ans, { answer }) => {
@@ -47,7 +47,7 @@ const generateTable = () => {
47
47
  };
48
48
  const generateYValues = (xValues) => {
49
49
  const flip = (0, coinFlip_1.coinFlip)();
50
- const coeff = (0, randint_1.randint)(1, 5);
50
+ const coeff = (0, randint_1.randint)(2, 6);
51
51
  return flip
52
52
  ? {
53
53
  values: xValues.map((value) => value * (0, randint_1.randint)(2, 5)),
@@ -59,7 +59,7 @@ const generateYValues = (xValues) => {
59
59
  };
60
60
  exports.isTableProportional = {
61
61
  id: "isVTableProportional",
62
- label: "Reconnaître si 2 grandeurs sont proportionnelles à partir d'un tableau.",
62
+ label: "Reconnaître un tableau de proportionnalité",
63
63
  levels: ["5ème"],
64
64
  isSingleStep: true,
65
65
  sections: ["Proportionnalité"],
@@ -41,7 +41,7 @@ const getArcValueQuestion = () => {
41
41
  : selectedFunction === "cos"
42
42
  ? new cosNode_1.CosNode(new variableNode_1.VariableNode("\\theta"))
43
43
  : new tanNode_1.TanNode(new variableNode_1.VariableNode("\\theta"));
44
- const instruction = `Quelle est la valeur en degrés de l'angle $\\theta$ si $${trigNode.toTex()} = ${trigValue.frenchify()}$ ? Arrondir à l'unité.`;
44
+ const instruction = `Quelle est la valeur en degrés de l'angle $\\theta$ sachant que $${trigNode.toTex()} = ${trigValue.frenchify()}$ ? Arrondir à l'unité.`;
45
45
  const answer = (0, round_1.round)(angleInDegrees, 0).toTree().toTex();
46
46
  const question = {
47
47
  answer: answer,
@@ -65,7 +65,7 @@ const isAnswerValid = (ans, { answer }) => {
65
65
  };
66
66
  exports.arcValue = {
67
67
  id: "arcValue",
68
- label: "Calculer l'angle en degrés donné une valeur trigonométrique",
68
+ label: "Calculer un angle via son cosinus/sinus/tangente",
69
69
  levels: ["1reSpé"],
70
70
  isSingleStep: true,
71
71
  sections: ["Trigonométrie"],
@@ -1,6 +1,7 @@
1
1
  import { Exercise } from "../../../exercises/exercise";
2
2
  type Identifiers = {
3
3
  degree: number;
4
+ trigoFunct: string;
4
5
  };
5
6
  export declare const calculateCosSinAndTan: Exercise<Identifiers>;
6
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA0DF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAavD,CAAC"}
1
+ {"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA0DF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAavD,CAAC"}
@@ -13,13 +13,13 @@ const random_1 = require("../../../utils/random");
13
13
  const trigo = ["sin", "tan", "cos"];
14
14
  const getCalculateCosSinAndTanQuestion = () => {
15
15
  const trigoFunct = (0, random_1.random)(trigo);
16
- const degree = (0, randint_1.randint)(1, 360);
16
+ const degree = (0, randint_1.randint)(1, 180);
17
17
  const question = {
18
18
  answer: getCorrectAnswer(degree, trigoFunct),
19
- instruction: `Calculer $${trigoFunct}(${new degree_1.DegreeNode(degree).toTex()})$, arrondir le resultat au dixième.`,
19
+ instruction: `Calculer $\\${trigoFunct}(${new degree_1.DegreeNode(degree).toTex()})$, arrondir le résultat au dixième.`,
20
20
  keys: [],
21
21
  answerFormat: "tex",
22
- identifiers: { degree },
22
+ identifiers: { degree, trigoFunct },
23
23
  };
24
24
  return question;
25
25
  };
@@ -58,7 +58,7 @@ const getCorrectAnswer = (degree, trigoFunct) => {
58
58
  };
59
59
  exports.calculateCosSinAndTan = {
60
60
  id: "calculateCosSinAndTan",
61
- label: "Calcul de tan/sin/cos avec des degrés",
61
+ label: "Calculer le cosinus/sinus/tangente d'un angle en degrés",
62
62
  levels: ["3ème"],
63
63
  isSingleStep: true,
64
64
  sections: ["Trigonométrie"],
@@ -78,7 +78,7 @@ const getHint = (sides, angle) => {
78
78
  const adjacent = sides.filter((value) => value !== hypothenus &&
79
79
  [value.charAt(0), value.charAt(1)].includes(angle))[0];
80
80
  const opposite = sides.filter((value) => value !== hypothenus && value !== adjacent[0])[0];
81
- return `Identifier le côté opposé, le côté adjacent et l'hypoténuse, puis utiliesr la bonne formule de trigonométrie.`;
81
+ return `Identifier le côté opposé, le côté adjacent et l'hypoténuse, puis utiliser la bonne formule de trigonométrie.`;
82
82
  };
83
83
  const getCorrection = (sides, sideLengths, randSideQuestion, randSide, angle, angleValue, answer) => {
84
84
  const hypothenus = { name: sides[2], length: sideLengths[2] };
package/lib/index.d.ts CHANGED
@@ -1284,6 +1284,7 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
1284
1284
  angleInDegrees: number;
1285
1285
  }> | import("./exercises/exercise").Exercise<{
1286
1286
  degree: number;
1287
+ trigoFunct: string;
1287
1288
  }> | import("./exercises/exercise").Exercise<{
1288
1289
  exercise: {
1289
1290
  a: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA/BF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEgD,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-exercises",
3
- "version": "2.1.17",
3
+ "version": "2.1.19",
4
4
  "description": "Math exercises generator for middle school and high school",
5
5
  "main": "lib/index.js",
6
6
  "files": [