math-exercises 2.2.77 → 2.2.79
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.
- package/lib/exercises/math/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/firstDegreeDerivative.js +44 -5
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +57 -26
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.js +50 -8
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +67 -13
- package/lib/exercises/math/derivation/derivative/usualderivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/usualderivative.js +1 -2
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts +9 -0
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +124 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts +2 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/index.js +17 -0
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/geometry/areas/rectangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/rectangleArea.js +5 -2
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts +10 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.js +107 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/index.js +1 -0
- package/lib/exercises/math/index.d.ts +1 -0
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +1 -0
- package/lib/exercises/math/percent/applyPercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/applyPercent.js +2 -0
- package/lib/exercises/math/percent/findEndValueAfterEvolution.d.ts +8 -0
- package/lib/exercises/math/percent/findEndValueAfterEvolution.d.ts.map +1 -0
- package/lib/exercises/math/percent/findEndValueAfterEvolution.js +104 -0
- package/lib/exercises/math/percent/index.d.ts +1 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +1 -0
- package/lib/exercises/math/powers/index.d.ts +1 -0
- package/lib/exercises/math/powers/index.d.ts.map +1 -1
- package/lib/exercises/math/powers/index.js +1 -0
- package/lib/exercises/math/powers/powersMixOperations.d.ts +11 -0
- package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -0
- package/lib/exercises/math/powers/powersMixOperations.js +99 -0
- package/lib/exercises/math/sampling/confidenceInterval.d.ts +9 -0
- package/lib/exercises/math/sampling/confidenceInterval.d.ts.map +1 -0
- package/lib/exercises/math/sampling/confidenceInterval.js +134 -0
- package/lib/exercises/math/sampling/fluctuationInterval.d.ts +9 -0
- package/lib/exercises/math/sampling/fluctuationInterval.d.ts.map +1 -0
- package/lib/exercises/math/sampling/fluctuationInterval.js +131 -0
- package/lib/exercises/math/sampling/index.d.ts +4 -0
- package/lib/exercises/math/sampling/index.d.ts.map +1 -0
- package/lib/exercises/math/sampling/index.js +19 -0
- package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts +11 -0
- package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts.map +1 -0
- package/lib/exercises/math/sampling/isSamplingRepresentative.js +116 -0
- package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts +9 -0
- package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricVariations.js +124 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -2
- package/lib/geogebra/parsers/parseGGBPoints.js +1 -1
- package/lib/index.d.ts +32 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/circle.d.ts +10 -0
- package/lib/math/geometry/circle.d.ts.map +1 -0
- package/lib/math/geometry/circle.js +33 -0
- package/lib/math/geometry/line.d.ts +1 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +10 -7
- package/lib/math/geometry/point.d.ts +3 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +11 -12
- package/lib/math/numbers/rationals/rational.d.ts +3 -1
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +3 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +6 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +15 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +8 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +4 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts +6 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/monomNode.js +126 -2
- package/lib/tree/parsers/affineParser.d.ts.map +1 -1
- package/lib/tree/parsers/affineParser.js +2 -1
- package/lib/tree/parsers/intervalParser.d.ts +8 -0
- package/lib/tree/parsers/intervalParser.d.ts.map +1 -0
- package/lib/tree/parsers/intervalParser.js +38 -0
- package/lib/tree/parsers/monomParser.d.ts +1 -3
- package/lib/tree/parsers/monomParser.d.ts.map +1 -1
- package/lib/tree/parsers/monomParser.js +7 -129
- package/lib/tree/parsers/polynomialParser.d.ts.map +1 -1
- package/lib/tree/parsers/polynomialParser.js +2 -1
- package/lib/tree/parsers/powerParser.d.ts +1 -1
- package/lib/tree/parsers/powerParser.d.ts.map +1 -1
- package/lib/tree/parsers/powerParser.js +2 -1
- package/lib/tree/parsers/trinomParser.js +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/firstDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"firstDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/firstDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAKR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyCF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAenE,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,YAAY,CAAC,WAAW,CAkB1E,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,GAAG,CAAC,WAAW,CAK/D,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
|
|
@@ -5,17 +5,53 @@ const exercise_1 = require("../../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const polynomial_1 = require("../../../../math/polynomials/polynomial");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
10
|
+
const getAnswer = (identifiers) => {
|
|
11
|
+
const { a, b } = identifiers;
|
|
12
|
+
return a + "";
|
|
13
|
+
};
|
|
14
|
+
const getHint = (identifiers) => {
|
|
15
|
+
return `Dérive chacun des termes de la somme, puis additionne les dérivées obtenues.
|
|
16
|
+
|
|
17
|
+
On rappelle que la dérivée de la fonction $kx$ est $k$.`;
|
|
18
|
+
};
|
|
19
|
+
const getCorrection = (identifiers) => {
|
|
20
|
+
const { a, b } = identifiers;
|
|
21
|
+
const monoms = [b, a]
|
|
22
|
+
.map((c, i) => (0, multiplyNode_1.multiply)(c, (0, powerNode_1.power)("x", i)).simplify())
|
|
23
|
+
.filter((n) => n.evaluate() !== 0);
|
|
24
|
+
const answer = getAnswer(identifiers);
|
|
25
|
+
return `On dérive chacun des termes de la somme :
|
|
26
|
+
|
|
27
|
+
${monoms
|
|
28
|
+
.reverse()
|
|
29
|
+
.map((n) => `- $${n.toTex()} \\to ${n.derivative().simplify().toTex()}$`)
|
|
30
|
+
.join(" \n ")}
|
|
31
|
+
|
|
32
|
+
Puis, on additionne ces résultats pour obtenir la dérivée de la fonction $f$ :
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
f'(x) = ${answer}
|
|
36
|
+
$$`;
|
|
37
|
+
};
|
|
38
|
+
const getInstruction = (identifiers) => {
|
|
39
|
+
const { a, b } = identifiers;
|
|
40
|
+
const polynomial = new polynomial_1.Polynomial([b, a]);
|
|
41
|
+
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial.toTex()}$.`;
|
|
42
|
+
};
|
|
8
43
|
const getFirstDegreeDerivative = () => {
|
|
9
44
|
const [a, b] = [(0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10)];
|
|
10
|
-
const
|
|
11
|
-
const answer = a + "";
|
|
45
|
+
const identifiers = { a, b };
|
|
12
46
|
const question = {
|
|
13
|
-
instruction:
|
|
47
|
+
instruction: getInstruction(identifiers),
|
|
14
48
|
startStatement: `f'(x)`,
|
|
15
|
-
answer,
|
|
49
|
+
answer: getAnswer(identifiers),
|
|
16
50
|
keys: ["x"],
|
|
17
51
|
answerFormat: "tex",
|
|
18
|
-
identifiers
|
|
52
|
+
identifiers,
|
|
53
|
+
hint: getHint(identifiers),
|
|
54
|
+
correction: getCorrection(identifiers),
|
|
19
55
|
};
|
|
20
56
|
return question;
|
|
21
57
|
};
|
|
@@ -50,4 +86,7 @@ exports.firstDegreeDerivative = {
|
|
|
50
86
|
getPropositions: exports.getFirstDegreeDerivativePropositions,
|
|
51
87
|
isAnswerValid: exports.isFirstDegreeDerivativeAnswerValid,
|
|
52
88
|
subject: "Mathématiques",
|
|
89
|
+
hasHintAndCorrection: true,
|
|
90
|
+
getHint,
|
|
91
|
+
getCorrection,
|
|
53
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/rootFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"rootFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/rootFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,0BAA0B,CAAC;AAmBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+FF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAmBxD,CAAC"}
|
|
@@ -6,11 +6,11 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
|
|
|
6
6
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
7
7
|
const round_1 = require("../../../../math/utils/round");
|
|
8
8
|
const sqrtNode_1 = require("../../../../tree/nodes/functions/sqrtNode");
|
|
9
|
-
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
10
9
|
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
11
10
|
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
12
|
-
const
|
|
11
|
+
const latexParser_1 = require("../../../../tree/parsers/latexParser");
|
|
13
12
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
13
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
14
14
|
const getStatementNode = (identifiers) => {
|
|
15
15
|
return (0, multiplyNode_1.multiply)(identifiers.a, (0, sqrtNode_1.sqrt)("x"));
|
|
16
16
|
};
|
|
@@ -21,27 +21,50 @@ $$
|
|
|
21
21
|
f(x) = ${getStatementNode(identifiers).toTex()}
|
|
22
22
|
$$ `;
|
|
23
23
|
};
|
|
24
|
+
const getAnswer = (identifiers) => {
|
|
25
|
+
return (0, fractionNode_1.frac)(identifiers.a, (0, multiplyNode_1.multiply)(2, (0, sqrtNode_1.sqrt)("x")))
|
|
26
|
+
.simplify()
|
|
27
|
+
.toTex();
|
|
28
|
+
};
|
|
29
|
+
const getHint = (identifiers) => {
|
|
30
|
+
return `La dérivée sur $]0; +\\infty[$ de la fonction $f(x) =\\sqrt{x}$ est :
|
|
31
|
+
|
|
32
|
+
$$
|
|
33
|
+
f'(x) = \\frac{1}{2\\sqrt{x}}
|
|
34
|
+
$$`;
|
|
35
|
+
};
|
|
36
|
+
const getCorrection = (identifiers) => {
|
|
37
|
+
const statement = getStatementNode(identifiers);
|
|
38
|
+
const answer = getAnswer(identifiers);
|
|
39
|
+
const a = identifiers.a;
|
|
40
|
+
return `La dérivée sur $]0; +\\infty[$ de la fonction $\\sqrt{x}$ est :
|
|
41
|
+
|
|
42
|
+
$$
|
|
43
|
+
\\frac{1}{2\\sqrt{x}}
|
|
44
|
+
$$
|
|
45
|
+
|
|
46
|
+
Ici, on a $f(x) = ${statement.toTex()}$.
|
|
47
|
+
|
|
48
|
+
On a donc :
|
|
49
|
+
|
|
50
|
+
${(0, alignTex_1.alignTex)([
|
|
51
|
+
["f'(x)", "=", (0, multiplyNode_1.multiply)(a, (0, fractionNode_1.frac)(1, (0, multiplyNode_1.multiply)(2, (0, sqrtNode_1.sqrt)("x")))).toTex()],
|
|
52
|
+
["", "=", answer],
|
|
53
|
+
])}
|
|
54
|
+
`;
|
|
55
|
+
};
|
|
24
56
|
const getRootFunctionDerivative = () => {
|
|
25
|
-
const a = (0, randint_1.randint)(-19, 20, [0]);
|
|
26
|
-
|
|
27
|
-
let answer = "";
|
|
28
|
-
if (a === 1)
|
|
29
|
-
instruction += `$\\sqrt{x}$.`;
|
|
30
|
-
else if (a === -1)
|
|
31
|
-
instruction += `$-\\sqrt{x}$.`;
|
|
32
|
-
else
|
|
33
|
-
instruction += `$${a}\\sqrt{x}$.`;
|
|
34
|
-
if (a % 2 === 0)
|
|
35
|
-
answer = `${a < 0 ? "-" : ""}\\frac{${Math.abs(a / 2)}}{\\sqrt{x}}`;
|
|
36
|
-
else
|
|
37
|
-
answer = `${a < 0 ? "-" : ""}\\frac{${Math.abs(a)}}{2\\sqrt{x}}`;
|
|
57
|
+
const a = (0, randint_1.randint)(-19, 20, [0, 1]);
|
|
58
|
+
const identifiers = { a };
|
|
38
59
|
const question = {
|
|
39
|
-
instruction,
|
|
60
|
+
instruction: getInstruction(identifiers),
|
|
40
61
|
startStatement: `f'(x)`,
|
|
41
|
-
answer,
|
|
62
|
+
answer: getAnswer(identifiers),
|
|
42
63
|
keys: ["x"],
|
|
43
64
|
answerFormat: "tex",
|
|
44
|
-
identifiers
|
|
65
|
+
identifiers,
|
|
66
|
+
hint: getHint(identifiers),
|
|
67
|
+
correction: getCorrection(identifiers),
|
|
45
68
|
};
|
|
46
69
|
return question;
|
|
47
70
|
};
|
|
@@ -63,14 +86,17 @@ const getPropositions = (n, { answer, a }) => {
|
|
|
63
86
|
}
|
|
64
87
|
return (0, shuffle_1.shuffle)(propositions);
|
|
65
88
|
};
|
|
66
|
-
const isAnswerValid = (ans, { a }) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
89
|
+
const isAnswerValid = (ans, { answer, a }) => {
|
|
90
|
+
try {
|
|
91
|
+
const parsed = (0, latexParser_1.parseAlgebraic)(ans);
|
|
92
|
+
if (!parsed)
|
|
93
|
+
return false;
|
|
94
|
+
const simplified = parsed.simplify();
|
|
95
|
+
return simplified.toTex() === answer;
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
74
100
|
};
|
|
75
101
|
exports.rootFunctionDerivative = {
|
|
76
102
|
id: "rootFunctionDerivative",
|
|
@@ -85,4 +111,9 @@ exports.rootFunctionDerivative = {
|
|
|
85
111
|
getPropositions,
|
|
86
112
|
isAnswerValid,
|
|
87
113
|
subject: "Mathématiques",
|
|
114
|
+
getHint,
|
|
115
|
+
getCorrection,
|
|
116
|
+
getInstruction,
|
|
117
|
+
getAnswer,
|
|
118
|
+
hasHintAndCorrection: true,
|
|
88
119
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA4CF,eAAO,MAAM,yBAAyB,EAAE,iBAAiB,CAAC,WAAW,CAgBpE,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,YAAY,CAC9D,WAAW,CA+BZ,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,GAAG,CAAC,WAAW,CAQhE,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAyBxD,CAAC"}
|
|
@@ -5,21 +5,60 @@ const exercise_1 = require("../../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const polynomial_1 = require("../../../../math/polynomials/polynomial");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
8
10
|
const shuffle_1 = require("../../../../utils/alea/shuffle");
|
|
11
|
+
const getAnswer = (identifiers) => {
|
|
12
|
+
const polynomial = new polynomial_1.Polynomial(identifiers.coefficients);
|
|
13
|
+
const derivative = polynomial.derivate();
|
|
14
|
+
return derivative.toTree().toTex();
|
|
15
|
+
};
|
|
16
|
+
const getHint = (identifiers) => {
|
|
17
|
+
return `Dérive chacun des termes de la somme, puis additionne les dérivées obtenues.
|
|
18
|
+
|
|
19
|
+
On rappelle que la dérivée de la fonction $kx^n$ est :
|
|
20
|
+
|
|
21
|
+
$$
|
|
22
|
+
k\\times n \\times x^{n-1}
|
|
23
|
+
$$`;
|
|
24
|
+
};
|
|
25
|
+
const getCorrection = (identifiers) => {
|
|
26
|
+
const monoms = identifiers.coefficients
|
|
27
|
+
.map((c, i) => (0, multiplyNode_1.multiply)(c, (0, powerNode_1.power)("x", i)).simplify())
|
|
28
|
+
.filter((n) => n.evaluate() !== 0);
|
|
29
|
+
const answer = getAnswer(identifiers);
|
|
30
|
+
return `On dérive chacun des termes de la somme :
|
|
31
|
+
|
|
32
|
+
${monoms
|
|
33
|
+
.reverse()
|
|
34
|
+
.map((n) => `- $${n.toTex()} \\to ${n.derivative().simplify().toTex()}$`)
|
|
35
|
+
.join(" \n ")}
|
|
36
|
+
|
|
37
|
+
Puis, on additionne ces résultats pour obtenir la dérivée de la fonction $f$ :
|
|
38
|
+
|
|
39
|
+
$$
|
|
40
|
+
f'(x) = ${answer}
|
|
41
|
+
$$
|
|
42
|
+
`;
|
|
43
|
+
};
|
|
44
|
+
const getInstruction = (identifiers) => {
|
|
45
|
+
const polynomial = new polynomial_1.Polynomial(identifiers.coefficients);
|
|
46
|
+
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial
|
|
47
|
+
.toTree()
|
|
48
|
+
.toTex()}$.`;
|
|
49
|
+
};
|
|
9
50
|
const getSecondDegreeDerivative = () => {
|
|
10
51
|
const coefficients = [(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])];
|
|
11
|
-
const
|
|
12
|
-
const derivative = polynomial.derivate();
|
|
13
|
-
const answer = derivative.toTree().toTex();
|
|
52
|
+
const identifiers = { coefficients };
|
|
14
53
|
const question = {
|
|
15
|
-
instruction:
|
|
16
|
-
.toTree()
|
|
17
|
-
.toTex()}$.`,
|
|
54
|
+
instruction: getInstruction(identifiers),
|
|
18
55
|
startStatement: `f'(x)`,
|
|
19
|
-
answer,
|
|
56
|
+
answer: getAnswer(identifiers),
|
|
20
57
|
keys: ["x"],
|
|
21
58
|
answerFormat: "tex",
|
|
22
|
-
identifiers
|
|
59
|
+
identifiers,
|
|
60
|
+
hint: getHint(identifiers),
|
|
61
|
+
correction: getCorrection(identifiers),
|
|
23
62
|
};
|
|
24
63
|
return question;
|
|
25
64
|
};
|
|
@@ -73,4 +112,7 @@ exports.secondDegreeDerivative = {
|
|
|
73
112
|
getPropositions: exports.getSecondDegreeDerivativePropositions,
|
|
74
113
|
isAnswerValid: exports.isSecondDegreeDerivativeAnswerValid,
|
|
75
114
|
subject: "Mathématiques",
|
|
115
|
+
getHint,
|
|
116
|
+
getCorrection,
|
|
117
|
+
hasHintAndCorrection: true,
|
|
76
118
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"thirdDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/thirdDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMR,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA4CF,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,WAAW,CAmBnE,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,YAAY,CAAC,WAAW,CAwC1E,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,GAAG,CAAC,WAAW,CAe/D,CAAC;AACF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CA0BvD,CAAC"}
|
|
@@ -5,23 +5,63 @@ const exercise_1 = require("../../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const polynomial_1 = require("../../../../math/polynomials/polynomial");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
9
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
10
|
+
const polynomialParser_1 = require("../../../../tree/parsers/polynomialParser");
|
|
11
|
+
const getHint = (identifiers) => {
|
|
12
|
+
return `Dérive chacun des termes de la somme, puis additionne les dérivées obtenues.
|
|
13
|
+
|
|
14
|
+
On rappelle que la dérivée de la fonction $kx^n$ est :
|
|
15
|
+
|
|
16
|
+
$$
|
|
17
|
+
k\\times n \\times x^{n-1}
|
|
18
|
+
$$`;
|
|
19
|
+
};
|
|
20
|
+
const getCorrection = (identifiers) => {
|
|
21
|
+
const monoms = identifiers.coefficients
|
|
22
|
+
.map((c, i) => (0, multiplyNode_1.multiply)(c, (0, powerNode_1.power)("x", i)).simplify())
|
|
23
|
+
.filter((n) => n.evaluate() !== 0);
|
|
24
|
+
const answer = getAnswer(identifiers);
|
|
25
|
+
return `On dérive chacun des termes de la somme :
|
|
26
|
+
|
|
27
|
+
${monoms
|
|
28
|
+
.reverse()
|
|
29
|
+
.map((n) => `- $${n.toTex()} \\to ${n.derivative().simplify().toTex()}$`)
|
|
30
|
+
.join(" \n ")}
|
|
31
|
+
|
|
32
|
+
Puis, on additionne ces résultats pour obtenir la dérivée de la fonction $f$ :
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
f'(x) = ${answer}
|
|
36
|
+
$$
|
|
37
|
+
`;
|
|
38
|
+
};
|
|
39
|
+
const getInstruction = (identifiers) => {
|
|
40
|
+
const polynomial = new polynomial_1.Polynomial(identifiers.coefficients);
|
|
41
|
+
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial
|
|
42
|
+
.toTree()
|
|
43
|
+
.toTex()}$.`;
|
|
44
|
+
};
|
|
45
|
+
const getAnswer = (identifiers) => {
|
|
46
|
+
const polynomial = new polynomial_1.Polynomial(identifiers.coefficients);
|
|
47
|
+
const derivative = polynomial.derivate();
|
|
48
|
+
return derivative.toTree().toTex();
|
|
49
|
+
};
|
|
8
50
|
const getThirdDegreeDerivative = () => {
|
|
9
51
|
const coefficients = [];
|
|
10
52
|
for (let i = 1; i <= 3; i++)
|
|
11
53
|
coefficients.push((0, randint_1.randint)(-9, 10));
|
|
12
54
|
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
13
|
-
const
|
|
14
|
-
const derivative = polynomial.derivate();
|
|
15
|
-
const answer = derivative.toTree().toTex();
|
|
55
|
+
const identifiers = { coefficients };
|
|
16
56
|
const question = {
|
|
17
|
-
instruction:
|
|
18
|
-
.toTree()
|
|
19
|
-
.toTex()}$.`,
|
|
57
|
+
instruction: getInstruction(identifiers),
|
|
20
58
|
startStatement: `f'(x)`,
|
|
21
|
-
answer:
|
|
59
|
+
answer: getAnswer(identifiers),
|
|
22
60
|
keys: ["x"],
|
|
23
61
|
answerFormat: "tex",
|
|
24
|
-
identifiers
|
|
62
|
+
identifiers,
|
|
63
|
+
hint: getHint(identifiers),
|
|
64
|
+
correction: getCorrection(identifiers),
|
|
25
65
|
};
|
|
26
66
|
return question;
|
|
27
67
|
};
|
|
@@ -52,11 +92,20 @@ const getThirdDegreeDerivativePropositions = (n, { answer, coefficients }) => {
|
|
|
52
92
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
53
93
|
};
|
|
54
94
|
exports.getThirdDegreeDerivativePropositions = getThirdDegreeDerivativePropositions;
|
|
55
|
-
const isThirdDegreeDerivativeAnswerValid = (ans, { coefficients }) => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
95
|
+
const isThirdDegreeDerivativeAnswerValid = (ans, { answer, coefficients }) => {
|
|
96
|
+
try {
|
|
97
|
+
const parsed = (0, polynomialParser_1.polynomialParser)(ans);
|
|
98
|
+
if (!parsed)
|
|
99
|
+
return false;
|
|
100
|
+
const simp = parsed.simplify({
|
|
101
|
+
forbidFactorize: true,
|
|
102
|
+
towardsDistribute: true,
|
|
103
|
+
});
|
|
104
|
+
return simp.toTex() === answer;
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
60
109
|
};
|
|
61
110
|
exports.isThirdDegreeDerivativeAnswerValid = isThirdDegreeDerivativeAnswerValid;
|
|
62
111
|
exports.thirdDegreeDerivative = {
|
|
@@ -80,4 +129,9 @@ exports.thirdDegreeDerivative = {
|
|
|
80
129
|
getPropositions: exports.getThirdDegreeDerivativePropositions,
|
|
81
130
|
isAnswerValid: exports.isThirdDegreeDerivativeAnswerValid,
|
|
82
131
|
subject: "Mathématiques",
|
|
132
|
+
getInstruction,
|
|
133
|
+
getHint,
|
|
134
|
+
getAnswer,
|
|
135
|
+
getCorrection,
|
|
136
|
+
hasHintAndCorrection: true,
|
|
83
137
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usualderivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/usualderivative.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAMT,MAAM,mBAAmB,CAAC;AAuB3B,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;
|
|
1
|
+
{"version":3,"file":"usualderivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/usualderivative.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAMT,MAAM,mBAAmB,CAAC;AAuB3B,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AA0FF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAsBjD,CAAC"}
|
|
@@ -26,8 +26,6 @@ const getUsualDerivative = () => {
|
|
|
26
26
|
break;
|
|
27
27
|
case 4:
|
|
28
28
|
question = (0, constanteDerivative_1.getConstanteDerivative)();
|
|
29
|
-
question.hint = undefined;
|
|
30
|
-
question.correction = undefined;
|
|
31
29
|
identifiers = { ...question.identifiers, type: 4 };
|
|
32
30
|
break;
|
|
33
31
|
default:
|
|
@@ -108,4 +106,5 @@ exports.usualDerivative = {
|
|
|
108
106
|
getPropositions,
|
|
109
107
|
isAnswerValid,
|
|
110
108
|
subject: "Mathématiques",
|
|
109
|
+
hasHintAndCorrection: true,
|
|
111
110
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
q: NodeIdentifiers;
|
|
5
|
+
a: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const exponentialsVariations: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=exponentialsVariations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exponentialsVariations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/exponentialsVariations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EACL,eAAe,EAEhB,MAAM,kCAAkC,CAAC;AAM1C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAkBxD,CAAC"}
|
|
@@ -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 @@
|
|
|
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);
|
|
@@ -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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rectangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/rectangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
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
|
|
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
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
import { LineIdentifiers } from "../../../../math/geometry/line";
|
|
3
|
+
import { PointIdentifiers } from "../../../../math/geometry/point";
|
|
4
|
+
type Identifiers = {
|
|
5
|
+
point: PointIdentifiers;
|
|
6
|
+
line: LineIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
export declare const buildPointFromAxialSymetry: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=buildPointFromAxialSymetry.d.ts.map
|
package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildPointFromAxialSymetry.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAGL,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAGL,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAEnC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAiGF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAe5D,CAAC"}
|