math-exercises 2.0.7 → 2.0.10

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 (118) hide show
  1. package/lib/exercises/calcul/fractions/index.d.ts +1 -0
  2. package/lib/exercises/calcul/fractions/index.d.ts.map +1 -1
  3. package/lib/exercises/calcul/fractions/index.js +1 -0
  4. package/lib/exercises/calcul/fractions/periodicWritingToFraction.d.ts +9 -0
  5. package/lib/exercises/calcul/fractions/periodicWritingToFraction.d.ts.map +1 -0
  6. package/lib/exercises/calcul/fractions/periodicWritingToFraction.js +80 -0
  7. package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  8. package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.js +2 -1
  9. package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts +6 -0
  10. package/lib/exercises/complex/argumentFromAlgebraicComplex.d.ts.map +1 -1
  11. package/lib/exercises/complex/argumentFromAlgebraicComplex.js +62 -51
  12. package/lib/exercises/complex/index.d.ts +1 -0
  13. package/lib/exercises/complex/index.d.ts.map +1 -1
  14. package/lib/exercises/complex/index.js +1 -0
  15. package/lib/exercises/functions/exponential/expEquation.d.ts +1 -0
  16. package/lib/exercises/functions/exponential/expEquation.d.ts.map +1 -1
  17. package/lib/exercises/functions/logarithm/index.d.ts +2 -0
  18. package/lib/exercises/functions/logarithm/index.d.ts.map +1 -1
  19. package/lib/exercises/functions/logarithm/index.js +2 -1
  20. package/lib/exercises/functions/logarithm/log10PowerSimplifying.d.ts.map +1 -1
  21. package/lib/exercises/functions/logarithm/log10PowerSimplifying.js +3 -2
  22. package/lib/exercises/functions/logarithm/log10Simplifying.d.ts +11 -0
  23. package/lib/exercises/functions/logarithm/log10Simplifying.d.ts.map +1 -0
  24. package/lib/exercises/functions/logarithm/log10Simplifying.js +97 -0
  25. package/lib/exercises/functions/logarithm/logEquation.d.ts.map +1 -1
  26. package/lib/exercises/functions/logarithm/logEquation.js +0 -1
  27. package/lib/exercises/functions/logarithm/logPowerEquation.d.ts +7 -1
  28. package/lib/exercises/functions/logarithm/logPowerEquation.d.ts.map +1 -1
  29. package/lib/exercises/functions/logarithm/logPowerEquation.js +47 -17
  30. package/lib/exercises/trigonometry/associatePoint.d.ts +7 -0
  31. package/lib/exercises/trigonometry/associatePoint.d.ts.map +1 -0
  32. package/lib/exercises/trigonometry/associatePoint.js +64 -0
  33. package/lib/exercises/trigonometry/index.d.ts +1 -0
  34. package/lib/exercises/trigonometry/index.d.ts.map +1 -1
  35. package/lib/exercises/trigonometry/index.js +1 -0
  36. package/lib/exercises/trigonometry/remarkableValues.d.ts +1 -1
  37. package/lib/exercises/trigonometry/remarkableValues.d.ts.map +1 -1
  38. package/lib/exercises/trigonometry/remarkableValues.js +9 -7
  39. package/lib/index.d.ts +22 -3
  40. package/lib/index.d.ts.map +1 -1
  41. package/lib/math/numbers/decimals/decimal.d.ts +3 -0
  42. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  43. package/lib/math/numbers/decimals/decimal.js +8 -0
  44. package/lib/math/numbers/integer/integer.d.ts +1 -1
  45. package/lib/math/numbers/nombre.d.ts +1 -1
  46. package/lib/math/numbers/nombre.js +1 -1
  47. package/lib/math/numbers/reals/extendedRingElement.d.ts +2 -1
  48. package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -1
  49. package/lib/math/polynomials/rationalFrac.d.ts +1 -1
  50. package/lib/math/polynomials/trinom.d.ts +2 -2
  51. package/lib/math/trigonometry/remarkableValue.d.ts +3 -10
  52. package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
  53. package/lib/math/trigonometry/remarkableValue.js +5 -15
  54. package/lib/math/trigonometry/remarkableValues.d.ts +7 -1
  55. package/lib/math/trigonometry/remarkableValues.d.ts.map +1 -1
  56. package/lib/math/trigonometry/remarkableValues.js +63 -13
  57. package/lib/math/utils/arithmetic/gcd.js +1 -1
  58. package/lib/server.js +2 -7
  59. package/lib/tree/nodes/algebraicNode.d.ts +3 -0
  60. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  61. package/lib/tree/nodes/functions/absNode.d.ts +3 -1
  62. package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
  63. package/lib/tree/nodes/functions/absNode.js +5 -1
  64. package/lib/tree/nodes/functions/cosNode.d.ts +3 -1
  65. package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
  66. package/lib/tree/nodes/functions/cosNode.js +21 -0
  67. package/lib/tree/nodes/functions/expNode.d.ts +3 -1
  68. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
  69. package/lib/tree/nodes/functions/expNode.js +4 -0
  70. package/lib/tree/nodes/functions/log10Node.d.ts +3 -1
  71. package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
  72. package/lib/tree/nodes/functions/log10Node.js +28 -0
  73. package/lib/tree/nodes/functions/logNode.d.ts +3 -1
  74. package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
  75. package/lib/tree/nodes/functions/logNode.js +32 -0
  76. package/lib/tree/nodes/functions/oppositeNode.d.ts +3 -0
  77. package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
  78. package/lib/tree/nodes/functions/oppositeNode.js +7 -0
  79. package/lib/tree/nodes/functions/sinNode.d.ts +3 -1
  80. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  81. package/lib/tree/nodes/functions/sinNode.js +21 -0
  82. package/lib/tree/nodes/functions/sqrtNode.d.ts +3 -0
  83. package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
  84. package/lib/tree/nodes/functions/sqrtNode.js +41 -0
  85. package/lib/tree/nodes/geometry/lengthNode.d.ts +5 -1
  86. package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
  87. package/lib/tree/nodes/geometry/lengthNode.js +12 -1
  88. package/lib/tree/nodes/node.d.ts +1 -0
  89. package/lib/tree/nodes/node.d.ts.map +1 -1
  90. package/lib/tree/nodes/node.js +14 -1
  91. package/lib/tree/nodes/numbers/constantNode.d.ts +3 -0
  92. package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
  93. package/lib/tree/nodes/numbers/constantNode.js +7 -0
  94. package/lib/tree/nodes/numbers/numberNode.d.ts +3 -0
  95. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  96. package/lib/tree/nodes/numbers/numberNode.js +7 -0
  97. package/lib/tree/nodes/operators/addNode.d.ts +3 -0
  98. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  99. package/lib/tree/nodes/operators/addNode.js +173 -0
  100. package/lib/tree/nodes/operators/divideNode.d.ts +3 -0
  101. package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
  102. package/lib/tree/nodes/operators/divideNode.js +12 -0
  103. package/lib/tree/nodes/operators/fractionNode.d.ts +3 -0
  104. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  105. package/lib/tree/nodes/operators/fractionNode.js +84 -0
  106. package/lib/tree/nodes/operators/multiplyNode.d.ts +5 -0
  107. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  108. package/lib/tree/nodes/operators/multiplyNode.js +126 -10
  109. package/lib/tree/nodes/operators/powerNode.d.ts +3 -0
  110. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  111. package/lib/tree/nodes/operators/powerNode.js +46 -0
  112. package/lib/tree/nodes/operators/substractNode.d.ts +3 -0
  113. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  114. package/lib/tree/nodes/operators/substractNode.js +12 -0
  115. package/lib/tree/nodes/variables/variableNode.d.ts +3 -0
  116. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  117. package/lib/tree/nodes/variables/variableNode.js +10 -0
  118. package/package.json +1 -1
@@ -6,4 +6,5 @@ export * from "./fractionsDivision";
6
6
  export * from "./fractionsProduct";
7
7
  export * from "./fractionsSum";
8
8
  export * from "./simplifyFraction";
9
+ export * from "./periodicWritingToFraction";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC"}
@@ -22,3 +22,4 @@ __exportStar(require("./fractionsDivision"), exports);
22
22
  __exportStar(require("./fractionsProduct"), exports);
23
23
  __exportStar(require("./fractionsSum"), exports);
24
24
  __exportStar(require("./simplifyFraction"), exports);
25
+ __exportStar(require("./periodicWritingToFraction"), exports);
@@ -0,0 +1,9 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ num: number;
4
+ denum: number;
5
+ leadingPart: number;
6
+ };
7
+ export declare const periodicWritingToFraction: MathExercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=periodicWritingToFraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"periodicWritingToFraction.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/fractions/periodicWritingToFraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA2EF,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,WAAW,CAa/D,CAAC"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.periodicWritingToFraction = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const decimal_1 = require("../../../math/numbers/decimals/decimal");
7
+ const rational_1 = require("../../../math/numbers/rationals/rational");
8
+ const randint_1 = require("../../../math/utils/random/randint");
9
+ /**
10
+ * méthode : x = 0,123123123
11
+ * 1000x = 123,123123
12
+ * 999x = 123
13
+ */
14
+ const getPeriodicWritingToFractionQuestion = () => {
15
+ const periodicPartLength = (0, randint_1.randint)(1, 4);
16
+ const periodicPart = [];
17
+ for (let i = 0; i < periodicPartLength; i++) {
18
+ periodicPart.push((0, randint_1.randint)(periodicPartLength === 1 ? 1 : 0, 10, periodicPart));
19
+ }
20
+ const num = Number("0." + periodicPart.join("")) * 10 ** periodicPartLength;
21
+ let denumString = "";
22
+ for (let i = 0; i < periodicPartLength; i++) {
23
+ denumString += "9";
24
+ }
25
+ const denum = Number(denumString);
26
+ const leadingPart = decimal_1.DecimalConstructor.random(0, 10, (0, randint_1.randint)(0, 3));
27
+ let x = leadingPart.toTree().toTex();
28
+ if (!x.includes(","))
29
+ x += ",";
30
+ for (let i = 0; i < 4; i++) {
31
+ x += periodicPart.join("");
32
+ }
33
+ x += "\\ldots";
34
+ const answer = new rational_1.Rational(num, denum * 10 ** leadingPart.precision)
35
+ .add(leadingPart.toRational())
36
+ .toTree()
37
+ .toTex();
38
+ const question = {
39
+ answer,
40
+ instruction: `Ecrire sous forme de fraction : $${x}$`,
41
+ keys: [],
42
+ answerFormat: "tex",
43
+ identifiers: { num, denum, leadingPart: leadingPart.value },
44
+ };
45
+ return question;
46
+ };
47
+ const getPropositions = (n, { answer, num, denum, leadingPart }) => {
48
+ const propositions = [];
49
+ (0, exercise_1.addValidProp)(propositions, answer);
50
+ const leadingPartDec = new decimal_1.Decimal(leadingPart);
51
+ const increments = [-1, 1, 2];
52
+ for (const i of increments) {
53
+ (0, exercise_1.tryToAddWrongProp)(propositions, new rational_1.Rational(num, denum * 10 ** (leadingPartDec.precision + i))
54
+ .add(leadingPartDec.toRational())
55
+ .toTree()
56
+ .toTex());
57
+ }
58
+ return (0, exercise_1.shuffleProps)(propositions, n);
59
+ };
60
+ const isAnswerValid = (ans, { denum, leadingPart, num }) => {
61
+ const leadingPartDec = new decimal_1.Decimal(leadingPart);
62
+ const answer = new rational_1.Rational(num, denum * 10 ** leadingPartDec.precision)
63
+ .add(leadingPartDec.toRational())
64
+ .toTree();
65
+ const texs = answer.toAllValidTexs();
66
+ return texs.includes(ans);
67
+ };
68
+ exports.periodicWritingToFraction = {
69
+ id: "periodicWritingToFraction",
70
+ connector: "=",
71
+ label: "Passer de l'écriture décimale périodique à l'écriture fractionnaire",
72
+ levels: ["2nde"],
73
+ isSingleStep: true,
74
+ sections: ["Fractions"],
75
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPeriodicWritingToFractionQuestion, nb),
76
+ qcmTimer: 60,
77
+ freeTimer: 60,
78
+ getPropositions,
79
+ isAnswerValid,
80
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA6EF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
1
+ {"version":3,"file":"factoIdRmq3.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calculLitteral/factorisation/factoIdRmq3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AA8EF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
@@ -11,7 +11,8 @@ const randint_1 = require("../../../math/utils/random/randint");
11
11
  const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
12
12
  const getFactoType1Question = () => {
13
13
  const interval = new intervals_1.Interval("[[-10; 10]]").difference(new discreteSet_1.DiscreteSet([new integer_1.Integer(0)]));
14
- const affine = affine_1.AffineConstructor.random(interval, interval);
14
+ const intervalPlus = new intervals_1.Interval("[[1; 10]]");
15
+ const affine = affine_1.AffineConstructor.random(intervalPlus, interval);
15
16
  const affine2 = new affine_1.Affine(affine.a, -affine.b);
16
17
  const statementTree = affine.multiply(affine2).toTree();
17
18
  const answerTree = new multiplyNode_1.MultiplyNode(affine.toTree(), affine2.toTree());
@@ -1 +1,7 @@
1
+ import { MathExercise } from "../../exercises/exercise";
2
+ type Identifiers = {
3
+ arg: number;
4
+ };
5
+ export declare const argumentFromAlgebraicComplex: MathExercise<Identifiers>;
6
+ export {};
1
7
  //# sourceMappingURL=argumentFromAlgebraicComplex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"argumentFromAlgebraicComplex.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/argumentFromAlgebraicComplex.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"argumentFromAlgebraicComplex.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/argumentFromAlgebraicComplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AA4CF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAalE,CAAC"}
@@ -1,52 +1,63 @@
1
1
  "use strict";
2
- // import {
3
- // MathExercise,
4
- // Proposition,
5
- // QCMGenerator,
6
- // Question,
7
- // QuestionGenerator,
8
- // VEA,
9
- // addValidProp,
10
- // shuffleProps,
11
- // tryToAddWrongProp,
12
- // } from "../../exercises/exercise";
13
- // import { getDistinctQuestions } from "../../exercises/utils/getDistinctQuestions";
14
- // import { ComplexConstructor } from "../../math/complex/complex";
15
- // type Identifiers = {
16
- // re: number;
17
- // im: number;
18
- // };
19
- // const getArgumentFromAlgebraicComplexQuestion: QuestionGenerator<
20
- // Identifiers
21
- // > = () => {
22
- // const z = ComplexConstructor.random();
23
- // const zTex = z.toTree().toTex();
24
- // const answer = z.toModuleTree().toTex();
25
- // const question: Question<Identifiers> = {
26
- // answer: answer,
27
- // instruction: `Soit $z=${zTex}$. Déterminer le module $|z|$ de $z$.`,
28
- // keys: [],
29
- // answerFormat: "tex",
30
- // identifiers: { re: z.re, im: z.im },
31
- // };
32
- // return question;
33
- // };
34
- // const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
35
- // const propositions: Proposition[] = [];
36
- // addValidProp(propositions, answer);
37
- // while (propositions.length < n) {}
38
- // return shuffleProps(propositions, n);
39
- // };
40
- // export const argumentFromAlgebraicComplex: MathExercise<Identifiers> = {
41
- // id: "argumentFromAlgebraicComplex",
42
- // connector: "=",
43
- // label: "Déterminer l'argument d'un nombre complexe via sa forme algébrique",
44
- // levels: ["MathExp"],
45
- // isSingleStep: true,
46
- // sections: ["Nombres complexes"],
47
- // generator: (nb: number) =>
48
- // getDistinctQuestions(getArgumentFromAlgebraicComplexQuestion, nb),
49
- // qcmTimer: 60,
50
- // freeTimer: 60,
51
- // getPropositions,
52
- // };
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.argumentFromAlgebraicComplex = void 0;
4
+ const exercise_1 = require("../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
6
+ const integer_1 = require("../../math/numbers/integer/integer");
7
+ const rational_1 = require("../../math/numbers/rationals/rational");
8
+ const remarkableValue_1 = require("../../math/trigonometry/remarkableValue");
9
+ const remarkableValues_1 = require("../../math/trigonometry/remarkableValues");
10
+ const randint_1 = require("../../math/utils/random/randint");
11
+ const complexNode_1 = require("../../tree/nodes/complex/complexNode");
12
+ const sqrtNode_1 = require("../../tree/nodes/functions/sqrtNode");
13
+ const numberNode_1 = require("../../tree/nodes/numbers/numberNode");
14
+ const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
15
+ const random_1 = require("../../utils/random");
16
+ const getArgumentFromAlgebraicComplexQuestion = () => {
17
+ const arg = remarkableValue_1.RemarkableValueConstructor.mainInterval();
18
+ const factor = (0, random_1.random)([
19
+ new integer_1.Integer((0, randint_1.randint)(-5, 6, [0, 1])).toTree(),
20
+ rational_1.RationalConstructor.randomIrreductible().toTree(),
21
+ (0, random_1.random)([new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(2)), new sqrtNode_1.SqrtNode(new numberNode_1.NumberNode(3))]),
22
+ ]);
23
+ const re = new multiplyNode_1.MultiplyNode(factor, arg.cos).simplify();
24
+ const im = new multiplyNode_1.MultiplyNode(factor, arg.sin).simplify();
25
+ const z = new complexNode_1.ComplexNode(re, im);
26
+ const zTex = z.toTex();
27
+ const answer = arg.angle.toTex();
28
+ const question = {
29
+ answer: answer,
30
+ instruction: `Soit $z=${zTex}$. Déterminer l'argument principal de $z$.`,
31
+ keys: ["pi"],
32
+ answerFormat: "tex",
33
+ identifiers: { arg: arg.angle.evaluate({}) },
34
+ };
35
+ return question;
36
+ };
37
+ const getPropositions = (n, { answer }) => {
38
+ const propositions = [];
39
+ (0, exercise_1.addValidProp)(propositions, answer);
40
+ while (propositions.length < n) {
41
+ const randomPoint = remarkableValue_1.RemarkableValueConstructor.mainInterval();
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, randomPoint.angle.toTex());
43
+ }
44
+ return (0, exercise_1.shuffleProps)(propositions, n);
45
+ };
46
+ const isAnswerValid = (ans, { arg }) => {
47
+ const point = remarkableValues_1.remarkableTrigoValues.find((point) => point.angle.evaluate({}) === arg);
48
+ const texs = point.angle.toAllValidTexs();
49
+ return texs.includes(ans);
50
+ };
51
+ exports.argumentFromAlgebraicComplex = {
52
+ id: "argumentFromAlgebraicComplex",
53
+ connector: "=",
54
+ label: "Déterminer l'argument d'un nombre complexe via sa forme algébrique",
55
+ levels: ["MathExp"],
56
+ isSingleStep: true,
57
+ sections: ["Nombres complexes"],
58
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getArgumentFromAlgebraicComplexQuestion, nb),
59
+ qcmTimer: 60,
60
+ freeTimer: 60,
61
+ getPropositions,
62
+ isAnswerValid,
63
+ };
@@ -8,4 +8,5 @@ export * from "./linearCombinaisonComplex";
8
8
  export * from "./moduloFromAlgebraicComplex";
9
9
  export * from "./mutiplyComplex";
10
10
  export * from "./reAndIm";
11
+ export * from "./argumentFromAlgebraicComplex";
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/complex/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,gCAAgC,CAAC"}
@@ -25,3 +25,4 @@ __exportStar(require("./linearCombinaisonComplex"), exports);
25
25
  __exportStar(require("./moduloFromAlgebraicComplex"), exports);
26
26
  __exportStar(require("./mutiplyComplex"), exports);
27
27
  __exportStar(require("./reAndIm"), exports);
28
+ __exportStar(require("./argumentFromAlgebraicComplex"), exports);
@@ -1,4 +1,5 @@
1
1
  import { MathExercise } from "../../../exercises/exercise";
2
+ /**ae^x = k */
2
3
  type Identifiers = {
3
4
  a: number;
4
5
  k: number;
@@ -1 +1 @@
1
- {"version":3,"file":"expEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/exponential/expEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAelC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwEF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
1
+ {"version":3,"file":"expEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/exponential/expEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAelC,cAAc;AACd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwEF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
@@ -1,4 +1,6 @@
1
1
  export * from "./logEquation";
2
2
  export * from "./logSimplifiying";
3
3
  export * from "./log10PowerSimplifying";
4
+ export * from "./logPowerEquation";
5
+ export * from "./log10Simplifying";
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./logEquation"), exports);
18
18
  __exportStar(require("./logSimplifiying"), exports);
19
19
  __exportStar(require("./log10PowerSimplifying"), exports);
20
- // export * from "./logPowerEquation";
20
+ __exportStar(require("./logPowerEquation"), exports);
21
+ __exportStar(require("./log10Simplifying"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAqCF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAa3D,CAAC"}
1
+ {"version":3,"file":"log10PowerSimplifying.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/log10PowerSimplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAqCF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAc3D,CAAC"}
@@ -10,7 +10,7 @@ const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
10
10
  const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
11
11
  const probaFlip_1 = require("../../../utils/probaFlip");
12
12
  const getLog10PowerSimplifyingQuestion = () => {
13
- const tenthPower = (0, randint_1.randint)(-5, 6, [0]);
13
+ const tenthPower = (0, randint_1.randint)(-5, 6, [0, 1]);
14
14
  const shouldEvaluate = (0, probaFlip_1.probaFlip)(0.7);
15
15
  const nb = shouldEvaluate
16
16
  ? new decimal_1.Decimal(1).multiplyByPowerOfTen(tenthPower).toTree()
@@ -45,9 +45,10 @@ exports.log10PowerSimplifying = {
45
45
  levels: ["TermTech", "MathComp"],
46
46
  isSingleStep: true,
47
47
  sections: ["Logarithme décimal", "Puissances"],
48
- generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLog10PowerSimplifyingQuestion, nb),
48
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLog10PowerSimplifyingQuestion, nb, 15),
49
49
  qcmTimer: 60,
50
50
  freeTimer: 60,
51
51
  getPropositions,
52
52
  isAnswerValid,
53
+ maxAllowedQuestions: 15,
53
54
  };
@@ -0,0 +1,11 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ nb: number;
4
+ powers: number[];
5
+ signs: number[];
6
+ isLog10: boolean;
7
+ };
8
+ export declare const log10SumSimplifying: MathExercise<Identifiers>;
9
+ export declare const logSumSimplifying: MathExercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=log10Simplifying.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log10Simplifying.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/log10Simplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAsFF,eAAO,MAAM,mBAAmB,EAAE,YAAY,CAAC,WAAW,CAgBzD,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CAgBvD,CAAC"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logSumSimplifying = exports.log10SumSimplifying = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const randint_1 = require("../../../math/utils/random/randint");
7
+ const log10Node_1 = require("../../../tree/nodes/functions/log10Node");
8
+ const logNode_1 = require("../../../tree/nodes/functions/logNode");
9
+ const oppositeNode_1 = require("../../../tree/nodes/functions/oppositeNode");
10
+ const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
11
+ const addNode_1 = require("../../../tree/nodes/operators/addNode");
12
+ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
13
+ const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
14
+ const operatorComposition_1 = require("../../../tree/utilities/operatorComposition");
15
+ const random_1 = require("../../../utils/random");
16
+ const getLog10SumSimplifyingQuestion = (opts) => {
17
+ const nb = (0, randint_1.randint)(2, 10);
18
+ const nbTerms = (0, randint_1.randint)(2, 4);
19
+ const powers = [];
20
+ const signs = [];
21
+ for (let i = 0; i < nbTerms; i++) {
22
+ const power = (0, randint_1.randint)(powers.includes(1) ? 2 : 1, 6, powers);
23
+ powers.push(power);
24
+ signs.push((0, random_1.random)([-1, 1]));
25
+ }
26
+ const nbNode = new numberNode_1.NumberNode(nb);
27
+ const LNode = opts?.isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
28
+ const logs = powers.map((power, index) => nb ** power < 100
29
+ ? signs[index] > 0
30
+ ? new LNode(new numberNode_1.NumberNode(nb ** power))
31
+ : new oppositeNode_1.OppositeNode(new LNode(new numberNode_1.NumberNode(nb ** power)))
32
+ : signs[index] > 0
33
+ ? new LNode(new powerNode_1.PowerNode(nbNode, new numberNode_1.NumberNode(power)))
34
+ : new oppositeNode_1.OppositeNode(new LNode(new powerNode_1.PowerNode(nbNode, new numberNode_1.NumberNode(power)))));
35
+ const statement = (0, operatorComposition_1.operatorComposition)(addNode_1.AddNode, logs);
36
+ const answer = statement.simplify();
37
+ const question = {
38
+ answer: answer.toTex(),
39
+ instruction: `Simplifier le plus possible l'expression suivante : $${statement.toTex()}$`,
40
+ keys: [opts?.isLog10 ? "log" : "ln"],
41
+ answerFormat: "tex",
42
+ identifiers: { nb, powers, signs, isLog10: opts?.isLog10 ?? false },
43
+ };
44
+ return question;
45
+ };
46
+ const getPropositions = (n, { answer, nb, isLog10 }) => {
47
+ const propositions = [];
48
+ (0, exercise_1.addValidProp)(propositions, answer);
49
+ const LNode = isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
50
+ while (propositions.length < n) {
51
+ (0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode((0, randint_1.randint)(1, 10)), new LNode(new numberNode_1.NumberNode(nb)))
52
+ .simplify()
53
+ .toTex());
54
+ }
55
+ return (0, exercise_1.shuffleProps)(propositions, n);
56
+ };
57
+ const isAnswerValid = (ans, { nb, powers, signs, isLog10 }) => {
58
+ const nbNode = new numberNode_1.NumberNode(nb);
59
+ const LNode = isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
60
+ const logs = powers.map((power, index) => nb ** power < 100
61
+ ? signs[index] > 0
62
+ ? new LNode(new numberNode_1.NumberNode(nb ** power))
63
+ : new oppositeNode_1.OppositeNode(new LNode(new numberNode_1.NumberNode(nb ** power)))
64
+ : signs[index] > 0
65
+ ? new LNode(new powerNode_1.PowerNode(nbNode, new numberNode_1.NumberNode(power)))
66
+ : new oppositeNode_1.OppositeNode(new LNode(new powerNode_1.PowerNode(nbNode, new numberNode_1.NumberNode(power)))));
67
+ const statement = (0, operatorComposition_1.operatorComposition)(addNode_1.AddNode, logs);
68
+ const answer = statement.simplify();
69
+ const texs = answer.toAllValidTexs();
70
+ return texs.includes(ans);
71
+ };
72
+ exports.log10SumSimplifying = {
73
+ id: "log10SumSimplifying",
74
+ connector: "=",
75
+ label: "Simplifer une somme de logarithmes décimaux",
76
+ levels: ["TermTech"],
77
+ isSingleStep: true,
78
+ sections: ["Logarithme décimal"],
79
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getLog10SumSimplifyingQuestion({ isLog10: true }), nb),
80
+ qcmTimer: 60,
81
+ freeTimer: 60,
82
+ getPropositions,
83
+ isAnswerValid,
84
+ };
85
+ exports.logSumSimplifying = {
86
+ id: "logSumSimplifying",
87
+ connector: "=",
88
+ label: "Simplifer une somme de logarithmes népériens",
89
+ levels: ["TermSpé", "MathComp"],
90
+ isSingleStep: true,
91
+ sections: ["Logarithme népérien"],
92
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getLog10SumSimplifyingQuestion({ isLog10: false }), nb),
93
+ qcmTimer: 60,
94
+ freeTimer: 60,
95
+ getPropositions,
96
+ isAnswerValid,
97
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAclC,cAAc;AACd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqEF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
1
+ {"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAclC,cAAc;AACd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoEF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
@@ -56,7 +56,6 @@ const isAnswerValid = (ans, { a, k }) => {
56
56
  new expNode_1.ExpNode(new rational_1.Rational(k, a).simplify().toTree({ allowFractionToDecimal: true })),
57
57
  ]));
58
58
  const texs = answer.toAllValidTexs();
59
- console.log(texs);
60
59
  return texs.includes(ans);
61
60
  };
62
61
  exports.logEquation = {
@@ -1,5 +1,11 @@
1
1
  import { MathExercise } from "../../../exercises/exercise";
2
- type Identifiers = {};
2
+ type Identifiers = {
3
+ a: number;
4
+ powered: number;
5
+ c: number;
6
+ k: number;
7
+ isLog10: boolean;
8
+ };
3
9
  export declare const logPowerEquation: MathExercise<Identifiers>;
4
10
  export declare const log10PowerEquation: MathExercise<Identifiers>;
5
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG,EAAE,CAAC;AAkDtB,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,WAAW,CAatD,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,WAAW,CAgBxD,CAAC"}
1
+ {"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAwGF,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,WAAW,CAatD,CAAC;AACF,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,WAAW,CAgBxD,CAAC"}
@@ -7,6 +7,7 @@ const randint_1 = require("../../../math/utils/random/randint");
7
7
  const equalNode_1 = require("../../../tree/nodes/equations/equalNode");
8
8
  const equationSolutionNode_1 = require("../../../tree/nodes/equations/equationSolutionNode");
9
9
  const log10Node_1 = require("../../../tree/nodes/functions/log10Node");
10
+ const logNode_1 = require("../../../tree/nodes/functions/logNode");
10
11
  const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
11
12
  const addNode_1 = require("../../../tree/nodes/operators/addNode");
12
13
  const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
@@ -17,41 +18,70 @@ const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
17
18
  /**a*b^x+c=d */
18
19
  const getLogPowerEquationQuestion = (opts) => {
19
20
  const powered = (0, randint_1.randint)(2, 8);
20
- const a = (0, randint_1.randint)(1, 10);
21
- const c = (0, randint_1.randint)(-5, 5);
22
- const k = (0, randint_1.randint)(5, 15, [powered, 10]);
21
+ const a = (0, randint_1.randint)(1, 10, [powered]);
22
+ const c = (0, randint_1.randint)(-5, 5, [a]);
23
+ const k = (0, randint_1.randint)(5, 15, [powered]);
23
24
  const d = k * a + c;
24
25
  const xNode = new variableNode_1.VariableNode("x");
25
26
  const poweredNode = new numberNode_1.NumberNode(powered);
27
+ const LNode = opts?.isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
26
28
  const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
27
- new fractionNode_1.FractionNode(new log10Node_1.Log10Node(new numberNode_1.NumberNode(k)), new log10Node_1.Log10Node(poweredNode)),
29
+ new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode(k)), new LNode(poweredNode)).simplify(),
28
30
  ])).toTex();
29
- const equation = new equalNode_1.EqualNode(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new powerNode_1.PowerNode(poweredNode, xNode)), new numberNode_1.NumberNode(c)), new numberNode_1.NumberNode(d));
31
+ const equation = new equalNode_1.EqualNode(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new powerNode_1.PowerNode(poweredNode, xNode)), new numberNode_1.NumberNode(c)).simplify(), new numberNode_1.NumberNode(d));
32
+ const keys = [
33
+ "log",
34
+ "x",
35
+ "equal",
36
+ "S",
37
+ "lbrace",
38
+ "semicolon",
39
+ "rbrace",
40
+ ];
41
+ keys.push(opts?.isLog10 ? "log" : "ln");
30
42
  const question = {
31
43
  answer,
32
44
  instruction: `Résoudre : $${equation.toTex()}$`,
33
- keys: ["log", "x", "equal", "lbrace", "semicolon", "rbrace"],
45
+ keys,
34
46
  answerFormat: "tex",
35
- identifiers: {},
47
+ identifiers: { a, c, k, powered, isLog10: opts?.isLog10 ?? false },
36
48
  };
37
49
  return question;
38
50
  };
39
- const getPropositions = (n, { answer }) => {
51
+ const getPropositions = (n, { answer, isLog10, a, c, k, powered }) => {
40
52
  const propositions = [];
41
53
  (0, exercise_1.addValidProp)(propositions, answer);
42
- while (propositions.length < n) { }
54
+ const LNode = isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
55
+ const withoutLogs = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
56
+ new fractionNode_1.FractionNode(new numberNode_1.NumberNode(k), new numberNode_1.NumberNode(powered)).simplify(),
57
+ ]));
58
+ (0, exercise_1.tryToAddWrongProp)(propositions, withoutLogs.toTex());
59
+ while (propositions.length < n) {
60
+ (0, exercise_1.tryToAddWrongProp)(propositions, new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
61
+ new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode((0, randint_1.randint)(2, 10))), new LNode(new numberNode_1.NumberNode((0, randint_1.randint)(2, 10)))).simplify(),
62
+ ])).toTex());
63
+ }
43
64
  return (0, exercise_1.shuffleProps)(propositions, n);
44
65
  };
45
- const isAnswerValid = (ans, { answer }) => {
46
- return true;
66
+ const isAnswerValid = (ans, { a, c, k, powered, isLog10 }) => {
67
+ const LNode = isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
68
+ const poweredNode = new numberNode_1.NumberNode(powered);
69
+ const answerSimp = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
70
+ new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode(k)), new LNode(poweredNode)).simplify(),
71
+ ]));
72
+ const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
73
+ new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode(k)), new LNode(poweredNode)),
74
+ ]));
75
+ const texs = [...answerSimp.toAllValidTexs(), ...answer.toAllValidTexs()];
76
+ return texs.includes(ans);
47
77
  };
48
78
  exports.logPowerEquation = {
49
79
  id: "logPowerEquation",
50
80
  connector: "\\iff",
51
- label: "",
52
- levels: [],
81
+ label: "Résoudre une équation du type $a\\times b^x + c = d$",
82
+ levels: ["TermSpé", "MathComp"],
53
83
  isSingleStep: true,
54
- sections: [],
84
+ sections: ["Logarithme népérien", "Puissances"],
55
85
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getLogPowerEquationQuestion, nb),
56
86
  qcmTimer: 60,
57
87
  freeTimer: 60,
@@ -61,10 +91,10 @@ exports.logPowerEquation = {
61
91
  exports.log10PowerEquation = {
62
92
  id: "log10PowerEquation",
63
93
  connector: "\\iff",
64
- label: "",
65
- levels: [],
94
+ label: "Résoudre une équation du type $a\\times b^x + c = d$",
95
+ levels: ["TermSpé", "MathComp"],
66
96
  isSingleStep: true,
67
- sections: [],
97
+ sections: ["Logarithme décimal", "Puissances"],
68
98
  generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getLogPowerEquationQuestion({ isLog10: true }), nb),
69
99
  qcmTimer: 60,
70
100
  freeTimer: 60,
@@ -0,0 +1,7 @@
1
+ import { MathExercise } from "../../exercises/exercise";
2
+ type Identifiers = {
3
+ angleValue: number;
4
+ };
5
+ export declare const associatePoint: MathExercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=associatePoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"associatePoint.d.ts","sourceRoot":"","sources":["../../../src/exercises/trigonometry/associatePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAqDF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAapD,CAAC"}