math-exercises 3.0.76 → 3.0.78
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/arithmetics/calculateDistanceWithAbsoluteValue.d.ts +10 -0
- package/lib/exercises/math/calcul/arithmetics/calculateDistanceWithAbsoluteValue.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/calculateDistanceWithAbsoluteValue.js +112 -0
- package/lib/exercises/math/calcul/arithmetics/calculateWithAbsoluteValue.d.ts +8 -0
- package/lib/exercises/math/calcul/arithmetics/calculateWithAbsoluteValue.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/calculateWithAbsoluteValue.js +123 -0
- package/lib/exercises/math/calcul/arithmetics/compareInverseValues.d.ts +10 -0
- package/lib/exercises/math/calcul/arithmetics/compareInverseValues.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/compareInverseValues.js +136 -0
- package/lib/exercises/math/calcul/arithmetics/compareSquaredValues.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/compareSquaredValues.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/compareSquaredValues.js +143 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +5 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +5 -0
- package/lib/exercises/math/calcul/arithmetics/sqrtInequality.d.ts +10 -0
- package/lib/exercises/math/calcul/arithmetics/sqrtInequality.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/sqrtInequality.js +160 -0
- package/lib/exercises/math/calcul/sign/absoluteNumber.js +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +5 -1
- package/lib/exercises/math/functions/basics/graphicEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicEquation.js +33 -1
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsEquation.js +27 -0
- package/lib/exercises/math/functions/cube/compareCubeValues.d.ts +8 -0
- package/lib/exercises/math/functions/cube/compareCubeValues.d.ts.map +1 -0
- package/lib/exercises/math/functions/cube/compareCubeValues.js +113 -0
- package/lib/exercises/math/functions/cube/index.d.ts +1 -0
- package/lib/exercises/math/functions/cube/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/cube/index.js +1 -0
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/functions/sqrt/compareSqrtValues.d.ts +8 -0
- package/lib/exercises/math/functions/sqrt/compareSqrtValues.d.ts.map +1 -0
- package/lib/exercises/math/functions/sqrt/compareSqrtValues.js +83 -0
- package/lib/exercises/math/functions/sqrt/index.d.ts +2 -0
- package/lib/exercises/math/functions/sqrt/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/sqrt/index.js +1 -0
- package/lib/exercises/math/functions/variations/varTableExtremaReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/varTableExtremaReading.js +23 -8
- package/lib/exercises/math/geometry/angles/index.d.ts +1 -0
- package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/index.js +1 -0
- package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.d.ts +8 -0
- package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.js +92 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnLine.js +26 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +47 -13
- package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/linesRelativePositions.js +29 -5
- package/lib/exercises/math/probaStat/calculateMeanFromFrequencies.d.ts +8 -0
- package/lib/exercises/math/probaStat/calculateMeanFromFrequencies.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/calculateMeanFromFrequencies.js +108 -0
- package/lib/exercises/math/probaStat/checkEquiprobability.d.ts +9 -0
- package/lib/exercises/math/probaStat/checkEquiprobability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/checkEquiprobability.js +129 -0
- package/lib/exercises/math/probaStat/getComplementaryProbability.d.ts +7 -0
- package/lib/exercises/math/probaStat/getComplementaryProbability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/getComplementaryProbability.js +90 -0
- package/lib/exercises/math/probaStat/getMissingProbabilityValue.d.ts +9 -0
- package/lib/exercises/math/probaStat/getMissingProbabilityValue.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/getMissingProbabilityValue.js +109 -0
- package/lib/exercises/math/probaStat/index.d.ts +6 -0
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +6 -0
- package/lib/exercises/math/probaStat/mostLeastProbable.d.ts +8 -0
- package/lib/exercises/math/probaStat/mostLeastProbable.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/mostLeastProbable.js +114 -0
- package/lib/exercises/math/probaStat/unionIntersectionProba.d.ts +11 -0
- package/lib/exercises/math/probaStat/unionIntersectionProba.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/unionIntersectionProba.js +164 -0
- package/lib/exercises/math/python/conditionIfElifElse.d.ts +9 -0
- package/lib/exercises/math/python/conditionIfElifElse.d.ts.map +1 -0
- package/lib/exercises/math/python/conditionIfElifElse.js +121 -0
- package/lib/exercises/math/python/index.d.ts +1 -0
- package/lib/exercises/math/python/index.d.ts.map +1 -1
- package/lib/exercises/math/python/index.js +1 -0
- package/lib/exercises/math/python/pyNestedForLoopExercise.d.ts.map +1 -1
- package/lib/exercises/math/python/pyNestedForLoopExercise.js +26 -10
- package/lib/exercises/math/python/pyWhileLoop1Exercise.d.ts +0 -1
- package/lib/exercises/math/python/pyWhileLoop1Exercise.d.ts.map +1 -1
- package/lib/exercises/math/python/pyWhileLoop1Exercise.js +54 -31
- package/lib/exercises/math/python/pythonFunctionTrinom.d.ts.map +1 -1
- package/lib/exercises/math/python/pythonFunctionTrinom.js +23 -1
- package/lib/exercises/math/python/whileLoop.js +2 -2
- package/lib/exercises/math/python/whileLoopCount.js +1 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.js +3 -3
- package/lib/exercises/math/sequences/genericSequenceVariations.js +2 -2
- package/lib/exercises/math/sets/index.d.ts +2 -0
- package/lib/exercises/math/sets/index.d.ts.map +1 -1
- package/lib/exercises/math/sets/index.js +2 -0
- package/lib/exercises/math/sets/nameOfNumberSets.d.ts +8 -0
- package/lib/exercises/math/sets/nameOfNumberSets.d.ts.map +1 -0
- package/lib/exercises/math/sets/nameOfNumberSets.js +125 -0
- package/lib/exercises/math/sets/subsetsOfKnownSets.d.ts +8 -0
- package/lib/exercises/math/sets/subsetsOfKnownSets.d.ts.map +1 -0
- package/lib/exercises/math/sets/subsetsOfKnownSets.js +99 -0
- package/lib/index.d.ts +61 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +25 -7
- package/lib/tests/pdfExo.test.d.ts.map +1 -1
- package/lib/tests/pdfExo.test.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, shuffleProps, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
5
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
6
|
+
import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
|
|
7
|
+
import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
|
|
8
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
9
|
+
import { intervalParser } from "../../../../tree/parsers/intervalParser.js";
|
|
10
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
11
|
+
import { square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
12
|
+
import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
13
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
14
|
+
const getPropositions = (n, { answer }) => {
|
|
15
|
+
const propositions = [];
|
|
16
|
+
addValidProp(propositions, answer);
|
|
17
|
+
const allClosures = Object.values(ClosureType);
|
|
18
|
+
while (propositions.length < n) {
|
|
19
|
+
const falseInterval = new IntervalNode(randint(0, 10).toTree(), randint(0, 10).toTree(), random(allClosures)).toTex();
|
|
20
|
+
tryToAddWrongProp(propositions, "S=\\ " + falseInterval);
|
|
21
|
+
}
|
|
22
|
+
return shuffleProps(propositions, n);
|
|
23
|
+
};
|
|
24
|
+
const getInstruction = ({ twoSided, a, b }) => {
|
|
25
|
+
const aNode = reifyAlgebraic(a).toTex();
|
|
26
|
+
if (twoSided) {
|
|
27
|
+
const bNode = reifyAlgebraic(b).toTex();
|
|
28
|
+
return `Résoudre l'inéquation suivante, pour $x\\geq 0$ :
|
|
29
|
+
|
|
30
|
+
$$
|
|
31
|
+
${aNode} < \\sqrt{x} < ${bNode}
|
|
32
|
+
$$`;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return `Résoudre l'inéquation suivante, pour $x\\geq 0$ :
|
|
36
|
+
|
|
37
|
+
$$
|
|
38
|
+
\\sqrt{x} < ${aNode}
|
|
39
|
+
$$`;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const getAnswer = ({ twoSided, a, b }) => {
|
|
43
|
+
const aVal = reifyAlgebraic(a).evaluate();
|
|
44
|
+
let interval;
|
|
45
|
+
if (twoSided) {
|
|
46
|
+
const bVal = reifyAlgebraic(b).evaluate();
|
|
47
|
+
interval = new IntervalNode((aVal * aVal).toTree(), (bVal * bVal).toTree(), ClosureType.OO);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
interval = new IntervalNode((0).toTree(), (aVal * aVal).toTree(), ClosureType.FO);
|
|
51
|
+
}
|
|
52
|
+
return "S=\\ " + interval.simplify().toTex();
|
|
53
|
+
};
|
|
54
|
+
const getHint = ({ twoSided }) => {
|
|
55
|
+
if (twoSided) {
|
|
56
|
+
return `Puisque tous les termes de cette inéquations sont positifs, on peut les élèver au carré sans changer l'ordre de l'inéquation.`;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return `Puisque tous les termes de cette inéquations sont positifs, on peut les élèver au carré sans changer l'ordre de l'inéquation.`;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const getCorrection = (identifiers) => {
|
|
63
|
+
const { a, twoSided, b } = identifiers;
|
|
64
|
+
const aNode = reifyAlgebraic(a);
|
|
65
|
+
let steps;
|
|
66
|
+
let solTex;
|
|
67
|
+
const answer = getAnswer(identifiers);
|
|
68
|
+
if (twoSided) {
|
|
69
|
+
const bNode = reifyAlgebraic(b);
|
|
70
|
+
steps = [
|
|
71
|
+
[`${aNode.toTex()} < \\sqrt{x} < ${bNode.toTex()}`],
|
|
72
|
+
[
|
|
73
|
+
`${square(aNode).toTex()} < ${square(sqrt("x")).toTex()} < ${square(bNode).toTex()}`,
|
|
74
|
+
],
|
|
75
|
+
[
|
|
76
|
+
`${square(aNode).simplify().toTex()} < x < ${square(bNode)
|
|
77
|
+
.simplify()
|
|
78
|
+
.toTex()}`,
|
|
79
|
+
],
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
steps = [
|
|
84
|
+
[`\\sqrt{x} < ${aNode.toTex()}`],
|
|
85
|
+
[`${square(sqrt("x")).toTex()} < ${square(aNode).toTex()}`],
|
|
86
|
+
[`x < ${square(aNode).simplify().toTex()}`],
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
return `Puisque tous les termes de cette inéquation sont positifs, on peut les élèver au carré sans changer l'ordre de l'inéquation (en effet, si deux nombres positifs $a$ et $b$ vérifient $a<b$, alors $a^2<b^2$).
|
|
90
|
+
|
|
91
|
+
On a donc :
|
|
92
|
+
|
|
93
|
+
${alignTex(steps)}
|
|
94
|
+
|
|
95
|
+
La solution de l'inéquation est donc :
|
|
96
|
+
|
|
97
|
+
$$
|
|
98
|
+
${answer}
|
|
99
|
+
$$`;
|
|
100
|
+
};
|
|
101
|
+
const getKeys = () => [
|
|
102
|
+
"S",
|
|
103
|
+
"equal",
|
|
104
|
+
"lbracket",
|
|
105
|
+
"rbracket",
|
|
106
|
+
"semicolon",
|
|
107
|
+
];
|
|
108
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
109
|
+
try {
|
|
110
|
+
const parsed = intervalParser(ans.replaceAll("S", "").replaceAll("=", ""));
|
|
111
|
+
if (!parsed)
|
|
112
|
+
return false;
|
|
113
|
+
return answer === "S=\\ " + parsed.simplify().toTex();
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
return handleVEAError(err);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const getSqrtInequalityQuestion = () => {
|
|
120
|
+
const twoSided = coinFlip();
|
|
121
|
+
let aIds;
|
|
122
|
+
let bIds;
|
|
123
|
+
if (twoSided) {
|
|
124
|
+
const aVal = randint(1, 10);
|
|
125
|
+
const bVal = randint(aVal + 1, aVal + 10);
|
|
126
|
+
aIds = aVal.toTree().toIdentifiers();
|
|
127
|
+
bIds = bVal.toTree().toIdentifiers();
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const aVal = randint(1, 10);
|
|
131
|
+
aIds = aVal.toTree().toIdentifiers();
|
|
132
|
+
}
|
|
133
|
+
const identifiers = { twoSided, a: aIds, b: bIds };
|
|
134
|
+
return {
|
|
135
|
+
answer: getAnswer(identifiers),
|
|
136
|
+
instruction: getInstruction(identifiers),
|
|
137
|
+
keys: getKeys(identifiers),
|
|
138
|
+
answerFormat: "tex",
|
|
139
|
+
identifiers,
|
|
140
|
+
hint: getHint(identifiers),
|
|
141
|
+
correction: getCorrection(identifiers),
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
export const sqrtInequality = {
|
|
145
|
+
id: "sqrtInequality",
|
|
146
|
+
label: "Résoudre une inéquation du type $a<\\sqrt{x}<b$ ou $\\sqrt{x}<b$",
|
|
147
|
+
isSingleStep: true,
|
|
148
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSqrtInequalityQuestion(opts), nb),
|
|
149
|
+
freeTimer: 60,
|
|
150
|
+
getInstruction,
|
|
151
|
+
getHint,
|
|
152
|
+
getCorrection,
|
|
153
|
+
getAnswer,
|
|
154
|
+
getPropositions,
|
|
155
|
+
getQuestionFromIdentifiers: ({ twoSided, a, b }) => getSqrtInequalityQuestion(),
|
|
156
|
+
getKeys,
|
|
157
|
+
isAnswerValid,
|
|
158
|
+
hasHintAndCorrection: true,
|
|
159
|
+
subject: "Mathématiques",
|
|
160
|
+
};
|
|
@@ -63,7 +63,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
63
63
|
};
|
|
64
64
|
export const absoluteNumber = {
|
|
65
65
|
id: "absoluteNumber",
|
|
66
|
-
label: "Calculer
|
|
66
|
+
label: "Calculer la valeur absolue d'un nombre",
|
|
67
67
|
isSingleStep: true,
|
|
68
68
|
generator: (nb, opts) => getDistinctQuestions(() => getAbsoluteNumberQuestion(opts), nb),
|
|
69
69
|
qcmTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"absoluteValueInequations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absoluteValueInequations.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"absoluteValueInequations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/absolute/absoluteValueInequations.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AA6GF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAa1D,CAAC"}
|
|
@@ -14,7 +14,11 @@ const getInstruction = (identifiers) => {
|
|
|
14
14
|
const diff = new NumberNode(b - a);
|
|
15
15
|
const add = new NumberNode(b + a);
|
|
16
16
|
const poly = new Polynomial([-b, 1]);
|
|
17
|
-
return `Résoudre l'inéquation
|
|
17
|
+
return `Résoudre l'inéquation :
|
|
18
|
+
|
|
19
|
+
$$
|
|
20
|
+
|${poly.toTree().toTex()}|${isStrict ? "<" : "\\le"}${a}
|
|
21
|
+
$$`;
|
|
18
22
|
};
|
|
19
23
|
const getAnswer = (identifiers) => {
|
|
20
24
|
const { a, b, isStrict } = identifiers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphicEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"graphicEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/graphicEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAClC,CAAC;AA6JF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAejD,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
|
|
|
3
3
|
import { discreteSetKeys } from "../../../../exercises/utils/keys/discreteSetKeys.js";
|
|
4
4
|
import { randomColor } from "../../../../geogebra/colors.js";
|
|
5
5
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
6
|
+
import { Point } from "../../../../math/geometry/point.js";
|
|
6
7
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
7
8
|
import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationSolutionNode.js";
|
|
8
9
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
@@ -10,8 +11,36 @@ import { DiscreteSetNode, } from "../../../../tree/nodes/sets/discreteSetNode.js
|
|
|
10
11
|
import { discreteSetParser } from "../../../../tree/parsers/discreteSetParser.js";
|
|
11
12
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
12
13
|
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
14
|
+
import { pluralize } from "../../../../utils/strings/pluralize.js";
|
|
13
15
|
const getInstruction = (identifiers) => {
|
|
14
|
-
return `
|
|
16
|
+
return `On considère la fonction $f$ dont la courbe représentative est tracée ci-dessous.
|
|
17
|
+
|
|
18
|
+
Déterminer graphiquement les solutions de l'équation $f(x) = ${identifiers.yValue}$.`;
|
|
19
|
+
};
|
|
20
|
+
const getHint = (identifiers) => {
|
|
21
|
+
const { splinePoints, yValue } = identifiers;
|
|
22
|
+
return `Les solutions de l'équation $f(x) = ${yValue}$ sont les abscisses des points de la courbe d'ordonnée $${yValue}$.`;
|
|
23
|
+
};
|
|
24
|
+
const getCorrection = (identifiers) => {
|
|
25
|
+
const { splinePoints, yValue } = identifiers;
|
|
26
|
+
const xSolutions = identifiers.splinePoints
|
|
27
|
+
.filter((p) => p[1] === identifiers.yValue)
|
|
28
|
+
.map((p) => p[0]);
|
|
29
|
+
const names = ["A", "B", "C", "D", "E"];
|
|
30
|
+
const points = xSolutions.map((x, i) => new Point(names[i], x, yValue));
|
|
31
|
+
return `Les solutions de l'équation $f(x) = ${yValue}$ sont les abscisses des points de la courbe d'ordonnée $${yValue}$.
|
|
32
|
+
|
|
33
|
+
On trouve graphiquement $${xSolutions.length}$ ${pluralize("point", xSolutions.length)} d'ordonnée $${yValue}$ :
|
|
34
|
+
|
|
35
|
+
$$
|
|
36
|
+
${points.map((e) => e.toTexWithCoords()).join(" \\ ; \\ ")}
|
|
37
|
+
$$
|
|
38
|
+
|
|
39
|
+
L'ensemble des solutions de l'équation $f(x) = ${yValue}$ est donc :
|
|
40
|
+
|
|
41
|
+
$$
|
|
42
|
+
${getAnswer(identifiers)}
|
|
43
|
+
$$`;
|
|
15
44
|
};
|
|
16
45
|
const getGGBOptions = (identifiers) => {
|
|
17
46
|
const { splinePoints } = identifiers;
|
|
@@ -86,6 +115,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
86
115
|
answerFormat: "tex",
|
|
87
116
|
ggbOptions: getGGBOptions(identifiers),
|
|
88
117
|
identifiers,
|
|
118
|
+
hint: getHint(identifiers),
|
|
119
|
+
correction: getCorrection(identifiers),
|
|
89
120
|
};
|
|
90
121
|
return question;
|
|
91
122
|
};
|
|
@@ -129,4 +160,5 @@ export const graphicEquation = {
|
|
|
129
160
|
hasGeogebra: true,
|
|
130
161
|
subject: "Mathématiques",
|
|
131
162
|
getQuestionFromIdentifiers,
|
|
163
|
+
hasHintAndCorrection: true,
|
|
132
164
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"twoFunctionsEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/twoFunctionsEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"twoFunctionsEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/twoFunctionsEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AA8LF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
|
|
@@ -9,6 +9,30 @@ import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
|
9
9
|
import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
|
|
10
10
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
11
11
|
import { random } from "../../../../utils/alea/random.js";
|
|
12
|
+
import { Point } from "../../../../math/geometry/point.js";
|
|
13
|
+
import { pluralize } from "../../../../utils/strings/pluralize.js";
|
|
14
|
+
const getHint = (identifiers) => {
|
|
15
|
+
const { fSplinePoints, gSplinePoints, xSolutions, yValue } = identifiers;
|
|
16
|
+
return `Les solutions de l'équation $f(x) = g(x)$ sont les abscisses des points qui appartiennent à la fois à la courbe de $f$ et à celle de $g$.`;
|
|
17
|
+
};
|
|
18
|
+
const getCorrection = (identifiers) => {
|
|
19
|
+
const { fSplinePoints, gSplinePoints, xSolutions, yValue } = identifiers;
|
|
20
|
+
const names = ["A", "B", "C", "D", "E"];
|
|
21
|
+
const points = xSolutions.map((x, i) => new Point(names[i], x, yValue));
|
|
22
|
+
return `Les solutions de l'équation $f(x) = g(x)$ sont les abscisses des points qui appartiennent à la fois à la courbe de $f$ et à celle de $g$.
|
|
23
|
+
|
|
24
|
+
On trouve graphiquement $${xSolutions.length}$ ${pluralize("point", xSolutions.length)} d'intersection des deux courbes :
|
|
25
|
+
|
|
26
|
+
$$
|
|
27
|
+
${points.map((e) => e.toTexWithCoords()).join(" \\ ; \\ ")}
|
|
28
|
+
$$
|
|
29
|
+
|
|
30
|
+
L'ensemble des solutions de l'équation $f(x) = g(x)$ est donc :
|
|
31
|
+
|
|
32
|
+
$$
|
|
33
|
+
${getAnswer(identifiers)}
|
|
34
|
+
$$`;
|
|
35
|
+
};
|
|
12
36
|
const getInstruction = (identifiers) => {
|
|
13
37
|
return `Déterminer graphiquement les solutions de l'équation $f(x) = g(x)$ où $f$ et $g$ sont les fonctions représentées ci-dessous.`;
|
|
14
38
|
};
|
|
@@ -103,6 +127,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
103
127
|
answerFormat: "tex",
|
|
104
128
|
identifiers,
|
|
105
129
|
ggbOptions: getGGBOptions(identifiers),
|
|
130
|
+
hint: getHint(identifiers),
|
|
131
|
+
correction: getCorrection(identifiers),
|
|
106
132
|
};
|
|
107
133
|
return question;
|
|
108
134
|
};
|
|
@@ -142,4 +168,5 @@ export const twoFunctionsEquation = {
|
|
|
142
168
|
hasGeogebra: true,
|
|
143
169
|
subject: "Mathématiques",
|
|
144
170
|
getQuestionFromIdentifiers,
|
|
171
|
+
hasHintAndCorrection: true,
|
|
145
172
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareCubeValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/cube/compareCubeValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuGF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAiBnD,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
4
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
6
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
7
|
+
const getPropositions = (n, { answer, a, b }) => {
|
|
8
|
+
const propositions = [];
|
|
9
|
+
addValidProp(propositions, answer);
|
|
10
|
+
tryToAddWrongProp(propositions, `>`);
|
|
11
|
+
tryToAddWrongProp(propositions, `<`);
|
|
12
|
+
tryToAddWrongProp(propositions, `=`);
|
|
13
|
+
return shuffleProps(propositions, n);
|
|
14
|
+
};
|
|
15
|
+
const getAnswer = (identifiers) => {
|
|
16
|
+
const { a, b } = identifiers;
|
|
17
|
+
if (a > b) {
|
|
18
|
+
return `>`;
|
|
19
|
+
}
|
|
20
|
+
else if (a < b) {
|
|
21
|
+
return `<`;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return `=`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const getInstruction = (identifiers) => {
|
|
28
|
+
const { a, b } = identifiers;
|
|
29
|
+
return `Compléter par le bon symbole :
|
|
30
|
+
|
|
31
|
+
$$
|
|
32
|
+
${power(a, 3).toTex()}\\ \\ldots \\ ${power(b, 3).toTex()}
|
|
33
|
+
$$`;
|
|
34
|
+
};
|
|
35
|
+
const getHint = (identifiers) => {
|
|
36
|
+
return `La fonction cube conserve l'ordre : pour tous $a$ et $b$ réels,
|
|
37
|
+
|
|
38
|
+
- $a^3 > b^3$ si et seulement si $a > b$ ;
|
|
39
|
+
|
|
40
|
+
- $a^3 < b^3$ si et seulement si $a < b$ ;
|
|
41
|
+
|
|
42
|
+
- $a^3 = b^3$ si et seulement si $a = b$.`;
|
|
43
|
+
};
|
|
44
|
+
const getCorrection = (identifiers) => {
|
|
45
|
+
const { a, b } = identifiers;
|
|
46
|
+
const signe = a < b ? "<" : a > b ? ">" : "=";
|
|
47
|
+
return `La fonction cube conserve l'ordre.
|
|
48
|
+
|
|
49
|
+
Puisque $${a.frenchify()} ${signe} ${b.frenchify()}$, alors $${power(a, 3).toTex()} ${getAnswer(identifiers)} ${power(b, 3).toTex()}$.`;
|
|
50
|
+
};
|
|
51
|
+
const getCompareCubeValuesQuestion = (ops) => {
|
|
52
|
+
const randomNumberOrDecimal = (min, max, excl) => {
|
|
53
|
+
const isDecimal = coinFlip();
|
|
54
|
+
return isDecimal ? randfloat(min, max, 2, excl) : randint(min, max, excl);
|
|
55
|
+
};
|
|
56
|
+
let a = null;
|
|
57
|
+
let b = null;
|
|
58
|
+
const bound = 10;
|
|
59
|
+
switch (randint(0, 3)) {
|
|
60
|
+
case 0:
|
|
61
|
+
a = randomNumberOrDecimal(0, bound);
|
|
62
|
+
b = randomNumberOrDecimal(0, bound, [a]);
|
|
63
|
+
break;
|
|
64
|
+
case 1:
|
|
65
|
+
a = randomNumberOrDecimal(-bound, 0);
|
|
66
|
+
b = randomNumberOrDecimal(-bound, 0, [a]);
|
|
67
|
+
break;
|
|
68
|
+
case 2:
|
|
69
|
+
default:
|
|
70
|
+
if (coinFlip()) {
|
|
71
|
+
a = randomNumberOrDecimal(-bound, 0);
|
|
72
|
+
b = randomNumberOrDecimal(0, bound);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
a = randomNumberOrDecimal(0, bound);
|
|
76
|
+
b = randomNumberOrDecimal(-bound, 0);
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
const identifiers = {
|
|
81
|
+
a,
|
|
82
|
+
b,
|
|
83
|
+
};
|
|
84
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
85
|
+
};
|
|
86
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
87
|
+
return {
|
|
88
|
+
answer: getAnswer(identifiers),
|
|
89
|
+
instruction: getInstruction(identifiers),
|
|
90
|
+
keys: [],
|
|
91
|
+
answerFormat: "tex",
|
|
92
|
+
identifiers,
|
|
93
|
+
hint: getHint(identifiers),
|
|
94
|
+
correction: getCorrection(identifiers),
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
export const compareCubeValues = {
|
|
98
|
+
id: "compareCubeValues",
|
|
99
|
+
label: "Comparer des nombres élevés au cube",
|
|
100
|
+
answerType: "QCU",
|
|
101
|
+
isSingleStep: true,
|
|
102
|
+
generator: (nb, opts) => getDistinctQuestions(() => getCompareCubeValuesQuestion(opts), nb),
|
|
103
|
+
qcmTimer: 60,
|
|
104
|
+
freeTimer: 60,
|
|
105
|
+
getPropositions,
|
|
106
|
+
subject: "Mathématiques",
|
|
107
|
+
getInstruction,
|
|
108
|
+
getHint,
|
|
109
|
+
getCorrection,
|
|
110
|
+
getAnswer,
|
|
111
|
+
getQuestionFromIdentifiers,
|
|
112
|
+
hasHintAndCorrection: true,
|
|
113
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/cube/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/cube/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareSqrtValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sqrt/compareSqrtValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2EF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAiBnD,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
4
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
6
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
7
|
+
const getPropositions = (n, { answer, a, b }) => {
|
|
8
|
+
const propositions = [];
|
|
9
|
+
addValidProp(propositions, answer);
|
|
10
|
+
tryToAddWrongProp(propositions, `>`);
|
|
11
|
+
tryToAddWrongProp(propositions, `<`);
|
|
12
|
+
tryToAddWrongProp(propositions, `=`);
|
|
13
|
+
return shuffleProps(propositions, n);
|
|
14
|
+
};
|
|
15
|
+
const getAnswer = (identifiers) => {
|
|
16
|
+
const { a, b } = identifiers;
|
|
17
|
+
const signe = a > b ? ">" : a < b ? "<" : "=";
|
|
18
|
+
return `${signe}`;
|
|
19
|
+
};
|
|
20
|
+
const getInstruction = (identifiers) => {
|
|
21
|
+
const { a, b } = identifiers;
|
|
22
|
+
return `Compléter par le bon symbole :
|
|
23
|
+
|
|
24
|
+
$$
|
|
25
|
+
${sqrt(a).toTex()} \\ \\ldots \\ ${sqrt(b).toTex()}
|
|
26
|
+
$$`;
|
|
27
|
+
};
|
|
28
|
+
const getHint = (identifiers) => {
|
|
29
|
+
return `La racine carré conserve l'ordre : pour tous $a$ et $b$ positifs,
|
|
30
|
+
|
|
31
|
+
- $a > b \\iff ${sqrt("a").toTex()} > ${sqrt("b").toTex()}$
|
|
32
|
+
- $a < b \\iff ${sqrt("a").toTex()} < ${sqrt("b").toTex()}$
|
|
33
|
+
- $a = b \\iff ${sqrt("a").toTex()} = ${sqrt("b").toTex()}$`;
|
|
34
|
+
};
|
|
35
|
+
const getCorrection = (identifiers) => {
|
|
36
|
+
const { a, b } = identifiers;
|
|
37
|
+
const signe = a > b ? ">" : a < b ? "<" : "=";
|
|
38
|
+
return `La racine carrée conserve l'ordre.
|
|
39
|
+
|
|
40
|
+
Puisque $${a.frenchify()} ${signe} ${b.frenchify()}$, alors $${sqrt(a).toTex()} ${signe} ${sqrt(b).toTex()}$.`;
|
|
41
|
+
};
|
|
42
|
+
const getCompareSqrtValuesQuestion = (ops) => {
|
|
43
|
+
const randomNumberOrDecimal = (min, max, excl) => {
|
|
44
|
+
const isDecimal = coinFlip();
|
|
45
|
+
return isDecimal ? randfloat(min, max, 2, excl) : randint(min, max, excl);
|
|
46
|
+
};
|
|
47
|
+
const bound = 10;
|
|
48
|
+
const a = randomNumberOrDecimal(0, bound);
|
|
49
|
+
const b = randomNumberOrDecimal(0, bound, [a]);
|
|
50
|
+
const identifiers = {
|
|
51
|
+
a,
|
|
52
|
+
b,
|
|
53
|
+
};
|
|
54
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
55
|
+
};
|
|
56
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
57
|
+
return {
|
|
58
|
+
answer: getAnswer(identifiers),
|
|
59
|
+
instruction: getInstruction(identifiers),
|
|
60
|
+
keys: [],
|
|
61
|
+
answerFormat: "tex",
|
|
62
|
+
identifiers,
|
|
63
|
+
hint: getHint(identifiers),
|
|
64
|
+
correction: getCorrection(identifiers),
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export const compareSqrtValues = {
|
|
68
|
+
id: "compareSqrtValues",
|
|
69
|
+
label: "Comparer des racines carrés",
|
|
70
|
+
answerType: "QCU",
|
|
71
|
+
isSingleStep: true,
|
|
72
|
+
generator: (nb, opts) => getDistinctQuestions(() => getCompareSqrtValuesQuestion(opts), nb),
|
|
73
|
+
qcmTimer: 60,
|
|
74
|
+
freeTimer: 60,
|
|
75
|
+
getPropositions,
|
|
76
|
+
subject: "Mathématiques",
|
|
77
|
+
getInstruction,
|
|
78
|
+
getHint,
|
|
79
|
+
getCorrection,
|
|
80
|
+
getAnswer,
|
|
81
|
+
getQuestionFromIdentifiers,
|
|
82
|
+
hasHintAndCorrection: true,
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sqrt/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./compareSqrtValues.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"varTableExtremaReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableExtremaReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;
|
|
1
|
+
{"version":3,"file":"varTableExtremaReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/variations/varTableExtremaReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AA+LF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
|
|
@@ -29,12 +29,26 @@ const getInstruction = (identifiers) => {
|
|
|
29
29
|
: `Sur l'intervalle $${interval.toTex()}$, quel est le ${type} de la fonction $f$ ?`}`;
|
|
30
30
|
return instruction;
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
const getHint = (identifiers) => {
|
|
33
|
+
return `Le minimum d'une fonction $f$ sur un intervalle $[a;b]$ est la plus petite valeur de $f(x)$ pour $x$ appartenant à $[a;b]$. On dit alors que le minimum de $f$ sur $[a;b]$ est $f(x)$, atteint en $x$.
|
|
34
|
+
|
|
35
|
+
Le maximum d'une fonction $f$ sur un intervalle $[a;b]$ est la plus grande valeur de $f(x)$ pour $x$ appartenant à $[a;b]$. On dit alors que le maximum de $f$ sur $[a;b]$ est $f(x)$, atteint en $x$.
|
|
36
|
+
`;
|
|
37
|
+
};
|
|
38
|
+
const getCorrection = (identifiers) => {
|
|
39
|
+
const { intervalXIndexes, isAskingMin, isAskingX, xValues, yValues } = identifiers;
|
|
40
|
+
const type = isAskingMin ? "minimum" : "maximum";
|
|
41
|
+
const type2 = isAskingMin ? "petite" : "grande";
|
|
42
|
+
const interval = new IntervalNode(identifiers.xValues[identifiers.intervalXIndexes[0]].toTree(), identifiers.xValues[identifiers.intervalXIndexes[1]].toTree(), ClosureType.FF);
|
|
43
|
+
const x = xValues[yValues.indexOf((isAskingMin ? Math.min : Math.max)(...yValues.slice(intervalXIndexes[0], intervalXIndexes[1] + 1)))].frenchify();
|
|
44
|
+
const y = yValues[yValues.indexOf((isAskingMin ? Math.min : Math.max)(...yValues.slice(intervalXIndexes[0], intervalXIndexes[1] + 1)))].frenchify();
|
|
45
|
+
return `On cherche la plus ${type2} valeur de $f(x)$ (deuxième ligne) pour les valeurs de $x$ allant de $${interval.a.toTex()}$ à $${interval.b.toTex()}$ (première ligne). On lit que cette valeur est $${y}$, atteinte pour $x = ${x}$.
|
|
46
|
+
|
|
47
|
+
${identifiers.isAskingX
|
|
48
|
+
? `Sur l'intervalle $${interval.toTex()}$, le ${type} de la fonction $f$ est donc atteint pour $x = ${x}$.`
|
|
49
|
+
: `Sur l'intervalle $${interval.toTex()}$, le ${type} de la fonction $f$ est donc $${y}$.`}
|
|
50
|
+
`;
|
|
51
|
+
};
|
|
38
52
|
const getGGBOptions = (identifiers) => {
|
|
39
53
|
const xValues = identifiers.xValues;
|
|
40
54
|
const yValues = identifiers.yValues;
|
|
@@ -103,8 +117,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
103
117
|
keys: getKeys(identifiers),
|
|
104
118
|
answerFormat: "tex",
|
|
105
119
|
identifiers,
|
|
106
|
-
|
|
107
|
-
|
|
120
|
+
hint: getHint(identifiers),
|
|
121
|
+
correction: getCorrection(identifiers),
|
|
108
122
|
ggbOptions: getGGBOptions(identifiers),
|
|
109
123
|
};
|
|
110
124
|
return question;
|
|
@@ -121,4 +135,5 @@ export const varTableExtremaReading = {
|
|
|
121
135
|
subject: "Mathématiques",
|
|
122
136
|
getQuestionFromIdentifiers,
|
|
123
137
|
hasGeogebra: true,
|
|
138
|
+
hasHintAndCorrection: true,
|
|
124
139
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC"}
|