math-exercises 3.0.37 → 3.0.39
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/fractions/fractionsSumsMultiplesDenominators.d.ts +4 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsMultiplesDenominators.js +71 -16
- package/lib/exercises/math/calcul/fractions/simplifyFraction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/simplifyFraction.js +37 -0
- package/lib/exercises/math/calcul/rounding/rounding.d.ts +8 -5
- package/lib/exercises/math/calcul/rounding/rounding.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/rounding.js +63 -31
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.js +64 -57
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.js +48 -5
- package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficient.js +42 -4
- package/lib/exercises/math/functions/integral/integralAffines.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralAffines.js +31 -15
- package/lib/exercises/math/functions/integral/integralTrinomials.d.ts.map +1 -1
- package/lib/exercises/math/functions/integral/integralTrinomials.js +31 -16
- package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/factoForm/factorizedFormFromRoots.js +49 -0
- package/lib/exercises/math/functions/trinoms/parabole/trinomSymetryAxisFromFacto.js +1 -1
- package/lib/exercises/math/functions/trinoms/roots/findSecondRoot.js +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsProduct.js +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsSum.js +1 -1
- package/lib/exercises/math/geometry/cartesian/distanceBetweenTwoPoints.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/distanceBetweenTwoPoints.js +66 -18
- package/lib/exercises/math/geometry/cartesian/midpoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/midpoint.js +45 -3
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +1 -2
- package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.js +0 -2
- package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +1 -1
- package/lib/exercises/math/geometry/vectors/chasles.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/chasles.js +0 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.js +68 -15
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +32 -14
- package/lib/exercises/math/probaStat/diceBasicProbas.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.js +43 -8
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.js +0 -2
- package/lib/exercises/math/sequences/arithmetic/arithmeticReasonUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticReasonUsage.js +51 -8
- package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromFirstTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromFirstTerms.js +36 -5
- package/lib/exercises/math/sequences/geometric/geometricRecognizeReasonFromFirstTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricRecognizeReasonFromFirstTerms.js +36 -5
- package/lib/exercises/math/trigonometry/associatePoint.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/associatePoint.js +5 -2
- package/lib/exercises/math/trigonometry/mainRemarkableValues.js +1 -1
- package/lib/exercises/math/trigonometry/remarkableValues.js +2 -2
- package/lib/geogebra/geogebraConstructor.d.ts +3 -1
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +5 -2
- package/lib/index.d.ts +8 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.js +1 -0
- package/lib/math/geometry/point.d.ts +2 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +10 -0
- package/lib/math/numbers/integer/integer.d.ts +1 -1
- package/lib/math/numbers/rationals/rational.d.ts +1 -0
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +3 -0
- package/lib/math/trigonometry/remarkableValue.d.ts +1 -4
- package/lib/math/trigonometry/remarkableValue.d.ts.map +1 -1
- package/lib/math/trigonometry/remarkableValue.js +5 -6
- package/lib/math/utils/stats/generateAffineCloud.js +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +5 -0
- package/lib/tests/pdfExo.test.d.ts.map +1 -1
- package/lib/tests/pdfExo.test.js +2 -2
- package/lib/tree/nodes/functions/oppositeNode.d.ts +1 -2
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +2 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +47 -2
- package/lib/tree/nodes/node.d.ts +1 -0
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts +1 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts +1 -0
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +6 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +1 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts +1 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +7 -0
- package/lib/utils/iterators/dualReturn.d.ts +2 -0
- package/lib/utils/iterators/dualReturn.d.ts.map +1 -0
- package/lib/utils/iterators/dualReturn.js +19 -0
- package/package.json +1 -1
|
@@ -4,7 +4,10 @@ import { Point } from "../../../../math/geometry/point.js";
|
|
|
4
4
|
import { distinctRandTupleInt } from "../../../../math/utils/random/randTupleInt.js";
|
|
5
5
|
import { PointNode } from "../../../../tree/nodes/geometry/pointNode.js";
|
|
6
6
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
7
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
8
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
7
9
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
10
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
8
11
|
const getPoints = (identifiers) => {
|
|
9
12
|
const { coordsA, coordsB } = identifiers;
|
|
10
13
|
const A = new Point("A", new NumberNode(coordsA[0]), new NumberNode(coordsA[1]));
|
|
@@ -13,13 +16,47 @@ const getPoints = (identifiers) => {
|
|
|
13
16
|
};
|
|
14
17
|
const getInstruction = (identifiers) => {
|
|
15
18
|
const [A, B] = getPoints(identifiers);
|
|
16
|
-
return `Soit $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$.
|
|
19
|
+
return `Soit deux points $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$.
|
|
20
|
+
|
|
21
|
+
Quelles sont les coordonnées du milieu $I$ de $[AB]$ ?`;
|
|
22
|
+
};
|
|
23
|
+
const getHint = (identifiers) => {
|
|
24
|
+
const A = new Point("A", "x_A".toTree(), "y_A".toTree());
|
|
25
|
+
const B = new Point("B", "x_B".toTree(), "y_B".toTree());
|
|
26
|
+
const I = new Point("I", frac(add("x_A", "x_B"), 2), frac(add("y_A", "y_B"), 2));
|
|
27
|
+
return `Le milieu $I$ du segment $[AB]$, où $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$, a pour coordonnées :
|
|
28
|
+
|
|
29
|
+
$$
|
|
30
|
+
${I.toTexWithCoords()}
|
|
31
|
+
$$
|
|
32
|
+
`;
|
|
17
33
|
};
|
|
18
34
|
const getAnswer = (identifiers) => {
|
|
19
35
|
const [A, B] = getPoints(identifiers);
|
|
20
36
|
const answer = A.midpoint(B).toTexWithCoords();
|
|
21
37
|
return answer;
|
|
22
38
|
};
|
|
39
|
+
const getCorrection = (identifiers) => {
|
|
40
|
+
const { coordsA, coordsB } = identifiers;
|
|
41
|
+
let A = new Point("A", new NumberNode(coordsA[0]), new NumberNode(coordsA[1]));
|
|
42
|
+
let B = new Point("B", new NumberNode(coordsB[0]), new NumberNode(coordsB[1]));
|
|
43
|
+
const Ax = new Point("A", "x_A".toTree(), "y_A".toTree());
|
|
44
|
+
const Bx = new Point("B", "x_B".toTree(), "y_B".toTree());
|
|
45
|
+
const I = new Point("I", frac(add("x_A", "x_B"), 2), frac(add("y_A", "y_B"), 2));
|
|
46
|
+
return `Le milieu $I$ du segment $[AB]$, où $${A.toTexWithCoords()}$ et $${B.toTexWithCoords()}$, a pour coordonnées :
|
|
47
|
+
|
|
48
|
+
$$
|
|
49
|
+
${I.toTexWithCoords()}
|
|
50
|
+
$$
|
|
51
|
+
|
|
52
|
+
Ici, on a donc :
|
|
53
|
+
|
|
54
|
+
${alignTex([
|
|
55
|
+
["", A.midpointNode(B).toTexWithCoords()],
|
|
56
|
+
["=", getAnswer(identifiers)],
|
|
57
|
+
])}
|
|
58
|
+
`;
|
|
59
|
+
};
|
|
23
60
|
const getMidpointQuestion = () => {
|
|
24
61
|
const [coords1, coords2] = distinctRandTupleInt(2, 2, { from: -9, to: 10 });
|
|
25
62
|
const identifiers = { coordsA: coords1, coordsB: coords2 };
|
|
@@ -30,6 +67,8 @@ const getMidpointQuestion = () => {
|
|
|
30
67
|
keys: ["I", "semicolon"],
|
|
31
68
|
answerFormat: "tex",
|
|
32
69
|
identifiers,
|
|
70
|
+
hint: getHint(identifiers),
|
|
71
|
+
correction: getCorrection(identifiers),
|
|
33
72
|
};
|
|
34
73
|
return question;
|
|
35
74
|
};
|
|
@@ -61,13 +100,16 @@ export const midpoint = {
|
|
|
61
100
|
id: "midpoint",
|
|
62
101
|
connector: "=",
|
|
63
102
|
label: "Coordonnées du milieu",
|
|
64
|
-
levels: ["3ème", "2nde"],
|
|
65
103
|
isSingleStep: false,
|
|
66
|
-
sections: ["Géométrie cartésienne"],
|
|
67
104
|
generator: (nb) => getDistinctQuestions(getMidpointQuestion, nb),
|
|
68
105
|
qcmTimer: 60,
|
|
69
106
|
freeTimer: 60,
|
|
70
107
|
getPropositions,
|
|
71
108
|
isAnswerValid,
|
|
72
109
|
subject: "Mathématiques",
|
|
110
|
+
getAnswer,
|
|
111
|
+
getInstruction,
|
|
112
|
+
getHint,
|
|
113
|
+
getCorrection,
|
|
114
|
+
hasHintAndCorrection: true,
|
|
73
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAQ1D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"placeAbscissOnSemiLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAQ1D,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAuIF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
|
|
@@ -51,9 +51,8 @@ const getStudentGGBOptions = ({ coeff, oneUnitTex, abscissType, }) => {
|
|
|
51
51
|
};
|
|
52
52
|
const isGGBAnswerValid = (ans, { ggbAnswer, absciss, abscissTex, abscissType, axisUnit, coeff, oneUnitTex }) => {
|
|
53
53
|
const points = parseGGBPoints(ans).map((p) => ggbPointToCoords(p));
|
|
54
|
-
console.log(points);
|
|
55
54
|
return (points.length === 1 &&
|
|
56
|
-
points[0].y
|
|
55
|
+
Math.abs(points[0].y) < 0.5 &&
|
|
57
56
|
Math.abs(points[0].x - coeff) < 0.1);
|
|
58
57
|
};
|
|
59
58
|
const getPlaceAbscissOnSemiLineQuestion = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rectanglePerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/rectanglePerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAkCF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"rectanglePerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/rectanglePerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAkCF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAWpD,CAAC"}
|
|
@@ -32,9 +32,7 @@ export const rectanglePerimeter = {
|
|
|
32
32
|
id: "rectanglePerimeter",
|
|
33
33
|
connector: "=",
|
|
34
34
|
label: "Calculer le périmètre d'un rectangle",
|
|
35
|
-
levels: ["4ème", "3ème", "2nde"],
|
|
36
35
|
isSingleStep: false,
|
|
37
|
-
sections: ["Périmètres", "Géométrie euclidienne"],
|
|
38
36
|
generator: (nb) => getDistinctQuestions(getRectanglePerimeter, nb),
|
|
39
37
|
qcmTimer: 60,
|
|
40
38
|
freeTimer: 60,
|
|
@@ -59,7 +59,7 @@ const isAnswerValid = (ans, { answer, sideAsked, triangleIdentifiers }) => {
|
|
|
59
59
|
export const pythagoreCalcul = {
|
|
60
60
|
id: "pythagoreCalcul",
|
|
61
61
|
connector: "=",
|
|
62
|
-
label: "Utiliser le théoreme de Pythagore pour
|
|
62
|
+
label: "Utiliser le théoreme de Pythagore pour calculer un côté",
|
|
63
63
|
levels: ["4ème", "3ème", "2nde"],
|
|
64
64
|
isSingleStep: false,
|
|
65
65
|
sections: ["Théorème de Pythagore", "Géométrie euclidienne"],
|
|
@@ -170,7 +170,7 @@ const getThalesFindSideQuestion = (opts) => {
|
|
|
170
170
|
export const thalesCalcul = {
|
|
171
171
|
id: "thalesCalcul",
|
|
172
172
|
connector: "=",
|
|
173
|
-
label: "Utiliser le théoreme de Thalès calculer un côté",
|
|
173
|
+
label: "Utiliser le théoreme de Thalès pour calculer un côté",
|
|
174
174
|
isSingleStep: true,
|
|
175
175
|
generator: (nb, opts) => getDistinctQuestions(() => getThalesFindSideQuestion(opts), nb),
|
|
176
176
|
qcmTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chasles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/chasles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAuDF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"chasles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/chasles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAuDF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAWzC,CAAC"}
|
|
@@ -49,9 +49,7 @@ export const chasles = {
|
|
|
49
49
|
id: "chasles",
|
|
50
50
|
connector: "=",
|
|
51
51
|
label: "Relation de Chasles pour les vecteurs",
|
|
52
|
-
levels: ["2nde", "1reESM", "1reSpé"],
|
|
53
52
|
isSingleStep: true,
|
|
54
|
-
sections: ["Vecteurs"],
|
|
55
53
|
generator: (nb) => getDistinctQuestions(getChaslesQuestion, nb),
|
|
56
54
|
qcmTimer: 60,
|
|
57
55
|
freeTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalarProductViaCoords.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"scalarProductViaCoords.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAkIF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAmBxD,CAAC"}
|
|
@@ -4,28 +4,71 @@ import { Vector } from "../../../../../math/geometry/vector.js";
|
|
|
4
4
|
import { distinctRandTupleInt } from "../../../../../math/utils/random/randTupleInt.js";
|
|
5
5
|
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
6
6
|
import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
|
|
7
|
+
import { add } from "../../../../../tree/nodes/operators/addNode.js";
|
|
8
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
7
10
|
import { shuffle } from "../../../../../utils/alea/shuffle.js";
|
|
11
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
12
|
+
const getStartStatement = (identifiers) => {
|
|
13
|
+
const { uCoords, vCoords } = identifiers;
|
|
14
|
+
const u = new Vector("u", new NumberNode(Number(uCoords[0])), new NumberNode(Number(uCoords[1])));
|
|
15
|
+
const v = new Vector("v", new NumberNode(Number(vCoords[0])), new NumberNode(Number(vCoords[1])));
|
|
16
|
+
return `${u.toTex()}\\cdot ${v.toTex()}`;
|
|
17
|
+
};
|
|
18
|
+
const getInstruction = (identifiers) => {
|
|
19
|
+
const { uCoords, vCoords } = identifiers;
|
|
20
|
+
const u = new Vector("u", new NumberNode(Number(uCoords[0])), new NumberNode(Number(uCoords[1])));
|
|
21
|
+
const v = new Vector("v", new NumberNode(Number(vCoords[0])), new NumberNode(Number(vCoords[1])));
|
|
22
|
+
return `Soit deux vecteurs $${u.toTexWithCoords()}$ et $${v.toTexWithCoords()}$.
|
|
23
|
+
|
|
24
|
+
Calculer le produit scalaire $${u.toTex()}\\cdot ${v.toTex()}$.`;
|
|
25
|
+
};
|
|
26
|
+
const getAnswer = (identifiers) => {
|
|
27
|
+
const { uCoords, vCoords } = identifiers;
|
|
28
|
+
const u = new Vector("u", new NumberNode(Number(uCoords[0])), new NumberNode(Number(uCoords[1])));
|
|
29
|
+
const v = new Vector("v", new NumberNode(Number(vCoords[0])), new NumberNode(Number(vCoords[1])));
|
|
30
|
+
const answer = u.scalarProduct(v).toTex();
|
|
31
|
+
return answer;
|
|
32
|
+
};
|
|
33
|
+
const getHint = (identifiers) => {
|
|
34
|
+
const u = new Vector("u", "x".toTree(), "y".toTree());
|
|
35
|
+
const v = new Vector("v", "x'".toTree(), "y'".toTree());
|
|
36
|
+
return `Le produit scalaire de deux vecteurs $${u.toTexWithCoords()}$ et $${v.toTexWithCoords()}$ est :
|
|
37
|
+
|
|
38
|
+
$$
|
|
39
|
+
${u.toTex()}\\cdot ${v.toTex()} = x\\times x' + y\\times y'
|
|
40
|
+
$$`;
|
|
41
|
+
};
|
|
42
|
+
const getCorrection = (identifiers) => {
|
|
43
|
+
const { uCoords, vCoords } = identifiers;
|
|
44
|
+
const u = new Vector("u", new NumberNode(Number(uCoords[0])), new NumberNode(Number(uCoords[1])));
|
|
45
|
+
const v = new Vector("v", new NumberNode(Number(vCoords[0])), new NumberNode(Number(vCoords[1])));
|
|
46
|
+
return `Le produit scalaire de $${u.toTex()}$ et $${v.toTex()}$ est :
|
|
47
|
+
|
|
48
|
+
$$
|
|
49
|
+
${add(multiply(u.x, v.x), multiply(u.y, v.y)).toTex({
|
|
50
|
+
forceNoSimplification: true,
|
|
51
|
+
})} = ${getAnswer(identifiers)}
|
|
52
|
+
$$
|
|
53
|
+
`;
|
|
54
|
+
};
|
|
8
55
|
const getScalarProductViaCoordsQuestion = () => {
|
|
9
56
|
const [coords1, coords2] = distinctRandTupleInt(2, 2, { from: -9, to: 10 });
|
|
10
57
|
const u = new Vector("u", new NumberNode(coords1[0]), new NumberNode(coords1[1]));
|
|
11
58
|
const v = new Vector("v", new NumberNode(coords2[0]), new NumberNode(coords2[1]));
|
|
12
|
-
const
|
|
59
|
+
const identifiers = {
|
|
60
|
+
uCoords: [u.x.toTex(), u.y.toTex()],
|
|
61
|
+
vCoords: [v.x.toTex(), v.y.toTex()],
|
|
62
|
+
};
|
|
13
63
|
const question = {
|
|
14
|
-
instruction:
|
|
15
|
-
startStatement:
|
|
16
|
-
answer:
|
|
64
|
+
instruction: getInstruction(identifiers),
|
|
65
|
+
startStatement: getStartStatement(identifiers),
|
|
66
|
+
answer: getAnswer(identifiers),
|
|
17
67
|
keys: [],
|
|
18
68
|
answerFormat: "tex",
|
|
19
|
-
identifiers
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
hint: "Le produit scalaire de deux vecteurs se calcule en multipliant les coordonnées correspondantes et en additionnant les résultats.",
|
|
24
|
-
correction: `Le produit scalaire de $${u.toTex()}$ et $${v.toTex()}$ est calculé comme suit :
|
|
25
|
-
|
|
26
|
-
$$
|
|
27
|
-
(${u.x.toTex()} \\times ${v.x.toTex()}) + (${u.y.toTex()} \\times ${v.y.toTex()}) = ${answer}
|
|
28
|
-
$$`,
|
|
69
|
+
identifiers,
|
|
70
|
+
hint: getHint(identifiers),
|
|
71
|
+
correction: getCorrection(identifiers),
|
|
29
72
|
};
|
|
30
73
|
return question;
|
|
31
74
|
};
|
|
@@ -38,7 +81,13 @@ const getPropositions = (n, { answer }) => {
|
|
|
38
81
|
return shuffle(propositions);
|
|
39
82
|
};
|
|
40
83
|
const isAnswerValid = (ans, { answer }) => {
|
|
41
|
-
|
|
84
|
+
try {
|
|
85
|
+
const parsed = parseAlgebraic(ans);
|
|
86
|
+
return parsed.simplify().toTex() === answer;
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
return handleVEAError(err);
|
|
90
|
+
}
|
|
42
91
|
};
|
|
43
92
|
export const scalarProductViaCoords = {
|
|
44
93
|
id: "scalarProductViaCoords",
|
|
@@ -54,4 +103,8 @@ export const scalarProductViaCoords = {
|
|
|
54
103
|
isAnswerValid,
|
|
55
104
|
subject: "Mathématiques",
|
|
56
105
|
hasHintAndCorrection: true,
|
|
106
|
+
getAnswer,
|
|
107
|
+
getInstruction,
|
|
108
|
+
getHint,
|
|
109
|
+
getCorrection,
|
|
57
110
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scalarProductViaCos.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"scalarProductViaCos.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA4EF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
|
|
@@ -7,26 +7,41 @@ import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.j
|
|
|
7
7
|
import { randomLetter } from "../../../../../utils/strings/randomLetter.js";
|
|
8
8
|
import { shuffle } from "../../../../../utils/alea/shuffle.js";
|
|
9
9
|
import { random } from "../../../../../utils/alea/random.js";
|
|
10
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
11
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
10
12
|
//|u| |v| cos(u,v)
|
|
13
|
+
const getInstruction = (identifiers) => {
|
|
14
|
+
const { AB, AC, trigoPoint, letters } = identifiers;
|
|
15
|
+
const [letterA, letterB, letterC] = letters;
|
|
16
|
+
const trigo = mainTrigoValues.find((v) => v.point === trigoPoint);
|
|
17
|
+
return `Soient trois points $${letterA}$, $${letterB}$ et $${letterC}$ tels que $${letterA}${letterB} = ${AB}$, $${letterA}${letterC}= ${AC}$, et $\\widehat{${letterB}${letterA}${letterC}} = ${trigo.angle.toTex()}$.
|
|
18
|
+
|
|
19
|
+
Calculer le produit scalaire $\\overrightarrow{${letterA}${letterB}}\\cdot \\overrightarrow{${letterA}${letterC}}$.`;
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
const { AB, AC, trigoPoint } = identifiers;
|
|
23
|
+
const trigo = mainTrigoValues.find((v) => v.point === trigoPoint);
|
|
24
|
+
const answer = new MultiplyNode(new NumberNode(AB * AC), trigo.cos)
|
|
25
|
+
.simplify()
|
|
26
|
+
.toTex();
|
|
27
|
+
return answer;
|
|
28
|
+
};
|
|
11
29
|
const getScalarProductViaCosQuestion = () => {
|
|
12
30
|
const AB = randint(1, 10);
|
|
13
31
|
const AC = randint(1, 10);
|
|
14
32
|
const trigo = random(mainTrigoValues);
|
|
15
|
-
const answer = new MultiplyNode(new NumberNode(AB * AC), trigo.cos)
|
|
16
|
-
.simplify()
|
|
17
|
-
.toTex();
|
|
18
33
|
const letters = [];
|
|
19
34
|
for (let i = 0; i < 3; i++) {
|
|
20
35
|
letters.push(randomLetter(true, letters));
|
|
21
36
|
}
|
|
22
37
|
letters.sort((a, b) => a.localeCompare(b));
|
|
23
|
-
const
|
|
38
|
+
const identifiers = { AB, AC, trigoPoint: trigo.point, letters };
|
|
24
39
|
const question = {
|
|
25
|
-
answer,
|
|
26
|
-
instruction:
|
|
40
|
+
answer: getAnswer(identifiers),
|
|
41
|
+
instruction: getInstruction(identifiers),
|
|
27
42
|
keys: ["pi"],
|
|
28
43
|
answerFormat: "tex",
|
|
29
|
-
identifiers
|
|
44
|
+
identifiers,
|
|
30
45
|
};
|
|
31
46
|
return question;
|
|
32
47
|
};
|
|
@@ -42,23 +57,26 @@ const getPropositions = (n, { answer, AB, AC, trigoPoint }) => {
|
|
|
42
57
|
}
|
|
43
58
|
return shuffle(propositions);
|
|
44
59
|
};
|
|
45
|
-
const isAnswerValid = (ans, { AB, AC, trigoPoint }) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
60
|
+
const isAnswerValid = (ans, { answer, AB, AC, trigoPoint }) => {
|
|
61
|
+
try {
|
|
62
|
+
const parsed = parseAlgebraic(ans);
|
|
63
|
+
return parsed.simplify().toTex() === answer;
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
return handleVEAError(err);
|
|
67
|
+
}
|
|
50
68
|
};
|
|
51
69
|
export const scalarProductViaCos = {
|
|
52
70
|
id: "scalarProductViaCos",
|
|
53
71
|
connector: "=",
|
|
54
72
|
label: "Calculer un produit scalaire (formule avec $cos$)",
|
|
55
|
-
levels: ["1reSpé"],
|
|
56
73
|
isSingleStep: true,
|
|
57
|
-
sections: ["Vecteurs", "Produit scalaire"],
|
|
58
74
|
generator: (nb) => getDistinctQuestions(getScalarProductViaCosQuestion, nb),
|
|
59
75
|
qcmTimer: 60,
|
|
60
76
|
freeTimer: 60,
|
|
61
77
|
getPropositions,
|
|
62
78
|
isAnswerValid,
|
|
63
79
|
subject: "Mathématiques",
|
|
80
|
+
getInstruction,
|
|
81
|
+
getAnswer,
|
|
64
82
|
};
|
|
@@ -36,7 +36,7 @@ Puisque le dé est équilibré, chaque face du dé a autant de chances d'appara
|
|
|
36
36
|
Ainsi, la probabilité d'obtenir une face ${parity} est :
|
|
37
37
|
|
|
38
38
|
$$
|
|
39
|
-
${frac(count, nbFaces).
|
|
39
|
+
${frac(count, nbFaces).toSimplificationTex()}
|
|
40
40
|
$$`;
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticFindReason.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindReason.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"arithmeticFindReason.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindReason.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAoEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAgBtD,CAAC"}
|
|
@@ -1,21 +1,53 @@
|
|
|
1
1
|
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
4
5
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
6
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
7
|
+
const getInstruction = (identifiers) => {
|
|
8
|
+
const { rank1, value1, reason } = identifiers;
|
|
9
|
+
const rank2 = rank1 + 1;
|
|
10
|
+
const value2 = reason + value1;
|
|
11
|
+
return `Soit $u$ une suite arithmétique telle que $u_{${rank1}} = ${value1}$ et $u_{${rank2}} = ${value2}$.
|
|
12
|
+
|
|
13
|
+
Quelle est la raison de la suite $(u_n)$ ?`;
|
|
14
|
+
};
|
|
15
|
+
const getAnswer = (identifiers) => {
|
|
16
|
+
const { rank1, value1, reason } = identifiers;
|
|
17
|
+
const answer = reason + "";
|
|
18
|
+
return answer;
|
|
19
|
+
};
|
|
20
|
+
const getHint = (identifiers) => {
|
|
21
|
+
return `La raison d'une suite arithmétique est le nombre par lequel on additionne un terme pour obtenir le suivant.`;
|
|
22
|
+
};
|
|
23
|
+
const getCorrection = (identifiers) => {
|
|
24
|
+
const { rank1, value1, reason } = identifiers;
|
|
25
|
+
const rank2 = rank1 + 1;
|
|
26
|
+
const value2 = reason + value1;
|
|
27
|
+
return `La raison de $u$ est le nombre par lequel on a additionné $u_{${rank1}}$ pour obtenir $u_{${rank2}}$.
|
|
28
|
+
|
|
29
|
+
Ainsi, la raison $r$ de la suite $u$ est :
|
|
30
|
+
|
|
31
|
+
${alignTex([
|
|
32
|
+
["r", "=", `u_{${rank2}} - u_{${rank1}}`],
|
|
33
|
+
["", "=", substract(value2, value1).toTex()],
|
|
34
|
+
["", "=", getAnswer(identifiers)],
|
|
35
|
+
])}`;
|
|
36
|
+
};
|
|
5
37
|
const getArithmeticFindReason = () => {
|
|
6
38
|
const rank1 = randint(0, 10);
|
|
7
|
-
const rank2 = rank1 + 1;
|
|
8
39
|
const reason = randint(-10, 10, [0]);
|
|
9
40
|
const value1 = randint(-10, 10);
|
|
10
|
-
const
|
|
11
|
-
const answer = reason + "";
|
|
41
|
+
const identifiers = { rank1, reason, value1 };
|
|
12
42
|
const question = {
|
|
13
|
-
instruction:
|
|
43
|
+
instruction: getInstruction(identifiers),
|
|
14
44
|
startStatement: "r",
|
|
15
|
-
answer,
|
|
45
|
+
answer: getAnswer(identifiers),
|
|
16
46
|
keys: [],
|
|
17
47
|
answerFormat: "tex",
|
|
18
|
-
identifiers
|
|
48
|
+
identifiers,
|
|
49
|
+
hint: getHint(identifiers),
|
|
50
|
+
correction: getCorrection(identifiers),
|
|
19
51
|
};
|
|
20
52
|
return question;
|
|
21
53
|
};
|
|
@@ -34,8 +66,6 @@ export const arithmeticFindReason = {
|
|
|
34
66
|
id: "arithmeticFindReason",
|
|
35
67
|
connector: "=",
|
|
36
68
|
label: "Déterminer la raison d'une suite arithmétique",
|
|
37
|
-
levels: ["1reESM", "1reSpé", "1reTech", "1rePro", "TermTech", "TermPro"],
|
|
38
|
-
sections: ["Suites"],
|
|
39
69
|
isSingleStep: false,
|
|
40
70
|
getPropositions,
|
|
41
71
|
isAnswerValid,
|
|
@@ -43,4 +73,9 @@ export const arithmeticFindReason = {
|
|
|
43
73
|
freeTimer: 60,
|
|
44
74
|
generator: (nb) => getDistinctQuestions(getArithmeticFindReason, nb),
|
|
45
75
|
subject: "Mathématiques",
|
|
76
|
+
getAnswer,
|
|
77
|
+
getInstruction,
|
|
78
|
+
getHint,
|
|
79
|
+
getCorrection,
|
|
80
|
+
hasHintAndCorrection: true,
|
|
46
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticFindReasonRandomRange.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAmCF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"arithmeticFindReasonRandomRange.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAmCF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAYjE,CAAC"}
|
|
@@ -34,8 +34,6 @@ export const arithmeticFindReasonRandomRange = {
|
|
|
34
34
|
id: "arithmeticFindReasonRandomRange",
|
|
35
35
|
connector: "=",
|
|
36
36
|
label: "Déterminer la raison d'une suite arithmétique (écart aléatoire)",
|
|
37
|
-
levels: ["1reESM", "1reSpé", "1reTech", "1rePro", "TermTech", "TermPro"],
|
|
38
|
-
sections: ["Suites"],
|
|
39
37
|
isSingleStep: false,
|
|
40
38
|
getPropositions,
|
|
41
39
|
isAnswerValid,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticReasonUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"arithmeticReasonUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA2EF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
|
|
@@ -1,20 +1,60 @@
|
|
|
1
1
|
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
4
5
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
6
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
7
|
+
const getStartStatement = (identifiers) => {
|
|
8
|
+
const { reason, startRank, startValue } = identifiers;
|
|
9
|
+
const askedRank = startRank + 1;
|
|
10
|
+
return `u_{${askedRank}}`;
|
|
11
|
+
};
|
|
12
|
+
const getInstruction = (identifiers) => {
|
|
13
|
+
const { reason, startRank, startValue } = identifiers;
|
|
14
|
+
const askedRank = startRank + 1;
|
|
15
|
+
return `Soit $u$ une suite arithmétique de raison $r = ${reason}$ et telle que $u_{${startRank}} = ${startValue}$.
|
|
16
|
+
|
|
17
|
+
Calculer $u_{${askedRank}}$.`;
|
|
18
|
+
};
|
|
19
|
+
const getAnswer = (identifiers) => {
|
|
20
|
+
const { reason, startRank, startValue } = identifiers;
|
|
21
|
+
const answer = (startValue + reason).toString();
|
|
22
|
+
return answer;
|
|
23
|
+
};
|
|
24
|
+
const getHint = (identifiers) => {
|
|
25
|
+
const { reason, startRank, startValue } = identifiers;
|
|
26
|
+
return `Une suite arithmétique est une suite telle que, pour passer d'un terme de la suite au suivant, on additionne toujours par la raison de la suite.
|
|
27
|
+
|
|
28
|
+
En d'autres termes, si $u$ est une suite arithmétique de raison $r$, alors pour tout entier $n$, on a :
|
|
29
|
+
|
|
30
|
+
$$
|
|
31
|
+
u_{n+1} = u_n + r
|
|
32
|
+
$$`;
|
|
33
|
+
};
|
|
34
|
+
const getCorrection = (identifiers) => {
|
|
35
|
+
const { reason, startRank, startValue } = identifiers;
|
|
36
|
+
return `Puisque $u$ est une suite arithmétique, on a :
|
|
37
|
+
|
|
38
|
+
${alignTex([
|
|
39
|
+
[getStartStatement(identifiers), "=", add(`u_{${startRank}}`, "r").toTex()],
|
|
40
|
+
["", "=", add(startValue, reason).toTex()],
|
|
41
|
+
["", "=", getAnswer(identifiers)],
|
|
42
|
+
])}`;
|
|
43
|
+
};
|
|
5
44
|
const getArithmeticReasonUsage = () => {
|
|
6
45
|
const reason = randint(-10, 10, [0]);
|
|
7
46
|
const startRank = randint(0, 20);
|
|
8
|
-
const askedRank = startRank + 1;
|
|
9
47
|
const startValue = randint(-10, 10);
|
|
10
|
-
const
|
|
48
|
+
const identifiers = { reason, startRank, startValue };
|
|
11
49
|
const question = {
|
|
12
|
-
instruction:
|
|
13
|
-
startStatement:
|
|
14
|
-
answer,
|
|
50
|
+
instruction: getInstruction(identifiers),
|
|
51
|
+
startStatement: getStartStatement(identifiers),
|
|
52
|
+
answer: getAnswer(identifiers),
|
|
15
53
|
keys: ["u", "underscore", "equal"],
|
|
16
54
|
answerFormat: "tex",
|
|
17
|
-
identifiers
|
|
55
|
+
identifiers,
|
|
56
|
+
hint: getHint(identifiers),
|
|
57
|
+
correction: getCorrection(identifiers),
|
|
18
58
|
};
|
|
19
59
|
return question;
|
|
20
60
|
};
|
|
@@ -38,8 +78,6 @@ export const arithmeticReasonUsage = {
|
|
|
38
78
|
id: "arithmeticReasonUsage",
|
|
39
79
|
connector: "=",
|
|
40
80
|
label: "Utiliser la raison d'une suite arithmétique",
|
|
41
|
-
levels: ["1reESM", "1reSpé", "1reTech", "1rePro", "TermTech", "TermPro"],
|
|
42
|
-
sections: ["Suites"],
|
|
43
81
|
isSingleStep: false,
|
|
44
82
|
generator: (nb) => getDistinctQuestions(getArithmeticReasonUsage, nb),
|
|
45
83
|
qcmTimer: 60,
|
|
@@ -47,4 +85,9 @@ export const arithmeticReasonUsage = {
|
|
|
47
85
|
getPropositions,
|
|
48
86
|
isAnswerValid,
|
|
49
87
|
subject: "Mathématiques",
|
|
88
|
+
getAnswer,
|
|
89
|
+
getInstruction,
|
|
90
|
+
getHint,
|
|
91
|
+
getCorrection,
|
|
92
|
+
hasHintAndCorrection: true,
|
|
50
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeReasonFromFirstTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/recognizeReasonFromFirstTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"recognizeReasonFromFirstTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/recognizeReasonFromFirstTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAgEF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAiB/D,CAAC"}
|