math-exercises 2.2.5 → 2.2.7
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/addAndSub.js +1 -1
- package/lib/exercises/math/calcul/addAndSubWithoutRelatives.js +1 -1
- package/lib/exercises/math/calcul/digitDecimalRank.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitDecimalRank.js +2 -3
- package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts +8 -0
- package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts.map +1 -0
- package/lib/exercises/math/calcul/digitDecimalRankNumber.js +59 -0
- package/lib/exercises/math/calcul/digitRank.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitRank.js +2 -3
- package/lib/exercises/math/calcul/digitRankNumber.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitRankNumber.js +3 -5
- package/lib/exercises/math/calcul/index.d.ts +1 -0
- package/lib/exercises/math/calcul/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/index.js +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +2 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.js +2 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts +7 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.js +71 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.js +25 -17
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.d.ts +7 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.js +93 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts +1 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/expressionNature.js +81 -0
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts +2 -0
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +46 -66
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.js +1 -1
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.js +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts +4 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +1 -1
- package/lib/exercises/math/percent/averageEvolutionRate.d.ts.map +1 -1
- package/lib/exercises/math/percent/averageEvolutionRate.js +16 -0
- package/lib/exercises/math/percent/cmToEvolution.d.ts +7 -0
- package/lib/exercises/math/percent/cmToEvolution.d.ts.map +1 -0
- package/lib/exercises/math/percent/cmToEvolution.js +70 -0
- package/lib/exercises/math/percent/evolutionToCM.d.ts +0 -1
- package/lib/exercises/math/percent/evolutionToCM.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutionToCM.js +20 -24
- package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
- package/lib/exercises/math/percent/findProportion.js +15 -0
- package/lib/exercises/math/percent/globalPercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/globalPercent.js +14 -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/isTableProportional.d.ts.map +1 -1
- package/lib/exercises/math/percent/isTableProportional.js +35 -33
- package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/percent/percentToDecimal.js +14 -0
- package/lib/exercises/math/percent/reciprocalPercentage.d.ts.map +1 -1
- package/lib/exercises/math/percent/reciprocalPercentage.js +18 -0
- package/lib/exercises/math/percent/valuePercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/valuePercent.js +7 -0
- package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersProduct.js +22 -0
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.js +14 -2
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +5 -4
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.js +21 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +15 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +17 -0
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +13 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +15 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +15 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +26 -1
- package/lib/exercises/math/suites/sequenceEvaluation.js +1 -1
- package/lib/exercises/math/suites/sequencePlot.d.ts.map +1 -1
- package/lib/exercises/math/suites/sequencePlot.js +10 -3
- package/lib/index.d.ts +48 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/math/geometry/spaceVector.d.ts +1 -0
- package/lib/math/geometry/spaceVector.d.ts.map +1 -1
- package/lib/math/geometry/spaceVector.js +3 -0
- package/lib/math/polynomials/trinom.js +2 -2
- package/lib/math/utils/random/randTupleInt.d.ts +1 -0
- package/lib/math/utils/random/randTupleInt.d.ts.map +1 -1
- package/lib/math/utils/random/randTupleInt.js +5 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +2 -13
- package/lib/server.d.ts +1 -0
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +6 -2
- package/lib/utils/numberPrototype/toSeparatedThousands.d.ts +2 -0
- package/lib/utils/numberPrototype/toSeparatedThousands.d.ts.map +1 -0
- package/lib/utils/numberPrototype/toSeparatedThousands.js +12 -0
- package/package.json +1 -1
|
@@ -3,91 +3,71 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.inverseImageFunctionTable = void 0;
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
-
const
|
|
6
|
+
const randTupleInt_1 = require("../../../../math/utils/random/randTupleInt");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const arrayHasSameElement_1 = require("../../../../utils/arrayHasSameElement");
|
|
8
9
|
const coinFlip_1 = require("../../../../utils/coinFlip");
|
|
9
10
|
const random_1 = require("../../../../utils/random");
|
|
10
11
|
const getInverseImageFunctionTableQuestion = () => {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
const xValues = (0, randTupleInt_1.randTupleInt)(5, {
|
|
13
|
+
from: -10,
|
|
14
|
+
to: 10,
|
|
15
|
+
allDifferent: true,
|
|
16
|
+
}).sort((a, b) => a - b);
|
|
17
|
+
const yValues = (0, randTupleInt_1.randTupleInt)(5, { from: -10, to: 10 });
|
|
18
|
+
let indexAsked = (0, randint_1.randint)(0, 5);
|
|
19
|
+
const valueAsked = xValues[indexAsked];
|
|
20
|
+
//on force un meme nombre dans les deux lignes pour complexifier
|
|
21
|
+
if (!yValues.includes(valueAsked) || yValues[indexAsked] === valueAsked) {
|
|
22
|
+
yValues[(0, randint_1.randint)(0, 5, [indexAsked])] = valueAsked;
|
|
23
|
+
}
|
|
24
|
+
const isAskingImage = (0, coinFlip_1.coinFlip)();
|
|
25
|
+
const answer = (isAskingImage
|
|
26
|
+
? yValues[indexAsked]
|
|
27
|
+
: xValues
|
|
28
|
+
.filter((el, index) => yValues[index] === valueAsked)
|
|
29
|
+
.join("\\text{ et }")) + "";
|
|
30
|
+
const instruction = `Ci-dessous est donné le tableau de valeurs d'une fonction $f$. Déterminer ${isAskingImage ? `l'image de` : `le ou les antécédents de`} $${valueAsked}$ par $f$.
|
|
31
|
+
|
|
32
|
+
|$x$|${xValues.map((value) => `$${value}$`).join("|")}|
|
|
33
|
+
|-|-|-|-|-|-|
|
|
34
|
+
|$f(x)$|${yValues.map((value) => `$${value}$`).join("|")}|
|
|
35
|
+
`;
|
|
14
36
|
const question = {
|
|
15
|
-
answer
|
|
37
|
+
answer,
|
|
16
38
|
instruction,
|
|
17
|
-
keys: ["
|
|
39
|
+
keys: ["et"],
|
|
18
40
|
answerFormat: "tex",
|
|
19
41
|
style: { tableHasNoHeader: true },
|
|
20
42
|
identifiers: {
|
|
21
|
-
xValues
|
|
22
|
-
imageValues:
|
|
43
|
+
xValues,
|
|
44
|
+
imageValues: yValues,
|
|
45
|
+
isAskingImage,
|
|
46
|
+
value: valueAsked,
|
|
23
47
|
},
|
|
24
48
|
};
|
|
25
49
|
return question;
|
|
26
50
|
};
|
|
27
|
-
const getPropositions = (n, { answer, xValues, imageValues }) => {
|
|
51
|
+
const getPropositions = (n, { answer, xValues, imageValues, isAskingImage, value }) => {
|
|
28
52
|
const propositions = [];
|
|
29
53
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
30
|
-
|
|
54
|
+
if (isAskingImage) {
|
|
55
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, xValues[imageValues.indexOf(value)] + "");
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, imageValues[xValues.indexOf(value)] + "");
|
|
59
|
+
}
|
|
31
60
|
while (propositions.length < n) {
|
|
32
|
-
|
|
33
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, randProp + "");
|
|
61
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, ((0, coinFlip_1.coinFlip)() ? (0, random_1.random)(xValues) : (0, random_1.random)(imageValues)) + "");
|
|
34
62
|
}
|
|
35
63
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
36
64
|
};
|
|
37
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
xValues,
|
|
45
|
-
imageValues,
|
|
46
|
-
table: `
|
|
47
|
-
|$x$|${xValues
|
|
48
|
-
.map((value) => `$${value}$`)
|
|
49
|
-
.reduce((prev, curr) => prev + "|" + curr)}|
|
|
50
|
-
|-|-|-|-|-|-|
|
|
51
|
-
|$f(x)$|${imageValues
|
|
52
|
-
.map((value) => `$${value}$`)
|
|
53
|
-
.reduce((prev, curr) => prev + "|" + curr)}|
|
|
54
|
-
`,
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
const generateXValues = () => {
|
|
58
|
-
const xValues = [];
|
|
59
|
-
for (let i = 0; i < 5; i++) {
|
|
60
|
-
let value;
|
|
61
|
-
do {
|
|
62
|
-
value = (0, randint_1.randint)(-11, 11);
|
|
63
|
-
} while (xValues.includes(value));
|
|
64
|
-
xValues.push(value);
|
|
65
|
-
}
|
|
66
|
-
xValues.sort((a, b) => {
|
|
67
|
-
return a - b;
|
|
68
|
-
});
|
|
69
|
-
return xValues;
|
|
70
|
-
};
|
|
71
|
-
const generateExercise = () => {
|
|
72
|
-
const polynom = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-5, 6, [0])]);
|
|
73
|
-
const exoTable = generateTable(polynom);
|
|
74
|
-
const isAskingImage = (0, coinFlip_1.coinFlip)();
|
|
75
|
-
const questionValue = isAskingImage
|
|
76
|
-
? (0, random_1.random)(exoTable.xValues)
|
|
77
|
-
: (0, random_1.random)(exoTable.imageValues);
|
|
78
|
-
const answer = isAskingImage
|
|
79
|
-
? polynom.calculate(questionValue)
|
|
80
|
-
: exoTable.xValues.find((value, index) => exoTable.imageValues[index] === questionValue);
|
|
81
|
-
return { polynom, exoTable, isAskingImage, questionValue, answer };
|
|
82
|
-
};
|
|
83
|
-
const generatePropositions = (xValues, imageValues, answer) => {
|
|
84
|
-
const filteredXValues = xValues.filter((value) => value !== +answer);
|
|
85
|
-
const firstProp = (0, random_1.random)(filteredXValues);
|
|
86
|
-
const secondProp = (0, random_1.random)(filteredXValues
|
|
87
|
-
.concat(imageValues)
|
|
88
|
-
.filter((value) => ![firstProp, +answer].includes(value)));
|
|
89
|
-
const thirdProp = (0, random_1.random)(imageValues.filter((value) => value !== secondProp));
|
|
90
|
-
return [firstProp + "", secondProp + "", thirdProp + ""];
|
|
65
|
+
const isAnswerValid = (ans, { answer, xValues, imageValues, isAskingImage, value }) => {
|
|
66
|
+
const numbers = ans.split("\\text{ et }").map((el) => Number(el));
|
|
67
|
+
if (numbers.some((n) => isNaN(n)))
|
|
68
|
+
return false;
|
|
69
|
+
const answerNumbers = answer.split("\\text{ et }").map((el) => Number(el));
|
|
70
|
+
return ans === answer || (0, arrayHasSameElement_1.arrayHasSameElements)(numbers, answerNumbers);
|
|
91
71
|
};
|
|
92
72
|
exports.inverseImageFunctionTable = {
|
|
93
73
|
id: "inverseImageFunctionTable",
|
|
@@ -64,7 +64,7 @@ const getSolveSecondDegreeEquationByFactorisationQuestion = () => {
|
|
|
64
64
|
}
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
|
-
const instruction = `Soit $f(x) = ${statement}$.
|
|
67
|
+
const instruction = `Soit $f(x) = ${statement}$. Factoriser $f(x)$, puis résoudre l'équation $f(x) = 0$.`;
|
|
68
68
|
answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(roots)).toTex();
|
|
69
69
|
const question = {
|
|
70
70
|
answer,
|
|
@@ -9,7 +9,7 @@ const randint_1 = require("../../../../math/utils/random/randint");
|
|
|
9
9
|
const equationSolutionNode_1 = require("../../../../tree/nodes/equations/equationSolutionNode");
|
|
10
10
|
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
11
11
|
const getSolveSecondDegreeEquationFromCanoQuestion = () => {
|
|
12
|
-
const trinom = trinom_1.TrinomConstructor.
|
|
12
|
+
const trinom = trinom_1.TrinomConstructor.randomNiceRoots();
|
|
13
13
|
const statement = trinom.getCanonicalForm().toTex();
|
|
14
14
|
const roots = trinom.getRootsNode();
|
|
15
15
|
const answer = new equationSolutionNode_1.EquationSolutionNode(new discreteSetNode_1.DiscreteSetNode(roots)).toTex();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeAPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AA+
|
|
1
|
+
{"version":3,"file":"placeAPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/placeAPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA+B5C,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAY/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"averageEvolutionRate.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/averageEvolutionRate.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"averageEvolutionRate.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/averageEvolutionRate.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAqEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
|
|
@@ -18,6 +18,21 @@ const getAverageEvolutionRate = () => {
|
|
|
18
18
|
keys: ["percent"],
|
|
19
19
|
answerFormat: "tex",
|
|
20
20
|
identifiers: { nbMois, rate },
|
|
21
|
+
hint: `Commence par déterminer le coefficient multiplicateur assoicié à une hausse de $${rate}\\%$. Puis, élève ce coefficient à la puissance $\\frac{1}{${nbMois}}$. Enfin, transforme le coefficient multiplicateur obtenu en taux d'évolution.`,
|
|
22
|
+
correction: `Le coefficient multiplicateur associé à une hausse de $${rate}\\%$ est :
|
|
23
|
+
|
|
24
|
+
$1+\\frac{${rate}}{100} = ${(1 + rate / 100).frenchify()}$
|
|
25
|
+
|
|
26
|
+
Le coefficient multiplicateur moyen pour chaque mois sur une période de $${nbMois}$ mois est donc de :
|
|
27
|
+
|
|
28
|
+
$\\left(${(1 +
|
|
29
|
+
rate / 100).frenchify()}\\right)^{\\frac{1}{${nbMois}}} = ${(0, round_1.round)(Math.pow(1 + rate / 100, 1 / nbMois), 4).frenchify()}$
|
|
30
|
+
|
|
31
|
+
On transforme alors ce coefficient multiplicateur en taux d'évolution :
|
|
32
|
+
|
|
33
|
+
$t = (${(0, round_1.round)(Math.pow(1 + rate / 100, 1 / nbMois), 4).frenchify()}-1)\\times 100 = ${answer.frenchify()}$
|
|
34
|
+
|
|
35
|
+
Le taux d'évoution mensuel moyen est donc de $${answerTex}$.`,
|
|
21
36
|
};
|
|
22
37
|
return question;
|
|
23
38
|
};
|
|
@@ -52,4 +67,5 @@ exports.averageEvolutionRate = {
|
|
|
52
67
|
getPropositions,
|
|
53
68
|
isAnswerValid,
|
|
54
69
|
subject: "Mathématiques",
|
|
70
|
+
hasHintAndCorrection: true,
|
|
55
71
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmToEvolution.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/cmToEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA8DF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAc/C,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cmToEvolution = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const round_1 = require("../../../math/utils/round");
|
|
8
|
+
const alignTex_1 = require("../../../utils/alignTex");
|
|
9
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
10
|
+
const getCmToEvolutionQuestion = () => {
|
|
11
|
+
const evolution = (0, randint_1.randint)(-99, 101, [0]);
|
|
12
|
+
const isHausse = evolution > 0;
|
|
13
|
+
const CM = ((0, round_1.round)(1 + evolution / 100, 2) + "").replaceAll(".", ",");
|
|
14
|
+
const answer = (isHausse ? "+" : "") + evolution + "\\%";
|
|
15
|
+
const question = {
|
|
16
|
+
answer: answer,
|
|
17
|
+
instruction: `Quelle est l'évolution en pourcentage associée à un coefficient multiplicateur de $${CM}$ ?`,
|
|
18
|
+
keys: ["percent"],
|
|
19
|
+
answerFormat: "tex",
|
|
20
|
+
identifiers: { evolution },
|
|
21
|
+
hint: "Pour trouver le taux d'évolution $t$ à partir du coefficient multiplicateur (CM) utilise la formule $t = \\left(\\text{CM}-1\\right)\\times 100$.",
|
|
22
|
+
correction: `Le taux d'évolution $t$ s'obtient par la formule
|
|
23
|
+
|
|
24
|
+
$$t = \\left(\\text{CM}-1\\right)\\times 100$$
|
|
25
|
+
|
|
26
|
+
Ici, on a donc :
|
|
27
|
+
|
|
28
|
+
${(0, alignTex_1.alignTex)([
|
|
29
|
+
["t", "=", `\\left(${CM}-1\\right)\\times 100`],
|
|
30
|
+
["", "=", evolution + ""],
|
|
31
|
+
])}
|
|
32
|
+
|
|
33
|
+
Le taux d'évolution est donc de $${answer}$.
|
|
34
|
+
`,
|
|
35
|
+
};
|
|
36
|
+
return question;
|
|
37
|
+
};
|
|
38
|
+
const getPropositions = (n, { answer, evolution }) => {
|
|
39
|
+
const propositions = [];
|
|
40
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
41
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "+" + ((0, round_1.round)(1 + evolution / 100, 2) * 100 + "\\%").replaceAll(".", ","));
|
|
42
|
+
while (propositions.length < n) {
|
|
43
|
+
const wrongAnswer = ((0, coinFlip_1.coinFlip)() ? "+" : "-") + (0, randint_1.randint)(1, 100) + "\\%";
|
|
44
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer);
|
|
45
|
+
}
|
|
46
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
47
|
+
};
|
|
48
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
49
|
+
const allowedTex = [answer, answer.replace("\\%", "")];
|
|
50
|
+
if (answer[0] === "+") {
|
|
51
|
+
allowedTex.push(answer.slice(1));
|
|
52
|
+
allowedTex.push(answer.slice(1).replace("\\%", ""));
|
|
53
|
+
}
|
|
54
|
+
return allowedTex.includes(ans);
|
|
55
|
+
};
|
|
56
|
+
exports.cmToEvolution = {
|
|
57
|
+
id: "cmToEvolution",
|
|
58
|
+
connector: "=",
|
|
59
|
+
label: "Passer de coefficient multiplicateur à évolution en pourcentage",
|
|
60
|
+
levels: ["2ndPro", "2nde", "1rePro", "1reTech", "1reESM"],
|
|
61
|
+
isSingleStep: true,
|
|
62
|
+
sections: ["Pourcentages"],
|
|
63
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCmToEvolutionQuestion, nb),
|
|
64
|
+
qcmTimer: 60,
|
|
65
|
+
freeTimer: 60,
|
|
66
|
+
getPropositions,
|
|
67
|
+
isAnswerValid,
|
|
68
|
+
subject: "Mathématiques",
|
|
69
|
+
hasHintAndCorrection: true,
|
|
70
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evolutionToCM.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/evolutionToCM.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"evolutionToCM.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/evolutionToCM.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAsEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAc/C,CAAC"}
|
|
@@ -5,49 +5,44 @@ const exercise_1 = require("../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
7
|
const round_1 = require("../../../math/utils/round");
|
|
8
|
-
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
9
8
|
const getEvolutionToCmQuestion = () => {
|
|
10
|
-
const isFromEvolutionToCM = (0, coinFlip_1.coinFlip)();
|
|
11
9
|
const evolution = (0, randint_1.randint)(-99, 101, [0]);
|
|
12
10
|
const isHausse = evolution > 0;
|
|
13
11
|
const CM = ((0, round_1.round)(1 + evolution / 100, 2) + "").replaceAll(".", ",");
|
|
14
|
-
const answer =
|
|
15
|
-
? CM
|
|
16
|
-
: (isHausse ? "+" : "") + evolution + "\\%";
|
|
12
|
+
const answer = CM;
|
|
17
13
|
const question = {
|
|
18
14
|
answer: answer,
|
|
19
|
-
instruction:
|
|
20
|
-
? `Quel est le coefficient multiplicateur associé à une ${isHausse ? "hausse" : "baisse"} de $${isHausse ? evolution : evolution.toString().slice(1)}\\%$ ?`
|
|
21
|
-
: `Quelle est l'évolution en pourcentage associée à un coefficient multiplicateur de $${CM}$ ?`,
|
|
15
|
+
instruction: `Quel est le coefficient multiplicateur associé à une ${isHausse ? "hausse" : "baisse"} de $${isHausse ? evolution : evolution.toString().slice(1)}\\%$ ?`,
|
|
22
16
|
keys: ["percent"],
|
|
23
17
|
answerFormat: "tex",
|
|
24
|
-
identifiers: {
|
|
18
|
+
identifiers: { evolution },
|
|
19
|
+
hint: `Le coefficient multiplicateur associé à une ${isHausse ? "hausse" : "baisse"} de $t\\%$ est donné par $${isHausse ? "1+\\frac{t}{100}" : "1-\\frac{t}{100}"}$.
|
|
20
|
+
`,
|
|
21
|
+
correction: `Le coefficient multiplicateur associé à une ${isHausse ? "hausse" : "baisse"} de $t\\%$ est donné par $${isHausse ? "1+\\frac{t}{100}" : "1-\\frac{t}{100}"}$.
|
|
22
|
+
|
|
23
|
+
Ici, on a $t = ${Math.abs(evolution)}$\\%, donc le coefficient multiplicateur vaut :
|
|
24
|
+
|
|
25
|
+
$$
|
|
26
|
+
1${isHausse ? "+" : "-"}\\frac{${Math.abs(evolution)}}{100} = ${CM}
|
|
27
|
+
$$
|
|
28
|
+
|
|
29
|
+
`,
|
|
25
30
|
};
|
|
26
31
|
return question;
|
|
27
32
|
};
|
|
28
|
-
const getPropositions = (n, { answer,
|
|
33
|
+
const getPropositions = (n, { answer, evolution }) => {
|
|
29
34
|
const propositions = [];
|
|
30
35
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, evolution + "");
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, "+" + ((0, round_1.round)(1 + evolution / 100, 2) * 100 + "\\%").replaceAll(".", ","));
|
|
37
|
-
}
|
|
36
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, ((0, round_1.round)(evolution / 100, 2) + "").replaceAll(".", ","));
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, evolution + "");
|
|
38
38
|
while (propositions.length < n) {
|
|
39
|
-
const wrongAnswer =
|
|
40
|
-
? ((0, round_1.round)((0, randint_1.randint)(1, 200) / 100, 2) + "").replaceAll(".", ",")
|
|
41
|
-
: ((0, coinFlip_1.coinFlip)() ? "+" : "-") + (0, randint_1.randint)(1, 100) + "\\%";
|
|
39
|
+
const wrongAnswer = ((0, round_1.round)((0, randint_1.randint)(1, 200) / 100, 2) + "").replaceAll(".", ",");
|
|
42
40
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer);
|
|
43
41
|
}
|
|
44
42
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
45
43
|
};
|
|
46
44
|
const isAnswerValid = (ans, { answer }) => {
|
|
47
|
-
|
|
48
|
-
if (answer[0] === "+")
|
|
49
|
-
allowedTex.push(answer.slice(1));
|
|
50
|
-
return allowedTex.includes(ans);
|
|
45
|
+
return ans === answer;
|
|
51
46
|
};
|
|
52
47
|
exports.evolutionToCM = {
|
|
53
48
|
id: "evolutionToCM",
|
|
@@ -62,4 +57,5 @@ exports.evolutionToCM = {
|
|
|
62
57
|
getPropositions,
|
|
63
58
|
isAnswerValid,
|
|
64
59
|
subject: "Mathématiques",
|
|
60
|
+
hasHintAndCorrection: true,
|
|
65
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findProportion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findProportion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"findProportion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findProportion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsDF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
|
|
@@ -16,6 +16,20 @@ const getFindProportionQuestion = () => {
|
|
|
16
16
|
keys: ["percent"],
|
|
17
17
|
answerFormat: "tex",
|
|
18
18
|
identifiers: { total, lefties },
|
|
19
|
+
hint: `La proportion de gauchers s'obtient par la formule :
|
|
20
|
+
|
|
21
|
+
$$
|
|
22
|
+
\\frac{\\text{nombre de gauchers}}{\\text{nombre d'élèves}}\\times 100
|
|
23
|
+
$$
|
|
24
|
+
|
|
25
|
+
`,
|
|
26
|
+
correction: `Le pourcentage de gauchers dans ce lycée est de :
|
|
27
|
+
|
|
28
|
+
$$
|
|
29
|
+
\\frac{${lefties}}{${total}}\\times 100 = ${answer}
|
|
30
|
+
$$
|
|
31
|
+
|
|
32
|
+
`,
|
|
19
33
|
};
|
|
20
34
|
return question;
|
|
21
35
|
};
|
|
@@ -45,4 +59,5 @@ exports.findProportion = {
|
|
|
45
59
|
getPropositions,
|
|
46
60
|
isAnswerValid,
|
|
47
61
|
subject: "Mathématiques",
|
|
62
|
+
hasHintAndCorrection: true,
|
|
48
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/globalPercent.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAMxB,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;
|
|
1
|
+
{"version":3,"file":"globalPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/globalPercent.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAMxB,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAuFF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAe/C,CAAC"}
|
|
@@ -34,6 +34,19 @@ const getGlobalPercentQuestion = () => {
|
|
|
34
34
|
keys: ["percent"],
|
|
35
35
|
answerFormat: "tex",
|
|
36
36
|
identifiers: { evolutions },
|
|
37
|
+
hint: "Transforme chaque taux d'évolution en coefficient multiplicateur, puis multiplie ces coefficients multiplicateurs entre eux pour obtenir le coefficient multiplicateur global. Transforme alors ce CM global en taux d'évolution.",
|
|
38
|
+
correction: `On transforme les taux d'évolution en coefficients multiplicateurs puis on les multiplie entre eux :
|
|
39
|
+
|
|
40
|
+
$${evolutions
|
|
41
|
+
.map((e) => (0, round_1.round)(1 + Number(e) / 100, 2).frenchify())
|
|
42
|
+
.join(" \\times ")} = ${(0, round_1.round)(evolutions.reduce((acc, curr) => acc * (0, round_1.round)(1 + Number(curr) / 100, 2), 1), 4).frenchify()}$
|
|
43
|
+
|
|
44
|
+
Enfin, on transforme ce CM global en taux d'évolution :
|
|
45
|
+
|
|
46
|
+
$(${(0, round_1.round)(evolutions.reduce((acc, curr) => acc * (0, round_1.round)(1 + Number(curr) / 100, 2), 1), 4).frenchify()} - 1)\\times 100 = ${answer.replace("\\%", "")}$
|
|
47
|
+
|
|
48
|
+
Le taux d'évolution global est donc de $${answer}$.
|
|
49
|
+
`,
|
|
37
50
|
};
|
|
38
51
|
return question;
|
|
39
52
|
};
|
|
@@ -69,4 +82,5 @@ exports.globalPercent = {
|
|
|
69
82
|
getPropositions,
|
|
70
83
|
isAnswerValid,
|
|
71
84
|
subject: "Mathématiques",
|
|
85
|
+
hasHintAndCorrection: true,
|
|
72
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC"}
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./percentToDecimal"), exports);
|
|
|
23
23
|
__exportStar(require("./valuePercent"), exports);
|
|
24
24
|
__exportStar(require("./findProportion"), exports);
|
|
25
25
|
__exportStar(require("./isTableProportional"), exports);
|
|
26
|
+
__exportStar(require("./cmToEvolution"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG,EAAE,CAAC;AA8DtB,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAerD,CAAC"}
|
|
@@ -3,17 +3,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isTableProportional = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randTupleInt_1 = require("../../../math/utils/random/randTupleInt");
|
|
6
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
8
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
9
|
const getIsTableProportionalQuestion = () => {
|
|
9
|
-
const
|
|
10
|
+
const xValues = (0, randTupleInt_1.randTupleInt)(3, {
|
|
11
|
+
from: 1,
|
|
12
|
+
to: 15,
|
|
13
|
+
allDifferent: true,
|
|
14
|
+
}).sort((a, b) => a - b);
|
|
15
|
+
const isProportionnal = (0, coinFlip_1.coinFlip)();
|
|
16
|
+
const coeff = (0, randint_1.randint)(2, 6);
|
|
17
|
+
const yValues = isProportionnal
|
|
18
|
+
? xValues.map((value) => value * coeff)
|
|
19
|
+
: xValues.map((value) => value * (0, randint_1.randint)(2, 5));
|
|
10
20
|
const question = {
|
|
11
|
-
answer:
|
|
12
|
-
instruction: `On considère le tableau ci-dessous. Est-ce un tableau de proportionnalité
|
|
21
|
+
answer: isProportionnal ? "Oui" : "Non",
|
|
22
|
+
instruction: `On considère le tableau ci-dessous. Est-ce un tableau de proportionnalité
|
|
23
|
+
|${xValues.map((value) => `$${value}$`).join("|")}|
|
|
24
|
+
|-|-|-|
|
|
25
|
+
|${yValues.map((value) => `$${value}$`).join("|")}|
|
|
26
|
+
`,
|
|
13
27
|
keys: [],
|
|
14
28
|
answerFormat: "raw",
|
|
15
29
|
style: { tableHasNoHeader: true },
|
|
16
|
-
identifiers: {
|
|
30
|
+
identifiers: {
|
|
31
|
+
xValues,
|
|
32
|
+
yValues,
|
|
33
|
+
},
|
|
34
|
+
hint: "Pour passer de la ligne du haut à la ligne du bas, multiplie-t-on toujours par le même nombre ? Si oui, alors c'est un tableau de proportionnalité.",
|
|
35
|
+
correction: `On divise les nombres de la deuxième ligne par les nombres de la première ligne. Si on obtient toujours le même résultat, alors c'est un tableau de proportionnalité.
|
|
36
|
+
|
|
37
|
+
- $${yValues[0]}\\div ${xValues[0]} = ${yValues[0] / xValues[0]}$
|
|
38
|
+
|
|
39
|
+
- $${yValues[1]}\\div ${xValues[1]} = ${yValues[1] / xValues[1]}$
|
|
40
|
+
|
|
41
|
+
- $${yValues[2]}\\div ${xValues[2]} = ${yValues[2] / xValues[2]}$
|
|
42
|
+
|
|
43
|
+
${isProportionnal
|
|
44
|
+
? "Puisque tous les résultats sont égaux, c'est bien un tableau de proportionnalité."
|
|
45
|
+
: "Puisque les résultats ne sont pas tous égaux, ce n'est pas un tableau de proportionnalité."}
|
|
46
|
+
`,
|
|
17
47
|
};
|
|
18
48
|
return question;
|
|
19
49
|
};
|
|
@@ -28,35 +58,6 @@ const getPropositions = (n, { answer }) => {
|
|
|
28
58
|
const isAnswerValid = (ans, { answer }) => {
|
|
29
59
|
return ans === answer;
|
|
30
60
|
};
|
|
31
|
-
const generateTable = () => {
|
|
32
|
-
const xValues = [(0, randint_1.randint)(1, 11)];
|
|
33
|
-
while (xValues.length < 3) {
|
|
34
|
-
let lastNb = xValues[xValues.length - 1];
|
|
35
|
-
let random = (0, randint_1.randint)(lastNb, lastNb + 11, [...xValues]);
|
|
36
|
-
xValues.push(random);
|
|
37
|
-
}
|
|
38
|
-
const yValues = generateYValues(xValues);
|
|
39
|
-
return {
|
|
40
|
-
table: `
|
|
41
|
-
|${xValues.map((value) => `$${value}$`).join("|")}|
|
|
42
|
-
|-|-|-|
|
|
43
|
-
|${yValues.values.map((value) => `$${value}$`).join("|")}|
|
|
44
|
-
`,
|
|
45
|
-
coeff: yValues.coeff,
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
const generateYValues = (xValues) => {
|
|
49
|
-
const flip = (0, coinFlip_1.coinFlip)();
|
|
50
|
-
const coeff = (0, randint_1.randint)(2, 6);
|
|
51
|
-
return flip
|
|
52
|
-
? {
|
|
53
|
-
values: xValues.map((value) => value * (0, randint_1.randint)(2, 5)),
|
|
54
|
-
}
|
|
55
|
-
: {
|
|
56
|
-
values: xValues.map((value) => value * coeff),
|
|
57
|
-
coeff,
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
61
|
exports.isTableProportional = {
|
|
61
62
|
id: "isVTableProportional",
|
|
62
63
|
label: "Reconnaître un tableau de proportionnalité",
|
|
@@ -70,4 +71,5 @@ exports.isTableProportional = {
|
|
|
70
71
|
isAnswerValid,
|
|
71
72
|
answerType: "QCU",
|
|
72
73
|
subject: "Mathématiques",
|
|
74
|
+
hasHintAndCorrection: true,
|
|
73
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAwFF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
|
|
@@ -21,6 +21,19 @@ const getPercentToDecimalQuestion = () => {
|
|
|
21
21
|
keys: ["percent"],
|
|
22
22
|
answerFormat: "tex",
|
|
23
23
|
identifiers: { isPercentToDecimal, nb: nb.value },
|
|
24
|
+
hint: `${isPercentToDecimal
|
|
25
|
+
? `Pour écrire $x\\%$ en décimal, rappelle toi que $x\\% = \\frac{x}{100}$.`
|
|
26
|
+
: `Pour écrire un nombre $x$ en pourcentage, on multiplie $x$ par $100$.`}`,
|
|
27
|
+
correction: `${isPercentToDecimal
|
|
28
|
+
? `Le symbole $\\%$ signifie simplement "divisé par $100$".
|
|
29
|
+
|
|
30
|
+
On a donc $${(nb.value * 100).frenchify()}\\% = \\frac{${(nb.value * 100).frenchify()}}{100} = ${answer}$
|
|
31
|
+
`
|
|
32
|
+
: `Pour écrire un nombre sous la forme d'un pourcentage, il suffit de le multiplier par $100$.
|
|
33
|
+
|
|
34
|
+
On a donc $${nb.value.frenchify()} = ${answer}$.
|
|
35
|
+
|
|
36
|
+
En effet, on a bien $${answer} = \\frac{${answer.replace("\\%", "")}}{100} = ${nb.value.frenchify()}$.`}`,
|
|
24
37
|
};
|
|
25
38
|
return question;
|
|
26
39
|
};
|
|
@@ -68,4 +81,5 @@ exports.percentToDecimal = {
|
|
|
68
81
|
getPropositions,
|
|
69
82
|
isAnswerValid,
|
|
70
83
|
subject: "Mathématiques",
|
|
84
|
+
hasHintAndCorrection: true,
|
|
71
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reciprocalPercentage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/reciprocalPercentage.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAKxB,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"reciprocalPercentage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/reciprocalPercentage.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAKxB,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAiFF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
|