math-exercises 2.2.78 → 2.2.80

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 (152) hide show
  1. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.d.ts +5 -1
  2. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
  3. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.js +95 -20
  4. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.d.ts +4 -1
  5. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.d.ts.map +1 -1
  6. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType1.js +104 -26
  7. package/lib/exercises/math/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
  8. package/lib/exercises/math/derivation/derivative/firstDegreeDerivative.js +44 -5
  9. package/lib/exercises/math/derivation/derivative/lnDerivativeOne.d.ts.map +1 -1
  10. package/lib/exercises/math/derivation/derivative/lnDerivativeOne.js +17 -7
  11. package/lib/exercises/math/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
  12. package/lib/exercises/math/derivation/derivative/lnDerivativeThree.js +46 -27
  13. package/lib/exercises/math/derivation/derivative/lnDerivativeTwo.js +1 -1
  14. package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
  15. package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +57 -26
  16. package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
  17. package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.js +50 -8
  18. package/lib/exercises/math/derivation/derivative/secondDerivativeOfExpoFunction.js +1 -1
  19. package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
  20. package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +67 -13
  21. package/lib/exercises/math/derivation/derivative/usualderivative.d.ts.map +1 -1
  22. package/lib/exercises/math/derivation/derivative/usualderivative.js +1 -2
  23. package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
  24. package/lib/exercises/math/functions/affines/signFunction.js +66 -27
  25. package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
  26. package/lib/exercises/math/functions/basics/graphicInequation.js +57 -36
  27. package/lib/exercises/math/functions/exponential/expEquation.js +1 -1
  28. package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts +9 -0
  29. package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -0
  30. package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +124 -0
  31. package/lib/exercises/math/functions/exponentials/index.d.ts +2 -0
  32. package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -0
  33. package/lib/exercises/math/functions/exponentials/index.js +17 -0
  34. package/lib/exercises/math/functions/index.d.ts +1 -0
  35. package/lib/exercises/math/functions/index.d.ts.map +1 -1
  36. package/lib/exercises/math/functions/index.js +1 -0
  37. package/lib/exercises/math/functions/integral/integralFractions.js +1 -1
  38. package/lib/exercises/math/functions/logarithm/log10Simplifying.d.ts.map +1 -1
  39. package/lib/exercises/math/functions/logarithm/log10Simplifying.js +6 -2
  40. package/lib/exercises/math/functions/logarithm/logEquation.d.ts.map +1 -1
  41. package/lib/exercises/math/functions/logarithm/logEquation.js +22 -14
  42. package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
  43. package/lib/exercises/math/functions/logarithm/logPowerEquation.js +14 -12
  44. package/lib/exercises/math/functions/logarithm/logSimplifiying.d.ts.map +1 -1
  45. package/lib/exercises/math/functions/logarithm/logSimplifiying.js +36 -16
  46. package/lib/exercises/math/geometry/areas/rectangleArea.d.ts.map +1 -1
  47. package/lib/exercises/math/geometry/areas/rectangleArea.js +5 -2
  48. package/lib/exercises/math/geometry/vectors/vectorLinearCombination.js +4 -4
  49. package/lib/exercises/math/index.d.ts +1 -0
  50. package/lib/exercises/math/index.d.ts.map +1 -1
  51. package/lib/exercises/math/index.js +1 -0
  52. package/lib/exercises/math/matrices/matrixInversibilityDomain.js +1 -0
  53. package/lib/exercises/math/percent/applyPercent.d.ts.map +1 -1
  54. package/lib/exercises/math/percent/applyPercent.js +2 -0
  55. package/lib/exercises/math/percent/findEndValueAfterEvolution.d.ts +8 -0
  56. package/lib/exercises/math/percent/findEndValueAfterEvolution.d.ts.map +1 -0
  57. package/lib/exercises/math/percent/findEndValueAfterEvolution.js +104 -0
  58. package/lib/exercises/math/percent/index.d.ts +1 -0
  59. package/lib/exercises/math/percent/index.d.ts.map +1 -1
  60. package/lib/exercises/math/percent/index.js +1 -0
  61. package/lib/exercises/math/powers/index.d.ts +1 -0
  62. package/lib/exercises/math/powers/index.d.ts.map +1 -1
  63. package/lib/exercises/math/powers/index.js +1 -0
  64. package/lib/exercises/math/powers/powersMixOperations.d.ts +11 -0
  65. package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -0
  66. package/lib/exercises/math/powers/powersMixOperations.js +99 -0
  67. package/lib/exercises/math/primitive/logarithmePrimitive.d.ts.map +1 -1
  68. package/lib/exercises/math/primitive/logarithmePrimitive.js +11 -3
  69. package/lib/exercises/math/sampling/confidenceInterval.d.ts +9 -0
  70. package/lib/exercises/math/sampling/confidenceInterval.d.ts.map +1 -0
  71. package/lib/exercises/math/sampling/confidenceInterval.js +134 -0
  72. package/lib/exercises/math/sampling/fluctuationInterval.d.ts +9 -0
  73. package/lib/exercises/math/sampling/fluctuationInterval.d.ts.map +1 -0
  74. package/lib/exercises/math/sampling/fluctuationInterval.js +131 -0
  75. package/lib/exercises/math/sampling/index.d.ts +4 -0
  76. package/lib/exercises/math/sampling/index.d.ts.map +1 -0
  77. package/lib/exercises/math/sampling/index.js +19 -0
  78. package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts +11 -0
  79. package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts.map +1 -0
  80. package/lib/exercises/math/sampling/isSamplingRepresentative.js +116 -0
  81. package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts +9 -0
  82. package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts.map +1 -0
  83. package/lib/exercises/math/sequences/geometric/geometricVariations.js +124 -0
  84. package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
  85. package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
  86. package/lib/exercises/math/sequences/geometric/index.js +1 -0
  87. package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
  88. package/lib/exercises/math/sets/intervals/inequalityToInterval.js +11 -11
  89. package/lib/exercises/options/inequationSolutionFormat.d.ts +3 -0
  90. package/lib/exercises/options/inequationSolutionFormat.d.ts.map +1 -0
  91. package/lib/exercises/options/inequationSolutionFormat.js +12 -0
  92. package/lib/exercises/pc/pH.js +1 -1
  93. package/lib/index.d.ts +35 -2
  94. package/lib/index.d.ts.map +1 -1
  95. package/lib/math/numbers/integer/integer.d.ts +1 -1
  96. package/lib/math/numbers/rationals/rational.d.ts +3 -1
  97. package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
  98. package/lib/math/numbers/rationals/rational.js +3 -1
  99. package/lib/math/numbers/reals/real.d.ts +1 -1
  100. package/lib/playground.d.ts.map +1 -1
  101. package/lib/playground.js +6 -1
  102. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  103. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  104. package/lib/tree/nodes/inequations/inequationNode.d.ts +5 -2
  105. package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
  106. package/lib/tree/nodes/inequations/inequationNode.js +40 -3
  107. package/lib/tree/nodes/numbers/numberNode.d.ts +2 -2
  108. package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
  109. package/lib/tree/nodes/numbers/numberNode.js +7 -1
  110. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  111. package/lib/tree/nodes/operators/addNode.js +15 -1
  112. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  113. package/lib/tree/nodes/operators/fractionNode.js +8 -0
  114. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  115. package/lib/tree/nodes/operators/multiplyNode.js +4 -0
  116. package/lib/tree/nodes/polynomials/monomNode.d.ts +6 -0
  117. package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
  118. package/lib/tree/nodes/polynomials/monomNode.js +126 -2
  119. package/lib/tree/nodes/sets/intervalNode.d.ts +2 -2
  120. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  121. package/lib/tree/nodes/sets/intervalNode.js +2 -2
  122. package/lib/tree/nodes/sets/setNode.d.ts +1 -0
  123. package/lib/tree/nodes/sets/setNode.d.ts.map +1 -1
  124. package/lib/tree/nodes/sets/unionIntervalNode.d.ts +1 -1
  125. package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
  126. package/lib/tree/nodes/sets/unionIntervalNode.js +1 -1
  127. package/lib/tree/parsers/affineParser.d.ts.map +1 -1
  128. package/lib/tree/parsers/affineParser.js +2 -1
  129. package/lib/tree/parsers/inequationParser.d.ts +7 -0
  130. package/lib/tree/parsers/inequationParser.d.ts.map +1 -0
  131. package/lib/tree/parsers/inequationParser.js +30 -0
  132. package/lib/tree/parsers/intervalParser.d.ts +8 -0
  133. package/lib/tree/parsers/intervalParser.d.ts.map +1 -0
  134. package/lib/tree/parsers/intervalParser.js +44 -0
  135. package/lib/tree/parsers/latexParser.d.ts.map +1 -1
  136. package/lib/tree/parsers/latexParser.js +29 -6
  137. package/lib/tree/parsers/monomParser.d.ts +1 -3
  138. package/lib/tree/parsers/monomParser.d.ts.map +1 -1
  139. package/lib/tree/parsers/monomParser.js +7 -129
  140. package/lib/tree/parsers/polynomialParser.d.ts.map +1 -1
  141. package/lib/tree/parsers/polynomialParser.js +2 -1
  142. package/lib/tree/parsers/powerParser.d.ts +1 -1
  143. package/lib/tree/parsers/powerParser.d.ts.map +1 -1
  144. package/lib/tree/parsers/powerParser.js +2 -1
  145. package/lib/tree/parsers/rationalParser.d.ts +1 -1
  146. package/lib/tree/parsers/trinomParser.js +2 -2
  147. package/lib/tree/parsers/unionIntervalParser.d.ts +9 -0
  148. package/lib/tree/parsers/unionIntervalParser.d.ts.map +1 -0
  149. package/lib/tree/parsers/unionIntervalParser.js +26 -0
  150. package/lib/types/keyIds.d.ts +1 -1
  151. package/lib/types/keyIds.d.ts.map +1 -1
  152. package/package.json +1 -1
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exponentialsVariations = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const rational_1 = require("../../../../math/numbers/rationals/rational");
7
+ const randfloat_1 = require("../../../../math/utils/random/randfloat");
8
+ const nodeConstructor_1 = require("../../../../tree/nodes/nodeConstructor");
9
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
10
+ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
11
+ const coinFlip_1 = require("../../../../utils/alea/coinFlip");
12
+ const getPropositions = (n, { answer }) => {
13
+ const propositions = [];
14
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
15
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Strictement croissante", "raw");
16
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Strictement décroissante", "raw");
17
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Constante", "raw");
18
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Non monotone", "raw");
19
+ return (0, exercise_1.shuffleProps)(propositions, n);
20
+ };
21
+ const getAnswer = (identifiers) => {
22
+ const qEv = (0, nodeConstructor_1.reifyAlgebraic)(identifiers.q).evaluate();
23
+ if (qEv > 1) {
24
+ return identifiers.a > 0
25
+ ? "Strictement croissante"
26
+ : "Strictement décroissante";
27
+ }
28
+ else {
29
+ return identifiers.a > 0
30
+ ? "Strictement décroissante"
31
+ : "Strictement croissante";
32
+ }
33
+ };
34
+ const getInstruction = (identifiers) => {
35
+ const q = (0, nodeConstructor_1.reifyAlgebraic)(identifiers.q);
36
+ const a = identifiers.a;
37
+ const statement = (0, multiplyNode_1.multiply)(a, (0, powerNode_1.power)(q, "x")).simplify();
38
+ return `Soit $f$ la fonction définie sur $[0; +\\infty[$ par
39
+
40
+ $$
41
+ f(x) = ${statement.toTex()}
42
+ $$
43
+
44
+ Quel est le sens de variations de $f$ sur $[0; +\\infty[$ ?`;
45
+ };
46
+ const getHint = (identifiers) => {
47
+ return `Sur $[0; +\\infty[$, la fonction $f(x) = a^x$ est :
48
+
49
+ - strictement croissante si $a>1$;
50
+ - strictement décroissante si $0<a<1$.
51
+
52
+ Puis, multiplier $f$ par un nombre positif ne change pas son sens de variations, tandis que multiplier par un nombre negatif inverse le sens de variations.
53
+ `;
54
+ };
55
+ const getCorrection = (identifiers) => {
56
+ const q = (0, nodeConstructor_1.reifyAlgebraic)(identifiers.q);
57
+ const qEv = q.evaluate();
58
+ const qLessThanOne = qEv < 1;
59
+ const a = identifiers.a;
60
+ const answer = getAnswer(identifiers);
61
+ const statement = (0, multiplyNode_1.multiply)(a, (0, powerNode_1.power)(q, "x")).simplify();
62
+ return `Puisque $${qLessThanOne ? `0 < ${q.toTex()} < 1` : `${q.toTex()}>1`}$, la fonction $${(0, powerNode_1.power)(q, "x").toTex()}$ est strictement ${qLessThanOne ? "décroissante" : " croissante"} sur $[0; +\\infty[$.
63
+
64
+ En multipliant $${(0, powerNode_1.power)(q, "x").toTex()}$ par $${a.frenchify()} ${a < 0 ? "<0" : ">0"}$, ${a < 0
65
+ ? `on inverse son sens de variations.`
66
+ : `on ne change pas son sens de variation.`}
67
+
68
+ Ainsi, la fonction $f(x) = ${statement.toTex()}$ est ${answer.toLocaleLowerCase()} sur $[0; +\\infty[$.
69
+ `;
70
+ };
71
+ const getKeys = (identifiers) => {
72
+ return [];
73
+ };
74
+ const isAnswerValid = (ans, { answer }) => {
75
+ return ans === answer;
76
+ };
77
+ const getExponentialsVariationsQuestion = (ops) => {
78
+ const a = (0, randfloat_1.randfloat)(0.1, 3, 2, [1]) * ((0, coinFlip_1.coinFlip)() ? 1 : -1);
79
+ const qLessThanOne = (0, coinFlip_1.coinFlip)();
80
+ let q;
81
+ if (qLessThanOne) {
82
+ q = (0, coinFlip_1.coinFlip)()
83
+ ? (0, randfloat_1.randfloat)(0.1, 1, 2).toTree()
84
+ : rational_1.RationalConstructor.randomIrreductibleProba().toTree();
85
+ }
86
+ else {
87
+ q = (0, coinFlip_1.coinFlip)()
88
+ ? (0, randfloat_1.randfloat)(1.1, 10, 2).toTree()
89
+ : rational_1.RationalConstructor.randomIrreductible(11, {
90
+ onlySupOne: true,
91
+ }).toTree();
92
+ }
93
+ const identifiers = {
94
+ a,
95
+ q: q.toIdentifiers(),
96
+ };
97
+ const question = {
98
+ answer: getAnswer(identifiers),
99
+ instruction: getInstruction(identifiers),
100
+ keys: getKeys(identifiers),
101
+ answerFormat: "raw",
102
+ identifiers,
103
+ hint: getHint(identifiers),
104
+ correction: getCorrection(identifiers),
105
+ };
106
+ return question;
107
+ };
108
+ exports.exponentialsVariations = {
109
+ id: "exponentialsVariations",
110
+ label: "Déterminer le sens de variations d'une fonction exponentielle du type $f(x) = k\\times a^x$",
111
+ isSingleStep: true,
112
+ generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getExponentialsVariationsQuestion(opts), nb),
113
+ qcmTimer: 60,
114
+ freeTimer: 60,
115
+ getPropositions,
116
+ isAnswerValid,
117
+ subject: "Mathématiques",
118
+ getInstruction,
119
+ getHint,
120
+ getCorrection,
121
+ getAnswer,
122
+ answerType: "QCU",
123
+ hasHintAndCorrection: true,
124
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./exponentialsVariations";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./exponentialsVariations"), exports);
@@ -9,4 +9,5 @@ export * from "./logarithm";
9
9
  export * from "./parity";
10
10
  export * from "./square";
11
11
  export * from "./integral";
12
+ export * from "./exponentials";
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
@@ -25,3 +25,4 @@ __exportStar(require("./logarithm"), exports);
25
25
  __exportStar(require("./parity"), exports);
26
26
  __exportStar(require("./square"), exports);
27
27
  __exportStar(require("./integral"), exports);
28
+ __exportStar(require("./exponentials"), exports);
@@ -47,7 +47,7 @@ const getIntegralFractionsQuestion = () => {
47
47
  const question = {
48
48
  answer: answer.toTex(),
49
49
  instruction: `Calculer : $${integral.toTex()}$`,
50
- keys: ["ln"],
50
+ keys: ["lnBrackets"],
51
51
  answerFormat: "tex",
52
52
  identifiers: {
53
53
  questionType,
@@ -1 +1 @@
1
- {"version":3,"file":"log10Simplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10Simplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,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;AA8FF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAiBnD,CAAC"}
1
+ {"version":3,"file":"log10Simplifying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/log10Simplifying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,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;AAkGF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC;AACF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAiBnD,CAAC"}
@@ -13,6 +13,9 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
13
13
  const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
14
14
  const operatorComposition_1 = require("../../../../tree/utilities/operatorComposition");
15
15
  const random_1 = require("../../../../utils/alea/random");
16
+ const getKeys = (identifiers, opts) => {
17
+ return [opts?.isLog10 ? "logBrackets" : "lnBrackets"];
18
+ };
16
19
  const getLog10SumSimplifyingQuestion = (opts) => {
17
20
  const nb = (0, randint_1.randint)(2, 10);
18
21
  const trueNb = [2, 4, 8].includes(nb) ? 2 : [3, 9].includes(nb) ? 3 : nb;
@@ -35,12 +38,13 @@ const getLog10SumSimplifyingQuestion = (opts) => {
35
38
  : new oppositeNode_1.OppositeNode(new LNode(new powerNode_1.PowerNode(nbNode, new numberNode_1.NumberNode(power)))));
36
39
  const statement = (0, operatorComposition_1.operatorComposition)(addNode_1.AddNode, logs);
37
40
  const answer = statement.simplify();
41
+ const identifiers = { nb, powers, signs, isLog10: opts?.isLog10 ?? false };
38
42
  const question = {
39
43
  answer: answer.toTex(),
40
44
  instruction: `Exprimer le nombre suivant sous la forme $a${opts?.isLog10 ? "\\log" : "\\ln"}\\left(${trueNb}\\right)$ : $\\newline ${statement.toTex()}$`,
41
- keys: [opts?.isLog10 ? "log" : "ln"],
45
+ keys: getKeys(identifiers, opts),
42
46
  answerFormat: "tex",
43
- identifiers: { nb, powers, signs, isLog10: opts?.isLog10 ?? false },
47
+ identifiers,
44
48
  };
45
49
  return question;
46
50
  };
@@ -1 +1 @@
1
- {"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,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,QAAQ,CAAC,WAAW,CAa7C,CAAC"}
1
+ {"version":3,"file":"logEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,cAAc;AACd,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6EF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAa7C,CAAC"}
@@ -14,28 +14,36 @@ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
14
14
  const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
15
15
  const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
16
16
  const shuffle_1 = require("../../../../utils/alea/shuffle");
17
+ const getKeys = () => {
18
+ return [
19
+ "x",
20
+ "equal",
21
+ "lnBrackets",
22
+ "e",
23
+ "epower",
24
+ "exp",
25
+ "lbrace",
26
+ "S",
27
+ "semicolon",
28
+ "rbrace",
29
+ ];
30
+ };
17
31
  const getLnEquation = () => {
18
32
  const a = (0, randint_1.randint)(-9, 20, [0]);
19
33
  const k = (0, randint_1.randint)(-9, 20, [0]);
20
34
  const equation = new equalNode_1.EqualNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new logNode_1.LogNode(new variableNode_1.VariableNode("x"))), new numberNode_1.NumberNode(k));
21
35
  const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([new expNode_1.ExpNode(new rational_1.Rational(k, a).simplify().toTree())])).toTex();
36
+ const identifiers = { a, k };
22
37
  const question = {
23
- instruction: `Résoudre l'équation $${equation.toTex()}$.`,
38
+ instruction: `Résoudre l'équation :
39
+
40
+ $$
41
+ ${equation.toTex()}
42
+ $$`,
24
43
  answer,
25
- keys: [
26
- "x",
27
- "equal",
28
- "ln",
29
- "e",
30
- "epower",
31
- "exp",
32
- "lbrace",
33
- "S",
34
- "semicolon",
35
- "rbrace",
36
- ],
44
+ keys: getKeys(identifiers),
37
45
  answerFormat: "tex",
38
- identifiers: { a, k },
46
+ identifiers,
39
47
  };
40
48
  return question;
41
49
  };
@@ -1 +1 @@
1
- {"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,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;AA0GF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAkBpD,CAAC"}
1
+ {"version":3,"file":"logPowerEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logPowerEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,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;AA4GF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAkBpD,CAAC"}
@@ -16,6 +16,11 @@ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
16
16
  const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
17
17
  const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
18
18
  /**a*b^x+c=d */
19
+ const getKeys = (identifiers, opts) => {
20
+ const keys = ["x", "equal", "S", "lbrace", "semicolon", "rbrace"];
21
+ keys.push(opts?.isLog10 ? "logBrackets" : "lnBrackets");
22
+ return keys;
23
+ };
19
24
  const getLogPowerEquationQuestion = (opts) => {
20
25
  const powered = (0, randint_1.randint)(2, 8);
21
26
  const a = (0, randint_1.randint)(1, 10, [powered]);
@@ -29,22 +34,13 @@ const getLogPowerEquationQuestion = (opts) => {
29
34
  new fractionNode_1.FractionNode(new LNode(new numberNode_1.NumberNode(k)), new LNode(poweredNode)).simplify(),
30
35
  ])).toTex();
31
36
  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");
37
+ const identifiers = { a, c, k, powered, isLog10: opts?.isLog10 ?? false };
42
38
  const question = {
43
39
  answer,
44
40
  instruction: `Résoudre : $${equation.toTex()}$`,
45
- keys,
41
+ keys: getKeys(identifiers, opts),
46
42
  answerFormat: "tex",
47
- identifiers: { a, c, k, powered, isLog10: opts?.isLog10 ?? false },
43
+ identifiers,
48
44
  };
49
45
  return question;
50
46
  };
@@ -64,6 +60,12 @@ const getPropositions = (n, { answer, isLog10, a, c, k, powered }) => {
64
60
  return (0, exercise_1.shuffleProps)(propositions, n);
65
61
  };
66
62
  const isAnswerValid = (ans, { a, c, k, powered, isLog10 }) => {
63
+ try {
64
+ //!TODO parse equation solution
65
+ }
66
+ catch (err) {
67
+ return false;
68
+ }
67
69
  const LNode = isLog10 ? log10Node_1.Log10Node : logNode_1.LogNode;
68
70
  const poweredNode = new numberNode_1.NumberNode(powered);
69
71
  const answerSimp = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode([
@@ -1 +1 @@
1
- {"version":3,"file":"logSimplifiying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logSimplifiying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqEF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
1
+ {"version":3,"file":"logSimplifiying.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/logarithm/logSimplifiying.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqFF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
@@ -11,31 +11,51 @@ const addNode_1 = require("../../../../tree/nodes/operators/addNode");
11
11
  const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
12
12
  const coinFlip_1 = require("../../../../utils/alea/coinFlip");
13
13
  const shuffle_1 = require("../../../../utils/alea/shuffle");
14
+ const getStatementNode = (identifiers) => {
15
+ const { a, b, pm } = identifiers;
16
+ const opts = { allowLnOfOne: true };
17
+ const aNode = new logNode_1.LogNode(new numberNode_1.NumberNode(a), opts);
18
+ const bNode = new logNode_1.LogNode(new numberNode_1.NumberNode(b), opts);
19
+ if (pm === 1) {
20
+ return new addNode_1.AddNode(aNode, bNode);
21
+ }
22
+ else {
23
+ return new substractNode_1.SubstractNode(aNode, bNode);
24
+ }
25
+ };
26
+ const getInstruction = (identifiers) => {
27
+ return `Ecrire le nombre suivant sous la forme $\\ln\\left(a\\right)$ :
28
+
29
+ $$
30
+ ${getStatementNode(identifiers).toTex()}
31
+ $$`;
32
+ };
33
+ const getAnswer = (identifiers) => {
34
+ const { a, b, pm } = identifiers;
35
+ if (pm === 1) {
36
+ return new logNode_1.LogNode(new numberNode_1.NumberNode(a * b)).toTex();
37
+ }
38
+ else {
39
+ return new logNode_1.LogNode(new rational_1.Rational(a, b).simplify().toTree()).toTex();
40
+ }
41
+ };
42
+ const getKeys = (identifiers) => {
43
+ return ["lnBrackets"];
44
+ };
14
45
  const getExpSimplifiying = () => {
15
- let expression;
16
- let simplifiedExpression;
17
46
  let pm = (0, coinFlip_1.coinFlip)() ? 1 : -1;
18
47
  const a = (0, randint_1.randint)(1, 10);
19
48
  let b;
20
49
  do {
21
50
  b = (0, randint_1.randint)(1, 10);
22
51
  } while (pm === -1 && a === b);
23
- const opts = { allowLnOfOne: true };
24
- if (pm === 1) {
25
- expression = new addNode_1.AddNode(new logNode_1.LogNode(new numberNode_1.NumberNode(a), opts), new logNode_1.LogNode(new numberNode_1.NumberNode(b), opts));
26
- simplifiedExpression = new logNode_1.LogNode(new numberNode_1.NumberNode(a * b));
27
- }
28
- else {
29
- expression = new substractNode_1.SubstractNode(new logNode_1.LogNode(new numberNode_1.NumberNode(a), opts), new logNode_1.LogNode(new numberNode_1.NumberNode(b), opts));
30
- simplifiedExpression = new logNode_1.LogNode(new rational_1.Rational(a, b).simplify().toTree());
31
- }
32
- const answer = simplifiedExpression.toTex();
52
+ const identifiers = { pm, a, b };
33
53
  const question = {
34
- instruction: `Ecrire le nombre suivant sous la forme $\\ln\\left(a\\right)$ : $\\newline ${expression.toTex()}$.`,
35
- answer,
36
- keys: ["ln"],
54
+ instruction: getInstruction(identifiers),
55
+ answer: getAnswer(identifiers),
56
+ keys: getKeys(identifiers),
37
57
  answerFormat: "tex",
38
- identifiers: { pm, a, b },
58
+ identifiers,
39
59
  };
40
60
  return question;
41
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rectangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/rectangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAa/C,CAAC"}
1
+ {"version":3,"file":"rectangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/rectangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAuCF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAc/C,CAAC"}
@@ -5,17 +5,19 @@ const exercise_1 = require("../../../../exercises/exercise");
5
5
  const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
6
  const randint_1 = require("../../../../math/utils/random/randint");
7
7
  const shuffle_1 = require("../../../../utils/alea/shuffle");
8
+ const getKeys = (identifiers) => ["cm", "cm2"];
8
9
  const getRectangleArea = () => {
9
10
  const length = (0, randint_1.randint)(3, 13);
10
11
  const width = (0, randint_1.randint)(1, length);
11
12
  const answer = length * width + "";
12
13
  const answerTex = answer + "\\text{cm}^2";
14
+ const identifiers = { length, width };
13
15
  const question = {
14
16
  instruction: `Calculer l'aire d'un rectangle de $${length}$ cm de longueur et de $${width}$ cm de largeur.`,
15
17
  answer: answerTex,
16
18
  answerFormat: "tex",
17
- keys: [],
18
- identifiers: { length, width },
19
+ keys: getKeys(identifiers),
20
+ identifiers,
19
21
  };
20
22
  return question;
21
23
  };
@@ -44,4 +46,5 @@ exports.rectangleArea = {
44
46
  getPropositions,
45
47
  isAnswerValid,
46
48
  subject: "Mathématiques",
49
+ getKeys,
47
50
  };
@@ -15,12 +15,12 @@ const getVectorLinearCombinationQuestion = () => {
15
15
  const a = (0, randint_1.randint)(-10, 11, [0]);
16
16
  const b = (0, randint_1.randint)(-10, 11, [0]);
17
17
  const uCoords = {
18
- x: u.x.simplify().value,
19
- y: u.y.simplify().value,
18
+ x: u.x.simplify().evaluate(),
19
+ y: u.y.simplify().evaluate(),
20
20
  };
21
21
  const vCoords = {
22
- x: v.x.simplify().value,
23
- y: v.y.simplify().value,
22
+ x: v.x.simplify().evaluate(),
23
+ y: v.y.simplify().evaluate(),
24
24
  };
25
25
  const instruction = `Soient deux vecteurs $${u.toTexWithCoords()}$ et $${v.toTexWithCoords()}$.
26
26
  Calculer les coordonnées du vecteur $${getAddVectorTex(getMultiplyVectorTex(a, u), getMultiplyVectorTex(b, v))}$`;
@@ -19,4 +19,5 @@ export * from "./spaceGeometry";
19
19
  export * from "./squareRoots";
20
20
  export * from "./trigonometry";
21
21
  export * from "./python";
22
+ export * from "./sampling";
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -35,3 +35,4 @@ __exportStar(require("./spaceGeometry"), exports);
35
35
  __exportStar(require("./squareRoots"), exports);
36
36
  __exportStar(require("./trigonometry"), exports);
37
37
  __exportStar(require("./python"), exports);
38
+ __exportStar(require("./sampling"), exports);
@@ -94,3 +94,4 @@ exports.matrixInversibilityDomain = {
94
94
  subject: "Mathématiques",
95
95
  pdfOptions: { shouldSpreadPropositions: true },
96
96
  };
97
+ //lbracket
@@ -1 +1 @@
1
- {"version":3,"file":"applyPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/applyPercent.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAmFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAwB9C,CAAC"}
1
+ {"version":3,"file":"applyPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/applyPercent.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAoFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAwB9C,CAAC"}
@@ -65,6 +65,8 @@ const getPropositions = (n, { answer }) => {
65
65
  (0, exercise_1.addValidProp)(propositions, answer);
66
66
  while (propositions.length < n) {
67
67
  const ansNb = Number(answer.replace(",", "."));
68
+ if (ansNb === 0)
69
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-10, 10) + "");
68
70
  const deviation = Math.random() < 0.5 ? -1 : 1;
69
71
  const percentDeviation = Math.random() * 20 + 1;
70
72
  let wrongAnswer = ansNb + deviation * (percentDeviation / 100) * ansNb;
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ vd: number;
4
+ percentRate: number;
5
+ };
6
+ export declare const findEndValueAfterEvolution: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=findEndValueAfterEvolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findEndValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findEndValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA4FF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAkB5D,CAAC"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findEndValueAfterEvolution = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
7
+ const round_1 = require("../../../math/utils/round");
8
+ const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
9
+ const euroParser_1 = require("../../../tree/parsers/euroParser");
10
+ const alignTex_1 = require("../../../utils/latex/alignTex");
11
+ const approxOrEqual_1 = require("../../../utils/latex/approxOrEqual");
12
+ const getPropositions = (n, { answer, percentRate, vd }) => {
13
+ const propositions = [];
14
+ (0, exercise_1.addValidProp)(propositions, answer);
15
+ const cm = 1 + percentRate / 100;
16
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(vd * percentRate, 2).frenchify());
17
+ const invCm = 1 - percentRate / 100;
18
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(vd * invCm, 2).frenchify());
19
+ while (propositions.length < n) {
20
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)((0, randfloat_1.randfloat)(1, 100, 2), 2).frenchify());
21
+ }
22
+ return (0, exercise_1.shuffleProps)(propositions, n);
23
+ };
24
+ const getAnswer = (identifiers) => {
25
+ const cm = 1 + identifiers.percentRate / 100;
26
+ const vf = (0, round_1.round)(identifiers.vd * cm, 2);
27
+ return vf.frenchify();
28
+ };
29
+ const getInstruction = (identifiers) => {
30
+ const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
31
+ return `Le prix initial d'un objet est $${identifiers.vd.frenchify()}€$. Quel sera son prix après une ${evolution} de $${identifiers.percentRate.frenchify()}\\%$ ? Arrondir au centième.`;
32
+ };
33
+ const getHint = (identifiers) => {
34
+ return `Transforme le taux d'évolution en coefficient multiplicateur. Puis, multiplie le prix initial par ce coefficient multiplicateur.`;
35
+ };
36
+ const getCorrection = (identifiers) => {
37
+ const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
38
+ const answer = getAnswer(identifiers);
39
+ const cm = (0, round_1.round)(1 + identifiers.percentRate / 100, 4);
40
+ const vd = identifiers.vd;
41
+ const percentRate = identifiers.percentRate;
42
+ return `Le coefficient multiplicateur associé à une ${evolution} de $${percentRate.frenchify()}\\%$ est :
43
+
44
+ ${(0, alignTex_1.alignTex)([
45
+ ["CM", "=", "1+\\frac{t}{100}"],
46
+ ["", "=", `1+\\frac{${percentRate.frenchify()}}{100}`],
47
+ ["", "=", cm.frenchify()],
48
+ ])}
49
+
50
+ Si on note $V_d$ la valeur de départ et $V_a$ la valeur d'arrivée, alors on sait que :
51
+
52
+ $$
53
+ V_d\\times CM = V_a
54
+ $$
55
+
56
+ Le prix final arrondi au centième est donc :
57
+
58
+ ${(0, alignTex_1.alignTex)([
59
+ ["V_a", "=", (0, multiplyNode_1.multiply)(vd.frenchify(), cm.frenchify()).toTex()],
60
+ ["", ...(0, approxOrEqual_1.approxOrEqual)(cm * vd, 2)],
61
+ ])}
62
+ `;
63
+ };
64
+ const getKeys = (identifiers) => {
65
+ return [];
66
+ };
67
+ const isAnswerValid = (ans, { answer }) => {
68
+ return (0, euroParser_1.euroParser)(ans) === answer + "€";
69
+ };
70
+ const getFindEndValueAfterEvolutionQuestion = () => {
71
+ const vd = (0, randfloat_1.randfloat)(1, 100, 2);
72
+ const percentRate = (0, randfloat_1.randfloat)(-100, 100, 2, [0]);
73
+ const identifiers = {
74
+ vd,
75
+ percentRate,
76
+ };
77
+ const question = {
78
+ answer: getAnswer(identifiers),
79
+ instruction: getInstruction(identifiers),
80
+ keys: getKeys(identifiers),
81
+ answerFormat: "tex",
82
+ identifiers,
83
+ hint: getHint(identifiers),
84
+ correction: getCorrection(identifiers),
85
+ };
86
+ return question;
87
+ };
88
+ exports.findEndValueAfterEvolution = {
89
+ id: "findEndValueAfterEvolution",
90
+ connector: "=",
91
+ label: "Retrouver un prix final à partir du prix initial et du taux d'évolution",
92
+ isSingleStep: true,
93
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFindEndValueAfterEvolutionQuestion, nb),
94
+ qcmTimer: 60,
95
+ freeTimer: 60,
96
+ ggbTimer: 60,
97
+ getPropositions,
98
+ isAnswerValid,
99
+ subject: "Mathématiques",
100
+ getAnswer,
101
+ getCorrection,
102
+ getHint,
103
+ hasHintAndCorrection: true,
104
+ };
@@ -14,4 +14,5 @@ export * from "./evolutionRateFromValues";
14
14
  export * from "./findStartValueAfterEvolution";
15
15
  export * from "./subPopulationEffectifFromPercent";
16
16
  export * from "./populationEffectifFromSubPopulation";
17
+ export * from "./findEndValueAfterEvolution";
17
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC"}
@@ -30,3 +30,4 @@ __exportStar(require("./evolutionRateFromValues"), exports);
30
30
  __exportStar(require("./findStartValueAfterEvolution"), exports);
31
31
  __exportStar(require("./subPopulationEffectifFromPercent"), exports);
32
32
  __exportStar(require("./populationEffectifFromSubPopulation"), exports);
33
+ __exportStar(require("./findEndValueAfterEvolution"), exports);
@@ -7,4 +7,5 @@ export * from "./powersOfTenToDecimal";
7
7
  export * from "./powersPower";
8
8
  export * from "./powersProduct";
9
9
  export * from "./scientificToDecimal";
10
+ export * from "./powersMixOperations";
10
11
  //# sourceMappingURL=index.d.ts.map