math-exercises 1.3.66 → 1.3.67

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 (77) hide show
  1. package/lib/exercises/calcul/arithmetics/euclideanDivision.js +1 -1
  2. package/lib/exercises/calcul/arithmetics/primeNumbers.js +1 -1
  3. package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.js +1 -1
  4. package/lib/exercises/calcul/rounding/rounding.d.ts.map +1 -1
  5. package/lib/exercises/calcul/rounding/rounding.js +0 -1
  6. package/lib/exercises/derivation/derivative/constanteDerivative.d.ts.map +1 -1
  7. package/lib/exercises/derivation/derivative/constanteDerivative.js +7 -2
  8. package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts.map +1 -1
  9. package/lib/exercises/derivation/derivative/expDerivativeOne.js +8 -18
  10. package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts.map +1 -1
  11. package/lib/exercises/derivation/derivative/expDerivativeThree.js +8 -17
  12. package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts.map +1 -1
  13. package/lib/exercises/derivation/derivative/expDerivativeTwo.js +6 -2
  14. package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
  15. package/lib/exercises/derivation/derivative/firstDegreeDerivative.js +7 -2
  16. package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
  17. package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +8 -2
  18. package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts.map +1 -1
  19. package/lib/exercises/derivation/derivative/lnDerivativeOne.js +16 -20
  20. package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
  21. package/lib/exercises/derivation/derivative/lnDerivativeThree.js +14 -5
  22. package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts.map +1 -1
  23. package/lib/exercises/derivation/derivative/lnDerivativeTwo.js +8 -2
  24. package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
  25. package/lib/exercises/derivation/derivative/powerFunctionDerivative.js +7 -2
  26. package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
  27. package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +7 -2
  28. package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
  29. package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +5 -1
  30. package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
  31. package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +5 -1
  32. package/lib/exercises/exercise.d.ts +1 -0
  33. package/lib/exercises/exercise.d.ts.map +1 -1
  34. package/lib/exercises/exercise.js +13 -0
  35. package/lib/exercises/exercises.d.ts.map +1 -1
  36. package/lib/exercises/exercises.js +6 -0
  37. package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
  38. package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +0 -1
  39. package/lib/exercises/limits/polynomeLimit.js +2 -2
  40. package/lib/exercises/limits/sequenceGeometricLimit.d.ts +4 -0
  41. package/lib/exercises/limits/sequenceGeometricLimit.d.ts.map +1 -0
  42. package/lib/exercises/limits/sequenceGeometricLimit.js +51 -0
  43. package/lib/exercises/limits/sequencePolynomLimit.d.ts.map +1 -1
  44. package/lib/exercises/limits/sequencePolynomLimit.js +9 -7
  45. package/lib/exercises/limits/sequencePolynomNoFILimit.d.ts +4 -0
  46. package/lib/exercises/limits/sequencePolynomNoFILimit.d.ts.map +1 -0
  47. package/lib/exercises/limits/sequencePolynomNoFILimit.js +66 -0
  48. package/lib/exercises/limits/sequencePolynomProductLimit.d.ts +4 -0
  49. package/lib/exercises/limits/sequencePolynomProductLimit.d.ts.map +1 -0
  50. package/lib/exercises/limits/sequencePolynomProductLimit.js +74 -0
  51. package/lib/exercises/limits/sequenceRationalFracLimit.d.ts.map +1 -1
  52. package/lib/exercises/limits/sequenceRationalFracLimit.js +12 -8
  53. package/lib/exercises/limits/sequenceSimpleElementsSumLimit.d.ts +4 -0
  54. package/lib/exercises/limits/sequenceSimpleElementsSumLimit.d.ts.map +1 -0
  55. package/lib/exercises/limits/sequenceSimpleElementsSumLimit.js +65 -0
  56. package/lib/exercises/primitve/exponentialPrimitive.js +1 -1
  57. package/lib/exercises/primitve/logarithmePrimitive.js +2 -2
  58. package/lib/exercises/primitve/polynomialPrimitive.js +2 -2
  59. package/lib/exercises/primitve/sinCosPrimitive.js +1 -1
  60. package/lib/exercises/probaStat/quartiles.d.ts.map +1 -1
  61. package/lib/exercises/probaStat/quartiles.js +0 -1
  62. package/lib/exercises/sets/intervals/inequalityToInterval.js +3 -3
  63. package/lib/math/numbers/decimals/decimal.d.ts +1 -1
  64. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  65. package/lib/math/numbers/decimals/decimal.js +2 -1
  66. package/lib/math/numbers/rationals/rational.d.ts +1 -0
  67. package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
  68. package/lib/math/numbers/rationals/rational.js +10 -0
  69. package/lib/math/polynomials/polynomial.d.ts +2 -1
  70. package/lib/math/polynomials/polynomial.d.ts.map +1 -1
  71. package/lib/math/polynomials/polynomial.js +41 -13
  72. package/lib/math/sequences/geometricSequence.d.ts +11 -1
  73. package/lib/math/sequences/geometricSequence.d.ts.map +1 -1
  74. package/lib/math/sequences/geometricSequence.js +65 -2
  75. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  76. package/lib/tree/nodes/operators/powerNode.js +1 -1
  77. package/package.json +1 -1
@@ -58,7 +58,7 @@ function getEuclideanDivisionQuestions() {
58
58
  } while (isDuplicate);
59
59
  res.push(proposition);
60
60
  }
61
- return (0, shuffle_1.shuffle)(res);
61
+ return (0, shuffle_1.shuffle)(res).slice(0, n);
62
62
  };
63
63
  const question = {
64
64
  instruction: `Ecrire la division euclidienne de ${dividend} par ${divisor}`,
@@ -78,7 +78,7 @@ function getPrimeNumbers() {
78
78
  format: 'tex',
79
79
  });
80
80
  }
81
- return (0, shuffle_1.shuffle)(res);
81
+ return (0, shuffle_1.shuffle)(res).slice(0, n);
82
82
  };
83
83
  const question = {
84
84
  startStatement: `${prod}`,
@@ -62,7 +62,7 @@ function getFractionAndIntegerDivision() {
62
62
  } while (isDuplicate);
63
63
  res.push(proposition);
64
64
  }
65
- return (0, shuffle_1.shuffle)(res);
65
+ return (0, shuffle_1.shuffle)(res).slice(0, n);
66
66
  };
67
67
  const question = {
68
68
  instruction: '',
@@ -1 +1 @@
1
- {"version":3,"file":"rounding.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/rounding/rounding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ3E;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,QAYzB,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,QAW5B,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAW7B,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAW7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAW1B,CAAC;AASF,wBAAgB,iBAAiB,CAAC,cAAc,GAAE,MAAU,GAAG,QAAQ,CA0EtE"}
1
+ {"version":3,"file":"rounding.d.ts","sourceRoot":"","sources":["../../../../src/exercises/calcul/rounding/rounding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQ3E;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,QAYzB,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,QAW5B,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAW7B,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAW7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAW1B,CAAC;AASF,wBAAgB,iBAAiB,CAAC,cAAc,GAAE,MAAU,GAAG,QAAQ,CAyEtE"}
@@ -132,7 +132,6 @@ function getRoundQuestions(precisionAsked = 0) {
132
132
  isRightAnswer: false,
133
133
  format: 'tex',
134
134
  };
135
- console.log(proposition);
136
135
  isDuplicate = res.some((p) => p.statement === proposition.statement);
137
136
  } while (isDuplicate);
138
137
  res.push(proposition);
@@ -1 +1 @@
1
- {"version":3,"file":"constanteDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/constanteDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,mBAAmB,EAAE,QAYjC,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,CA6CjD"}
1
+ {"version":3,"file":"constanteDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/constanteDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAM9F,eAAO,MAAM,mBAAmB,EAAE,QAYjC,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,CAmDjD"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getConstanteDerivative = exports.constanteDerivative = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const randint_1 = require("../../../math/utils/random/randint");
6
7
  const shuffle_1 = require("../../../utils/shuffle");
@@ -28,7 +29,11 @@ function getConstanteDerivative() {
28
29
  isRightAnswer: true,
29
30
  format: 'tex',
30
31
  });
31
- for (let i = 0; i < n - 1; i++) {
32
+ (0, exercise_1.tryToAddWrongProp)(propositions, c + '');
33
+ (0, exercise_1.tryToAddWrongProp)(propositions, '1');
34
+ (0, exercise_1.tryToAddWrongProp)(propositions, -c + '');
35
+ const missing = n - propositions.length;
36
+ for (let i = 0; i < missing; i++) {
32
37
  let isDuplicate;
33
38
  let proposition;
34
39
  do {
@@ -49,7 +54,7 @@ function getConstanteDerivative() {
49
54
  instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${c}$.`,
50
55
  startStatement: `f'(x)`,
51
56
  answer: '0',
52
- keys: [],
57
+ keys: ['x'],
53
58
  getPropositions,
54
59
  answerFormat: 'tex',
55
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"expDerivativeOne.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/expDerivativeOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,gBAAgB,EAAE,QAY9B,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,QAAQ,CAqD3C"}
1
+ {"version":3,"file":"expDerivativeOne.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/expDerivativeOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAW9F,eAAO,MAAM,gBAAgB,EAAE,QAY9B,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,QAAQ,CAsC3C"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExpDerivative = exports.expDerivativeOne = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const polynomial_1 = require("../../../math/polynomials/polynomial");
6
7
  const randint_1 = require("../../../math/utils/random/randint");
@@ -26,7 +27,8 @@ exports.expDerivativeOne = {
26
27
  function getExpDerivative() {
27
28
  const a = (0, randint_1.randint)(-9, 10, [0]);
28
29
  const b = (0, randint_1.randint)(-9, 10);
29
- const myfunction = new expNode_1.ExpNode(new polynomial_1.Polynomial([b, a]).toTree());
30
+ const affine = new polynomial_1.Polynomial([b, a]);
31
+ const myfunction = new expNode_1.ExpNode(affine.toTree());
30
32
  const derivative = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), myfunction));
31
33
  const getPropositions = (numOptions) => {
32
34
  const propositions = [];
@@ -36,23 +38,11 @@ function getExpDerivative() {
36
38
  isRightAnswer: true,
37
39
  format: 'tex',
38
40
  });
39
- for (let i = 0; i < numOptions - 1; i++) {
40
- let isDuplicate;
41
- let proposition;
42
- do {
43
- const randomA = (0, randint_1.randint)(-9, 10, [0]);
44
- const randomB = (0, randint_1.randint)(-9, 10);
45
- proposition = {
46
- id: (0, uuid_1.v4)(),
47
- statement: (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(randomA), new expNode_1.ExpNode(new polynomial_1.Polynomial([randomB, randomA]).toTree()))).toTex(),
48
- isRightAnswer: false,
49
- format: 'tex',
50
- };
51
- isDuplicate = propositions.some((p) => p.statement === proposition.statement);
52
- } while (isDuplicate);
53
- propositions.push(proposition);
54
- }
55
- return (0, shuffle_1.shuffle)(propositions);
41
+ (0, exercise_1.tryToAddWrongProp)(propositions, myfunction.toTex());
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(affine.toTree(), myfunction)).toTex());
43
+ (0, exercise_1.tryToAddWrongProp)(propositions, new expNode_1.ExpNode(new numberNode_1.NumberNode(affine.coefficients[1])).toTex());
44
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(affine.coefficients[0]), myfunction)).toTex());
45
+ return (0, shuffle_1.shuffle)(propositions).slice(0, numOptions);
56
46
  };
57
47
  const question = {
58
48
  instruction: `Déterminer la dérivée de la fonction $f(x) = ${myfunction.toTex()}$.`,
@@ -1 +1 @@
1
- {"version":3,"file":"expDerivativeThree.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/expDerivativeThree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAU3E,eAAO,MAAM,kBAAkB,EAAE,QAYhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CAsDhD"}
1
+ {"version":3,"file":"expDerivativeThree.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/expDerivativeThree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAY9F,eAAO,MAAM,kBAAkB,EAAE,QAYhC,CAAC;AAEF,wBAAgB,qBAAqB,IAAI,QAAQ,CA8ChD"}
@@ -1,12 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExpDerivativeThree = exports.expDerivativeThree = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const polynomial_1 = require("../../../math/polynomials/polynomial");
6
7
  const randint_1 = require("../../../math/utils/random/randint");
7
8
  const expNode_1 = require("../../../tree/nodes/functions/expNode");
9
+ const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
8
10
  const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
9
11
  const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
12
+ const simplify_1 = require("../../../tree/parsers/simplify");
10
13
  const shuffle_1 = require("../../../utils/shuffle");
11
14
  const uuid_1 = require("uuid");
12
15
  exports.expDerivativeThree = {
@@ -35,23 +38,11 @@ function getExpDerivativeThree() {
35
38
  isRightAnswer: true,
36
39
  format: 'tex',
37
40
  });
38
- for (let i = 0; i < numOptions - 1; i++) {
39
- let isDuplicate;
40
- let proposition;
41
- do {
42
- const randomA = (0, randint_1.randint)(-9, 10, [0]);
43
- const randomB = (0, randint_1.randint)(-9, 10);
44
- proposition = {
45
- id: (0, uuid_1.v4)(),
46
- statement: new multiplyNode_1.MultiplyNode(new polynomial_1.Polynomial([randomB + randomA, randomA]).toTree(), new expNode_1.ExpNode(new variableNode_1.VariableNode('x'))).toTex(),
47
- isRightAnswer: false,
48
- format: 'tex',
49
- };
50
- isDuplicate = propositions.some((p) => p.statement === proposition.statement);
51
- } while (isDuplicate);
52
- propositions.push(proposition);
53
- }
54
- return (0, shuffle_1.shuffle)(propositions);
41
+ (0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new expNode_1.ExpNode(new variableNode_1.VariableNode('x'))).toTex());
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new polynomial_1.Polynomial([b + a, -a]).toTree(), new expNode_1.ExpNode(new variableNode_1.VariableNode('x'))).toTex());
43
+ (0, exercise_1.tryToAddWrongProp)(propositions, a + '');
44
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new variableNode_1.VariableNode('x')), new expNode_1.ExpNode(new variableNode_1.VariableNode('x')))).toTex());
45
+ return (0, shuffle_1.shuffle)(propositions).slice(0, numOptions);
55
46
  };
56
47
  const question = {
57
48
  instruction: `Déterminer la dérivée de la fonction $f(x) = ${myfunction.toTex()}$.`,
@@ -1 +1 @@
1
- {"version":3,"file":"expDerivativeTwo.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/expDerivativeTwo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAY3E,eAAO,MAAM,gBAAgB,EAAE,QAY9B,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,QAAQ,CAsD3C"}
1
+ {"version":3,"file":"expDerivativeTwo.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/expDerivativeTwo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAY9F,eAAO,MAAM,gBAAgB,EAAE,QAY9B,CAAC;AAEF,wBAAgB,gBAAgB,IAAI,QAAQ,CA2D3C"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getExpDerivative = exports.expDerivativeTwo = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const randint_1 = require("../../../math/utils/random/randint");
6
7
  const expNode_1 = require("../../../tree/nodes/functions/expNode"); // Importer le nœud d'exponentielle
@@ -37,7 +38,10 @@ function getExpDerivative() {
37
38
  isRightAnswer: true,
38
39
  format: 'tex',
39
40
  });
40
- for (let i = 0; i < numOptions - 1; i++) {
41
+ (0, exercise_1.tryToAddWrongProp)(propositions, myfunction.toTex());
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, a + '');
43
+ const missing = numOptions - propositions.length;
44
+ for (let i = 0; i < missing; i++) {
41
45
  let isDuplicate;
42
46
  let proposition;
43
47
  do {
@@ -52,7 +56,7 @@ function getExpDerivative() {
52
56
  } while (isDuplicate);
53
57
  propositions.push(proposition);
54
58
  }
55
- return (0, shuffle_1.shuffle)(propositions);
59
+ return (0, shuffle_1.shuffle)(propositions).slice(0, numOptions);
56
60
  };
57
61
  const question = {
58
62
  instruction: `Déterminer la dérivée de la fonction $f(x) = ${myfunction.toTex()}$.`,
@@ -1 +1 @@
1
- {"version":3,"file":"firstDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/firstDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,qBAAqB,EAAE,QAYnC,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CA8CnD"}
1
+ {"version":3,"file":"firstDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/firstDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAO9F,eAAO,MAAM,qBAAqB,EAAE,QAYnC,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CAoDnD"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getFirstDegreeDerivative = exports.firstDegreeDerivative = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const polynomial_1 = require("../../../math/polynomials/polynomial");
6
7
  const randint_1 = require("../../../math/utils/random/randint");
@@ -30,7 +31,11 @@ function getFirstDegreeDerivative() {
30
31
  isRightAnswer: true,
31
32
  format: 'tex',
32
33
  });
33
- for (let i = 0; i < n - 1; i++) {
34
+ (0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([0, a]).toTree().toTex());
35
+ (0, exercise_1.tryToAddWrongProp)(propositions, 'x');
36
+ (0, exercise_1.tryToAddWrongProp)(propositions, b + '');
37
+ const missing = n - propositions.length;
38
+ for (let i = 0; i < missing; i++) {
34
39
  let isDuplicate;
35
40
  let proposition;
36
41
  do {
@@ -45,7 +50,7 @@ function getFirstDegreeDerivative() {
45
50
  } while (isDuplicate);
46
51
  propositions.push(proposition);
47
52
  }
48
- return (0, shuffle_1.shuffle)(propositions);
53
+ return (0, shuffle_1.shuffle)(propositions).slice(0, n);
49
54
  };
50
55
  const question = {
51
56
  instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial.toString()}$.`,
@@ -1 +1 @@
1
- {"version":3,"file":"inverseFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/inverseFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAM3E,eAAO,MAAM,yBAAyB,EAAE,QAYvC,CAAC;AAEF,wBAAgB,4BAA4B,IAAI,QAAQ,CA6CvD"}
1
+ {"version":3,"file":"inverseFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/inverseFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAM9F,eAAO,MAAM,yBAAyB,EAAE,QAYvC,CAAC;AAEF,wBAAgB,4BAA4B,IAAI,QAAQ,CAoDvD"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInverseFunctionDerivative = exports.inverseFunctionDerivative = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const randint_1 = require("../../../math/utils/random/randint");
6
7
  const shuffle_1 = require("../../../utils/shuffle");
@@ -28,7 +29,12 @@ function getInverseFunctionDerivative() {
28
29
  isRightAnswer: true,
29
30
  format: 'tex',
30
31
  });
31
- for (let i = 0; i < n - 1; i++) {
32
+ (0, exercise_1.tryToAddWrongProp)(propositions, `\\frac{${a}}{x^2}`);
33
+ (0, exercise_1.tryToAddWrongProp)(propositions, `\\frac{${a}}{x}`);
34
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${a}`);
35
+ (0, exercise_1.tryToAddWrongProp)(propositions, `\\frac{${2 * a}}{x}`);
36
+ const missing = n - propositions.length;
37
+ for (let i = 0; i < missing; i++) {
32
38
  let isDuplicate;
33
39
  let proposition;
34
40
  do {
@@ -43,7 +49,7 @@ function getInverseFunctionDerivative() {
43
49
  } while (isDuplicate);
44
50
  propositions.push(proposition);
45
51
  }
46
- return (0, shuffle_1.shuffle)(propositions);
52
+ return (0, shuffle_1.shuffle)(propositions).slice(0, n);
47
53
  };
48
54
  const question = {
49
55
  instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) =\\frac{${a}}{x}$.`,
@@ -1 +1 @@
1
- {"version":3,"file":"lnDerivativeOne.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/lnDerivativeOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAU3E,eAAO,MAAM,eAAe,EAAE,QAY7B,CAAC;AAEF,wBAAgB,eAAe,IAAI,QAAQ,CAoD1C"}
1
+ {"version":3,"file":"lnDerivativeOne.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/lnDerivativeOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAc9F,eAAO,MAAM,eAAe,EAAE,QAY7B,CAAC;AAEF,wBAAgB,eAAe,IAAI,QAAQ,CAqC1C"}
@@ -1,11 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLnDerivative = exports.lnDerivativeOne = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const polynomial_1 = require("../../../math/polynomials/polynomial");
6
7
  const randint_1 = require("../../../math/utils/random/randint");
8
+ const expNode_1 = require("../../../tree/nodes/functions/expNode");
9
+ const logNode_1 = require("../../../tree/nodes/functions/logNode");
7
10
  const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
8
11
  const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
12
+ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
9
13
  const simplify_1 = require("../../../tree/parsers/simplify");
10
14
  const shuffle_1 = require("../../../utils/shuffle");
11
15
  const uuid_1 = require("uuid");
@@ -25,7 +29,9 @@ exports.lnDerivativeOne = {
25
29
  function getLnDerivative() {
26
30
  const a = (0, randint_1.randint)(-9, 10, [0]);
27
31
  const b = (0, randint_1.randint)(-9, 10);
28
- const derivative = (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(a), new polynomial_1.Polynomial([b, a]).toTree()));
32
+ const polynom = new polynomial_1.Polynomial([b, a]);
33
+ const derivative = (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(a), polynom.toTree()));
34
+ const logTree = new logNode_1.LogNode(polynom.toTree());
29
35
  const getPropositions = (numOptions) => {
30
36
  const propositions = [];
31
37
  propositions.push({
@@ -34,29 +40,19 @@ function getLnDerivative() {
34
40
  isRightAnswer: true,
35
41
  format: 'tex',
36
42
  });
37
- for (let i = 0; i < numOptions - 1; i++) {
38
- let isDuplicate;
39
- let proposition;
40
- do {
41
- const randomA = (0, randint_1.randint)(-9, 10, [0]);
42
- const randomB = (0, randint_1.randint)(-9, 10);
43
- proposition = {
44
- id: (0, uuid_1.v4)(),
45
- statement: (0, simplify_1.simplifyNode)(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(randomA), new polynomial_1.Polynomial([randomB, randomA]).toTree())).toTex(),
46
- isRightAnswer: false,
47
- format: 'tex',
48
- };
49
- isDuplicate = propositions.some((p) => p.statement === proposition.statement);
50
- } while (isDuplicate);
51
- propositions.push(proposition);
52
- }
53
- return (0, shuffle_1.shuffle)(propositions);
43
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), logTree)).toTex());
44
+ (0, exercise_1.tryToAddWrongProp)(propositions, a + '');
45
+ (0, exercise_1.tryToAddWrongProp)(propositions, new expNode_1.ExpNode(polynom.toTree()).toTex());
46
+ (0, exercise_1.tryToAddWrongProp)(propositions, polynom.toTree().toTex());
47
+ (0, exercise_1.tryToAddWrongProp)(propositions, `\\frac{${a}}{${logTree.toTex()}}`);
48
+ (0, exercise_1.tryToAddWrongProp)(propositions, `\\frac{1}{${polynom.toTree().toTex()}}`);
49
+ return (0, shuffle_1.shuffle)(propositions).slice(0, numOptions);
54
50
  };
55
51
  const question = {
56
- instruction: `Déterminer la dérivée de la fonction $f(x) = \\ln(${new polynomial_1.Polynomial([b, a])})$.`,
52
+ instruction: `Déterminer la dérivée de la fonction $f(x) = ${logTree.toTex()}$.`,
57
53
  startStatement: "f'(x)",
58
54
  answer: derivative.toTex(),
59
- keys: ['ln'],
55
+ keys: ['x', 'ln', 'epower'],
60
56
  getPropositions,
61
57
  answerFormat: 'tex',
62
58
  };
@@ -1 +1 @@
1
- {"version":3,"file":"lnDerivativeThree.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/lnDerivativeThree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAc3E,eAAO,MAAM,iBAAiB,EAAE,QAY/B,CAAC;AAEF,wBAAgB,eAAe,IAAI,QAAQ,CA8D1C"}
1
+ {"version":3,"file":"lnDerivativeThree.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/lnDerivativeThree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAc9F,eAAO,MAAM,iBAAiB,EAAE,QAY/B,CAAC;AAEF,wBAAgB,eAAe,IAAI,QAAQ,CAqE1C"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLnDerivative = exports.lnDerivativeThree = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const polynomial_1 = require("../../../math/polynomials/polynomial");
6
7
  const randint_1 = require("../../../math/utils/random/randint");
@@ -29,8 +30,9 @@ exports.lnDerivativeThree = {
29
30
  function getLnDerivative() {
30
31
  const a = (0, randint_1.randint)(-9, 10, [0]);
31
32
  const b = (0, randint_1.randint)(-9, 10);
32
- const myfunction = new multiplyNode_1.MultiplyNode(new polynomial_1.Polynomial([b, a]).toTree(), new logNode_1.LogNode(new variableNode_1.VariableNode('x')));
33
- const derivative = (0, simplify_1.simplifyNode)(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new logNode_1.LogNode(new variableNode_1.VariableNode('x'))), new fractionNode_1.FractionNode(new polynomial_1.Polynomial([b, a]).toTree(), new variableNode_1.VariableNode('x'))));
33
+ const affine = new polynomial_1.Polynomial([b, a]).toTree();
34
+ const myfunction = new multiplyNode_1.MultiplyNode(affine, new logNode_1.LogNode(new variableNode_1.VariableNode('x')));
35
+ const derivative = (0, simplify_1.simplifyNode)(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new logNode_1.LogNode(new variableNode_1.VariableNode('x'))), new fractionNode_1.FractionNode(affine, new variableNode_1.VariableNode('x'))));
34
36
  const getPropositions = (numOptions) => {
35
37
  const propositions = [];
36
38
  propositions.push({
@@ -39,7 +41,14 @@ function getLnDerivative() {
39
41
  isRightAnswer: true,
40
42
  format: 'tex',
41
43
  });
42
- for (let i = 0; i < numOptions - 1; i++) {
44
+ (0, exercise_1.tryToAddWrongProp)(propositions, new fractionNode_1.FractionNode(new numberNode_1.NumberNode(a), new variableNode_1.VariableNode('x')).toTex());
45
+ (0, exercise_1.tryToAddWrongProp)(propositions, new fractionNode_1.FractionNode(affine, new variableNode_1.VariableNode('x')).toTex());
46
+ if (a === 1)
47
+ (0, exercise_1.tryToAddWrongProp)(propositions, '\\ln\\left(x\\right)');
48
+ else
49
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${a}\\ln\\left(x\\right)`);
50
+ const missing = numOptions - propositions.length;
51
+ for (let i = 0; i < missing; i++) {
43
52
  let isDuplicate;
44
53
  let proposition;
45
54
  do {
@@ -55,13 +64,13 @@ function getLnDerivative() {
55
64
  } while (isDuplicate);
56
65
  propositions.push(proposition);
57
66
  }
58
- return (0, shuffle_1.shuffle)(propositions);
67
+ return (0, shuffle_1.shuffle)(propositions).slice(0, numOptions);
59
68
  };
60
69
  const question = {
61
70
  instruction: `Déterminer la dérivée de la fonction $f(x) = ${myfunction.toTex()} $.`,
62
71
  startStatement: "f'(x)",
63
72
  answer: derivative.toTex(),
64
- keys: ['ln'],
73
+ keys: ['x', 'ln', 'epower'],
65
74
  getPropositions,
66
75
  answerFormat: 'tex',
67
76
  };
@@ -1 +1 @@
1
- {"version":3,"file":"lnDerivativeTwo.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/lnDerivativeTwo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAa3E,eAAO,MAAM,eAAe,EAAE,QAY7B,CAAC;AAEF,wBAAgB,eAAe,IAAI,QAAQ,CAoD1C"}
1
+ {"version":3,"file":"lnDerivativeTwo.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/lnDerivativeTwo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAc9F,eAAO,MAAM,eAAe,EAAE,QAY7B,CAAC;AAEF,wBAAgB,eAAe,IAAI,QAAQ,CA4D1C"}
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLnDerivative = exports.lnDerivativeTwo = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const randint_1 = require("../../../math/utils/random/randint");
7
+ const expNode_1 = require("../../../tree/nodes/functions/expNode");
6
8
  const logNode_1 = require("../../../tree/nodes/functions/logNode");
7
9
  const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
8
10
  const addNode_1 = require("../../../tree/nodes/operators/addNode");
@@ -38,7 +40,11 @@ function getLnDerivative() {
38
40
  isRightAnswer: true,
39
41
  format: 'tex',
40
42
  });
41
- for (let i = 0; i < numOptions - 1; i++) {
43
+ (0, exercise_1.tryToAddWrongProp)(propositions, new addNode_1.AddNode(new fractionNode_1.FractionNode(new numberNode_1.NumberNode(a), new variableNode_1.VariableNode('x')), new numberNode_1.NumberNode(b)).toTex());
44
+ (0, exercise_1.tryToAddWrongProp)(propositions, a + '');
45
+ (0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new expNode_1.ExpNode(new variableNode_1.VariableNode('x'))).toTex());
46
+ const missing = numOptions - propositions.length;
47
+ for (let i = 0; i < missing; i++) {
42
48
  let isDuplicate;
43
49
  let proposition;
44
50
  do {
@@ -59,7 +65,7 @@ function getLnDerivative() {
59
65
  instruction: `Déterminer la dérivée de la fonction $f(x) = ${myfunction.toTex()}$.`,
60
66
  startStatement: "f'(x)",
61
67
  answer: derivative.toTex(),
62
- keys: ['ln'],
68
+ keys: ['x', 'ln', 'epower'],
63
69
  getPropositions,
64
70
  answerFormat: 'tex',
65
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"powerFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/powerFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAW3E,eAAO,MAAM,uBAAuB,EAAE,QAYrC,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,QAAQ,CA2DrD"}
1
+ {"version":3,"file":"powerFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/powerFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAW9F,eAAO,MAAM,uBAAuB,EAAE,QAYrC,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,QAAQ,CAwErD"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPowerFunctionDerivative = exports.powerFunctionDerivative = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const randint_1 = require("../../../math/utils/random/randint");
6
7
  const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
@@ -36,7 +37,11 @@ function getPowerFunctionDerivative() {
36
37
  isRightAnswer: true,
37
38
  format: 'tex',
38
39
  });
39
- for (let i = 0; i < numOptions - 1; i++) {
40
+ (0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new powerNode_1.PowerNode(new variableNode_1.VariableNode('x'), new numberNode_1.NumberNode(n - 1))).toTex());
41
+ (0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a * n), new powerNode_1.PowerNode(new variableNode_1.VariableNode('x'), new numberNode_1.NumberNode(n))).toTex());
42
+ (0, exercise_1.tryToAddWrongProp)(propositions, new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a - 1), new powerNode_1.PowerNode(new variableNode_1.VariableNode('x'), new numberNode_1.NumberNode(n))).toTex());
43
+ const missing = n - propositions.length;
44
+ for (let i = 0; i < missing; i++) {
40
45
  let isDuplicate;
41
46
  let proposition;
42
47
  do {
@@ -51,7 +56,7 @@ function getPowerFunctionDerivative() {
51
56
  } while (isDuplicate);
52
57
  propositions.push(proposition);
53
58
  }
54
- return (0, shuffle_1.shuffle)(propositions);
59
+ return (0, shuffle_1.shuffle)(propositions).slice(0, n);
55
60
  };
56
61
  const question = {
57
62
  instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) =${statement.toTex()}$.`,
@@ -1 +1 @@
1
- {"version":3,"file":"rootFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/rootFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,sBAAsB,EAAE,QAYpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CAkEpD"}
1
+ {"version":3,"file":"rootFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/rootFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAO9F,eAAO,MAAM,sBAAsB,EAAE,QAYpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CAuEpD"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRootFunctionDerivative = exports.rootFunctionDerivative = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const randint_1 = require("../../../math/utils/random/randint");
6
7
  const round_1 = require("../../../math/utils/round");
@@ -29,7 +30,7 @@ function getRootFunctionDerivative() {
29
30
  instruction += `$-\\sqrt{x}$.`;
30
31
  else
31
32
  instruction += `$${a}\\sqrt{x}$.`;
32
- if (a / 2 === (0, round_1.round)(a / 2, 0))
33
+ if (a % 2 === 0)
33
34
  answer = `\\frac{${a / 2}}{\\sqrt{x}}`;
34
35
  else
35
36
  answer = `\\frac{${a}}{2\\sqrt{x}}`;
@@ -41,7 +42,11 @@ function getRootFunctionDerivative() {
41
42
  isRightAnswer: true,
42
43
  format: 'tex',
43
44
  });
44
- for (let i = 0; i < numOptions - 1; i++) {
45
+ (0, exercise_1.tryToAddWrongProp)(propositions, `\\frac{${a}}{\\sqrt(x)}`);
46
+ (0, exercise_1.tryToAddWrongProp)(propositions, `${a}`);
47
+ (0, exercise_1.tryToAddWrongProp)(propositions, `\\frac{${a}}{x}`);
48
+ const missing = numOptions - propositions.length;
49
+ for (let i = 0; i < missing; i++) {
45
50
  let isDuplicate;
46
51
  let proposition;
47
52
  do {
@@ -1 +1 @@
1
- {"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,sBAAsB,EAAE,QAYpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CAqDpD"}
1
+ {"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAO9F,eAAO,MAAM,sBAAsB,EAAE,QAYpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CA4DpD"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSecondDegreeDerivative = exports.secondDegreeDerivative = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const polynomial_1 = require("../../../math/polynomials/polynomial");
6
7
  const randint_1 = require("../../../math/utils/random/randint");
@@ -31,7 +32,10 @@ function getSecondDegreeDerivative() {
31
32
  isRightAnswer: true,
32
33
  format: 'tex',
33
34
  });
34
- for (let i = 0; i < numOptions - 1; i++) {
35
+ (0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([coefficients[0], coefficients[1]]).toTree().toTex());
36
+ (0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([coefficients[0] + coefficients[1], coefficients[1]]).toTree().toTex());
37
+ const missing = numOptions - propositions.length;
38
+ for (let i = 0; i < missing; i++) {
35
39
  let isDuplicate;
36
40
  let proposition;
37
41
  do {
@@ -1 +1 @@
1
- {"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3E,eAAO,MAAM,qBAAqB,EAAE,QAYnC,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CAwDnD"}
1
+ {"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAO9F,eAAO,MAAM,qBAAqB,EAAE,QAYnC,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,QAAQ,CAiEnD"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getThirdDegreeDerivative = exports.thirdDegreeDerivative = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
4
5
  const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
5
6
  const polynomial_1 = require("../../../math/polynomials/polynomial");
6
7
  const randint_1 = require("../../../math/utils/random/randint");
@@ -34,7 +35,10 @@ function getThirdDegreeDerivative() {
34
35
  isRightAnswer: true,
35
36
  format: 'tex',
36
37
  });
37
- for (let i = 0; i < numOptions - 1; i++) {
38
+ (0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([coefficients[0], coefficients[1], coefficients[2]]).toTree().toTex());
39
+ (0, exercise_1.tryToAddWrongProp)(propositions, new polynomial_1.Polynomial([coefficients[0] + coefficients[1], coefficients[1], coefficients[2]]).toTree().toTex());
40
+ const missing = numOptions - propositions.length;
41
+ for (let i = 0; i < missing; i++) {
38
42
  let isDuplicate;
39
43
  let proposition;
40
44
  do {
@@ -1,4 +1,5 @@
1
1
  import { KeyId } from 'react-math-keyboard';
2
+ export declare const tryToAddWrongProp: (props: Proposition[], statement: string, format?: 'tex' | 'raw') => void;
2
3
  export type GeneratorOptions = {};
3
4
  export type Proposition = {
4
5
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,cAAc,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;IAC9D,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,aAAa,GACb,YAAY,GACZ,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,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,eAAe,GACf,UAAU,CAAC"}
1
+ {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,eAAO,MAAM,iBAAiB,UAAW,WAAW,EAAE,aAAa,MAAM,WAAU,KAAK,GAAG,KAAK,SAS/F,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,cAAc,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACvC,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,UAAU,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,EAAE,CAAC;IAC9D,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,aAAa,GACb,YAAY,GACZ,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,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,eAAe,GACf,UAAU,CAAC"}