math-exercises 2.2.36 → 2.2.38
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 +5 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/framing.js +1 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +54 -26
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.js +1 -0
- package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/squareFunctionInequation.js +1 -0
- package/lib/exercises/math/conversion/aeraConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/aeraConversion.js +1 -2
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +1 -0
- package/lib/exercises/math/functions/basics/imageAntecedentFromSentence.d.ts +9 -0
- package/lib/exercises/math/functions/basics/imageAntecedentFromSentence.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/imageAntecedentFromSentence.js +76 -0
- package/lib/exercises/math/functions/basics/index.d.ts +1 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/rootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/rootsFromDevForm.js +1 -0
- package/lib/exercises/math/functions/trinoms/secondDegreeInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/secondDegreeInequation.js +1 -0
- package/lib/exercises/math/geometry/areas/circleRadiusFromArea.d.ts +7 -0
- package/lib/exercises/math/geometry/areas/circleRadiusFromArea.d.ts.map +1 -0
- package/lib/exercises/math/geometry/areas/circleRadiusFromArea.js +108 -0
- package/lib/exercises/math/geometry/areas/index.d.ts +3 -0
- package/lib/exercises/math/geometry/areas/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/index.js +3 -0
- package/lib/exercises/math/geometry/areas/rectangleSideFromArea.d.ts +8 -0
- package/lib/exercises/math/geometry/areas/rectangleSideFromArea.d.ts.map +1 -0
- package/lib/exercises/math/geometry/areas/rectangleSideFromArea.js +95 -0
- package/lib/exercises/math/geometry/areas/squareSideFromArea.d.ts +8 -0
- package/lib/exercises/math/geometry/areas/squareSideFromArea.d.ts.map +1 -0
- package/lib/exercises/math/geometry/areas/squareSideFromArea.js +77 -0
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +1 -1
- package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.d.ts +7 -0
- package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.d.ts.map +1 -0
- package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.js +102 -0
- package/lib/exercises/math/geometry/perimeters/index.d.ts +3 -0
- package/lib/exercises/math/geometry/perimeters/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/index.js +3 -0
- package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.d.ts +8 -0
- package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.d.ts.map +1 -0
- package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.js +114 -0
- package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.d.ts +7 -0
- package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.d.ts.map +1 -0
- package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.js +74 -0
- package/lib/exercises/math/matrices/matrixInversibilityDomain.d.ts.map +1 -1
- package/lib/exercises/math/matrices/matrixInversibilityDomain.js +1 -0
- package/lib/exercises/math/primitive/expUPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/expUPrimitive.js +1 -0
- package/lib/exercises/math/primitive/exponentialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/exponentialPrimitive.js +1 -0
- package/lib/exercises/math/primitive/logarithmePrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -0
- package/lib/exercises/math/primitive/usualPrimitives.d.ts.map +1 -1
- package/lib/exercises/math/primitive/usualPrimitives.js +1 -0
- package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageList.js +12 -3
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.js +21 -18
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +1 -0
- package/lib/exercises/math/trigonometry/equationCosOnRandomInterval.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/equationCosOnRandomInterval.js +14 -5
- package/lib/exercises/math/trigonometry/equationSinOnRandomInterval.js +1 -1
- package/lib/exercises/math/trigonometry/index.d.ts +1 -0
- package/lib/exercises/math/trigonometry/index.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/index.js +1 -1
- package/lib/exercises/pc/calibrationCurveOfSolution.js +4 -4
- package/lib/index.d.ts +22 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.d.ts +2 -0
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.js +7 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +2 -1
- package/lib/types/keyIds.d.ts +1 -1
- package/lib/types/keyIds.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squareSideFromArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/squareSideFromArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AA+DF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAgBpD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.squareSideFromArea = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
7
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const round_1 = require("../../../../math/utils/round");
|
|
9
|
+
const sqrtNode_1 = require("../../../../tree/nodes/functions/sqrtNode");
|
|
10
|
+
const coinFlip_1 = require("../../../../utils/alea/coinFlip");
|
|
11
|
+
const getPropositions = (n, { answer, area }) => {
|
|
12
|
+
const propositions = [];
|
|
13
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
14
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (area * area).frenchify());
|
|
15
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(area / 2, 2).frenchify());
|
|
16
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(area / 4, 2).frenchify());
|
|
17
|
+
while (propositions.length < n) {
|
|
18
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(1, 100, 2).frenchify());
|
|
19
|
+
}
|
|
20
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
return (0, round_1.round)(Math.sqrt(identifiers.area), 2).frenchify();
|
|
24
|
+
};
|
|
25
|
+
const getInstruction = (identifiers) => {
|
|
26
|
+
return `Calculer le côté d'un carré d'aire $${identifiers.area.frenchify()}$. Arrondir au centième.`;
|
|
27
|
+
};
|
|
28
|
+
const getHint = (identifiers) => {
|
|
29
|
+
return `L'aire d'un carré est égale au carré du côté.`;
|
|
30
|
+
};
|
|
31
|
+
const getCorrection = (identifiers) => {
|
|
32
|
+
return `L'aire d'un carré est égale au carré du côté. Pour retrouver le côté à partir de l'aire, il faut donc calculer la racine carrée de l'aire. Le côté du carré est donc égal à :
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
${new sqrtNode_1.SqrtNode(identifiers.area.toTree()).toTex()}${identifiers.isPerfectSquare ? "=" : "\\approx"}${getAnswer(identifiers)}
|
|
36
|
+
$$
|
|
37
|
+
`;
|
|
38
|
+
};
|
|
39
|
+
const getKeys = (identifiers) => {
|
|
40
|
+
return [];
|
|
41
|
+
};
|
|
42
|
+
const isAnswerValid = (ans, { answer, area }) => {
|
|
43
|
+
const node = new sqrtNode_1.SqrtNode(area.toTree());
|
|
44
|
+
const approximation = (0, round_1.round)(Math.sqrt(area), 2).frenchify();
|
|
45
|
+
return [...node.toAllValidTexs(), approximation].includes(ans);
|
|
46
|
+
};
|
|
47
|
+
const getSquareSideFromAreaQuestion = () => {
|
|
48
|
+
const isPerfectSquare = (0, coinFlip_1.coinFlip)();
|
|
49
|
+
const area = isPerfectSquare ? (0, randint_1.randint)(1, 11) ** 2 : (0, randfloat_1.randfloat)(1, 100, 1);
|
|
50
|
+
const identifiers = { area, isPerfectSquare };
|
|
51
|
+
const question = {
|
|
52
|
+
answer: getAnswer(identifiers),
|
|
53
|
+
instruction: getInstruction(identifiers),
|
|
54
|
+
keys: getKeys(identifiers),
|
|
55
|
+
answerFormat: "tex",
|
|
56
|
+
identifiers,
|
|
57
|
+
hint: getHint(identifiers),
|
|
58
|
+
correction: getCorrection(identifiers),
|
|
59
|
+
};
|
|
60
|
+
return question;
|
|
61
|
+
};
|
|
62
|
+
exports.squareSideFromArea = {
|
|
63
|
+
id: "squareSideFromArea",
|
|
64
|
+
connector: "=",
|
|
65
|
+
label: "Calculer le côté d'un carré en connaissant son aire",
|
|
66
|
+
isSingleStep: true,
|
|
67
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSquareSideFromAreaQuestion, nb),
|
|
68
|
+
qcmTimer: 60,
|
|
69
|
+
freeTimer: 60,
|
|
70
|
+
getPropositions,
|
|
71
|
+
isAnswerValid,
|
|
72
|
+
subject: "Mathématiques",
|
|
73
|
+
getHint,
|
|
74
|
+
getCorrection,
|
|
75
|
+
getAnswer,
|
|
76
|
+
hasHintAndCorrection: true,
|
|
77
|
+
};
|
|
@@ -106,7 +106,7 @@ const getReadAbscissOnSemiLineQuestion = () => {
|
|
|
106
106
|
break;
|
|
107
107
|
case nombre_1.NumberType.Decimal:
|
|
108
108
|
default:
|
|
109
|
-
axisUnit = (0, randfloat_1.randfloat)(0, 5, 1);
|
|
109
|
+
axisUnit = (0, randfloat_1.randfloat)(0.1, 5, 1);
|
|
110
110
|
coeff = (0, randint_1.randint)(2, 10);
|
|
111
111
|
absciss = (0, round_1.round)(axisUnit * coeff, 2);
|
|
112
112
|
oneUnitTex = axisUnit.frenchify();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circleRadiusFromPerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA2FF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAgB3D,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.circleRadiusFromPerimeter = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
7
|
+
const round_1 = require("../../../../math/utils/round");
|
|
8
|
+
const piNode_1 = require("../../../../tree/nodes/numbers/piNode");
|
|
9
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
10
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
11
|
+
const numberParser_1 = require("../../../../tree/parsers/numberParser");
|
|
12
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
13
|
+
const getPropositions = (n, { answer, perimeter }) => {
|
|
14
|
+
const propositions = [];
|
|
15
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
16
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(Math.sqrt(perimeter), 2).frenchify());
|
|
17
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(perimeter / Math.PI, 2).frenchify());
|
|
18
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(perimeter / 4, 2).frenchify());
|
|
19
|
+
while (propositions.length < n) {
|
|
20
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(1, 100, 2).frenchify());
|
|
21
|
+
}
|
|
22
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
23
|
+
};
|
|
24
|
+
const getAnswer = (identifiers) => {
|
|
25
|
+
return (0, round_1.round)(identifiers.perimeter / (2 * Math.PI), 2).frenchify();
|
|
26
|
+
};
|
|
27
|
+
const getInstruction = (identifiers) => {
|
|
28
|
+
return `Calculer le rayon d'un cercle de périmètre $${identifiers.perimeter.frenchify()}$. Arrondir au centième.`;
|
|
29
|
+
};
|
|
30
|
+
const getHint = (identifiers) => {
|
|
31
|
+
return `Le périmètre d'un cercle est égale à :
|
|
32
|
+
|
|
33
|
+
$$
|
|
34
|
+
2\\times \\pi\\times r
|
|
35
|
+
$$
|
|
36
|
+
|
|
37
|
+
où $r$ est le rayon.`;
|
|
38
|
+
};
|
|
39
|
+
const getCorrection = (identifiers) => {
|
|
40
|
+
return `Le périmètre d'un cercle est égal à :
|
|
41
|
+
|
|
42
|
+
$$
|
|
43
|
+
2\\times \\pi\\times r
|
|
44
|
+
$$
|
|
45
|
+
|
|
46
|
+
où $r$ est le rayon.
|
|
47
|
+
|
|
48
|
+
Ici, on a donc :
|
|
49
|
+
|
|
50
|
+
$${identifiers.perimeter.frenchify()} = 2\\times \\pi\\times r$
|
|
51
|
+
|
|
52
|
+
On isole $r$ dans cette équation :
|
|
53
|
+
|
|
54
|
+
${(0, alignTex_1.alignTex)([
|
|
55
|
+
[
|
|
56
|
+
"r",
|
|
57
|
+
"=",
|
|
58
|
+
new fractionNode_1.FractionNode(identifiers.perimeter.toTree(), new multiplyNode_1.MultiplyNode((2).toTree(), piNode_1.PiNode)).toTex(),
|
|
59
|
+
],
|
|
60
|
+
["", "\\aprox", getAnswer(identifiers)],
|
|
61
|
+
])}
|
|
62
|
+
`;
|
|
63
|
+
};
|
|
64
|
+
const getKeys = (identifiers) => {
|
|
65
|
+
return [];
|
|
66
|
+
};
|
|
67
|
+
const isAnswerValid = (ans, { answer, perimeter }) => {
|
|
68
|
+
const parsed = (0, numberParser_1.numberParser)(ans);
|
|
69
|
+
if (!parsed)
|
|
70
|
+
return false;
|
|
71
|
+
return parsed === answer;
|
|
72
|
+
};
|
|
73
|
+
const getCircleRadiusFromPerimeterQuestion = () => {
|
|
74
|
+
const perimeter = (0, randfloat_1.randfloat)(1, 100, 2);
|
|
75
|
+
const identifiers = { perimeter };
|
|
76
|
+
const question = {
|
|
77
|
+
answer: getAnswer(identifiers),
|
|
78
|
+
instruction: getInstruction(identifiers),
|
|
79
|
+
keys: getKeys(identifiers),
|
|
80
|
+
answerFormat: "tex",
|
|
81
|
+
identifiers,
|
|
82
|
+
hint: getHint(identifiers),
|
|
83
|
+
correction: getCorrection(identifiers),
|
|
84
|
+
};
|
|
85
|
+
return question;
|
|
86
|
+
};
|
|
87
|
+
exports.circleRadiusFromPerimeter = {
|
|
88
|
+
id: "circleRadiusFromPerimeter",
|
|
89
|
+
connector: "=",
|
|
90
|
+
label: "Calculer le rayon d'un cercle en connaissant son périmètre",
|
|
91
|
+
isSingleStep: true,
|
|
92
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCircleRadiusFromPerimeterQuestion, nb),
|
|
93
|
+
qcmTimer: 60,
|
|
94
|
+
freeTimer: 60,
|
|
95
|
+
getPropositions,
|
|
96
|
+
isAnswerValid,
|
|
97
|
+
subject: "Mathématiques",
|
|
98
|
+
getHint,
|
|
99
|
+
getCorrection,
|
|
100
|
+
getAnswer,
|
|
101
|
+
hasHintAndCorrection: true,
|
|
102
|
+
};
|
|
@@ -2,4 +2,7 @@ export * from "./circleCircumference";
|
|
|
2
2
|
export * from "./rectanglePerimeter";
|
|
3
3
|
export * from "./squarePerimeter";
|
|
4
4
|
export * from "./trianglePerimeter";
|
|
5
|
+
export * from "./squareSideFromPerimeter";
|
|
6
|
+
export * from "./rectangleSideFromPerimeter";
|
|
7
|
+
export * from "./circleRadiusFromPerimeter";
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC"}
|
|
@@ -18,3 +18,6 @@ __exportStar(require("./circleCircumference"), exports);
|
|
|
18
18
|
__exportStar(require("./rectanglePerimeter"), exports);
|
|
19
19
|
__exportStar(require("./squarePerimeter"), exports);
|
|
20
20
|
__exportStar(require("./trianglePerimeter"), exports);
|
|
21
|
+
__exportStar(require("./squareSideFromPerimeter"), exports);
|
|
22
|
+
__exportStar(require("./rectangleSideFromPerimeter"), exports);
|
|
23
|
+
__exportStar(require("./circleRadiusFromPerimeter"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
perimeter: number;
|
|
4
|
+
width: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const rectangleSideFromPerimeter: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=rectangleSideFromPerimeter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rectangleSideFromPerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA4GF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rectangleSideFromPerimeter = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
7
|
+
const round_1 = require("../../../../math/utils/round");
|
|
8
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
9
|
+
const alignTex_1 = require("../../../../utils/latex/alignTex");
|
|
10
|
+
const getPropositions = (n, { answer, perimeter, width }) => {
|
|
11
|
+
const propositions = [];
|
|
12
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
13
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(perimeter / 4, 2).frenchify());
|
|
14
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(perimeter - width, 2).frenchify());
|
|
15
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(perimeter - 2 * width, 2).frenchify());
|
|
16
|
+
while (propositions.length < n) {
|
|
17
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(1, 100, 2).frenchify());
|
|
18
|
+
}
|
|
19
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
return (0, round_1.round)((identifiers.perimeter - 2 * identifiers.width) / 2, 2).frenchify();
|
|
23
|
+
};
|
|
24
|
+
const getInstruction = (identifiers) => {
|
|
25
|
+
return `Calculer la longueur d'un rectangle de périmètre $${identifiers.perimeter.frenchify()}$ et de largeur $${identifiers.width.frenchify()}$.`;
|
|
26
|
+
};
|
|
27
|
+
const getHint = (identifiers) => {
|
|
28
|
+
return `Le périmètre d'un rectangle est égal à :
|
|
29
|
+
|
|
30
|
+
$$
|
|
31
|
+
P = 2\\times l + 2\\times L
|
|
32
|
+
$$
|
|
33
|
+
|
|
34
|
+
où $l$ et la largeur et $L$ et la longueur.`;
|
|
35
|
+
};
|
|
36
|
+
const getCorrection = (identifiers) => {
|
|
37
|
+
const lengthDouble = (0, round_1.round)(identifiers.perimeter - 2 * identifiers.width, 3);
|
|
38
|
+
return `Le périmètre d'un rectangle est égal à :
|
|
39
|
+
|
|
40
|
+
$$
|
|
41
|
+
P = 2\\times l + 2\\times L
|
|
42
|
+
$$
|
|
43
|
+
|
|
44
|
+
Ici, on a donc :
|
|
45
|
+
|
|
46
|
+
$$
|
|
47
|
+
${identifiers.perimeter.frenchify()} = 2\\times ${identifiers.width.frenchify()} + 2\\times L
|
|
48
|
+
$$
|
|
49
|
+
|
|
50
|
+
Pour retrouver la longueur, on isole $L$ dans cette équation. On obtient :
|
|
51
|
+
|
|
52
|
+
${(0, alignTex_1.alignTex)([
|
|
53
|
+
[
|
|
54
|
+
"2\\times L",
|
|
55
|
+
"=",
|
|
56
|
+
`${identifiers.perimeter.frenchify()}- 2\\times ${identifiers.width.frenchify()}`,
|
|
57
|
+
],
|
|
58
|
+
["", "=", `${lengthDouble.frenchify()}`],
|
|
59
|
+
])}
|
|
60
|
+
|
|
61
|
+
Ainsi, la longueur du rectangle vaut :
|
|
62
|
+
|
|
63
|
+
${(0, alignTex_1.alignTex)([
|
|
64
|
+
[
|
|
65
|
+
"L",
|
|
66
|
+
"=",
|
|
67
|
+
`${new fractionNode_1.FractionNode(lengthDouble.toTree(), (2).toTree()).toTex()}`,
|
|
68
|
+
],
|
|
69
|
+
["", "=", getAnswer(identifiers)],
|
|
70
|
+
])}
|
|
71
|
+
`;
|
|
72
|
+
};
|
|
73
|
+
const getKeys = (identifiers) => {
|
|
74
|
+
return [];
|
|
75
|
+
};
|
|
76
|
+
const isAnswerValid = (ans, { answer, perimeter, width }) => {
|
|
77
|
+
const node = new fractionNode_1.FractionNode((perimeter - 2 * width).toTree(), (2).toTree());
|
|
78
|
+
return node.toAllValidTexs({ allowFractionToDecimal: true }).includes(ans);
|
|
79
|
+
};
|
|
80
|
+
const getRectangleSideFromPerimeterQuestion = () => {
|
|
81
|
+
const width = (0, randfloat_1.randfloat)(1, 50, 1);
|
|
82
|
+
const perimeter = (0, randfloat_1.randfloat)(2 * width + 2, 2 * width + 50, 1);
|
|
83
|
+
const length = (0, round_1.round)((perimeter - 2 * width) / 2, 2);
|
|
84
|
+
const identifiers = {
|
|
85
|
+
perimeter,
|
|
86
|
+
width: Math.min(width, length),
|
|
87
|
+
};
|
|
88
|
+
const question = {
|
|
89
|
+
answer: getAnswer(identifiers),
|
|
90
|
+
instruction: getInstruction(identifiers),
|
|
91
|
+
keys: getKeys(identifiers),
|
|
92
|
+
answerFormat: "tex",
|
|
93
|
+
identifiers,
|
|
94
|
+
hint: getHint(identifiers),
|
|
95
|
+
correction: getCorrection(identifiers),
|
|
96
|
+
};
|
|
97
|
+
return question;
|
|
98
|
+
};
|
|
99
|
+
exports.rectangleSideFromPerimeter = {
|
|
100
|
+
id: "rectangleSideFromPerimeter",
|
|
101
|
+
connector: "=",
|
|
102
|
+
label: "Calculer la longueur d'un rectangle en connaissant son périmètre et sa largeur",
|
|
103
|
+
isSingleStep: true,
|
|
104
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getRectangleSideFromPerimeterQuestion, nb),
|
|
105
|
+
qcmTimer: 60,
|
|
106
|
+
freeTimer: 60,
|
|
107
|
+
getPropositions,
|
|
108
|
+
isAnswerValid,
|
|
109
|
+
subject: "Mathématiques",
|
|
110
|
+
getHint,
|
|
111
|
+
getCorrection,
|
|
112
|
+
getAnswer,
|
|
113
|
+
hasHintAndCorrection: true,
|
|
114
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squareSideFromPerimeter.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/squareSideFromPerimeter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAmEF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAgBzD,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.squareSideFromPerimeter = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const real_1 = require("../../../../math/numbers/reals/real");
|
|
7
|
+
const randfloat_1 = require("../../../../math/utils/random/randfloat");
|
|
8
|
+
const round_1 = require("../../../../math/utils/round");
|
|
9
|
+
const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
|
|
10
|
+
const getPropositions = (n, { answer, perimeter }) => {
|
|
11
|
+
const propositions = [];
|
|
12
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
13
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (4 * perimeter).frenchify());
|
|
14
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(perimeter / 2, 3).frenchify());
|
|
15
|
+
const sqrt = new real_1.SquareRoot(perimeter).basicSimplify().toTree().toTex();
|
|
16
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, sqrt);
|
|
17
|
+
while (propositions.length < n) {
|
|
18
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randfloat_1.randfloat)(1, 100, 2).frenchify());
|
|
19
|
+
}
|
|
20
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
return (0, round_1.round)(identifiers.perimeter / 4, 3).frenchify();
|
|
24
|
+
};
|
|
25
|
+
const getInstruction = (identifiers) => {
|
|
26
|
+
return `Calculer le côté d'un carré de périmètre $${identifiers.perimeter.frenchify()}$.`;
|
|
27
|
+
};
|
|
28
|
+
const getHint = (identifiers) => {
|
|
29
|
+
return `Le périmètre d'un carré est égal à $4$ fois la longueur du côté.`;
|
|
30
|
+
};
|
|
31
|
+
const getCorrection = (identifiers) => {
|
|
32
|
+
return `Le périmètre d'un carré est égal à $4$ fois la longueur du côté. Pour retrouver le côté à partir du périmètre, il faut donc diviser le périmètre par $4$. Le côté du carré est donc égal à :
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
${new fractionNode_1.FractionNode(identifiers.perimeter.toTree(), (4).toTree()).toTex()}=${getAnswer(identifiers)}
|
|
36
|
+
$$
|
|
37
|
+
`;
|
|
38
|
+
};
|
|
39
|
+
const getKeys = (identifiers) => {
|
|
40
|
+
return [];
|
|
41
|
+
};
|
|
42
|
+
const isAnswerValid = (ans, { answer, perimeter }) => {
|
|
43
|
+
const node = new fractionNode_1.FractionNode(perimeter.toTree(), (4).toTree());
|
|
44
|
+
return node.toAllValidTexs({ allowFractionToDecimal: true }).includes(ans);
|
|
45
|
+
};
|
|
46
|
+
const getSquareSideFromPerimeterQuestion = () => {
|
|
47
|
+
const identifiers = { perimeter: (0, randfloat_1.randfloat)(1, 100, 1) };
|
|
48
|
+
const question = {
|
|
49
|
+
answer: getAnswer(identifiers),
|
|
50
|
+
instruction: getInstruction(identifiers),
|
|
51
|
+
keys: getKeys(identifiers),
|
|
52
|
+
answerFormat: "tex",
|
|
53
|
+
identifiers,
|
|
54
|
+
hint: getHint(identifiers),
|
|
55
|
+
correction: getCorrection(identifiers),
|
|
56
|
+
};
|
|
57
|
+
return question;
|
|
58
|
+
};
|
|
59
|
+
exports.squareSideFromPerimeter = {
|
|
60
|
+
id: "squareSideFromPerimeter",
|
|
61
|
+
connector: "=",
|
|
62
|
+
label: "Calculer le côté d'un carré en connaissant son périmètre",
|
|
63
|
+
isSingleStep: true,
|
|
64
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSquareSideFromPerimeterQuestion, nb),
|
|
65
|
+
qcmTimer: 60,
|
|
66
|
+
freeTimer: 60,
|
|
67
|
+
getPropositions,
|
|
68
|
+
isAnswerValid,
|
|
69
|
+
subject: "Mathématiques",
|
|
70
|
+
getHint,
|
|
71
|
+
getCorrection,
|
|
72
|
+
getAnswer,
|
|
73
|
+
hasHintAndCorrection: true,
|
|
74
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrixInversibilityDomain.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/matrixInversibilityDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAyBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA0FF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"matrixInversibilityDomain.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/matrixInversibilityDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAyBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA0FF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expUPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/expUPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,WAAW,CAoB3D,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAiClE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAYvD,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"expUPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/expUPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,WAAW,CAoB3D,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,WAAW,CAiClE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,GAAG,CAAC,WAAW,CAYvD,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAc/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exponentialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/exponentialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,WAAW,CAmBlE,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,YAAY,CAAC,WAAW,CAgCzE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,GAAG,CAAC,WAAW,CAY9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"exponentialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/exponentialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAIJ,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,WAAW,CAmBlE,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,YAAY,CAAC,WAAW,CAgCzE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,GAAG,CAAC,WAAW,CAY9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logarithmePrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/logarithmePrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,YAAY,EAEZ,iBAAiB,EAIlB,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAgBjE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAsCxE,CAAC;AAeF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"logarithmePrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/logarithmePrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,YAAY,EAEZ,iBAAiB,EAIlB,MAAM,0BAA0B,CAAC;AAgBlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,iBAAiB,CAAC,WAAW,CAgBjE,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,YAAY,CAAC,WAAW,CAsCxE,CAAC;AAeF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usualPrimitives.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/usualPrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMT,MAAM,0BAA0B,CAAC;AAwBlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAiGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"usualPrimitives.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/usualPrimitives.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAMT,MAAM,0BAA0B,CAAC;AAwBlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAiGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"averageList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"averageList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA0EF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAe7C,CAAC"}
|
|
@@ -9,6 +9,14 @@ const round_1 = require("../../../../math/utils/round");
|
|
|
9
9
|
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
10
10
|
const operatorComposition_1 = require("../../../../tree/utilities/operatorComposition");
|
|
11
11
|
const average_1 = require("../../../../utils/average");
|
|
12
|
+
const getInstruction = ({ sortedValues }) => {
|
|
13
|
+
return `On considère la liste suivante :
|
|
14
|
+
$$
|
|
15
|
+
${sortedValues.join(";\\ ")}.
|
|
16
|
+
$$
|
|
17
|
+
|
|
18
|
+
Calculer la moyenne de cette liste de valeurs (arrondir au centième).`;
|
|
19
|
+
};
|
|
12
20
|
const getAverageListQuestion = () => {
|
|
13
21
|
let randomValues = [];
|
|
14
22
|
const length = (0, randint_1.randint)(6, 10);
|
|
@@ -18,13 +26,13 @@ const getAverageListQuestion = () => {
|
|
|
18
26
|
const avg = (0, average_1.average)(sortedValues);
|
|
19
27
|
const answer = (0, round_1.round)((0, average_1.average)(sortedValues), 2).frenchify();
|
|
20
28
|
const hasRounded = avg.frenchify() !== answer;
|
|
29
|
+
const identifiers = { sortedValues };
|
|
21
30
|
const question = {
|
|
22
31
|
answer,
|
|
23
|
-
instruction:
|
|
24
|
-
$\\\\$Calculer la moyenne de cette liste de valeurs (arrondir au centième).`,
|
|
32
|
+
instruction: getInstruction(identifiers),
|
|
25
33
|
keys: [],
|
|
26
34
|
answerFormat: "tex",
|
|
27
|
-
identifiers
|
|
35
|
+
identifiers,
|
|
28
36
|
hint: "La moyenne d'une liste de valeurs est la somme de ses valeurs divisé par le nombre de valeurs.",
|
|
29
37
|
correction: `
|
|
30
38
|
On additionne toutes les valeurs :
|
|
@@ -70,4 +78,5 @@ exports.averageList = {
|
|
|
70
78
|
isAnswerValid,
|
|
71
79
|
subject: "Mathématiques",
|
|
72
80
|
hasHintAndCorrection: true,
|
|
81
|
+
getInstruction,
|
|
73
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quartilesList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/quartilesList.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"quartilesList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/quartilesList.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAUT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA2EF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAc/C,CAAC"}
|
|
@@ -4,6 +4,19 @@ exports.quartilesList = void 0;
|
|
|
4
4
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
5
5
|
const exercise_1 = require("../../../exercise");
|
|
6
6
|
const getDistinctQuestions_1 = require("../../../utils/getDistinctQuestions");
|
|
7
|
+
const getInstruction = ({ randomQuartile, randomValues, }) => {
|
|
8
|
+
let quartileToString = "";
|
|
9
|
+
if (randomQuartile === 0)
|
|
10
|
+
quartileToString = "premier quartile";
|
|
11
|
+
else
|
|
12
|
+
quartileToString = "troisième quartile";
|
|
13
|
+
return `On considère la liste suivante :
|
|
14
|
+
$$
|
|
15
|
+
${randomValues.join(";\\ ")}
|
|
16
|
+
$$
|
|
17
|
+
|
|
18
|
+
Calculer le ${quartileToString} de cette série de valeurs.`;
|
|
19
|
+
};
|
|
7
20
|
const getQuartiles = () => {
|
|
8
21
|
let randomValues = [];
|
|
9
22
|
const length = (0, randint_1.randint)(5, 9);
|
|
@@ -15,30 +28,19 @@ const getQuartiles = () => {
|
|
|
15
28
|
const firstQuartile = sortedValues[firstQuartileIndex - 1];
|
|
16
29
|
const thirdQuartile = sortedValues[thirdQuartileIndex - 1];
|
|
17
30
|
const randomQuartile = (0, randint_1.randint)(0, 2);
|
|
18
|
-
let quartileToString;
|
|
19
31
|
let choosenQuartile;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
case 1:
|
|
26
|
-
quartileToString = "troisième quartile";
|
|
27
|
-
choosenQuartile = thirdQuartile;
|
|
28
|
-
break;
|
|
29
|
-
default:
|
|
30
|
-
quartileToString = "troisième quartile";
|
|
31
|
-
choosenQuartile = thirdQuartile;
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
32
|
+
if (randomQuartile === 0)
|
|
33
|
+
choosenQuartile = firstQuartile;
|
|
34
|
+
else
|
|
35
|
+
choosenQuartile = thirdQuartile;
|
|
36
|
+
const identifiers = { randomValues, randomQuartile };
|
|
34
37
|
const answer = choosenQuartile + "";
|
|
35
38
|
const question = {
|
|
36
|
-
instruction:
|
|
37
|
-
$\\\\$Calculer le ${quartileToString} de cette série de valeurs.`,
|
|
39
|
+
instruction: getInstruction(identifiers),
|
|
38
40
|
answer,
|
|
39
41
|
keys: [],
|
|
40
42
|
answerFormat: "tex",
|
|
41
|
-
identifiers
|
|
43
|
+
identifiers,
|
|
42
44
|
};
|
|
43
45
|
return question;
|
|
44
46
|
};
|
|
@@ -70,4 +72,5 @@ exports.quartilesList = {
|
|
|
70
72
|
getPropositions,
|
|
71
73
|
isAnswerValid,
|
|
72
74
|
subject: "Mathématiques",
|
|
75
|
+
getInstruction,
|
|
73
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recognizeArithmeticFromFirstTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA0EF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"recognizeArithmeticFromFirstTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA0EF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,CAgBnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationCosOnRandomInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/equationCosOnRandomInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"equationCosOnRandomInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/equationCosOnRandomInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAqBlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AA6HF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAgB7D,CAAC"}
|