math-exercises 3.0.86 → 3.0.88
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/exercise.d.ts +7 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/decimalBoundingOnLine.js +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisorsList.js +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +0 -10
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +0 -10
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +1 -1
- package/lib/exercises/math/calcul/fractions/evalFractionExpression.d.ts +9 -0
- package/lib/exercises/math/calcul/fractions/evalFractionExpression.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/evalFractionExpression.js +113 -0
- package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionSquare.js +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts +2 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +2 -0
- package/lib/exercises/math/calcul/fractions/powerNotation.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/powerNotation.js +1 -0
- package/lib/exercises/math/calcul/fractions/simplifyFraction.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/simplifyFraction.js +1 -0
- package/lib/exercises/math/calcul/fractions/simplifyFractionWithPrimeFactorization.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/simplifyFractionWithPrimeFactorization.js +1 -0
- package/lib/exercises/math/calcul/fractions/simplifyToFraction.d.ts +9 -0
- package/lib/exercises/math/calcul/fractions/simplifyToFraction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/simplifyToFraction.js +168 -0
- package/lib/exercises/math/calcul/ordering/framing.js +3 -3
- package/lib/exercises/math/calcul/sign/absoluteNumber.d.ts.map +1 -1
- package/lib/exercises/math/calcul/sign/absoluteNumber.js +1 -0
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/index.js +2 -0
- package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.d.ts +15 -0
- package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.js +143 -0
- package/lib/exercises/math/calculLitteral/inequations/minNumberInequality.d.ts +13 -0
- package/lib/exercises/math/calculLitteral/inequations/minNumberInequality.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/inequations/minNumberInequality.js +192 -0
- package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +1 -1
- package/lib/exercises/math/functions/absolute/calculateDistanceBetweenNumbers.d.ts +8 -0
- package/lib/exercises/math/functions/absolute/calculateDistanceBetweenNumbers.d.ts.map +1 -0
- package/lib/exercises/math/functions/absolute/calculateDistanceBetweenNumbers.js +102 -0
- package/lib/exercises/math/functions/absolute/calculateDistanceWithAbsoluteValue.d.ts +10 -0
- package/lib/exercises/math/functions/absolute/calculateDistanceWithAbsoluteValue.d.ts.map +1 -0
- package/lib/exercises/math/functions/absolute/calculateDistanceWithAbsoluteValue.js +112 -0
- package/lib/exercises/math/functions/absolute/calculateWithAbsoluteValue.d.ts +8 -0
- package/lib/exercises/math/functions/absolute/calculateWithAbsoluteValue.d.ts.map +1 -0
- package/lib/exercises/math/functions/absolute/calculateWithAbsoluteValue.js +124 -0
- package/lib/exercises/math/functions/absolute/index.d.ts +3 -0
- package/lib/exercises/math/functions/absolute/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/index.js +3 -0
- package/lib/exercises/math/functions/basics/index.d.ts +2 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +2 -1
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts +2 -1
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/valueTableCompletion.js +103 -31
- package/lib/exercises/math/functions/basics/valueTableFromGraph.d.ts +8 -0
- package/lib/exercises/math/functions/basics/valueTableFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/valueTableFromGraph.js +139 -0
- package/lib/exercises/math/functions/sqrt/index.d.ts +2 -0
- package/lib/exercises/math/functions/sqrt/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/sqrt/index.js +2 -0
- package/lib/exercises/math/functions/sqrt/sqrtInequality.d.ts +10 -0
- package/lib/exercises/math/functions/sqrt/sqrtInequality.d.ts.map +1 -0
- package/lib/exercises/math/functions/sqrt/sqrtInequality.js +160 -0
- package/lib/exercises/math/functions/sqrt/squareRootCalculation.d.ts +8 -0
- package/lib/exercises/math/functions/sqrt/squareRootCalculation.d.ts.map +1 -0
- package/lib/exercises/math/functions/sqrt/squareRootCalculation.js +108 -0
- package/lib/exercises/math/geometry/angles/recognizeAngleType.d.ts.map +1 -1
- package/lib/exercises/math/geometry/angles/recognizeAngleType.js +0 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianFromTwoPoints.js +1 -1
- package/lib/exercises/math/geometry/cartesian/cartesianFromVectorAndPoint.js +1 -1
- package/lib/exercises/math/geometry/index.d.ts +0 -1
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +0 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +1 -1
- package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +1 -1
- package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.js +1 -1
- package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/findParallelLineFromReductEquation.js +1 -1
- package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.js +1 -1
- package/lib/exercises/math/percent/evolutions/globalCM.d.ts +7 -0
- package/lib/exercises/math/percent/evolutions/globalCM.d.ts.map +1 -0
- package/lib/exercises/math/percent/evolutions/globalCM.js +89 -0
- package/lib/exercises/math/percent/evolutions/index.d.ts +1 -0
- package/lib/exercises/math/percent/evolutions/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutions/index.js +1 -0
- package/lib/exercises/math/percent/index.d.ts +1 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +1 -0
- package/lib/exercises/math/percent/percentOfPercent.d.ts +8 -0
- package/lib/exercises/math/percent/percentOfPercent.d.ts.map +1 -0
- package/lib/exercises/math/percent/percentOfPercent.js +89 -0
- package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
- package/lib/exercises/math/powers/calculateNegativePower.js +1 -0
- package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersDivision.js +2 -0
- package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersMixOperations.js +1 -0
- package/lib/exercises/math/powers/powersPower.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersPower.js +2 -0
- package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersProduct.js +2 -0
- package/lib/exercises/math/probaStat/basicStats/index.d.ts +0 -1
- package/lib/exercises/math/probaStat/basicStats/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicStats/index.js +0 -1
- package/lib/exercises/math/probaStat/index.d.ts +0 -2
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +0 -2
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +2 -2
- package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts +12 -0
- package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.js +178 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/index.js +1 -0
- package/lib/exercises/math/sampling/getSampleCountAndSize.d.ts +12 -0
- package/lib/exercises/math/sampling/getSampleCountAndSize.d.ts.map +1 -0
- package/lib/exercises/math/sampling/getSampleCountAndSize.js +95 -0
- package/lib/exercises/math/sampling/index.d.ts +2 -0
- package/lib/exercises/math/sampling/index.d.ts.map +1 -1
- package/lib/exercises/math/sampling/index.js +2 -0
- package/lib/exercises/math/sampling/samplingFrequency.d.ts +7 -0
- package/lib/exercises/math/sampling/samplingFrequency.d.ts.map +1 -0
- package/lib/exercises/math/sampling/samplingFrequency.js +106 -0
- package/lib/exercises/math/sets/intervals/index.d.ts +2 -0
- package/lib/exercises/math/sets/intervals/index.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/index.js +2 -0
- package/lib/exercises/math/sets/intervals/intervalOnGraph.d.ts +8 -0
- package/lib/exercises/math/sets/intervals/intervalOnGraph.d.ts.map +1 -0
- package/lib/exercises/math/sets/intervals/intervalOnGraph.js +156 -0
- package/lib/exercises/math/sets/intervals/isNumberInInterval.d.ts +9 -0
- package/lib/exercises/math/sets/intervals/isNumberInInterval.d.ts.map +1 -0
- package/lib/exercises/math/sets/intervals/isNumberInInterval.js +174 -0
- package/lib/exercises/math/squareRoots/simpifySquareRoot.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/simpifySquareRoot.js +1 -0
- package/lib/exercises/math/squareRoots/squareRootIdentities.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootIdentities.js +1 -0
- package/lib/exercises/math/squareRoots/squareRootsDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsDistributivity.js +1 -0
- package/lib/exercises/math/squareRoots/squareRootsFractions.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsFractions.js +1 -0
- package/lib/exercises/math/squareRoots/squareRootsProducts.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsProducts.js +1 -0
- package/lib/exercises/math/squareRoots/squareRootsSum.d.ts.map +1 -1
- package/lib/exercises/math/squareRoots/squareRootsSum.js +1 -0
- package/lib/geogebra/spline.d.ts +2 -1
- package/lib/geogebra/spline.d.ts.map +1 -1
- package/lib/geogebra/spline.js +39 -1
- package/lib/index.d.ts +68 -55
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +0 -11
- package/lib/server.js +21 -0
- package/lib/tests/exoTest.d.ts.map +1 -1
- package/lib/tests/exoTest.js +9 -2
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +21 -2
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +0 -1
- package/lib/utils/markdown/mdTable.d.ts +1 -1
- package/lib/utils/markdown/mdTable.d.ts.map +1 -1
- package/lib/utils/markdown/mdTable.js +10 -5
- 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
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
x: NodeIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
export declare const squareRootCalculation: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=squareRootCalculation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squareRootCalculation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sqrt/squareRootCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAS7C,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AAkGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAmBvD,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
5
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
6
|
+
import { isNumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
7
|
+
import { square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
8
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
9
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
10
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
11
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
12
|
+
const getPropositions = (n, { answer }) => {
|
|
13
|
+
const propositions = [];
|
|
14
|
+
addValidProp(propositions, answer);
|
|
15
|
+
const correctValue = parseAlgebraic(answer).evaluate();
|
|
16
|
+
const used = new Set([correctValue]);
|
|
17
|
+
while (propositions.length < n) {
|
|
18
|
+
const delta = randint(1, 5);
|
|
19
|
+
const sign = coinFlip() ? -1 : 1;
|
|
20
|
+
const candidate = correctValue + delta * sign;
|
|
21
|
+
if (candidate < 0 || used.has(candidate))
|
|
22
|
+
continue;
|
|
23
|
+
used.add(candidate);
|
|
24
|
+
const candidateTex = candidate.toTree().toTex();
|
|
25
|
+
tryToAddWrongProp(propositions, candidateTex);
|
|
26
|
+
}
|
|
27
|
+
return shuffleProps(propositions, n);
|
|
28
|
+
};
|
|
29
|
+
const getAnswer = (identifiers) => {
|
|
30
|
+
const { x } = identifiers;
|
|
31
|
+
const sqrtExpression = sqrt(reifyAlgebraic(x));
|
|
32
|
+
const answer = sqrtExpression.simplify().toTex();
|
|
33
|
+
return `${answer}`;
|
|
34
|
+
};
|
|
35
|
+
const getInstruction = (identifiers) => {
|
|
36
|
+
const { x } = identifiers;
|
|
37
|
+
const sqrtExpression = sqrt(reifyAlgebraic(x));
|
|
38
|
+
return `Calculer : $${sqrtExpression.toTex()}$`;
|
|
39
|
+
};
|
|
40
|
+
const getHint = (identifiers) => {
|
|
41
|
+
const { x } = identifiers;
|
|
42
|
+
return `Quel est le nombre qui, multiplié par lui-même, donne $${reifyAlgebraic(x).toTex()}$ ?`;
|
|
43
|
+
};
|
|
44
|
+
const getCorrection = (identifiers) => {
|
|
45
|
+
const { x } = identifiers;
|
|
46
|
+
const aNode = reifyAlgebraic(x);
|
|
47
|
+
const tex = aNode.toTex();
|
|
48
|
+
const answer = getAnswer(identifiers);
|
|
49
|
+
return `On remarque que $${tex} = ${square(answer.toTree()).toTex()}$.
|
|
50
|
+
|
|
51
|
+
On a donc $\\sqrt{${tex}} = ${answer}$.`;
|
|
52
|
+
};
|
|
53
|
+
const getKeys = (identifiers) => {
|
|
54
|
+
return [];
|
|
55
|
+
};
|
|
56
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
57
|
+
try {
|
|
58
|
+
const ansNode = parseAlgebraic(ans).simplify();
|
|
59
|
+
const answerNode = parseAlgebraic(answer).simplify();
|
|
60
|
+
if (!isNumberNode(ansNode))
|
|
61
|
+
return false;
|
|
62
|
+
return ansNode.equals(answerNode);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
return handleVEAError(err);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const getSquareRootCalculationQuestion = (ops) => {
|
|
69
|
+
const x = randint(0, 13) ** 2;
|
|
70
|
+
const squareX = 100 * randint(1, 13) ** 2;
|
|
71
|
+
const xChoices = [
|
|
72
|
+
x.toTree().toIdentifiers(),
|
|
73
|
+
squareX.toTree().toIdentifiers(),
|
|
74
|
+
];
|
|
75
|
+
const chosenX = random(xChoices);
|
|
76
|
+
const identifiers = { x: chosenX };
|
|
77
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
78
|
+
};
|
|
79
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
80
|
+
return {
|
|
81
|
+
answer: getAnswer(identifiers),
|
|
82
|
+
instruction: getInstruction(identifiers),
|
|
83
|
+
keys: getKeys(identifiers),
|
|
84
|
+
answerFormat: "tex",
|
|
85
|
+
identifiers,
|
|
86
|
+
hint: getHint(identifiers),
|
|
87
|
+
correction: getCorrection(identifiers),
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export const squareRootCalculation = {
|
|
91
|
+
id: "squareRootCalculation",
|
|
92
|
+
label: "Calculer une racine carrée",
|
|
93
|
+
isSingleStep: true,
|
|
94
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSquareRootCalculationQuestion(opts), nb, 20),
|
|
95
|
+
qcmTimer: 60,
|
|
96
|
+
freeTimer: 60,
|
|
97
|
+
getPropositions,
|
|
98
|
+
isAnswerValid,
|
|
99
|
+
subject: "Mathématiques",
|
|
100
|
+
getInstruction,
|
|
101
|
+
getHint,
|
|
102
|
+
getCorrection,
|
|
103
|
+
getAnswer,
|
|
104
|
+
getQuestionFromIdentifiers,
|
|
105
|
+
hasHintAndCorrection: true,
|
|
106
|
+
maxAllowedQuestions: 20,
|
|
107
|
+
shouldHaveCalculator: false,
|
|
108
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeAngleType.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/recognizeAngleType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAWtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"recognizeAngleType.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/recognizeAngleType.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAWtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAwVF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
|
|
@@ -182,7 +182,6 @@ const isAnswerValid = (ans, { answer, angleIndex, angleType, apexIndex, points }
|
|
|
182
182
|
break;
|
|
183
183
|
}
|
|
184
184
|
return validAngles.includes(formated);
|
|
185
|
-
// console.log(angleIndex, angleType, apexIndex);
|
|
186
185
|
// let formated = ans;
|
|
187
186
|
// if (ans.includes("widehat")) {
|
|
188
187
|
// formated = formated.replaceAll("\\widehat{", "").replaceAll("}", "");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cartesianEquationOfLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/cartesianEquationOfLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAqBrC,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;AAiOF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"cartesianEquationOfLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/cartesianEquationOfLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAqBrC,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;AAiOF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAezD,CAAC"}
|
|
@@ -177,7 +177,7 @@ const getFirstProposition = (x, y, aX, aY, bX, bY) => {
|
|
|
177
177
|
};
|
|
178
178
|
export const cartesianEquationOfLine = {
|
|
179
179
|
id: "cartesianEquationOfLine",
|
|
180
|
-
label: "Déterminer une équation
|
|
180
|
+
label: "Déterminer une équation cartésienne d'une droite par lecture graphique",
|
|
181
181
|
isSingleStep: true,
|
|
182
182
|
generator: (nb) => getDistinctQuestions(getCartesianEquationOfLineQuestion, nb),
|
|
183
183
|
qcmTimer: 60,
|
|
@@ -149,7 +149,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
149
149
|
};
|
|
150
150
|
export const cartesianFromTwoPoints = {
|
|
151
151
|
id: "cartesianFromTwoPoints",
|
|
152
|
-
label: "Déterminer
|
|
152
|
+
label: "Déterminer une équation cartésienne d'une droite en connaissant deux points",
|
|
153
153
|
isSingleStep: true,
|
|
154
154
|
generator: (nb, opts) => getDistinctQuestions(() => getCartesianFromTwoPointsQuestion(opts), nb),
|
|
155
155
|
qcmTimer: 60,
|
|
@@ -144,7 +144,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
144
144
|
};
|
|
145
145
|
export const cartesianFromVectorAndPoint = {
|
|
146
146
|
id: "cartesianFromVectorAndPoint",
|
|
147
|
-
label: "Déterminer
|
|
147
|
+
label: "Déterminer une équation cartésienne d'une droite en connaissant un point et un vecteur directeur",
|
|
148
148
|
isSingleStep: true,
|
|
149
149
|
generator: (nb, opts) => getDistinctQuestions(() => getCartesianFromVectorAndPointQuestion(opts), nb),
|
|
150
150
|
qcmTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
|
@@ -212,7 +212,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
212
212
|
};
|
|
213
213
|
export const cartesianEquationToReduced = {
|
|
214
214
|
id: "cartesianEquationToReduced",
|
|
215
|
-
label: "Passer
|
|
215
|
+
label: "Passer de l'équation réduite d'une droite à une équation cartésienne, et inversement",
|
|
216
216
|
isSingleStep: true,
|
|
217
217
|
generator: (nb, opts) => getDistinctQuestions(() => getCartesianEquationToReducedQuestion(opts), nb),
|
|
218
218
|
qcmTimer: 60,
|
|
@@ -150,7 +150,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
150
150
|
};
|
|
151
151
|
export const cartesianEquationsIntersection = {
|
|
152
152
|
id: "cartesianEquationsIntersection",
|
|
153
|
-
label: "Déterminer l'intersection de deux droites à partir de
|
|
153
|
+
label: "Déterminer l'intersection de deux droites à partir de leurs équations cartésiennes",
|
|
154
154
|
isSingleStep: true,
|
|
155
155
|
generator: (nb, opts) => getDistinctQuestions(() => getCartesianEquationsIntersectionQuestion(opts), nb),
|
|
156
156
|
qcmTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findParallelLineFromCartesianEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAO7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,mBAAmB,EAAE,eAAe,CAAC;IACrC,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAgIF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"findParallelLineFromCartesianEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/findParallelLineFromCartesianEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAO7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,mBAAmB,EAAE,eAAe,CAAC;IACrC,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAgIF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAoBvE,CAAC"}
|
|
@@ -114,7 +114,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
114
114
|
};
|
|
115
115
|
export const findParallelLineFromCartesianEquation = {
|
|
116
116
|
id: "findParallelLineFromCartesianEquation",
|
|
117
|
-
label: "
|
|
117
|
+
label: "Étudier le parallélisme de deux droites à partir d'équations cartésiennes",
|
|
118
118
|
isSingleStep: true,
|
|
119
119
|
generator: (nb, opts) => getDistinctQuestions(() => getFindParallelLineFromCartesianEquationQuestion(opts), nb),
|
|
120
120
|
qcmTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findParallelLineFromReductEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/findParallelLineFromReductEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAqGF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"findParallelLineFromReductEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/findParallelLineFromReductEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAqGF,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CAAC,WAAW,CAoBpE,CAAC"}
|
|
@@ -93,7 +93,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
93
93
|
};
|
|
94
94
|
export const findParallelLineFromReductEquation = {
|
|
95
95
|
id: "findParallelLineFromReductEquation",
|
|
96
|
-
label: "
|
|
96
|
+
label: "Étudier le parallélisme de deux droites à partir de leurs équations réduites",
|
|
97
97
|
isSingleStep: true,
|
|
98
98
|
generator: (nb, opts) => getDistinctQuestions(() => getFindParallelLineFromReductEquationQuestion(opts), nb),
|
|
99
99
|
qcmTimer: 60,
|
|
@@ -137,7 +137,7 @@ const isAnswerValid = (ans, { answer, uX, uY, aX, aY }) => {
|
|
|
137
137
|
};
|
|
138
138
|
export const lineFromDirectorVector = {
|
|
139
139
|
id: "lineFromDirectorVector",
|
|
140
|
-
label: "
|
|
140
|
+
label: "Déterminer l'équation réduite d'une droite en connaissant un point et un vecteur directeur",
|
|
141
141
|
isSingleStep: true,
|
|
142
142
|
generator: (nb) => getDistinctQuestions(getLineFromDirectorVectorQuestion, nb),
|
|
143
143
|
qcmTimer: 60,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalCM.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/globalCM.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAoFF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAmB1C,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { round } from "../../../../math/utils/round.js";
|
|
7
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
9
|
+
const getPropositions = (n, { answer }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
addValidProp(propositions, answer);
|
|
12
|
+
while (propositions.length < n) {
|
|
13
|
+
tryToAddWrongProp(propositions, randfloat(0, 2, 4).frenchify());
|
|
14
|
+
}
|
|
15
|
+
return shuffleProps(propositions, n);
|
|
16
|
+
};
|
|
17
|
+
const getAnswer = (identifiers) => {
|
|
18
|
+
const { evolutions } = identifiers;
|
|
19
|
+
const cms = evolutions.map((e) => round(1 + e / 100, 4));
|
|
20
|
+
return round(cms.reduce((acc, curr) => acc * curr, 1), 4).frenchify();
|
|
21
|
+
};
|
|
22
|
+
const getInstruction = (identifiers) => {
|
|
23
|
+
const { evolutions } = identifiers;
|
|
24
|
+
return `Déterminer le coefficient multiplicateur associé à une ${evolutions[0] > 0 ? "hausse" : "baisse"} de $${Math.abs(evolutions[0])}\\%$ suivie d'une ${evolutions[1] > 0 ? "hausse" : "baisse"} de $${Math.abs(evolutions[1])}\\%$. `;
|
|
25
|
+
};
|
|
26
|
+
const getHint = (identifiers) => {
|
|
27
|
+
return `Détermine les coefficients multiplicateurs de chacune des évolutions. Puis, multiplie ces coefficients multiplicateurs.`;
|
|
28
|
+
};
|
|
29
|
+
const getCorrection = (identifiers) => {
|
|
30
|
+
const { evolutions } = identifiers;
|
|
31
|
+
const cms = evolutions.map((e) => round(1 + e / 100, 4));
|
|
32
|
+
return `Le coefficient multiplicateur associé à une ${evolutions[0] > 0 ? "hausse" : "baisse"} de $${Math.abs(evolutions[0])}\\%$ est $${cms[0].frenchify()}$.
|
|
33
|
+
|
|
34
|
+
Le coefficient multiplicateur associé à une ${evolutions[1] > 0 ? "hausse" : "baisse"} de $${Math.abs(evolutions[1])}\\%$ est $${cms[1].frenchify()}$.
|
|
35
|
+
|
|
36
|
+
Pour déterminer le coefficient multiplicateur global, on multiplie ces deux coefficients multiplicateurs :
|
|
37
|
+
|
|
38
|
+
$$
|
|
39
|
+
${multiply(cms[0], cms[1]).toTex()}=${getAnswer(identifiers)}
|
|
40
|
+
$$
|
|
41
|
+
`;
|
|
42
|
+
};
|
|
43
|
+
const getKeys = (identifiers) => {
|
|
44
|
+
return [];
|
|
45
|
+
};
|
|
46
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
47
|
+
try {
|
|
48
|
+
return numberVEA(ans, answer);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
return handleVEAError(err);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const getGlobalCmQuestion = (ops) => {
|
|
55
|
+
const evolutions = [randint(-99, 101, [0]), randint(-99, 101, [0])];
|
|
56
|
+
const identifiers = {
|
|
57
|
+
evolutions,
|
|
58
|
+
};
|
|
59
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
60
|
+
};
|
|
61
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
62
|
+
return {
|
|
63
|
+
answer: getAnswer(identifiers),
|
|
64
|
+
instruction: getInstruction(identifiers),
|
|
65
|
+
keys: getKeys(identifiers),
|
|
66
|
+
answerFormat: "tex",
|
|
67
|
+
identifiers,
|
|
68
|
+
hint: getHint(identifiers),
|
|
69
|
+
correction: getCorrection(identifiers),
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export const globalCM = {
|
|
73
|
+
id: "globalCM",
|
|
74
|
+
connector: "=",
|
|
75
|
+
label: "Calculer le coefficient multiplicateur associé à deux évolutions successives",
|
|
76
|
+
isSingleStep: true,
|
|
77
|
+
generator: (nb, opts) => getDistinctQuestions(() => getGlobalCmQuestion(opts), nb),
|
|
78
|
+
qcmTimer: 60,
|
|
79
|
+
freeTimer: 60,
|
|
80
|
+
getPropositions,
|
|
81
|
+
isAnswerValid,
|
|
82
|
+
subject: "Mathématiques",
|
|
83
|
+
getInstruction,
|
|
84
|
+
getHint,
|
|
85
|
+
getCorrection,
|
|
86
|
+
getAnswer,
|
|
87
|
+
getQuestionFromIdentifiers,
|
|
88
|
+
hasHintAndCorrection: true,
|
|
89
|
+
};
|
|
@@ -8,4 +8,5 @@ export * from "./evolutionRateFromValues.js";
|
|
|
8
8
|
export * from "./findStartValueAfterEvolution.js";
|
|
9
9
|
export * from "./findEndValueAfterEvolution.js";
|
|
10
10
|
export * from "./findRightCalculForPriceEvolution.js";
|
|
11
|
+
export * from "./globalCM.js";
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"percentOfPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentOfPercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA0EF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAkBlD,CAAC"}
|