math-exercises 3.0.53 → 3.0.55
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/calcul/mentalCaluls/mentalAddAndSub.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +3 -5
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts +8 -3
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +53 -28
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +3 -0
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts +2 -2
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +52 -25
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts +2 -2
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +50 -33
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts +2 -1
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +37 -17
- package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/recognizeAngleType.js +33 -12
- package/lib/exercises/math/geometry/areas/circleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/circleArea.js +45 -2
- package/lib/exercises/math/geometry/areas/squareArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/squareArea.js +40 -7
- package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +52 -7
- package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.js +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.js +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.js +55 -11
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +20 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts +9 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +115 -0
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts +3 -2
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +36 -27
- package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.d.ts +10 -0
- package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/drawLineFromPointAndVector.js +123 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts +12 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.js +130 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts +10 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.js +109 -0
- package/lib/exercises/math/geometry/lines/index.d.ts +5 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +5 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.js +58 -9
- package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.js +39 -6
- package/lib/exercises/math/geometry/perimeters/squarePerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/squarePerimeter.js +40 -5
- package/lib/exercises/math/geometry/perimeters/trianglePerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/trianglePerimeter.js +34 -7
- package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagore.js +51 -15
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +109 -19
- package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/thales/thales.js +36 -5
- package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/triangleNature.js +45 -14
- package/lib/exercises/math/geometry/vectors/colinearity.d.ts +5 -4
- package/lib/exercises/math/geometry/vectors/colinearity.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity.js +82 -21
- package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts +2 -0
- package/lib/exercises/math/geometry/vectors/findCoordForAligment.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/findCoordForAligment.js +92 -0
- package/lib/exercises/math/powers/calculatePower.d.ts.map +1 -1
- package/lib/exercises/math/powers/calculatePower.js +63 -6
- package/lib/exercises/math/powers/powerDefinition.d.ts.map +1 -1
- package/lib/exercises/math/powers/powerDefinition.js +39 -8
- package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersOfTenToDecimal.js +2 -1
- package/lib/exercises/math/powers/powersPower.d.ts +5 -2
- package/lib/exercises/math/powers/powersPower.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersPower.js +59 -28
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +21 -0
- package/lib/exercises/math/trigonometry/mainRemarkableValues.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/mainRemarkableValues.js +1 -1
- package/lib/exercises/math/trigonometry/remarkableValues.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/remarkableValues.js +4 -0
- package/lib/index.d.ts +34 -13
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +12 -7
- package/lib/math/geometry/line.d.ts +2 -8
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +50 -29
- package/lib/math/geometry/point.d.ts +2 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +3 -0
- package/lib/math/geometry/segment.js +1 -1
- package/lib/math/geometry/triangles/triangle.d.ts.map +1 -1
- package/lib/math/geometry/triangles/triangle.js +11 -11
- package/lib/math/geometry/vector.d.ts +1 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +10 -3
- package/lib/math/systems/generalSystem.d.ts +12 -1
- package/lib/math/systems/generalSystem.d.ts.map +1 -1
- package/lib/math/systems/generalSystem.js +92 -55
- package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValue.js +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -15
- package/lib/server.js +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +0 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +1 -1
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +11 -5
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +11 -5
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +11 -5
- package/lib/tree/nodes/node.d.ts +8 -8
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +2 -2
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/nodes/operators/powerNode.d.ts +4 -4
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +5 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colinearity.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/colinearity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"colinearity.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/colinearity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;CACrB,CAAC;AA4GF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAa7C,CAAC"}
|
|
@@ -1,16 +1,79 @@
|
|
|
1
1
|
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
-
import { VectorConstructor } from "../../../../math/geometry/vector.js";
|
|
3
|
+
import { Vector, VectorConstructor } from "../../../../math/geometry/vector.js";
|
|
4
|
+
import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
|
|
4
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
5
7
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
6
8
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
7
9
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
10
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
11
|
+
const rebuildIdentifiers = (oldIds) => {
|
|
12
|
+
if (oldIds.xu?.id)
|
|
13
|
+
return oldIds;
|
|
14
|
+
return {
|
|
15
|
+
xu: oldIds.xu.toTree().toIdentifiers(),
|
|
16
|
+
yu: oldIds.yu.toTree().toIdentifiers(),
|
|
17
|
+
xv: oldIds.xv.toTree().toIdentifiers(),
|
|
18
|
+
yv: oldIds.yv.toTree().toIdentifiers(),
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const getInstruction = (identifiers) => {
|
|
22
|
+
const { xu, yu, xv, yv } = identifiers;
|
|
23
|
+
const u = new Vector("u", reifyAlgebraic(xu), reifyAlgebraic(yu));
|
|
24
|
+
const v = new Vector("v", reifyAlgebraic(xv), reifyAlgebraic(yv));
|
|
25
|
+
return `Soit deux vecteurs $${u.toTexWithCoords()}$ et $${v.toTexWithCoords()}$.
|
|
26
|
+
|
|
27
|
+
Les vecteurs $${u.toTex()}$ et $${v.toTex()}$ sont-ils colinéaires ?`;
|
|
28
|
+
};
|
|
29
|
+
const getHint = (identifiers) => {
|
|
30
|
+
const u = new Vector("u", "x".toTree(), "y".toTree());
|
|
31
|
+
const v = new Vector("v", "x'".toTree(), "y'".toTree());
|
|
32
|
+
return `Deux vecteurs sont colinéaires si et seulement si leur déterminant est nul.
|
|
33
|
+
|
|
34
|
+
Le déterminant de deux vecteurs $${u.toTexWithCoords()}$ et $${v.toTexWithCoords()}$ est :
|
|
35
|
+
|
|
36
|
+
$$
|
|
37
|
+
\\det(${u.toTex()}, ${v.toTex()}) = ${u.determinant(v).simplify().toTex()}
|
|
38
|
+
$$`;
|
|
39
|
+
};
|
|
40
|
+
const getCorrection = (identifiers) => {
|
|
41
|
+
const { xu, yu, xv, yv } = identifiers;
|
|
42
|
+
const u = new Vector("u", reifyAlgebraic(xu), reifyAlgebraic(yu));
|
|
43
|
+
const v = new Vector("v", reifyAlgebraic(xv), reifyAlgebraic(yv));
|
|
44
|
+
const det = u.determinant(v);
|
|
45
|
+
const detSimp = det.simplify();
|
|
46
|
+
const isCol = detSimp.evaluate() === 0;
|
|
47
|
+
return `On calcule le déterminant de $${u.toTex()}$ et $${v.toTex()}$ :
|
|
48
|
+
|
|
49
|
+
${alignTex([
|
|
50
|
+
["", `\\det(${u.toTex()}, ${v.toTex()})`],
|
|
51
|
+
["=", det.toTex()],
|
|
52
|
+
["=", detSimp.toTex()],
|
|
53
|
+
])}
|
|
54
|
+
|
|
55
|
+
${isCol
|
|
56
|
+
? `Puisque le déterminant est nul, les vecteurs sont bien colinéaires.`
|
|
57
|
+
: `Puisque le déterminant n'est pas nul, les vecteurs ne sont pas colinéaires.`}`;
|
|
58
|
+
};
|
|
59
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
60
|
+
const question = {
|
|
61
|
+
instruction: getInstruction(identifiers),
|
|
62
|
+
answerFormat: "raw",
|
|
63
|
+
identifiers,
|
|
64
|
+
hint: getHint(identifiers),
|
|
65
|
+
correction: getCorrection(identifiers),
|
|
66
|
+
};
|
|
67
|
+
return question;
|
|
68
|
+
};
|
|
8
69
|
const getColinearityQuestion = () => {
|
|
9
70
|
const u = VectorConstructor.random("u", false);
|
|
10
71
|
const isColinear = coinFlip();
|
|
11
72
|
let v;
|
|
12
73
|
if (isColinear) {
|
|
13
|
-
const coeff =
|
|
74
|
+
const coeff = coinFlip()
|
|
75
|
+
? new NumberNode(randint(-5, 5, [0, 1]))
|
|
76
|
+
: RationalConstructor.randomIrreductible(5).toTree();
|
|
14
77
|
v = u.times(coeff, "v");
|
|
15
78
|
}
|
|
16
79
|
else {
|
|
@@ -18,25 +81,22 @@ const getColinearityQuestion = () => {
|
|
|
18
81
|
v = VectorConstructor.random("v", false);
|
|
19
82
|
} while (u.isColinear(v));
|
|
20
83
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
keys: [],
|
|
27
|
-
answerFormat: "raw",
|
|
28
|
-
identifiers: {
|
|
29
|
-
xu: u.x.evaluate({}),
|
|
30
|
-
xv: v.x.evaluate({}),
|
|
31
|
-
yu: u.y.evaluate({}),
|
|
32
|
-
yv: v.y.evaluate({}),
|
|
33
|
-
},
|
|
84
|
+
const identifiers = {
|
|
85
|
+
xu: u.x.toIdentifiers(),
|
|
86
|
+
xv: v.x.toIdentifiers(),
|
|
87
|
+
yu: u.y.toIdentifiers(),
|
|
88
|
+
yv: v.y.toIdentifiers(),
|
|
34
89
|
};
|
|
35
|
-
return
|
|
90
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
36
91
|
};
|
|
37
|
-
const getPropositions = (n, { answer }) => {
|
|
92
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
38
93
|
const propositions = [];
|
|
39
|
-
addValidProp(propositions, answer, "raw");
|
|
94
|
+
// addValidProp(propositions, answer, "raw");
|
|
95
|
+
const { xu, yu, xv, yv } = identifiers;
|
|
96
|
+
const u = new Vector("u", reifyAlgebraic(xu), reifyAlgebraic(yu));
|
|
97
|
+
const v = new Vector("v", reifyAlgebraic(xv), reifyAlgebraic(yv));
|
|
98
|
+
const isCol = u.isColinear(v);
|
|
99
|
+
addValidProp(propositions, isCol ? "Oui" : "Non", "raw");
|
|
40
100
|
tryToAddWrongProp(propositions, "Oui", "raw");
|
|
41
101
|
tryToAddWrongProp(propositions, "Non", "raw");
|
|
42
102
|
tryToAddWrongProp(propositions, "On ne peut pas savoir", "raw");
|
|
@@ -44,14 +104,15 @@ const getPropositions = (n, { answer }) => {
|
|
|
44
104
|
};
|
|
45
105
|
export const colinearity = {
|
|
46
106
|
id: "colinearity",
|
|
47
|
-
label: "Déterminer si deux vecteurs sont colinéaires",
|
|
48
|
-
levels: ["2nde", "1reSpé"],
|
|
107
|
+
label: "Déterminer si deux vecteurs sont colinéaires (par les coordonnées)",
|
|
49
108
|
isSingleStep: true,
|
|
50
|
-
sections: ["Vecteurs"],
|
|
51
109
|
generator: (nb) => getDistinctQuestions(getColinearityQuestion, nb),
|
|
52
110
|
qcmTimer: 60,
|
|
53
111
|
freeTimer: 60,
|
|
54
112
|
getPropositions,
|
|
55
113
|
answerType: "QCU",
|
|
56
114
|
subject: "Mathématiques",
|
|
115
|
+
getQuestionFromIdentifiers,
|
|
116
|
+
hasHintAndCorrection: true,
|
|
117
|
+
rebuildIdentifiers,
|
|
57
118
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findCoordForAligment.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/findCoordForAligment.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// import {
|
|
2
|
+
// Exercise,
|
|
3
|
+
// Proposition,
|
|
4
|
+
// QCMGenerator,
|
|
5
|
+
// Question,
|
|
6
|
+
// QuestionGenerator,
|
|
7
|
+
// VEA,
|
|
8
|
+
// addValidProp,
|
|
9
|
+
// shuffleProps,
|
|
10
|
+
// GetAnswer,
|
|
11
|
+
// GetHint,
|
|
12
|
+
// GetCorrection,
|
|
13
|
+
// GetInstruction,
|
|
14
|
+
// GetKeys,
|
|
15
|
+
// GetQuestionFromIdentifiers,
|
|
16
|
+
// } from '../../../../exercises/exercise.js';
|
|
17
|
+
// import { getDistinctQuestions } from '../../../../exercises/utils/getDistinctQuestions.js';
|
|
18
|
+
// import { PointConstructor } from '../../../../math/geometry/point.js';
|
|
19
|
+
// import { VectorConstructor } from '../../../../math/geometry/vector.js';
|
|
20
|
+
// import { RationalConstructor } from '../../../../math/numbers/rationals/rational.js';
|
|
21
|
+
// import { randint } from '../../../../math/utils/random/randint.js';
|
|
22
|
+
// import { coinFlip } from '../../../../utils/alea/coinFlip.js';
|
|
23
|
+
// import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
24
|
+
export {};
|
|
25
|
+
// type Identifiers = {
|
|
26
|
+
// };
|
|
27
|
+
// const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
|
|
28
|
+
// const propositions: Proposition[] = [];
|
|
29
|
+
// addValidProp(propositions, answer);
|
|
30
|
+
// while (propositions.length < n) {
|
|
31
|
+
// throw Error("QCM not implemented")
|
|
32
|
+
// }
|
|
33
|
+
// return shuffleProps(propositions, n);
|
|
34
|
+
// };
|
|
35
|
+
// const getAnswer : GetAnswer<Identifiers> = (identifiers)=>{
|
|
36
|
+
// }
|
|
37
|
+
// const getInstruction : GetInstruction<Identifiers> = (identifiers)=>{
|
|
38
|
+
// return `Les points $${}$, $${}$ et $${}$ sont alignés.
|
|
39
|
+
// Déterminer $x$.`
|
|
40
|
+
// }
|
|
41
|
+
// const getHint : GetHint<Identifiers> = (identifiers)=>{
|
|
42
|
+
// }
|
|
43
|
+
// const getCorrection : GetCorrection<Identifiers> = (identifiers)=>{
|
|
44
|
+
// }
|
|
45
|
+
// const getKeys : GetKeys<Identifiers> = (identifiers)=>{
|
|
46
|
+
// return []
|
|
47
|
+
// }
|
|
48
|
+
// const isAnswerValid: VEA<Identifiers> = (ans, {answer})=>{
|
|
49
|
+
// try {
|
|
50
|
+
// throw Error("VEA not implemented")
|
|
51
|
+
// } catch(err){
|
|
52
|
+
// return handleVEAError(err)
|
|
53
|
+
// }
|
|
54
|
+
// }
|
|
55
|
+
// const getFindCoordForAligmentQuestion: QuestionGenerator<Identifiers> = (ops)=>{
|
|
56
|
+
// const points = PointConstructor.randomDifferent(2, {names: ["A","B"]})
|
|
57
|
+
// const vec = VectorConstructor.fromPoints(points[0],points[1])
|
|
58
|
+
// const coeff = coinFlip()
|
|
59
|
+
// ? randint(-5, 5, [0, 1]).toTree()
|
|
60
|
+
// : RationalConstructor.randomIrreductible(5).toTree();
|
|
61
|
+
// const last = vec.times(coeff).getEndPoint(points[0])
|
|
62
|
+
// const identifiers: Identifiers = {}
|
|
63
|
+
// return getQuestionFromIdentifiers(identifiers);
|
|
64
|
+
// }
|
|
65
|
+
// const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<Identifiers> = (identifiers)=>{
|
|
66
|
+
// return {
|
|
67
|
+
// answer: getAnswer(identifiers),
|
|
68
|
+
// instruction: getInstruction(identifiers),
|
|
69
|
+
// keys: getKeys(identifiers),
|
|
70
|
+
// answerFormat: 'tex',
|
|
71
|
+
// identifiers,
|
|
72
|
+
// hint: getHint(identifiers),
|
|
73
|
+
// correction: getCorrection(identifiers)
|
|
74
|
+
// }
|
|
75
|
+
// }
|
|
76
|
+
// export const findCoordForAligment: Exercise<Identifiers> = {
|
|
77
|
+
// id: 'findCoordForAligment',
|
|
78
|
+
// connector: "=",
|
|
79
|
+
// label: "Déterminer une coordonnée manquante d'un point pour obtenir un alignement",
|
|
80
|
+
// isSingleStep: true,
|
|
81
|
+
// generator: (nb, opts) => getDistinctQuestions(()=>getFindCoordForAligmentQuestion(opts), nb),
|
|
82
|
+
// qcmTimer: 60,
|
|
83
|
+
// freeTimer: 60,
|
|
84
|
+
// getPropositions,
|
|
85
|
+
// isAnswerValid,
|
|
86
|
+
// subject: "Mathématiques",
|
|
87
|
+
// getInstruction,
|
|
88
|
+
// getHint,
|
|
89
|
+
// getCorrection,
|
|
90
|
+
// getAnswer,
|
|
91
|
+
// getQuestionFromIdentifiers
|
|
92
|
+
// };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculatePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculatePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"calculatePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculatePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAwHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAchD,CAAC"}
|
|
@@ -2,21 +2,76 @@ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercis
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
4
4
|
import { NumberNode } from "../../../tree/nodes/numbers/numberNode.js";
|
|
5
|
+
import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
5
6
|
import { PowerNode } from "../../../tree/nodes/operators/powerNode.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { operatorComposition } from "../../../tree/utilities/operatorComposition.js";
|
|
8
|
+
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
9
|
+
const getInstruction = (identifiers) => {
|
|
10
|
+
const { int, power } = identifiers;
|
|
9
11
|
const statement = new PowerNode(new NumberNode(int), new NumberNode(power)).toTex();
|
|
12
|
+
return `Calculer :
|
|
13
|
+
|
|
14
|
+
$$
|
|
15
|
+
${statement}
|
|
16
|
+
$$`;
|
|
17
|
+
};
|
|
18
|
+
const getAnswer = (identifiers) => {
|
|
19
|
+
const { int, power } = identifiers;
|
|
10
20
|
const answer = int ** power + "";
|
|
21
|
+
return answer;
|
|
22
|
+
};
|
|
23
|
+
const getHint = (identifiers) => {
|
|
24
|
+
const { int, power } = identifiers;
|
|
25
|
+
return `L'écriture $a^b$ signifie : le nombre $a$ multiplié $b$ fois par lui-même.
|
|
26
|
+
|
|
27
|
+
D'autre part, pour tout nombre $a$, on a $a^0 = 1$.`;
|
|
28
|
+
};
|
|
29
|
+
const getCorrection = (identifiers) => {
|
|
30
|
+
const { int, power } = identifiers;
|
|
31
|
+
const statement = new PowerNode(new NumberNode(int), new NumberNode(power)).toTex();
|
|
32
|
+
if (power === 0) {
|
|
33
|
+
return `Pour tout nombre $a$, on a $a^0 = 1$.
|
|
34
|
+
|
|
35
|
+
Ici, on a donc :
|
|
36
|
+
|
|
37
|
+
$$
|
|
38
|
+
${statement} = ${getAnswer(identifiers)}
|
|
39
|
+
$$`;
|
|
40
|
+
}
|
|
41
|
+
if (power === 1) {
|
|
42
|
+
return `Élever un nombre à la puissance $1$ ne change pas ce nombre. On a donc :
|
|
43
|
+
|
|
44
|
+
$$
|
|
45
|
+
${statement} = ${getAnswer(identifiers)}
|
|
46
|
+
$$`;
|
|
47
|
+
}
|
|
48
|
+
const mul = operatorComposition(MultiplyNode, Array(power).fill(int.toTree()));
|
|
49
|
+
return `On multiplie $${int}$ par lui-même $${power}$ fois :
|
|
50
|
+
|
|
51
|
+
${alignTex([
|
|
52
|
+
[statement, "=", mul.toTex({ forceNoSimplification: true })],
|
|
53
|
+
["", "=", getAnswer(identifiers)],
|
|
54
|
+
])}
|
|
55
|
+
`;
|
|
56
|
+
};
|
|
57
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
11
58
|
const question = {
|
|
12
|
-
answer,
|
|
13
|
-
instruction:
|
|
59
|
+
answer: getAnswer(identifiers),
|
|
60
|
+
instruction: getInstruction(identifiers),
|
|
14
61
|
keys: [],
|
|
15
62
|
answerFormat: "tex",
|
|
16
|
-
identifiers
|
|
63
|
+
identifiers,
|
|
64
|
+
hint: getHint(identifiers),
|
|
65
|
+
correction: getCorrection(identifiers),
|
|
17
66
|
};
|
|
18
67
|
return question;
|
|
19
68
|
};
|
|
69
|
+
const getCalculatePowerQuestion = () => {
|
|
70
|
+
const int = randint(-10, 11);
|
|
71
|
+
const power = randint(0, 6);
|
|
72
|
+
const identifiers = { int, power };
|
|
73
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
74
|
+
};
|
|
20
75
|
const getPropositions = (n, { answer, int, power }) => {
|
|
21
76
|
const propositions = [];
|
|
22
77
|
addValidProp(propositions, answer);
|
|
@@ -58,4 +113,6 @@ export const calculatePower = {
|
|
|
58
113
|
getPropositions,
|
|
59
114
|
isAnswerValid,
|
|
60
115
|
subject: "Mathématiques",
|
|
116
|
+
getQuestionFromIdentifiers,
|
|
117
|
+
hasHintAndCorrection: true,
|
|
61
118
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powerDefinition.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powerDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"powerDefinition.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powerDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA6FF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
|
|
@@ -3,25 +3,56 @@ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuesti
|
|
|
3
3
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
4
4
|
import { NumberNode } from "../../../tree/nodes/numbers/numberNode.js";
|
|
5
5
|
import { PowerNode } from "../../../tree/nodes/operators/powerNode.js";
|
|
6
|
-
const
|
|
7
|
-
const int =
|
|
8
|
-
const power = randint(2, 6);
|
|
6
|
+
const getInstruction = (identifiers) => {
|
|
7
|
+
const { int, power } = identifiers;
|
|
9
8
|
let statement = "";
|
|
10
9
|
for (let i = 0; i < power; i++) {
|
|
11
10
|
statement += int + "";
|
|
12
11
|
if (i < power - 1)
|
|
13
12
|
statement += "\\times";
|
|
14
13
|
}
|
|
14
|
+
return `Écrire sous forme de puissance :
|
|
15
|
+
|
|
16
|
+
$$
|
|
17
|
+
${statement}
|
|
18
|
+
$$`;
|
|
19
|
+
};
|
|
20
|
+
const getAnswer = (identifiers) => {
|
|
21
|
+
const { int, power } = identifiers;
|
|
15
22
|
const answer = new PowerNode(new NumberNode(int), new NumberNode(power)).toTex();
|
|
23
|
+
return answer;
|
|
24
|
+
};
|
|
25
|
+
const getHint = (identifiers) => {
|
|
26
|
+
return "Une puissance du type $a^b$ signifie : $a$ multiplié $b$ fois par lui-même.";
|
|
27
|
+
};
|
|
28
|
+
const getCorrection = (identifiers) => {
|
|
29
|
+
const { int, power } = identifiers;
|
|
30
|
+
return `Le nombre $${int}$ est multiplié $${power}$ fois par lui-même.
|
|
31
|
+
|
|
32
|
+
Ce produit s'écrit donc sous forme de puissance :
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
${getAnswer(identifiers)}
|
|
36
|
+
$$`;
|
|
37
|
+
};
|
|
38
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
16
39
|
const question = {
|
|
17
|
-
answer,
|
|
18
|
-
instruction:
|
|
40
|
+
answer: getAnswer(identifiers),
|
|
41
|
+
instruction: getInstruction(identifiers),
|
|
19
42
|
keys: [],
|
|
20
43
|
answerFormat: "tex",
|
|
21
|
-
identifiers
|
|
44
|
+
identifiers,
|
|
45
|
+
hint: getHint(identifiers),
|
|
46
|
+
correction: getCorrection(identifiers),
|
|
22
47
|
};
|
|
23
48
|
return question;
|
|
24
49
|
};
|
|
50
|
+
const getPowerDefinitionQuestion = () => {
|
|
51
|
+
const int = randint(2, 11);
|
|
52
|
+
const power = randint(2, 6);
|
|
53
|
+
const identifiers = { int, power };
|
|
54
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
55
|
+
};
|
|
25
56
|
const isAnswerValid = (ans, { int, power }) => {
|
|
26
57
|
const answer = new PowerNode(new NumberNode(int), new NumberNode(power)).toTex();
|
|
27
58
|
return ans === answer;
|
|
@@ -41,13 +72,13 @@ export const powerDefinition = {
|
|
|
41
72
|
id: "powerDefinition",
|
|
42
73
|
connector: "=",
|
|
43
74
|
label: "Écrire un produit sous forme de puissance",
|
|
44
|
-
levels: ["4ème", "3ème", "2ndPro", "CAP"],
|
|
45
75
|
isSingleStep: true,
|
|
46
|
-
sections: ["Puissances"],
|
|
47
76
|
generator: (nb) => getDistinctQuestions(getPowerDefinitionQuestion, nb),
|
|
48
77
|
qcmTimer: 60,
|
|
49
78
|
freeTimer: 60,
|
|
50
79
|
getPropositions,
|
|
51
80
|
isAnswerValid,
|
|
52
81
|
subject: "Mathématiques",
|
|
82
|
+
getQuestionFromIdentifiers,
|
|
83
|
+
hasHintAndCorrection: true,
|
|
53
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powersOfTenToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersOfTenToDecimal.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"powersOfTenToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersOfTenToDecimal.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,EACL,QAAQ,EAYT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAyEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAiBtD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 10^(-x) into 0,0...1
|
|
3
3
|
*/
|
|
4
|
+
import { numberVEA } from "../../../exercises/vea/numberVEA.js";
|
|
4
5
|
import { Power } from "../../../math/numbers/integer/power.js";
|
|
5
6
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
7
|
import { NumberNode } from "../../../tree/nodes/numbers/numberNode.js";
|
|
@@ -60,7 +61,7 @@ const getPropositions = (n, { answer, randPower }) => {
|
|
|
60
61
|
return shuffle(propositions);
|
|
61
62
|
};
|
|
62
63
|
const isAnswerValid = (ans, { answer }) => {
|
|
63
|
-
return ans
|
|
64
|
+
return numberVEA(ans, answer);
|
|
64
65
|
};
|
|
65
66
|
export const powersOfTenToDecimal = {
|
|
66
67
|
id: "powersOfTenToDecimal",
|
|
@@ -7,7 +7,10 @@ type Identifiers = {
|
|
|
7
7
|
b: number;
|
|
8
8
|
c: number;
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type Options = {
|
|
11
|
+
useOnlyPowersOfTen: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const powersOfTenPower: Exercise<Identifiers, Options>;
|
|
14
|
+
export declare const powersPower: Exercise<Identifiers, Options>;
|
|
12
15
|
export {};
|
|
13
16
|
//# sourceMappingURL=powersPower.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powersPower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersPower.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"powersPower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersPower.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,OAAO,EACL,QAAQ,EAeT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAAC;AA6GF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiB3D,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBtD,CAAC"}
|
|
@@ -3,32 +3,74 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Power } from "../../../math/numbers/integer/power.js";
|
|
5
5
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
6
7
|
import { power } from "../../../tree/nodes/operators/powerNode.js";
|
|
7
8
|
import { powerParser } from "../../../tree/parsers/powerParser.js";
|
|
8
9
|
import { rationalParser } from "../../../tree/parsers/rationalParser.js";
|
|
10
|
+
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
9
11
|
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../exercise.js";
|
|
10
12
|
import { getDistinctQuestions } from "../../utils/getDistinctQuestions.js";
|
|
11
|
-
const
|
|
12
|
-
const a
|
|
13
|
-
const [b, c] = [1, 2].map((el) => randint(-11, 11));
|
|
13
|
+
const getStartStatement = (identifiers) => {
|
|
14
|
+
const { a, b, c } = identifiers;
|
|
14
15
|
const statement = power(power(a, b), c);
|
|
15
|
-
let answerTree = power(a, b * c).simplify();
|
|
16
|
-
const answer = answerTree.toTex();
|
|
17
16
|
const statementTex = statement.toTex();
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
return statementTex;
|
|
18
|
+
};
|
|
19
|
+
const getInstruction = (identifiers) => {
|
|
20
|
+
return `Simplifier :
|
|
20
21
|
|
|
21
22
|
$$
|
|
22
|
-
${
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
${getStartStatement(identifiers)}
|
|
24
|
+
$$`;
|
|
25
|
+
};
|
|
26
|
+
const getAnswer = (identifiers) => {
|
|
27
|
+
const { a, b, c } = identifiers;
|
|
28
|
+
let answerTree = power(a, b * c).simplify();
|
|
29
|
+
const answer = answerTree.toTex();
|
|
30
|
+
return answer;
|
|
31
|
+
};
|
|
32
|
+
const getHint = (identifiers) => {
|
|
33
|
+
const { a, b, c } = identifiers;
|
|
34
|
+
return `Si $a$, $b$ et $c$ sont trois nombres, alors :
|
|
35
|
+
|
|
36
|
+
$$
|
|
37
|
+
\\left(a^b\\right)^c = a^{b\\times c}
|
|
38
|
+
$$`;
|
|
39
|
+
};
|
|
40
|
+
const getCorrection = (identifiers) => {
|
|
41
|
+
const { a, b, c } = identifiers;
|
|
42
|
+
const statement = getStartStatement(identifiers);
|
|
43
|
+
return `On multiplie les puissances :
|
|
44
|
+
|
|
45
|
+
${alignTex([
|
|
46
|
+
[
|
|
47
|
+
statement,
|
|
48
|
+
"=",
|
|
49
|
+
power(a, multiply(b, c)).toTex({ forceNoSimplification: true }),
|
|
50
|
+
],
|
|
51
|
+
["", "=", getAnswer(identifiers)],
|
|
52
|
+
])}
|
|
53
|
+
`;
|
|
54
|
+
};
|
|
55
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
56
|
+
const question = {
|
|
57
|
+
instruction: getInstruction(identifiers),
|
|
58
|
+
startStatement: getStartStatement(identifiers),
|
|
59
|
+
answer: getAnswer(identifiers),
|
|
26
60
|
keys: [],
|
|
27
61
|
answerFormat: "tex",
|
|
28
|
-
identifiers
|
|
62
|
+
identifiers,
|
|
63
|
+
hint: getHint(identifiers),
|
|
64
|
+
correction: getCorrection(identifiers),
|
|
29
65
|
};
|
|
30
66
|
return question;
|
|
31
67
|
};
|
|
68
|
+
const getPowersPowerQuestion = (opts) => {
|
|
69
|
+
const a = opts?.useOnlyPowersOfTen ? 10 : randint(-10, 11, [0, 1]);
|
|
70
|
+
const [b, c] = [1, 2].map((el) => randint(-11, 11));
|
|
71
|
+
const identifiers = { a, b, c };
|
|
72
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
73
|
+
};
|
|
32
74
|
const getPropositions = (n, { answer, a, b, c }) => {
|
|
33
75
|
const propositions = [];
|
|
34
76
|
addValidProp(propositions, answer);
|
|
@@ -38,6 +80,7 @@ const getPropositions = (n, { answer, a, b, c }) => {
|
|
|
38
80
|
tryToAddWrongProp(propositions, "0");
|
|
39
81
|
tryToAddWrongProp(propositions, "-2");
|
|
40
82
|
}
|
|
83
|
+
tryToAddWrongProp(propositions, power(a, b + c).toTex());
|
|
41
84
|
while (propositions.length < n) {
|
|
42
85
|
const wrongExponent = b * c + randint(-11, 11, [0]);
|
|
43
86
|
const wrongAnswerTree = new Power(a, wrongExponent).simplify();
|
|
@@ -62,20 +105,6 @@ export const powersOfTenPower = {
|
|
|
62
105
|
id: "powersOfTenPower",
|
|
63
106
|
connector: "=",
|
|
64
107
|
label: "Puissance d'une puissance de $10$ ",
|
|
65
|
-
levels: [
|
|
66
|
-
"4ème",
|
|
67
|
-
"3ème",
|
|
68
|
-
"2nde",
|
|
69
|
-
"CAP",
|
|
70
|
-
"2ndPro",
|
|
71
|
-
"1reESM",
|
|
72
|
-
"1rePro",
|
|
73
|
-
"1reSpé",
|
|
74
|
-
"1reTech",
|
|
75
|
-
"TermPro",
|
|
76
|
-
"TermTech",
|
|
77
|
-
],
|
|
78
|
-
sections: ["Puissances"],
|
|
79
108
|
isSingleStep: true,
|
|
80
109
|
generator: (nb) => getDistinctQuestions(() => getPowersPowerQuestion({ useOnlyPowersOfTen: true }), nb),
|
|
81
110
|
qcmTimer: 60,
|
|
@@ -83,13 +112,13 @@ export const powersOfTenPower = {
|
|
|
83
112
|
getPropositions,
|
|
84
113
|
isAnswerValid,
|
|
85
114
|
subject: "Mathématiques",
|
|
115
|
+
getQuestionFromIdentifiers,
|
|
116
|
+
hasHintAndCorrection: true,
|
|
86
117
|
};
|
|
87
118
|
export const powersPower = {
|
|
88
119
|
id: "powersPower",
|
|
89
120
|
connector: "=",
|
|
90
121
|
label: "Puissance d'une puissance",
|
|
91
|
-
levels: ["4ème", "3ème", "2nde"],
|
|
92
|
-
sections: ["Puissances"],
|
|
93
122
|
isSingleStep: true,
|
|
94
123
|
generator: (nb) => getDistinctQuestions(() => getPowersPowerQuestion({ useOnlyPowersOfTen: false }), nb),
|
|
95
124
|
qcmTimer: 60,
|
|
@@ -97,4 +126,6 @@ export const powersPower = {
|
|
|
97
126
|
getPropositions,
|
|
98
127
|
isAnswerValid,
|
|
99
128
|
subject: "Mathématiques",
|
|
129
|
+
getQuestionFromIdentifiers,
|
|
130
|
+
hasHintAndCorrection: true,
|
|
100
131
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"calculateCosSinAndTan.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/calculateCosSinAndTan.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA6FF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAavD,CAAC"}
|
|
@@ -8,6 +8,20 @@ import { SinNode } from "../../../tree/nodes/functions/sinNode.js";
|
|
|
8
8
|
import { TanNode } from "../../../tree/nodes/functions/tanNode.js";
|
|
9
9
|
import { DegreeNode } from "../../../tree/nodes/geometry/degree.js";
|
|
10
10
|
import { random } from "../../../utils/alea/random.js";
|
|
11
|
+
const getHint = (identifiers) => {
|
|
12
|
+
return "Utilise la calculatrice, réglée en mode degrés.";
|
|
13
|
+
};
|
|
14
|
+
const getCorrection = (identifiers) => {
|
|
15
|
+
const { degree, trigoFunct } = identifiers;
|
|
16
|
+
const node = trigoFunct === "tan" ? TanNode : trigoFunct === "sin" ? SinNode : CosNode;
|
|
17
|
+
return `On utilise la calculatrice, réglée en mode degrés.
|
|
18
|
+
|
|
19
|
+
On obtient :
|
|
20
|
+
|
|
21
|
+
$$
|
|
22
|
+
${new node(new DegreeNode(degree)).toTex()} \\approx ${getAnswer(identifiers)}
|
|
23
|
+
$$`;
|
|
24
|
+
};
|
|
11
25
|
const getInstruction = (identifiers) => {
|
|
12
26
|
const { degree, trigoFunct } = identifiers;
|
|
13
27
|
const node = trigoFunct === "tan" ? TanNode : trigoFunct === "sin" ? SinNode : CosNode;
|
|
@@ -44,12 +58,17 @@ const getCalculateCosSinAndTanQuestion = () => {
|
|
|
44
58
|
const trigoFunct = random(trigo);
|
|
45
59
|
const degree = randint(1, 180);
|
|
46
60
|
const identifiers = { degree, trigoFunct };
|
|
61
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
62
|
+
};
|
|
63
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
47
64
|
const question = {
|
|
48
65
|
answer: getAnswer(identifiers),
|
|
49
66
|
instruction: getInstruction(identifiers),
|
|
50
67
|
keys: [],
|
|
51
68
|
answerFormat: "tex",
|
|
52
69
|
identifiers,
|
|
70
|
+
hint: getHint(identifiers),
|
|
71
|
+
correction: getCorrection(identifiers),
|
|
53
72
|
};
|
|
54
73
|
return question;
|
|
55
74
|
};
|
|
@@ -77,4 +96,6 @@ export const calculateCosSinAndTan = {
|
|
|
77
96
|
getPropositions,
|
|
78
97
|
isAnswerValid,
|
|
79
98
|
subject: "Mathématiques",
|
|
99
|
+
hasHintAndCorrection: true,
|
|
100
|
+
getQuestionFromIdentifiers,
|
|
80
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mainRemarkableValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/mainRemarkableValues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mainRemarkableValues.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/mainRemarkableValues.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,QAAQ,EAaT,MAAM,mBAAmB,CAAC;AAE3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AA4FF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAiB9D,CAAC"}
|