math-exercises 3.0.53 → 3.0.54
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 +3 -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 +51 -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 +12 -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":"rectanglePerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/rectanglePerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"rectanglePerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/rectanglePerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAwEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAapD,CAAC"}
|
|
@@ -2,20 +2,51 @@ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
4
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
5
|
-
const
|
|
6
|
-
const length =
|
|
7
|
-
|
|
5
|
+
const getInstruction = (identifiers) => {
|
|
6
|
+
const { width, length } = identifiers;
|
|
7
|
+
return `Calculer le périmètre d'un rectangle de $${length}$ cm de longueur et de $${width}$ cm de largeur.`;
|
|
8
|
+
};
|
|
9
|
+
const getAnswer = (identifiers) => {
|
|
10
|
+
const { width, length } = identifiers;
|
|
8
11
|
const answer = (length + width) * 2 + "";
|
|
9
12
|
const answerTex = answer + "\\text{cm}";
|
|
13
|
+
return answerTex;
|
|
14
|
+
};
|
|
15
|
+
const getHint = (identifiers) => {
|
|
16
|
+
return `Le périmètre d'un rectangle est la somme des longueurs de ses quatre côtés.`;
|
|
17
|
+
};
|
|
18
|
+
const getCorrection = (identifiers) => {
|
|
19
|
+
const { width, length } = identifiers;
|
|
20
|
+
return `Puisque les côtés opposés d'un rectangle sont égaux, le périmètre d'un rectangle est :
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
P = 2\\times \\text{Longueur} + 2\\times \\text{largeur}
|
|
24
|
+
$$
|
|
25
|
+
|
|
26
|
+
Ici, le périmètre du rectangle est donc :
|
|
27
|
+
|
|
28
|
+
$$
|
|
29
|
+
P = 2\\times ${width} + 2\\times ${length} = ${getAnswer(identifiers)}
|
|
30
|
+
$$`;
|
|
31
|
+
};
|
|
32
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
10
33
|
const question = {
|
|
11
|
-
instruction:
|
|
12
|
-
answer:
|
|
34
|
+
instruction: getInstruction(identifiers),
|
|
35
|
+
answer: getAnswer(identifiers),
|
|
13
36
|
answerFormat: "tex",
|
|
14
37
|
keys: ["cm", "cm2"],
|
|
15
|
-
identifiers
|
|
38
|
+
identifiers,
|
|
39
|
+
hint: getHint(identifiers),
|
|
40
|
+
correction: getCorrection(identifiers),
|
|
16
41
|
};
|
|
17
42
|
return question;
|
|
18
43
|
};
|
|
44
|
+
const getRectanglePerimeter = () => {
|
|
45
|
+
const length = randint(3, 13);
|
|
46
|
+
const width = randint(1, length);
|
|
47
|
+
const identifiers = { length, width };
|
|
48
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
49
|
+
};
|
|
19
50
|
const getPropositions = (n, { answer }) => {
|
|
20
51
|
const propositions = [];
|
|
21
52
|
addValidProp(propositions, answer);
|
|
@@ -39,4 +70,6 @@ export const rectanglePerimeter = {
|
|
|
39
70
|
getPropositions,
|
|
40
71
|
isAnswerValid,
|
|
41
72
|
subject: "Mathématiques",
|
|
73
|
+
getQuestionFromIdentifiers,
|
|
74
|
+
hasHintAndCorrection: true,
|
|
42
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"squarePerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/squarePerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"squarePerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/squarePerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAwEF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
|
|
@@ -2,16 +2,49 @@ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
4
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
5
|
-
const
|
|
6
|
-
const side =
|
|
5
|
+
const getInstruction = (identifiers) => {
|
|
6
|
+
const { side } = identifiers;
|
|
7
|
+
return `Calculer le périmètre d'un carré de $${side}$ cm de côté.`;
|
|
8
|
+
};
|
|
9
|
+
const getAnswer = (identifiers) => {
|
|
10
|
+
const { side } = identifiers;
|
|
7
11
|
const answer = side * 4 + "";
|
|
8
12
|
const answerTex = answer + "\\text{cm}";
|
|
13
|
+
return answerTex;
|
|
14
|
+
};
|
|
15
|
+
const getHint = (identifiers) => {
|
|
16
|
+
return "Le périmètre d'un carré est la somme des longueurs de ses côtés.";
|
|
17
|
+
};
|
|
18
|
+
const getCorrection = (identifiers) => {
|
|
19
|
+
const { side } = identifiers;
|
|
20
|
+
return `Puisque tous les côtés d'un carré sont égaux, le périmètre d'un carré est égal à :
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
P = 4\\times \\text{longueur d'un côté}
|
|
24
|
+
$$
|
|
25
|
+
|
|
26
|
+
Ici, la longueur d'un côté du carré est $${side}\\ \\text{cm}$.
|
|
27
|
+
|
|
28
|
+
Le périmètre est donc égal à :
|
|
29
|
+
|
|
30
|
+
$$
|
|
31
|
+
P = 4\\times ${side} = ${getAnswer(identifiers)}
|
|
32
|
+
$$`;
|
|
33
|
+
};
|
|
34
|
+
const getSquarePerimeter = () => {
|
|
35
|
+
const side = randint(1, 21);
|
|
36
|
+
const identifiers = { side };
|
|
37
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
38
|
+
};
|
|
39
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
9
40
|
const question = {
|
|
10
|
-
instruction:
|
|
11
|
-
answer:
|
|
41
|
+
instruction: getInstruction(identifiers),
|
|
42
|
+
answer: getAnswer(identifiers),
|
|
12
43
|
answerFormat: "tex",
|
|
13
44
|
keys: ["cm", "cm2"],
|
|
14
|
-
identifiers
|
|
45
|
+
identifiers,
|
|
46
|
+
hint: getHint(identifiers),
|
|
47
|
+
correction: getCorrection(identifiers),
|
|
15
48
|
};
|
|
16
49
|
return question;
|
|
17
50
|
};
|
|
@@ -39,4 +72,6 @@ export const squarePerimeter = {
|
|
|
39
72
|
getPropositions,
|
|
40
73
|
isAnswerValid,
|
|
41
74
|
subject: "Mathématiques",
|
|
75
|
+
getQuestionFromIdentifiers,
|
|
76
|
+
hasHintAndCorrection: true,
|
|
42
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trianglePerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/trianglePerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"trianglePerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/trianglePerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAkEF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAanD,CAAC"}
|
|
@@ -2,19 +2,46 @@ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
4
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
5
|
-
const
|
|
6
|
-
const sides =
|
|
5
|
+
const getInstruction = (identifiers) => {
|
|
6
|
+
const { sides } = identifiers;
|
|
7
|
+
return `Calculer le périmètre d'un triangle dont les côtés mesurent : $${sides[0]}$ cm, $${sides[1]}$ cm et $${sides[2]}$ cm.`;
|
|
8
|
+
};
|
|
9
|
+
const getAnswer = (identifiers) => {
|
|
10
|
+
const { sides } = identifiers;
|
|
7
11
|
const answer = sides[0] + sides[1] + sides[2] + "";
|
|
8
12
|
const answerTex = answer + "\\text{cm}";
|
|
13
|
+
return answerTex;
|
|
14
|
+
};
|
|
15
|
+
const getHint = (identifiers) => {
|
|
16
|
+
return `Le périmètre d'un triangle est la somme des longueurs de ses $3$ côtés.`;
|
|
17
|
+
};
|
|
18
|
+
const getCorrection = (identifiers) => {
|
|
19
|
+
const { sides } = identifiers;
|
|
20
|
+
return `Le périmètre d'un triangle est la somme des longueurs de ses $3$ côtés.
|
|
21
|
+
|
|
22
|
+
Ici, le périmètre est donc :
|
|
23
|
+
|
|
24
|
+
$$
|
|
25
|
+
P = ${sides.join("+")} = ${getAnswer(identifiers)}
|
|
26
|
+
$$`;
|
|
27
|
+
};
|
|
28
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
9
29
|
const question = {
|
|
10
|
-
instruction:
|
|
11
|
-
answer:
|
|
30
|
+
instruction: getInstruction(identifiers),
|
|
31
|
+
answer: getAnswer(identifiers),
|
|
12
32
|
answerFormat: "tex",
|
|
13
33
|
keys: ["cm", "cm2"],
|
|
14
|
-
identifiers
|
|
34
|
+
identifiers,
|
|
35
|
+
hint: getHint(identifiers),
|
|
36
|
+
correction: getCorrection(identifiers),
|
|
15
37
|
};
|
|
16
38
|
return question;
|
|
17
39
|
};
|
|
40
|
+
const getTrianglePerimeter = () => {
|
|
41
|
+
const sides = [randint(1, 13), randint(1, 13), randint(1, 13)];
|
|
42
|
+
const identifiers = { sides };
|
|
43
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
44
|
+
};
|
|
18
45
|
const getPropositions = (n, { answer }) => {
|
|
19
46
|
const propositions = [];
|
|
20
47
|
addValidProp(propositions, answer);
|
|
@@ -32,13 +59,13 @@ export const trianglePerimeter = {
|
|
|
32
59
|
id: "trianglePerimeter",
|
|
33
60
|
connector: "=",
|
|
34
61
|
label: "Calculer le périmètre d'un triangle",
|
|
35
|
-
levels: ["5ème", "4ème", "3ème", "2nde"],
|
|
36
62
|
isSingleStep: false,
|
|
37
|
-
sections: ["Périmètres", "Géométrie euclidienne"],
|
|
38
63
|
generator: (nb) => getDistinctQuestions(getTrianglePerimeter, nb),
|
|
39
64
|
qcmTimer: 60,
|
|
40
65
|
freeTimer: 60,
|
|
41
66
|
getPropositions,
|
|
42
67
|
isAnswerValid,
|
|
43
68
|
subject: "Mathématiques",
|
|
69
|
+
getQuestionFromIdentifiers,
|
|
70
|
+
hasHintAndCorrection: true,
|
|
44
71
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAUnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA8GF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
|
|
@@ -6,29 +6,65 @@ import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
|
|
|
6
6
|
import { SquareNode } from "../../../../tree/nodes/operators/powerNode.js";
|
|
7
7
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
8
8
|
import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
9
|
+
const getInstruction = (identifiers) => {
|
|
10
|
+
return "Écrire l'égalité de Pythagore pour le triangle rectangle suivant : ";
|
|
11
|
+
};
|
|
12
|
+
const getAnswer = (identifiers) => {
|
|
13
|
+
const triangle = RightTriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
|
|
14
|
+
const answer = triangle.getPythagorianTex();
|
|
15
|
+
return answer;
|
|
16
|
+
};
|
|
17
|
+
const getGGBOptions = (identifiers) => {
|
|
18
|
+
const triangle = RightTriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
|
|
14
19
|
const ggb = new GeogebraConstructor({
|
|
15
20
|
commands: triangle.commands,
|
|
16
21
|
hideAxes: true,
|
|
17
22
|
hideGrid: true,
|
|
18
23
|
});
|
|
19
|
-
|
|
24
|
+
return ggb.getOptions({
|
|
25
|
+
coords: triangle.generateCoords(),
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
const getHint = (identifiers) => {
|
|
29
|
+
return "D'après le théorème de Pythagore : dans un triangle rectangle, le carré de l'hypoténuse est égal à la somme des carrés des deux autres côtés.";
|
|
30
|
+
};
|
|
31
|
+
const getCorrection = (identifiers) => {
|
|
32
|
+
const triangle = RightTriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
|
|
33
|
+
return `Le triangle $${triangle.name}$ est rectangle en $${triangle.points[0].name}$.
|
|
34
|
+
|
|
35
|
+
L'hypoténuse dans ce triangle est donc le côté $${triangle.sides[0].toTex()}$.
|
|
36
|
+
|
|
37
|
+
D'après le théorème de Pythagore, on a donc :
|
|
38
|
+
|
|
39
|
+
$$
|
|
40
|
+
${getAnswer(identifiers)}
|
|
41
|
+
$$`;
|
|
42
|
+
};
|
|
43
|
+
const getKeys = (identifiers) => {
|
|
44
|
+
const triangle = RightTriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
|
|
45
|
+
return [...triangle.points.map((p) => p.name), "equal"];
|
|
46
|
+
};
|
|
47
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
20
48
|
const question = {
|
|
21
|
-
instruction:
|
|
22
|
-
answer,
|
|
23
|
-
keys:
|
|
24
|
-
ggbOptions:
|
|
25
|
-
coords: triangle.generateCoords(),
|
|
26
|
-
}),
|
|
49
|
+
instruction: getInstruction(identifiers),
|
|
50
|
+
answer: getAnswer(identifiers),
|
|
51
|
+
keys: getKeys(identifiers),
|
|
52
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
27
53
|
answerFormat: "tex",
|
|
28
|
-
identifiers
|
|
54
|
+
identifiers,
|
|
55
|
+
hint: getHint(identifiers),
|
|
56
|
+
correction: getCorrection(identifiers),
|
|
29
57
|
};
|
|
30
58
|
return question;
|
|
31
59
|
};
|
|
60
|
+
const getPythagore = () => {
|
|
61
|
+
const triangle = RightTriangleConstructor.randomNiceSides({
|
|
62
|
+
randomName: true,
|
|
63
|
+
});
|
|
64
|
+
const triangleIdentifiers = triangle.toIdentifiers();
|
|
65
|
+
const identifiers = { triangleIdentifiers };
|
|
66
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
67
|
+
};
|
|
32
68
|
const getPropositions = (n, { answer, triangleIdentifiers }) => {
|
|
33
69
|
const propositions = [];
|
|
34
70
|
addValidProp(propositions, answer);
|
|
@@ -53,9 +89,7 @@ export const pythagore = {
|
|
|
53
89
|
id: "pythagore",
|
|
54
90
|
connector: "=",
|
|
55
91
|
label: "Écrire l'égalité de Pythagore",
|
|
56
|
-
levels: ["4ème", "3ème", "2nde"],
|
|
57
92
|
isSingleStep: false,
|
|
58
|
-
sections: ["Théorème de Pythagore", "Géométrie euclidienne"],
|
|
59
93
|
generator: (nb) => getDistinctQuestions(getPythagore, nb),
|
|
60
94
|
qcmTimer: 60,
|
|
61
95
|
freeTimer: 60,
|
|
@@ -63,4 +97,6 @@ export const pythagore = {
|
|
|
63
97
|
isAnswerValid,
|
|
64
98
|
hasGeogebra: true,
|
|
65
99
|
subject: "Mathématiques",
|
|
100
|
+
getQuestionFromIdentifiers,
|
|
101
|
+
hasHintAndCorrection: true,
|
|
66
102
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAcnD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA8LF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
|
|
@@ -5,38 +5,128 @@ import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
|
5
5
|
import { random } from "../../../../utils/alea/random.js";
|
|
6
6
|
import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
|
|
7
7
|
import { sqrtVEA } from "../../../../exercises/vea/sqrtVEA.js";
|
|
8
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
8
9
|
import { square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
9
10
|
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
10
11
|
import { round } from "../../../../math/utils/round.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
|
|
13
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
14
|
+
import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
15
|
+
const getInstruction = (identifiers) => {
|
|
16
|
+
const { sideAsked, triangleIdentifiers } = identifiers;
|
|
17
|
+
const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
|
|
18
|
+
return `Dans le triangle $${triangle.name}$ rectangle en $${triangle.points[0].name}$, on sait que $${triangle.sides[(sideAsked + 1) % 3].toLengthTex()}$ et que $${triangle.sides[(sideAsked + 2) % 3].toLengthTex()}$.
|
|
19
|
+
|
|
20
|
+
Calculer la longueur exacte $${triangle.sides[sideAsked].toInsideName()}$.`;
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
const { sideAsked, triangleIdentifiers } = identifiers;
|
|
24
|
+
const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
|
|
25
|
+
const answer = triangle.sides[sideAsked].getLengthNode().toTex();
|
|
26
|
+
return answer;
|
|
27
|
+
};
|
|
28
|
+
const getHint = (identifiers) => {
|
|
29
|
+
const { sideAsked, triangleIdentifiers } = identifiers;
|
|
30
|
+
const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
|
|
31
|
+
return `Le triangle $${triangle.name}$ est rectangle en $${triangle.points[0].name}$.
|
|
32
|
+
|
|
33
|
+
D'après le théorème de Pythagore, on a donc :
|
|
34
|
+
|
|
35
|
+
$$
|
|
36
|
+
${triangle.getPythagorianTex()}
|
|
37
|
+
$$
|
|
38
|
+
|
|
39
|
+
Remplace les valeurs données dans l'énoncé dans cette égalité. Puis, isole le côté recherché. Enfin, utilise la racine carrée.`;
|
|
40
|
+
};
|
|
41
|
+
const getCorrection = (identifiers) => {
|
|
42
|
+
const { sideAsked, triangleIdentifiers } = identifiers;
|
|
43
|
+
const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
|
|
44
|
+
const sidesNames = triangle.sides.map((e) => e.toInsideName());
|
|
45
|
+
const sidesSquared = sidesNames.map((e) => square(e));
|
|
46
|
+
const equality = new EqualNode(sidesSquared[0], add(sidesSquared[1], sidesSquared[2]));
|
|
47
|
+
const isolated = sideAsked === 0
|
|
48
|
+
? equality
|
|
49
|
+
: new EqualNode(sidesSquared[sideAsked], substract(sidesSquared[0], sidesSquared[3 - sideAsked]));
|
|
50
|
+
const detailed = isolated.toDetailedEvaluation({
|
|
51
|
+
...(sideAsked !== 0 && {
|
|
52
|
+
[sidesNames[0]]: triangle.sides[0].getLengthNode(),
|
|
53
|
+
}),
|
|
54
|
+
...(sideAsked !== 1 && {
|
|
55
|
+
[sidesNames[1]]: triangle.sides[1].getLengthNode(),
|
|
56
|
+
}),
|
|
57
|
+
...(sideAsked !== 2 && {
|
|
58
|
+
[sidesNames[2]]: triangle.sides[2].getLengthNode(),
|
|
59
|
+
}),
|
|
14
60
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
61
|
+
const rightSimp = detailed.rightChild.simplify();
|
|
62
|
+
return `Le triangle $${triangle.name}$ est rectangle en $${triangle.points[0].name}$.
|
|
63
|
+
|
|
64
|
+
D'après le théorème de Pythagore, on a donc :
|
|
65
|
+
|
|
66
|
+
$$
|
|
67
|
+
${equality.toTex()}
|
|
68
|
+
$$
|
|
69
|
+
|
|
70
|
+
${sideAsked === 0
|
|
71
|
+
? ""
|
|
72
|
+
: `On isole le côté recherché :
|
|
73
|
+
|
|
74
|
+
$$
|
|
75
|
+
${isolated.toTex()}
|
|
76
|
+
$$`}
|
|
77
|
+
|
|
78
|
+
On remplace par les valeurs données dans l'énoncé :
|
|
79
|
+
|
|
80
|
+
$$
|
|
81
|
+
${detailed.toTex()} = ${rightSimp.toTex()}
|
|
82
|
+
$$
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
On applique enfin la racine carrée pour obtenir la valeur recherchée :
|
|
87
|
+
|
|
88
|
+
$$
|
|
89
|
+
${sidesNames[sideAsked]} = ${sqrt(rightSimp).toTex()} = ${getAnswer(identifiers)}
|
|
90
|
+
$$
|
|
91
|
+
`;
|
|
92
|
+
};
|
|
93
|
+
const getGGBOptions = (identifiers) => {
|
|
94
|
+
const { sideAsked, triangleIdentifiers } = identifiers;
|
|
95
|
+
const triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
|
|
96
|
+
triangle.showSidesLength([sideAsked]);
|
|
19
97
|
const commands = [...triangle.commands];
|
|
20
98
|
const ggb = new GeogebraConstructor({
|
|
21
99
|
commands,
|
|
22
100
|
hideAxes: true,
|
|
23
101
|
hideGrid: true,
|
|
24
102
|
});
|
|
25
|
-
|
|
103
|
+
return ggb.getOptions({
|
|
104
|
+
coords: triangle.generateCoords(),
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
26
108
|
const question = {
|
|
27
|
-
instruction:
|
|
28
|
-
|
|
29
|
-
Calculer la longueur exacte $${triangle.sides[sideIndexAsked].toInsideName()}$.`,
|
|
30
|
-
answer,
|
|
109
|
+
instruction: getInstruction(identifiers),
|
|
110
|
+
answer: getAnswer(identifiers),
|
|
31
111
|
keys: [],
|
|
32
|
-
ggbOptions:
|
|
33
|
-
coords: triangle.generateCoords(),
|
|
34
|
-
}),
|
|
112
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
35
113
|
answerFormat: "tex",
|
|
36
|
-
identifiers
|
|
114
|
+
identifiers,
|
|
115
|
+
hint: getHint(identifiers),
|
|
116
|
+
correction: getCorrection(identifiers),
|
|
37
117
|
};
|
|
38
118
|
return question;
|
|
39
119
|
};
|
|
120
|
+
const getPythagoreCalcul = () => {
|
|
121
|
+
const triangle = RightTriangleConstructor.randomNiceSides({
|
|
122
|
+
randomName: true,
|
|
123
|
+
});
|
|
124
|
+
//une chance sur deux d'avoir hypoténuse
|
|
125
|
+
const sideIndexAsked = random([0, random([1, 2])]);
|
|
126
|
+
const triangleIdentifiers = triangle.toIdentifiers();
|
|
127
|
+
const identifiers = { sideAsked: sideIndexAsked, triangleIdentifiers };
|
|
128
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
129
|
+
};
|
|
40
130
|
const getPropositions = (n, { answer, triangleIdentifiers, sideAsked }) => {
|
|
41
131
|
const propositions = [];
|
|
42
132
|
addValidProp(propositions, answer);
|
|
@@ -59,10 +149,8 @@ const isAnswerValid = (ans, { answer, sideAsked, triangleIdentifiers }) => {
|
|
|
59
149
|
export const pythagoreCalcul = {
|
|
60
150
|
id: "pythagoreCalcul",
|
|
61
151
|
connector: "=",
|
|
62
|
-
label: "Utiliser le
|
|
63
|
-
levels: ["4ème", "3ème", "2nde"],
|
|
152
|
+
label: "Utiliser le théorème de Pythagore pour calculer un côté",
|
|
64
153
|
isSingleStep: false,
|
|
65
|
-
sections: ["Théorème de Pythagore", "Géométrie euclidienne"],
|
|
66
154
|
generator: (nb) => getDistinctQuestions(getPythagoreCalcul, nb),
|
|
67
155
|
qcmTimer: 60,
|
|
68
156
|
freeTimer: 60,
|
|
@@ -70,4 +158,6 @@ export const pythagoreCalcul = {
|
|
|
70
158
|
isAnswerValid,
|
|
71
159
|
hasGeogebra: true,
|
|
72
160
|
subject: "Mathématiques",
|
|
161
|
+
getQuestionFromIdentifiers,
|
|
162
|
+
hasHintAndCorrection: true,
|
|
73
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAuBnD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAyFF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAoLF,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBjD,CAAC"}
|
|
@@ -106,17 +106,46 @@ const getThales = (opts) => {
|
|
|
106
106
|
isPapillon,
|
|
107
107
|
ratio,
|
|
108
108
|
};
|
|
109
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
110
|
+
};
|
|
111
|
+
const getHint = (identifiers) => {
|
|
112
|
+
const triangle = TriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
|
|
113
|
+
const subTriangle = getSubTriangle({
|
|
114
|
+
triangle,
|
|
115
|
+
insidePointsNames: identifiers.insidePointsNames,
|
|
116
|
+
ratio: identifiers.ratio,
|
|
117
|
+
isPapillon: identifiers.isPapillon,
|
|
118
|
+
});
|
|
119
|
+
return `Puisque les droites $\\left(${identifiers.insidePointsNames.join("")}\\right)$ et $\\left(${triangle.sides[2].toInsideName()}\\right)$ sont parallèles, les triangles $${triangle.name}$ et $${subTriangle.name}$ sont semblables. Leurs côtés sont donc proportionnels deux à deux.`;
|
|
120
|
+
};
|
|
121
|
+
const getCorrection = (identifiers) => {
|
|
122
|
+
const { triangleIdentifiers, insidePointsNames } = identifiers;
|
|
123
|
+
const triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
|
|
124
|
+
return `Puisque les droites $\\left(${insidePointsNames.join("")}\\right)$ et $\\left(${triangle.sides[2].toInsideName()}\\right)$ sont parallèles, d'après le théorème de Thalès, on a :
|
|
125
|
+
|
|
126
|
+
$$
|
|
127
|
+
${getAnswer(identifiers)}
|
|
128
|
+
$$`;
|
|
129
|
+
};
|
|
130
|
+
const getKeys = (identifiers) => {
|
|
131
|
+
const { triangleIdentifiers, insidePointsNames, isPapillon, ratio } = identifiers;
|
|
132
|
+
const triangle = TriangleConstructor.fromIdentifiers(identifiers.triangleIdentifiers);
|
|
133
|
+
return [
|
|
134
|
+
"equal",
|
|
135
|
+
...triangle.points.map((p) => p.name),
|
|
136
|
+
...insidePointsNames,
|
|
137
|
+
];
|
|
138
|
+
};
|
|
139
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
109
140
|
const question = {
|
|
110
141
|
instruction: getInstruction(identifiers),
|
|
111
142
|
answer: getAnswer(identifiers),
|
|
112
|
-
keys:
|
|
113
|
-
"equal",
|
|
114
|
-
...triangle.points.map((p) => p.name),
|
|
115
|
-
...[dName, eName],
|
|
116
|
-
],
|
|
143
|
+
keys: getKeys(identifiers),
|
|
117
144
|
ggbOptions: getGGBOptions(identifiers),
|
|
118
145
|
answerFormat: "tex",
|
|
119
146
|
identifiers,
|
|
147
|
+
hint: getHint(identifiers),
|
|
148
|
+
correction: getCorrection(identifiers),
|
|
120
149
|
};
|
|
121
150
|
return question;
|
|
122
151
|
};
|
|
@@ -195,4 +224,6 @@ export const thales = {
|
|
|
195
224
|
getInstruction,
|
|
196
225
|
getGGBOptions,
|
|
197
226
|
options,
|
|
227
|
+
getQuestionFromIdentifiers,
|
|
228
|
+
hasHintAndCorrection: true,
|
|
198
229
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triangleNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"triangleNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAKnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAoLF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAoBhD,CAAC"}
|
|
@@ -39,8 +39,40 @@ const getInstruction = (identifiers) => {
|
|
|
39
39
|
|
|
40
40
|
D'après les informations données sur la figure, quelle est la nature du triangle $${triangle.name}$ ? `;
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const getHint = (identifiers) => {
|
|
43
|
+
const { triangleIdentifiers, type, useAngles } = identifiers;
|
|
44
|
+
return `Voici quelques rappels :
|
|
45
|
+
|
|
46
|
+
- un triangle qui a un angle droit est un triangle rectangle ;
|
|
47
|
+
- un triangle qui a deux côtés égaux (ou deux angles égaux) est un triangle isocèle ;
|
|
48
|
+
- un triangle qiu a trois côtés égaux (ou trois angles égaux) est un triangle équilatéral.`;
|
|
49
|
+
};
|
|
50
|
+
const getCorrection = (identifiers) => {
|
|
51
|
+
const { triangleIdentifiers, type, useAngles } = identifiers;
|
|
52
|
+
switch (type) {
|
|
53
|
+
case 0:
|
|
54
|
+
return "Il n'y a aucune information donnée par la figure sur les longueurs des côtés où les mesures des angles du triangle. On en conclut donc que ce triangle est quelconque.";
|
|
55
|
+
case 1:
|
|
56
|
+
if (useAngles) {
|
|
57
|
+
return `Le triangle possède deux angles égaux : c'est donc un triangle isocèle.`;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return `Le triangle possède deux côtés égaux : c'est donc un triangle isocèle.`;
|
|
61
|
+
}
|
|
62
|
+
case 2:
|
|
63
|
+
if (useAngles) {
|
|
64
|
+
return `Le triangle possède trois angles égaux : c'est donc un triangle équilatéral.`;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return `Le triangle possède trois côtés égaux : c'est donc un triangle équilatéral.`;
|
|
68
|
+
}
|
|
69
|
+
case 3:
|
|
70
|
+
return `Le triangle possède un angle droit : c'est donc un triangle rectangle.`;
|
|
71
|
+
case 4:
|
|
72
|
+
default:
|
|
73
|
+
return `Le triangle possède un angle droit : il est donc rectangle. De plus, il possède ${useAngles ? "deux angles égaux" : "deux côtés égaux"} : il est donc également isocèle. `;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
44
76
|
const getGGBOptions = (identifiers) => {
|
|
45
77
|
const { triangleIdentifiers, type, useAngles } = identifiers;
|
|
46
78
|
let triangle;
|
|
@@ -84,12 +116,6 @@ const getGGBOptions = (identifiers) => {
|
|
|
84
116
|
coords: triangle.generateCoords(),
|
|
85
117
|
});
|
|
86
118
|
};
|
|
87
|
-
const getKeys = (identifiers) => {
|
|
88
|
-
return [];
|
|
89
|
-
};
|
|
90
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
91
|
-
throw Error("VEA not implemented");
|
|
92
|
-
};
|
|
93
119
|
const getTriangleNatureQuestion = (opts) => {
|
|
94
120
|
// const type = random(["scalène","isocèle","équilatéral", "rectangle", "rectangle et isocèle"]);
|
|
95
121
|
const type = randint(0, 5);
|
|
@@ -129,13 +155,16 @@ const getTriangleNatureQuestion = (opts) => {
|
|
|
129
155
|
type,
|
|
130
156
|
useAngles,
|
|
131
157
|
};
|
|
158
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
159
|
+
};
|
|
160
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
132
161
|
const question = {
|
|
133
162
|
instruction: getInstruction(identifiers),
|
|
134
|
-
keys: getKeys(identifiers),
|
|
163
|
+
// keys: getKeys(identifiers),
|
|
135
164
|
answerFormat: "tex",
|
|
136
165
|
identifiers,
|
|
137
|
-
|
|
138
|
-
|
|
166
|
+
hint: getHint(identifiers),
|
|
167
|
+
correction: getCorrection(identifiers),
|
|
139
168
|
ggbOptions: getGGBOptions(identifiers),
|
|
140
169
|
};
|
|
141
170
|
return question;
|
|
@@ -148,13 +177,15 @@ export const triangleNature = {
|
|
|
148
177
|
qcmTimer: 60,
|
|
149
178
|
freeTimer: 60,
|
|
150
179
|
getPropositions,
|
|
151
|
-
isAnswerValid,
|
|
180
|
+
// isAnswerValid,
|
|
152
181
|
subject: "Mathématiques",
|
|
153
|
-
|
|
154
|
-
|
|
182
|
+
getHint,
|
|
183
|
+
getCorrection,
|
|
155
184
|
getInstruction,
|
|
156
185
|
getGGBOptions,
|
|
157
186
|
hasGeogebra: true,
|
|
158
187
|
answerType: "QCM",
|
|
159
188
|
isQCM: true,
|
|
189
|
+
hasHintAndCorrection: true,
|
|
190
|
+
getQuestionFromIdentifiers,
|
|
160
191
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
2
3
|
type Identifiers = {
|
|
3
|
-
xu:
|
|
4
|
-
yu:
|
|
5
|
-
xv:
|
|
6
|
-
yv:
|
|
4
|
+
xu: NodeIdentifiers;
|
|
5
|
+
yu: NodeIdentifiers;
|
|
6
|
+
xv: NodeIdentifiers;
|
|
7
|
+
yv: NodeIdentifiers;
|
|
7
8
|
};
|
|
8
9
|
export declare const colinearity: Exercise<Identifiers>;
|
|
9
10
|
export {};
|