math-exercises 2.1.10 → 2.1.11
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/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +2 -2
- package/lib/exercises/math/calculLitteral/equation/equationFromSentenceExercise.js +4 -4
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.js +2 -2
- package/lib/exercises/math/derivation/derivative/convexityTrinomials.js +2 -2
- package/lib/exercises/math/derivation/derivative/inflexionPointQuadrinomials.js +2 -2
- package/lib/exercises/math/derivation/derivative/secondDerivativeOfExpoFunction.js +2 -2
- package/lib/exercises/math/derivation/derivative/secondDerivativeOfThirdDegreeFunction.js +3 -3
- package/lib/exercises/math/derivation/derivative/secondDerivativeOfTrinom.js +3 -3
- package/lib/exercises/math/derivation/derivative/sinSecondDegreeDerivative.js +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustment.js +3 -3
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +3 -3
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +3 -3
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.js +3 -2
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +24 -21
- package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVector.js +23 -5
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.js +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +2 -2
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts +1 -0
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts.map +1 -1
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +5 -6
- package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +2 -2
- package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.js +2 -2
- package/lib/exercises/math/geometry/vectors/vectorNormCalculation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorNormCalculation.js +4 -3
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +1 -1
- package/lib/exercises/math/python/conditionIf.d.ts +1 -0
- package/lib/exercises/math/python/conditionIf.d.ts.map +1 -1
- package/lib/exercises/math/python/conditionIf.js +8 -6
- package/lib/exercises/math/python/pyForLoop1Exercise.js +1 -1
- package/lib/exercises/math/python/pyNestedForLoopExercise.js +1 -1
- package/lib/exercises/math/python/pyWhileLoop1Exercise.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +2 -2
- package/package.json +1 -1
|
@@ -44,7 +44,7 @@ const getBinomialsTrinomialsProposedSolutionsQuestion = () => {
|
|
|
44
44
|
const answer = answertype ? "Oui" : "Non";
|
|
45
45
|
const question = {
|
|
46
46
|
answer: answer,
|
|
47
|
-
instruction: `
|
|
47
|
+
instruction: `Le nombre $${solution}$ est-il une solution de l'équation $${equation.toTex()}$ ?`,
|
|
48
48
|
keys: [],
|
|
49
49
|
answerFormat: "raw",
|
|
50
50
|
identifiers: {},
|
|
@@ -64,7 +64,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
64
64
|
};
|
|
65
65
|
exports.binomialsTrinomialsProposedSolutions = {
|
|
66
66
|
id: "binomialsTrinomialsProposedSolutions",
|
|
67
|
-
label: "
|
|
67
|
+
label: "Vérifier si un nombre est solution d'une équation",
|
|
68
68
|
levels: ["1rePro"],
|
|
69
69
|
isSingleStep: true,
|
|
70
70
|
sections: ["Équations"],
|
|
@@ -127,18 +127,18 @@ const generateExercise = () => {
|
|
|
127
127
|
switch (type) {
|
|
128
128
|
case 1:
|
|
129
129
|
instruction = `On appelle $x$ le nombre à trouver.
|
|
130
|
-
Traduire par une équation la phrase "${flip ? `Le double` : `La moitié`} du nombre à trouver vaut $${resultNb}$"
|
|
130
|
+
Traduire par une équation la phrase "${flip ? `Le double` : `La moitié`} du nombre à trouver vaut $${resultNb}$".`;
|
|
131
131
|
break;
|
|
132
132
|
case 2:
|
|
133
133
|
randAdd = (0, randint_1.randint)(1, 11);
|
|
134
134
|
instruction = `On appelle $x$ le nombre à trouver.
|
|
135
|
-
Traduire par une équation la phrase "${flip ? `La somme` : `La différence`} du nombre à trouver et de $${randAdd}$ a pour résultat $${resultNb}$"
|
|
135
|
+
Traduire par une équation la phrase "${flip ? `La somme` : `La différence`} du nombre à trouver et de $${randAdd}$ a pour résultat $${resultNb}$".`;
|
|
136
136
|
break;
|
|
137
137
|
case 3:
|
|
138
138
|
randAdd = (0, randint_1.randint)(1, 11);
|
|
139
139
|
op2 = (0, coinFlip_1.coinFlip)() ? `augmenté` : `diminué`;
|
|
140
140
|
instruction = `On appelle $x$ le nombre à trouver.
|
|
141
|
-
Traduire par une équation la phrase "${flip ? `Le double` : `La moitié`} du nombre à trouver ${flip ? op2 : op2 + "e"} de $${randAdd}$ vaut $${resultNb}$"
|
|
141
|
+
Traduire par une équation la phrase "${flip ? `Le double` : `La moitié`} du nombre à trouver ${flip ? op2 : op2 + "e"} de $${randAdd}$ vaut $${resultNb}$".`;
|
|
142
142
|
break;
|
|
143
143
|
}
|
|
144
144
|
const vars = { randAdd, resultNb, op2, flip };
|
|
@@ -147,7 +147,7 @@ const generateExercise = () => {
|
|
|
147
147
|
};
|
|
148
148
|
exports.equationFromSentenceExericse = {
|
|
149
149
|
id: "equationFromSentenceExercise",
|
|
150
|
-
label: "Traduire une phrase en une
|
|
150
|
+
label: "Traduire une phrase en une équation mathématique",
|
|
151
151
|
levels: ["5ème"],
|
|
152
152
|
isSingleStep: true,
|
|
153
153
|
sections: ["Calcul littéral"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeEquationIntType1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoEF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"firstDegreeEquationIntType1.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoEF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAa7D,CAAC"}
|
|
@@ -52,7 +52,7 @@ const isAnswerValid = (ans, { answer, x }) => {
|
|
|
52
52
|
};
|
|
53
53
|
exports.firstDegreeEquationIntType1 = {
|
|
54
54
|
id: "firstDegreeEquationIntType1",
|
|
55
|
-
label: "Résoudre une équation du
|
|
55
|
+
label: "Résoudre une équation du type $ax = b$ (solution entière)",
|
|
56
56
|
levels: ["2nde"],
|
|
57
57
|
isSingleStep: true,
|
|
58
58
|
sections: ["Équations"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeEquationIntType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6EF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"firstDegreeEquationIntType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6EF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAa7D,CAAC"}
|
|
@@ -59,7 +59,7 @@ const isAnswerValid = (ans, { answer, x }) => {
|
|
|
59
59
|
};
|
|
60
60
|
exports.firstDegreeEquationIntType2 = {
|
|
61
61
|
id: "firstDegreeEquationIntType2",
|
|
62
|
-
label: "Résoudre une équation du
|
|
62
|
+
label: "Résoudre une équation du type $ax + b = c$ (solution entière)",
|
|
63
63
|
levels: ["2nde"],
|
|
64
64
|
isSingleStep: true,
|
|
65
65
|
sections: ["Équations"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firstDegreeEquationIntType3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsFF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"firstDegreeEquationIntType3.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsFF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAa7D,CAAC"}
|
|
@@ -12,7 +12,7 @@ const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
|
12
12
|
const getFirstDegreeEquationIntQuestion = () => {
|
|
13
13
|
const a = (0, randint_1.randint)(-15, 15, [0]);
|
|
14
14
|
const x = (0, randint_1.randint)(-15, 15, [0]);
|
|
15
|
-
const c = (0, randint_1.randint)(-15, 15, [0]);
|
|
15
|
+
const c = (0, randint_1.randint)(-15, 15, [0, a]);
|
|
16
16
|
const d = (0, randint_1.randint)(-15, 15, [0]);
|
|
17
17
|
const b = d - (a - c) * x;
|
|
18
18
|
const answer = new equalNode_1.EqualNode(new variableNode_1.VariableNode("x"), x.toTree()).toTex();
|
|
@@ -65,7 +65,7 @@ const isAnswerValid = (ans, { answer, x }) => {
|
|
|
65
65
|
};
|
|
66
66
|
exports.firstDegreeEquationIntType3 = {
|
|
67
67
|
id: "firstDegreeEquationIntType3",
|
|
68
|
-
label: "Résoudre une équation du
|
|
68
|
+
label: "Résoudre une équation du type $ax + b = cx + d$ (solution entière)",
|
|
69
69
|
levels: ["2nde"],
|
|
70
70
|
isSingleStep: true,
|
|
71
71
|
sections: ["Équations"],
|
|
@@ -9,7 +9,7 @@ const getConvexityTrinomialsQuestion = () => {
|
|
|
9
9
|
const isConvex = trinom.a > 0 ? "Convexe" : "Concave";
|
|
10
10
|
const question = {
|
|
11
11
|
answer: isConvex,
|
|
12
|
-
instruction: `Soit la fonction $f(x) = ${trinom.toTex()}$.
|
|
12
|
+
instruction: `Soit la fonction $f(x) = ${trinom.toTex()}$. Sur $\\mathbb{R}$, $f$ est :`,
|
|
13
13
|
keys: [],
|
|
14
14
|
answerFormat: "raw",
|
|
15
15
|
identifiers: { coeffs: trinom.coefficients },
|
|
@@ -30,7 +30,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
30
30
|
};
|
|
31
31
|
exports.convexityTrinomials = {
|
|
32
32
|
id: "convexityTrinomials",
|
|
33
|
-
label: "
|
|
33
|
+
label: "Déterminer la convexité d'un trinôme",
|
|
34
34
|
levels: ["TermSpé"],
|
|
35
35
|
isSingleStep: true,
|
|
36
36
|
sections: ["Dérivation"],
|
|
@@ -54,7 +54,7 @@ const getPropositions = (n, { answer, quadcoeffs }) => {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
while (propositions.length < n) {
|
|
57
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-
|
|
57
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-10, 10).toString());
|
|
58
58
|
}
|
|
59
59
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
60
60
|
};
|
|
@@ -70,7 +70,7 @@ const isAnswerValid = (ans, { answer, quadcoeffs }) => {
|
|
|
70
70
|
};
|
|
71
71
|
exports.inflexionPointQuadrinomials = {
|
|
72
72
|
id: "inflexionPointQuadrinomials",
|
|
73
|
-
label: "Calcul du point d'inflexion
|
|
73
|
+
label: "Calcul du point d'inflexion",
|
|
74
74
|
levels: ["TermSpé"],
|
|
75
75
|
isSingleStep: true,
|
|
76
76
|
sections: ["Dérivation"],
|
|
@@ -15,7 +15,7 @@ const getSecondDerivativeOfExpoFunctionQuestion = () => {
|
|
|
15
15
|
const question = {
|
|
16
16
|
answer: correctAnswer.toTex(),
|
|
17
17
|
instruction: `Déterminer la fonction dérivée seconde $f''$ de la fonction $f$ définie par $f(x)=${funct.toTex()}$`,
|
|
18
|
-
keys: ["epower", "x"],
|
|
18
|
+
keys: ["epower", "x", "ln"],
|
|
19
19
|
answerFormat: "tex",
|
|
20
20
|
identifiers: { coeffs: polynom.coefficients },
|
|
21
21
|
};
|
|
@@ -46,7 +46,7 @@ const generateProposition = (coeffs) => {
|
|
|
46
46
|
};
|
|
47
47
|
exports.secondDerivativeOfExpoFunction = {
|
|
48
48
|
id: "secondDerivativeOfExpoFunction",
|
|
49
|
-
label: "
|
|
49
|
+
label: "Dérivée seconde d'une fonction de type $\\exp(u)$",
|
|
50
50
|
levels: ["TermSpé"],
|
|
51
51
|
isSingleStep: true,
|
|
52
52
|
sections: ["Dérivation"],
|
|
@@ -10,7 +10,7 @@ const getSecondDerivativeOfThirdDegreeFunction = () => {
|
|
|
10
10
|
const correctAnswer = funct.secondDerivate().toTree();
|
|
11
11
|
const instruction = `Déterminer la fonction dérivée seconde $f''$ de la fonction $f$ définie par $f(x)=${funct
|
|
12
12
|
.toTree()
|
|
13
|
-
.toTex()}
|
|
13
|
+
.toTex()}$.`;
|
|
14
14
|
const coeff = {
|
|
15
15
|
a: coefficients[3],
|
|
16
16
|
b: coefficients[2],
|
|
@@ -20,7 +20,7 @@ const getSecondDerivativeOfThirdDegreeFunction = () => {
|
|
|
20
20
|
const question = {
|
|
21
21
|
answer: correctAnswer.toTex(),
|
|
22
22
|
instruction: instruction,
|
|
23
|
-
keys: ["x"
|
|
23
|
+
keys: ["x"],
|
|
24
24
|
answerFormat: "tex",
|
|
25
25
|
identifiers: { ...coeff },
|
|
26
26
|
};
|
|
@@ -47,7 +47,7 @@ const isAnswerValid = (ans, { a, b, c, d }) => {
|
|
|
47
47
|
};
|
|
48
48
|
exports.secondDerivativeOfThridDegreeFunction = {
|
|
49
49
|
id: "secondDerivativeOfThirdDegreeFunction",
|
|
50
|
-
label: "
|
|
50
|
+
label: "Dérivée seconde d'un polynôme de degré 3",
|
|
51
51
|
levels: ["TermSpé"],
|
|
52
52
|
isSingleStep: true,
|
|
53
53
|
sections: ["Dérivation"],
|
|
@@ -10,12 +10,12 @@ const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
|
10
10
|
const getSecondDerivativeOfTrinomQuestion = () => {
|
|
11
11
|
const trinom = trinom_1.TrinomConstructor.random();
|
|
12
12
|
const trinomTree = trinom.toTree();
|
|
13
|
-
const instruction = `Déterminer la fonction dérivée seconde $f''$ de la fonction $f$ définie par $f(x)=${trinomTree.toTex()}
|
|
13
|
+
const instruction = `Déterminer la fonction dérivée seconde $f''$ de la fonction $f$ définie par $f(x)=${trinomTree.toTex()}$.`;
|
|
14
14
|
const correctAnswer = trinom.derivate().derivate().toTree();
|
|
15
15
|
const question = {
|
|
16
16
|
answer: correctAnswer.toTex(),
|
|
17
17
|
instruction: instruction,
|
|
18
|
-
keys: ["
|
|
18
|
+
keys: ["x"],
|
|
19
19
|
answerFormat: "tex",
|
|
20
20
|
identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
|
|
21
21
|
};
|
|
@@ -43,7 +43,7 @@ const generateProposition = (a, b, c) => {
|
|
|
43
43
|
};
|
|
44
44
|
exports.secondDerivativeOfTrinom = {
|
|
45
45
|
id: "secondDerivativeOfTrinom",
|
|
46
|
-
label: "
|
|
46
|
+
label: "Dérivée seconde d'un trinôme",
|
|
47
47
|
levels: ["TermSpé"],
|
|
48
48
|
isSingleStep: true,
|
|
49
49
|
sections: ["Dérivation"],
|
|
@@ -66,7 +66,7 @@ const isAnswerValid = (ans, { answer, affinecoeffs }) => {
|
|
|
66
66
|
};
|
|
67
67
|
exports.sinSecondDegreeDerivative = {
|
|
68
68
|
id: "sinSecondDegreeDerivative",
|
|
69
|
-
label: "Dérivée seconde de sin(u)",
|
|
69
|
+
label: "Dérivée seconde de $\\sin(u)$",
|
|
70
70
|
levels: ["TermSpé"],
|
|
71
71
|
isSingleStep: true,
|
|
72
72
|
sections: ["Dérivation"],
|
|
@@ -44,12 +44,12 @@ const getAffineAdjustmentQuestion = () => {
|
|
|
44
44
|
let dataTable = `
|
|
45
45
|
| | | | | | | | | | | |
|
|
46
46
|
|-|-|-|-|-|-|-|-|-|-|-|
|
|
47
|
-
| x | ${xValues.join(" | ")} |
|
|
48
|
-
| y | ${yValues.join(" | ")} |
|
|
47
|
+
| $x$ | ${xValues.join(" | ")} |
|
|
48
|
+
| $y$ | ${yValues.map((n) => n.frenchify()).join(" | ")} |
|
|
49
49
|
`;
|
|
50
50
|
const question = {
|
|
51
51
|
answer: answer,
|
|
52
|
-
instruction:
|
|
52
|
+
instruction: `On considère la série statistique ci-dessous. Déterminez l'équation de la droite d'ajustement obtenue par la méthode des moindres carrés. ${dataTable}
|
|
53
53
|
`,
|
|
54
54
|
keys: ["equal", "y", "x", "a", "b"],
|
|
55
55
|
answerFormat: "tex",
|
|
@@ -61,12 +61,12 @@ const getAffineAdjustmentCompleteQuestion = () => {
|
|
|
61
61
|
let dataTable = `
|
|
62
62
|
| | | | | | | | | | | |
|
|
63
63
|
|-|-|-|-|-|-|-|-|-|-|-|
|
|
64
|
-
| x | ${xValues.join(" | ")} |
|
|
65
|
-
| y | ${yValues.join(" | ")} |
|
|
64
|
+
| $x$ | ${xValues.join(" | ")} |
|
|
65
|
+
| $y$ | ${yValues.map((n) => n.frenchify()).join(" | ")} |
|
|
66
66
|
`;
|
|
67
67
|
const question = {
|
|
68
68
|
answer: `${answerEq}\\qquad ${answerR}`,
|
|
69
|
-
instruction: `
|
|
69
|
+
instruction: `On considère la série statistique ci-dessous. A l'aide de la calculatrice, déterminer l'équation de la droite d'ajustement et la valeur du coefficient de détermination. Arrondir au centième. ${dataTable}
|
|
70
70
|
`,
|
|
71
71
|
keys: [],
|
|
72
72
|
answerFormat: "tex",
|
|
@@ -49,12 +49,12 @@ const getAffineAdjustmentRsquaredQuestion = () => {
|
|
|
49
49
|
let dataTable = `
|
|
50
50
|
| | | | | | | | | | | |
|
|
51
51
|
|-|-|-|-|-|-|-|-|-|-|-|
|
|
52
|
-
| x | ${xValues.join(" | ")} |
|
|
53
|
-
| y | ${yValues.join(" | ")} |
|
|
52
|
+
| $x$ | ${xValues.join(" | ")} |
|
|
53
|
+
| $y$ | ${yValues.map((n) => n.frenchify()).join(" | ")} |
|
|
54
54
|
`;
|
|
55
55
|
const question = {
|
|
56
56
|
answer: answer,
|
|
57
|
-
instruction:
|
|
57
|
+
instruction: `On considère la série statistique ci-dessous. Déterminez la valeur du coefficient de détermination. ${dataTable}
|
|
58
58
|
`,
|
|
59
59
|
keys: ["R", "equal"],
|
|
60
60
|
answerFormat: "tex",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"algebricExpressionOfAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/algebricExpressionOfAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"algebricExpressionOfAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/algebricExpressionOfAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoDF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAa5D,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.algebricExpressionOfAffine = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const affine_1 = require("../../../../math/polynomials/affine");
|
|
7
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
7
8
|
const getAlgebricExpressionOfAffineQuestion = () => {
|
|
8
9
|
const f = affine_1.AffineConstructor.random();
|
|
9
10
|
const a = f.a;
|
|
@@ -33,7 +34,7 @@ const isAnswerValid = (ans, { a, b }) => {
|
|
|
33
34
|
return f.toTree().toAllValidTexs().includes(ans);
|
|
34
35
|
};
|
|
35
36
|
const generatePropositions = (a, b) => {
|
|
36
|
-
const firstProposition = new affine_1.Affine(b, a, "x");
|
|
37
|
+
const firstProposition = new affine_1.Affine(b !== 0 ? b : (0, randint_1.randint)(-10, 11, [0]), a, "x");
|
|
37
38
|
const secondProposition = new affine_1.Affine(a, -b, "x");
|
|
38
39
|
return [
|
|
39
40
|
firstProposition.toTree().toTex(),
|
|
@@ -42,7 +43,7 @@ const generatePropositions = (a, b) => {
|
|
|
42
43
|
};
|
|
43
44
|
exports.algebricExpressionOfAffine = {
|
|
44
45
|
id: "algebricExpressionOfAffine",
|
|
45
|
-
label: "Écrire l'expression algébrique d'une fonction affine
|
|
46
|
+
label: "Écrire l'expression algébrique d'une fonction affine",
|
|
46
47
|
levels: ["2nde"],
|
|
47
48
|
isSingleStep: true,
|
|
48
49
|
sections: ["Fonctions affines"],
|
|
@@ -48,7 +48,7 @@ const generateExercise = () => {
|
|
|
48
48
|
};
|
|
49
49
|
exports.leadingCoeffAndOriginOrdinate = {
|
|
50
50
|
id: "leadingCoeffAndOriginOrdinate",
|
|
51
|
-
label: "
|
|
51
|
+
label: "Identifier le coefficient directeur ou l'ordonnée à l'origine d'une fonction affine",
|
|
52
52
|
levels: ["2nde"],
|
|
53
53
|
isSingleStep: true,
|
|
54
54
|
sections: ["Fonctions affines"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cartesianEquationOfLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/cartesianEquationOfLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"cartesianEquationOfLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/cartesianEquationOfLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA+NF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
|
|
@@ -26,7 +26,7 @@ const getCartesianEquationOfLineQuestion = () => {
|
|
|
26
26
|
];
|
|
27
27
|
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, { isGridSimple: true });
|
|
28
28
|
const correctAnswer = line.getCartesianEquation();
|
|
29
|
-
const instruction = `Déterminer
|
|
29
|
+
const instruction = `Déterminer une équation cartesienne de la droite $d$ représentée ci-dessous :`;
|
|
30
30
|
const aX = a.getXnumber();
|
|
31
31
|
const aY = a.getYnumber();
|
|
32
32
|
const bX = b.getXnumber();
|
|
@@ -52,36 +52,39 @@ const getPropositions = (n, { answer, aX, aY, bX, bY }) => {
|
|
|
52
52
|
const propositions = [];
|
|
53
53
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
54
54
|
generateProposition(aX, aY, bX, bY).forEach((value) => (0, exercise_1.tryToAddWrongProp)(propositions, value.toTex()));
|
|
55
|
-
let
|
|
56
|
-
let
|
|
55
|
+
let a;
|
|
56
|
+
let b;
|
|
57
|
+
const x = new variableNode_1.VariableNode("x");
|
|
58
|
+
const y = new variableNode_1.VariableNode("y");
|
|
59
|
+
let node;
|
|
57
60
|
while (propositions.length < n) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, getCorrectAnswer(aXrand, aYrand, bX, bY).toTex());
|
|
61
|
+
node = generateRandomWrongProp(aX, aY, bX, bY, x, y);
|
|
62
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, node.toTex());
|
|
61
63
|
}
|
|
62
64
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
63
65
|
};
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
const generateRandomWrongProp = (aX, aY, bX, bY, x, y) => {
|
|
67
|
+
let a;
|
|
68
|
+
let b;
|
|
69
|
+
let c;
|
|
70
|
+
do {
|
|
71
|
+
a = (0, randint_1.randint)(-10, 11, [0]);
|
|
72
|
+
b = (0, randint_1.randint)(-10, 11, [0]);
|
|
73
|
+
c = (0, randint_1.randint)(-10, 11);
|
|
74
|
+
} while (a * aX + b * aY + c === 0 && a * bX + b * bY + c === 0);
|
|
75
|
+
return new equalNode_1.EqualNode(new addNode_1.AddNode(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(a.toTree(), x).simplify(), new multiplyNode_1.MultiplyNode(b.toTree(), y).simplify()), c.toTree()), zero);
|
|
69
76
|
};
|
|
70
77
|
const generateProposition = (aX, aY, bX, bY) => {
|
|
71
78
|
const x = new variableNode_1.VariableNode("x");
|
|
72
79
|
const y = new variableNode_1.VariableNode("y");
|
|
73
80
|
const firstProposition = getFirstProposition(x, y, aX, aY, bX, bY);
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
return [firstProposition].filter((value) => {
|
|
82
|
+
const leftChild = value.leftChild;
|
|
83
|
+
return (leftChild.evaluate({ x: aX, y: aY }) !== 0 ||
|
|
84
|
+
leftChild.evaluate({ x: bX, y: bY }) !== 0);
|
|
85
|
+
});
|
|
76
86
|
};
|
|
77
87
|
const getFirstProposition = (x, y, aX, aY, bX, bY) => {
|
|
78
|
-
const u = new vector_1.Vector("u", new numberNode_1.NumberNode(bX - aX), new numberNode_1.NumberNode(bY - aY));
|
|
79
|
-
const b = u.getXAsNumber();
|
|
80
|
-
const a = -u.getYAsNumber();
|
|
81
|
-
const c = -a * aX - b * aY;
|
|
82
|
-
return new equalNode_1.EqualNode(new addNode_1.AddNode(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), x).simplify(), new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(b), y).simplify()), new numberNode_1.NumberNode(c)), zero);
|
|
83
|
-
};
|
|
84
|
-
const getSecondPropoition = (x, y, aX, aY, bX, bY) => {
|
|
85
88
|
const u = new vector_1.Vector("u", new numberNode_1.NumberNode(aX - bX), new numberNode_1.NumberNode(aY - bY));
|
|
86
89
|
const b = -u.getXAsNumber();
|
|
87
90
|
const a = u.getYAsNumber();
|
|
@@ -158,7 +161,7 @@ const getNodeFromVariableString = (str, splitter) => {
|
|
|
158
161
|
};
|
|
159
162
|
exports.cartesianEquationOfLine = {
|
|
160
163
|
id: "cartesianEquationOfLine",
|
|
161
|
-
label: "Déterminer une
|
|
164
|
+
label: "Déterminer une équation cartesienne de droite par lecture graphique",
|
|
162
165
|
levels: ["2nde"],
|
|
163
166
|
isSingleStep: true,
|
|
164
167
|
sections: ["Droites"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directionVector.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/directionVector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"directionVector.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/directionVector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAyIF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
|
|
@@ -5,6 +5,7 @@ const exercise_1 = require("../../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
7
|
const vector_1 = require("../../../../math/geometry/vector");
|
|
8
|
+
const gcd_1 = require("../../../../math/utils/arithmetic/gcd");
|
|
8
9
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
9
10
|
function parseVector(input) {
|
|
10
11
|
const tex = input.replace("\\left", "");
|
|
@@ -19,6 +20,16 @@ function parseVector(input) {
|
|
|
19
20
|
}
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
23
|
+
function normalizeVector(x, y) {
|
|
24
|
+
const divisor = (0, gcd_1.gcd)(Math.abs(x), Math.abs(y));
|
|
25
|
+
let newX = x / divisor;
|
|
26
|
+
let newY = y / divisor;
|
|
27
|
+
if (newX < 0) {
|
|
28
|
+
newX = -newX;
|
|
29
|
+
newY = -newY;
|
|
30
|
+
}
|
|
31
|
+
return { x: newX, y: newY };
|
|
32
|
+
}
|
|
22
33
|
const getDirectionVectorQuestion = () => {
|
|
23
34
|
let x1 = (0, randint_1.randint)(-8, 8);
|
|
24
35
|
let x2 = (0, randint_1.randint)(-8, 8);
|
|
@@ -30,11 +41,15 @@ const getDirectionVectorQuestion = () => {
|
|
|
30
41
|
while (y2 === y1) {
|
|
31
42
|
y2 = (0, randint_1.randint)(-8, 8);
|
|
32
43
|
}
|
|
33
|
-
const
|
|
34
|
-
const
|
|
44
|
+
const rawXValue = x2 - x1;
|
|
45
|
+
const rawYValue = y2 - y1;
|
|
46
|
+
const { x: xValue, y: yValue } = normalizeVector(rawXValue, rawYValue);
|
|
35
47
|
const vector = new vector_1.Vector("v", xValue.toTree(), yValue.toTree());
|
|
36
|
-
const instruction = `
|
|
37
|
-
const commands = [
|
|
48
|
+
const instruction = `Lire les coordonnées d'un vecteur directeur de la droite représentée ci-dessous :`;
|
|
49
|
+
const commands = [
|
|
50
|
+
`line = Line((${x1}, ${y1}), (${x2}, ${y2}))`,
|
|
51
|
+
`SetFixed(line, true)`,
|
|
52
|
+
];
|
|
38
53
|
const xMin = Math.min(x1, x2);
|
|
39
54
|
const yMin = Math.min(y1, y2);
|
|
40
55
|
const xMax = Math.max(x1, x2);
|
|
@@ -71,7 +86,10 @@ const getPropositions = (n, { answer, xValue, yValue }) => {
|
|
|
71
86
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer3.toInlineCoordsTex());
|
|
72
87
|
}
|
|
73
88
|
while (propositions.length < n) {
|
|
74
|
-
const
|
|
89
|
+
const randomX = (0, randint_1.randint)(-5, 5);
|
|
90
|
+
const randomY = (0, randint_1.randint)(-5, 5);
|
|
91
|
+
const { x: wrongX, y: wrongY } = normalizeVector(randomX, randomY);
|
|
92
|
+
const wrongAnswer = new vector_1.Vector("v", wrongX.toTree(), wrongY.toTree());
|
|
75
93
|
if (wrongAnswer.isColinear(vector) === false) {
|
|
76
94
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toInlineCoordsTex());
|
|
77
95
|
}
|
|
@@ -41,7 +41,7 @@ const getDirectionVectorEquationQuestion = () => {
|
|
|
41
41
|
const equation = new equalNode_1.EqualNode(new addNode_1.AddNode(new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(yValue.toTree(), new variableNode_1.VariableNode("x")), new multiplyNode_1.MultiplyNode((-xValue).toTree(), new variableNode_1.VariableNode("y"))).simplify({ forbidFactorize: true }), c.toTree()), new numberNode_1.NumberNode(0)).toTex();
|
|
42
42
|
const question = {
|
|
43
43
|
answer: vector.toInlineCoordsTex(),
|
|
44
|
-
instruction: `Soit
|
|
44
|
+
instruction: `Soit une droite $d$ d'équation cartésienne $${equation}$. Déterminez les coordonnées d'un vecteur directeur de $d$.`,
|
|
45
45
|
keys: ["semicolon", "x", "y"],
|
|
46
46
|
answerFormat: "tex",
|
|
47
47
|
identifiers: { xValue, yValue },
|
|
@@ -13,7 +13,7 @@ const getPointCoordinatesQuestion = () => {
|
|
|
13
13
|
const xMax = Math.max(x) + 5;
|
|
14
14
|
const yMin = Math.min(y) - 5;
|
|
15
15
|
const yMax = Math.max(y) + 5;
|
|
16
|
-
const instruction = `
|
|
16
|
+
const instruction = `Lire les coordonnées du point $A$ représenté dans le repère ci-dessous : `;
|
|
17
17
|
const commands = [
|
|
18
18
|
`A = (${x}, ${y})`,
|
|
19
19
|
`ShowLabel(A, true)`,
|
|
@@ -63,7 +63,7 @@ const isAnswerValid = (ans, { answer, x, y }) => {
|
|
|
63
63
|
};
|
|
64
64
|
exports.pointCoordinates = {
|
|
65
65
|
id: "pointCoordinates",
|
|
66
|
-
label: "
|
|
66
|
+
label: "Lire les coordonnées d'un point",
|
|
67
67
|
levels: ["1rePro"],
|
|
68
68
|
isSingleStep: true,
|
|
69
69
|
sections: ["Géométrie cartésienne"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convexityQuadrinomialsGeo.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAoBlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"convexityQuadrinomialsGeo.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAoBlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAmMF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -61,7 +61,7 @@ const getConvexityQuadrinomialsGeoQuestion = () => {
|
|
|
61
61
|
: new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, inflexionPointX.toTree(), closure_1.ClosureType.OO).toTex();
|
|
62
62
|
}
|
|
63
63
|
const questionType = askConvex ? "convexe" : "concave";
|
|
64
|
-
const instruction = `Ci-dessous est tracée la courbe $\\mathcal C_f$
|
|
64
|
+
const instruction = `Ci-dessous est tracée la courbe représentative $\\mathcal C_f$ d'une fonction $f$. Sur quel intervalle $f$ est-elle ${questionType} ?`;
|
|
65
65
|
const commands = [
|
|
66
66
|
`f(x) = ${quadrinomial.toString()}`,
|
|
67
67
|
`SetColor(f, "${colors_1.blueMain}")`,
|
|
@@ -80,7 +80,7 @@ const getConvexityQuadrinomialsGeoQuestion = () => {
|
|
|
80
80
|
options: ggb.getOptions(),
|
|
81
81
|
keys: ["rbracket", "lbracket", "semicolon", "infty", "reals"],
|
|
82
82
|
answerFormat: "tex",
|
|
83
|
-
identifiers: { askConvex, quadcoeffs },
|
|
83
|
+
identifiers: { askConvex, quadcoeffs, inflexionPoint: inflexionPointX },
|
|
84
84
|
};
|
|
85
85
|
return question;
|
|
86
86
|
};
|
|
@@ -101,8 +101,7 @@ const getPropositions = (n, { answer, quadcoeffs }) => {
|
|
|
101
101
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongInterval4);
|
|
102
102
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
103
103
|
};
|
|
104
|
-
const isAnswerValid = (ans, { askConvex, quadcoeffs }) => {
|
|
105
|
-
const inflexionPoint = -quadcoeffs[2] / (3 * quadcoeffs[3]);
|
|
104
|
+
const isAnswerValid = (ans, { askConvex, quadcoeffs, inflexionPoint }) => {
|
|
106
105
|
let interval;
|
|
107
106
|
if (askConvex) {
|
|
108
107
|
interval =
|
|
@@ -116,12 +115,12 @@ const isAnswerValid = (ans, { askConvex, quadcoeffs }) => {
|
|
|
116
115
|
? new intervalNode_1.IntervalNode(inflexionPoint.toTree(), infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.OO)
|
|
117
116
|
: new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, inflexionPoint.toTree(), closure_1.ClosureType.OO);
|
|
118
117
|
}
|
|
119
|
-
const latexs = interval.toAllValidTexs({
|
|
118
|
+
const latexs = interval.toAllValidTexs({});
|
|
120
119
|
return latexs.includes(ans);
|
|
121
120
|
};
|
|
122
121
|
exports.convexityQuadrinomialsGeo = {
|
|
123
122
|
id: "convexityQuadrinomialsGeo",
|
|
124
|
-
label: "
|
|
123
|
+
label: "Déterminer graphiquement la convexité d'un polynôme de degré $3$",
|
|
125
124
|
levels: ["TermSpé"],
|
|
126
125
|
isSingleStep: true,
|
|
127
126
|
sections: ["Dérivation"],
|
|
@@ -8,7 +8,7 @@ const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor"
|
|
|
8
8
|
const trinom_1 = require("../../../../math/polynomials/trinom");
|
|
9
9
|
const getConvexityTrinomialsGeoQuestion = () => {
|
|
10
10
|
const trinom = trinom_1.TrinomConstructor.random();
|
|
11
|
-
const instruction = `Ci-dessous est tracée la courbe $\\mathcal C_f$
|
|
11
|
+
const instruction = `Ci-dessous est tracée la courbe représentative $\\mathcal C_f$ d'une fonction $f$. Sur $\\mathbb{R}$, la fonction $f$ est :`;
|
|
12
12
|
const commands = [
|
|
13
13
|
`f(x) = ${trinom.toString()}`,
|
|
14
14
|
`SetColor(f, "${colors_1.blueMain}")`,
|
|
@@ -46,7 +46,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
46
46
|
};
|
|
47
47
|
exports.convexityTrinomialsGeo = {
|
|
48
48
|
id: "convexityTrinomialsGeo",
|
|
49
|
-
label: "
|
|
49
|
+
label: "Déterminer graphiquement la convexité d'un trinôme",
|
|
50
50
|
levels: ["TermSpé"],
|
|
51
51
|
isSingleStep: true,
|
|
52
52
|
sections: ["Dérivation"],
|
|
@@ -20,7 +20,7 @@ const getLineFromDirectorVectorQuestion = () => {
|
|
|
20
20
|
const b = new point_1.Point("b", new numberNode_1.NumberNode(a.getXnumber() - u.getXAsNumber()), new numberNode_1.NumberNode(a.getYnumber() - u.getYAsNumber()));
|
|
21
21
|
const line = new line_1.Line(b, a);
|
|
22
22
|
const correctAnswer = line.getEquation(u, a);
|
|
23
|
-
const instruction = `Soit $d$ une droite de vecteur directeur $${u.toTexWithCoords()}$ passant par le point $${a.toTexWithCoords()}$. Déterminer l'équation réduite de la droite $d
|
|
23
|
+
const instruction = `Soit $d$ une droite de vecteur directeur $${u.toTexWithCoords()}$ passant par le point $${a.toTexWithCoords()}$. Déterminer l'équation réduite de la droite $d$.`;
|
|
24
24
|
const question = {
|
|
25
25
|
answer: correctAnswer.toTex(),
|
|
26
26
|
instruction: instruction,
|
|
@@ -99,7 +99,7 @@ const getCorrecAnswer = (uX, uY, aX, aY) => {
|
|
|
99
99
|
};
|
|
100
100
|
exports.lineFromDirectorVector = {
|
|
101
101
|
id: "lineFromDirectorVector",
|
|
102
|
-
label: "Équation réduite
|
|
102
|
+
label: "Équation réduite d'une droite connaissant un point et un vecteur directeur",
|
|
103
103
|
levels: ["2nde"],
|
|
104
104
|
isSingleStep: true,
|
|
105
105
|
sections: ["Droites"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorNormCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorNormCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"vectorNormCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorNormCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+CF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAavD,CAAC"}
|
|
@@ -8,7 +8,6 @@ const real_1 = require("../../../../math/numbers/reals/real");
|
|
|
8
8
|
const sqrtNode_1 = require("../../../../tree/nodes/functions/sqrtNode");
|
|
9
9
|
const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
|
|
10
10
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
11
|
-
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
12
11
|
const getVectorNormCalculationQuestion = () => {
|
|
13
12
|
const u = vector_1.VectorConstructor.random("u", false);
|
|
14
13
|
const x = u.x.simplify().value;
|
|
@@ -43,8 +42,10 @@ const generateProposition = (x, y) => {
|
|
|
43
42
|
return [firstProposition];
|
|
44
43
|
};
|
|
45
44
|
const isAnswerValid = (ans, { x, y }) => {
|
|
46
|
-
const correctAnswer = new sqrtNode_1.SqrtNode(
|
|
47
|
-
return correctAnswer
|
|
45
|
+
const correctAnswer = new sqrtNode_1.SqrtNode((x ** 2 + y ** 2).toTree());
|
|
46
|
+
return correctAnswer
|
|
47
|
+
.toAllValidTexs({ allowSimplifySqrt: true })
|
|
48
|
+
.includes(ans);
|
|
48
49
|
};
|
|
49
50
|
exports.vectorNormCalculation = {
|
|
50
51
|
id: "vectorNormCalculation",
|
|
@@ -33,7 +33,7 @@ const getFineAdjustementExerciseQuestion = () => {
|
|
|
33
33
|
const yMax = Math.max(...yValues);
|
|
34
34
|
const question = {
|
|
35
35
|
answer: exercise.correctAnswer,
|
|
36
|
-
instruction:
|
|
36
|
+
instruction: `On considère le nuage de points ci-dessous. Choisir la bonne réponse.`,
|
|
37
37
|
commands: ggb.commands,
|
|
38
38
|
options: ggb.getOptions(),
|
|
39
39
|
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditionIf.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/conditionIf.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"conditionIf.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/conditionIf.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAiEF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAY7C,CAAC"}
|
|
@@ -16,7 +16,11 @@ const getConditionIfQuestion = () => {
|
|
|
16
16
|
const opIndex = (0, randint_1.randint)(0, operations.length);
|
|
17
17
|
const operation = operations[opIndex];
|
|
18
18
|
const opresult = operation.func(a, b);
|
|
19
|
-
|
|
19
|
+
// Choisir aléatoirement entre les deux conditions
|
|
20
|
+
const condition = (0, randint_1.randint)(0, 2) === 0 ? "a <= b" : "b <= a";
|
|
21
|
+
const answer = (condition === "a <= b" ? opresult <= b : opresult >= b)
|
|
22
|
+
? b
|
|
23
|
+
: opresult;
|
|
20
24
|
const question = {
|
|
21
25
|
answer: answer.toString(),
|
|
22
26
|
instruction: `Quel sera l'affichage du code suivant ?
|
|
@@ -24,14 +28,14 @@ const getConditionIfQuestion = () => {
|
|
|
24
28
|
a = ${a}
|
|
25
29
|
b = ${b}
|
|
26
30
|
a = a ${operation.name} b
|
|
27
|
-
if
|
|
31
|
+
if ${condition} :
|
|
28
32
|
a = b
|
|
29
33
|
print(a)
|
|
30
34
|
\`\`\`
|
|
31
35
|
`,
|
|
32
36
|
keys: ["a", "b", "equal"],
|
|
33
37
|
answerFormat: "tex",
|
|
34
|
-
identifiers: { a, b, opresult },
|
|
38
|
+
identifiers: { a, b, opresult, condition },
|
|
35
39
|
};
|
|
36
40
|
return question;
|
|
37
41
|
};
|
|
@@ -42,9 +46,7 @@ const getPropositions = (n, { answer, a, b, opresult }) => {
|
|
|
42
46
|
(0, exercise_1.tryToAddWrongProp)(propositions, b.toString());
|
|
43
47
|
(0, exercise_1.tryToAddWrongProp)(propositions, opresult.toString());
|
|
44
48
|
while (propositions.length < n) {
|
|
45
|
-
|
|
46
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(0, 10).toString());
|
|
47
|
-
}
|
|
49
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(0, 10).toString());
|
|
48
50
|
}
|
|
49
51
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
50
52
|
};
|
|
@@ -131,7 +131,7 @@ const isAnswerValid = (ans, { exercise }) => {
|
|
|
131
131
|
};
|
|
132
132
|
exports.pythonForLoop1Exercise = {
|
|
133
133
|
id: "pyForLoop1Exercise",
|
|
134
|
-
label: "
|
|
134
|
+
label: "Boucles for 1",
|
|
135
135
|
levels: ["2nde"],
|
|
136
136
|
isSingleStep: true,
|
|
137
137
|
sections: ["Python"],
|
|
@@ -71,7 +71,7 @@ const getCorrectAnswer = (exo) => {
|
|
|
71
71
|
};
|
|
72
72
|
exports.pyNestedForLoopExercise = {
|
|
73
73
|
id: "pyNestedForLoopExercise",
|
|
74
|
-
label: "
|
|
74
|
+
label: "Boucles for imbriquées",
|
|
75
75
|
levels: ["2nde"],
|
|
76
76
|
isSingleStep: true,
|
|
77
77
|
sections: ["Python"],
|
|
@@ -101,7 +101,7 @@ const generateType17Instruction = (a, b, op) => {
|
|
|
101
101
|
};
|
|
102
102
|
exports.pyWhileLoop1Exercise = {
|
|
103
103
|
id: "pyWhileLoop1Exercise",
|
|
104
|
-
label: "
|
|
104
|
+
label: "Boucles while 1",
|
|
105
105
|
levels: ["2nde"],
|
|
106
106
|
isSingleStep: true,
|
|
107
107
|
sections: ["Python"],
|
package/lib/index.d.ts
CHANGED
|
@@ -836,6 +836,7 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
836
836
|
}> | import("./exercises/exercise").Exercise<{
|
|
837
837
|
askConvex: boolean;
|
|
838
838
|
quadcoeffs: number[];
|
|
839
|
+
inflexionPoint: number;
|
|
839
840
|
}> | import("./exercises/exercise").Exercise<{
|
|
840
841
|
coeffs: number[];
|
|
841
842
|
to: string;
|
|
@@ -1245,6 +1246,7 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
|
|
|
1245
1246
|
a: number;
|
|
1246
1247
|
b: number;
|
|
1247
1248
|
opresult: number;
|
|
1249
|
+
condition: string;
|
|
1248
1250
|
}> | import("./exercises/exercise").Exercise<{
|
|
1249
1251
|
exercise: {
|
|
1250
1252
|
op: string;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAA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;;KAEgD,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -12,7 +12,7 @@ export declare class SqrtNode implements FunctionNode {
|
|
|
12
12
|
toMathString(): string;
|
|
13
13
|
toTex(): string;
|
|
14
14
|
toEquivalentNodes(opts?: NodeOptions): AlgebraicNode[];
|
|
15
|
-
toAllValidTexs(): string[];
|
|
15
|
+
toAllValidTexs(opts?: NodeOptions): string[];
|
|
16
16
|
evaluate(vars: Record<string, number>): number;
|
|
17
17
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|
|
18
18
|
equals(node: AlgebraicNode): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqrtNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/sqrtNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAK5E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAElE,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,QAAQ,CAEjD;AACD,qBAAa,QAAS,YAAW,YAAY;IAC3C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,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GrC"}
|
|
@@ -49,8 +49,8 @@ class SqrtNode {
|
|
|
49
49
|
}
|
|
50
50
|
return res;
|
|
51
51
|
}
|
|
52
|
-
toAllValidTexs() {
|
|
53
|
-
return this.toEquivalentNodes().map((node) => node.toTex());
|
|
52
|
+
toAllValidTexs(opts) {
|
|
53
|
+
return this.toEquivalentNodes(opts).map((node) => node.toTex());
|
|
54
54
|
}
|
|
55
55
|
evaluate(vars) {
|
|
56
56
|
return Math.sqrt(this.child.evaluate(vars));
|