math-exercises 2.2.77 → 2.2.79
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/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/firstDegreeDerivative.js +44 -5
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/rootFunctionDerivative.js +57 -26
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.js +50 -8
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +67 -13
- package/lib/exercises/math/derivation/derivative/usualderivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/usualderivative.js +1 -2
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts +9 -0
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +124 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts +2 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/index.js +17 -0
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/geometry/areas/rectangleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/rectangleArea.js +5 -2
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts +10 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.js +107 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +1 -0
- package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/index.js +1 -0
- package/lib/exercises/math/index.d.ts +1 -0
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +1 -0
- package/lib/exercises/math/percent/applyPercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/applyPercent.js +2 -0
- package/lib/exercises/math/percent/findEndValueAfterEvolution.d.ts +8 -0
- package/lib/exercises/math/percent/findEndValueAfterEvolution.d.ts.map +1 -0
- package/lib/exercises/math/percent/findEndValueAfterEvolution.js +104 -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/powers/index.d.ts +1 -0
- package/lib/exercises/math/powers/index.d.ts.map +1 -1
- package/lib/exercises/math/powers/index.js +1 -0
- package/lib/exercises/math/powers/powersMixOperations.d.ts +11 -0
- package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -0
- package/lib/exercises/math/powers/powersMixOperations.js +99 -0
- package/lib/exercises/math/sampling/confidenceInterval.d.ts +9 -0
- package/lib/exercises/math/sampling/confidenceInterval.d.ts.map +1 -0
- package/lib/exercises/math/sampling/confidenceInterval.js +134 -0
- package/lib/exercises/math/sampling/fluctuationInterval.d.ts +9 -0
- package/lib/exercises/math/sampling/fluctuationInterval.d.ts.map +1 -0
- package/lib/exercises/math/sampling/fluctuationInterval.js +131 -0
- package/lib/exercises/math/sampling/index.d.ts +4 -0
- package/lib/exercises/math/sampling/index.d.ts.map +1 -0
- package/lib/exercises/math/sampling/index.js +19 -0
- package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts +11 -0
- package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts.map +1 -0
- package/lib/exercises/math/sampling/isSamplingRepresentative.js +116 -0
- package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts +9 -0
- package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricVariations.js +124 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -2
- package/lib/geogebra/parsers/parseGGBPoints.js +1 -1
- package/lib/index.d.ts +32 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/circle.d.ts +10 -0
- package/lib/math/geometry/circle.d.ts.map +1 -0
- package/lib/math/geometry/circle.js +33 -0
- package/lib/math/geometry/line.d.ts +1 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +10 -7
- package/lib/math/geometry/point.d.ts +3 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +11 -12
- package/lib/math/numbers/rationals/rational.d.ts +3 -1
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +3 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +6 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +15 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +8 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +4 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts +6 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/monomNode.js +126 -2
- package/lib/tree/parsers/affineParser.d.ts.map +1 -1
- package/lib/tree/parsers/affineParser.js +2 -1
- package/lib/tree/parsers/intervalParser.d.ts +8 -0
- package/lib/tree/parsers/intervalParser.d.ts.map +1 -0
- package/lib/tree/parsers/intervalParser.js +38 -0
- package/lib/tree/parsers/monomParser.d.ts +1 -3
- package/lib/tree/parsers/monomParser.d.ts.map +1 -1
- package/lib/tree/parsers/monomParser.js +7 -129
- package/lib/tree/parsers/polynomialParser.d.ts.map +1 -1
- package/lib/tree/parsers/polynomialParser.js +2 -1
- package/lib/tree/parsers/powerParser.d.ts +1 -1
- package/lib/tree/parsers/powerParser.d.ts.map +1 -1
- package/lib/tree/parsers/powerParser.js +2 -1
- package/lib/tree/parsers/trinomParser.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildPointFromAxialSymetry = void 0;
|
|
4
|
+
const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolBarConstructor");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
|
|
7
|
+
const ggbPointToCoords_1 = require("../../../../geogebra/parsers/ggbPointToCoords");
|
|
8
|
+
const parseGGBPoints_1 = require("../../../../geogebra/parsers/parseGGBPoints");
|
|
9
|
+
const circle_1 = require("../../../../math/geometry/circle");
|
|
10
|
+
const line_1 = require("../../../../math/geometry/line");
|
|
11
|
+
const point_1 = require("../../../../math/geometry/point");
|
|
12
|
+
const getInstruction = (identifiers) => {
|
|
13
|
+
return `Placer le point $A'$, symétrique du point $A$ par rapport à la droite $d$.`;
|
|
14
|
+
};
|
|
15
|
+
// const getHint : GetHint<Identifiers> = (identifiers)=>{
|
|
16
|
+
// }
|
|
17
|
+
// const getCorrection : GetCorrection<Identifiers> = (identifiers)=>{
|
|
18
|
+
// }
|
|
19
|
+
const getSolutionPoint = (identifiers) => {
|
|
20
|
+
const point = point_1.PointConstructor.fromIdentifiers(identifiers.point);
|
|
21
|
+
const line = line_1.LineConstructor.fromIdentifiers(identifiers.line);
|
|
22
|
+
return point.axialSymetric(line, "A'");
|
|
23
|
+
};
|
|
24
|
+
const getGGBAnswer = (identifiers) => {
|
|
25
|
+
const point = point_1.PointConstructor.fromIdentifiers(identifiers.point);
|
|
26
|
+
const sol = getSolutionPoint(identifiers);
|
|
27
|
+
const perp = new line_1.Line(point, sol);
|
|
28
|
+
const center = point.midpoint(sol);
|
|
29
|
+
const circle = new circle_1.Circle(center, point, "C");
|
|
30
|
+
return [
|
|
31
|
+
...sol.toGGBCommand(),
|
|
32
|
+
...perp.toGGBCommands(false),
|
|
33
|
+
...circle.toGGBCommands(false),
|
|
34
|
+
];
|
|
35
|
+
};
|
|
36
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
37
|
+
const point = point_1.PointConstructor.fromIdentifiers(identifiers.point);
|
|
38
|
+
const line = line_1.LineConstructor.fromIdentifiers(identifiers.line);
|
|
39
|
+
const commands = [
|
|
40
|
+
...point.toGGBCommand(),
|
|
41
|
+
...line.toGGBCommands(false, {
|
|
42
|
+
showLabel: true,
|
|
43
|
+
}),
|
|
44
|
+
];
|
|
45
|
+
const sol = getSolutionPoint(identifiers);
|
|
46
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor({
|
|
47
|
+
commands,
|
|
48
|
+
hideAxes: true,
|
|
49
|
+
hideGrid: true,
|
|
50
|
+
customToolBar: (0, toolBarConstructor_1.toolBarConstructor)({
|
|
51
|
+
orthogonal: true,
|
|
52
|
+
circleTwoPoints: true,
|
|
53
|
+
point: true,
|
|
54
|
+
intersect: true,
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
return ggb.getOptions({
|
|
58
|
+
coords: ggb.getCoordsForPoints([point, sol]),
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
62
|
+
const studentAns = ans.filter((c) => !["A"].includes(c[0]));
|
|
63
|
+
const points = (0, parseGGBPoints_1.parseGGBPoints)(studentAns)
|
|
64
|
+
.map((p) => (0, ggbPointToCoords_1.ggbPointToCoords)(p))
|
|
65
|
+
.map((coords) => new point_1.Point("K", coords.x, coords.y));
|
|
66
|
+
if (!points.length)
|
|
67
|
+
return false;
|
|
68
|
+
const solution = getSolutionPoint(identifiers);
|
|
69
|
+
if (points.some((p) => p.distanceTo(solution) < 0.001))
|
|
70
|
+
return true;
|
|
71
|
+
return false;
|
|
72
|
+
};
|
|
73
|
+
const getBuildPointFromAxialSymetryQuestion = () => {
|
|
74
|
+
const linePoints = point_1.PointConstructor.randomDifferent(2, {
|
|
75
|
+
names: ["B", "C"],
|
|
76
|
+
});
|
|
77
|
+
const line = new line_1.Line(linePoints[0], linePoints[1], "d");
|
|
78
|
+
const point = point_1.PointConstructor.random("A");
|
|
79
|
+
const identifiers = {
|
|
80
|
+
point: point.toIdentifiers(),
|
|
81
|
+
line: line.toIdentifiers(),
|
|
82
|
+
};
|
|
83
|
+
const question = {
|
|
84
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
85
|
+
instruction: getInstruction(identifiers),
|
|
86
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
87
|
+
identifiers,
|
|
88
|
+
// hint: getHint(identifiers),
|
|
89
|
+
// correction: getCorrection(identifiers)
|
|
90
|
+
};
|
|
91
|
+
return question;
|
|
92
|
+
};
|
|
93
|
+
exports.buildPointFromAxialSymetry = {
|
|
94
|
+
id: "buildPointFromAxialSymetry",
|
|
95
|
+
label: "Construire le symétrique d'un point par rapport à une droite",
|
|
96
|
+
isSingleStep: true,
|
|
97
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getBuildPointFromAxialSymetryQuestion(opts), nb),
|
|
98
|
+
ggbTimer: 60,
|
|
99
|
+
isGGBAnswerValid,
|
|
100
|
+
subject: "Mathématiques",
|
|
101
|
+
// getHint,
|
|
102
|
+
getInstruction,
|
|
103
|
+
// getCorrection,
|
|
104
|
+
getGGBAnswer,
|
|
105
|
+
getStudentGGBOptions,
|
|
106
|
+
answerType: "GGB",
|
|
107
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC"}
|
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./buildMediatriceWithCompass"), exports);
|
|
18
18
|
__exportStar(require("./buildTriangleWithSizes"), exports);
|
|
19
19
|
__exportStar(require("./pointImageFromTranslation"), exports);
|
|
20
|
+
__exportStar(require("./buildPointFromAxialSymetry"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/applyPercent.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"applyPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/applyPercent.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAGxB,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAoFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAwB9C,CAAC"}
|
|
@@ -65,6 +65,8 @@ const getPropositions = (n, { answer }) => {
|
|
|
65
65
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
66
66
|
while (propositions.length < n) {
|
|
67
67
|
const ansNb = Number(answer.replace(",", "."));
|
|
68
|
+
if (ansNb === 0)
|
|
69
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-10, 10) + "");
|
|
68
70
|
const deviation = Math.random() < 0.5 ? -1 : 1;
|
|
69
71
|
const percentDeviation = Math.random() * 20 + 1;
|
|
70
72
|
let wrongAnswer = ansNb + deviation * (percentDeviation / 100) * ansNb;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
vd: number;
|
|
4
|
+
percentRate: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const findEndValueAfterEvolution: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=findEndValueAfterEvolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findEndValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findEndValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA4FF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAkB5D,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findEndValueAfterEvolution = 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 multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
9
|
+
const euroParser_1 = require("../../../tree/parsers/euroParser");
|
|
10
|
+
const alignTex_1 = require("../../../utils/latex/alignTex");
|
|
11
|
+
const approxOrEqual_1 = require("../../../utils/latex/approxOrEqual");
|
|
12
|
+
const getPropositions = (n, { answer, percentRate, vd }) => {
|
|
13
|
+
const propositions = [];
|
|
14
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
15
|
+
const cm = 1 + percentRate / 100;
|
|
16
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(vd * percentRate, 2).frenchify());
|
|
17
|
+
const invCm = 1 - percentRate / 100;
|
|
18
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)(vd * invCm, 2).frenchify());
|
|
19
|
+
while (propositions.length < n) {
|
|
20
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, round_1.round)((0, randfloat_1.randfloat)(1, 100, 2), 2).frenchify());
|
|
21
|
+
}
|
|
22
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
23
|
+
};
|
|
24
|
+
const getAnswer = (identifiers) => {
|
|
25
|
+
const cm = 1 + identifiers.percentRate / 100;
|
|
26
|
+
const vf = (0, round_1.round)(identifiers.vd * cm, 2);
|
|
27
|
+
return vf.frenchify();
|
|
28
|
+
};
|
|
29
|
+
const getInstruction = (identifiers) => {
|
|
30
|
+
const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
|
|
31
|
+
return `Le prix initial d'un objet est $${identifiers.vd.frenchify()}€$. Quel sera son prix après une ${evolution} de $${identifiers.percentRate.frenchify()}\\%$ ? Arrondir au centième.`;
|
|
32
|
+
};
|
|
33
|
+
const getHint = (identifiers) => {
|
|
34
|
+
return `Transforme le taux d'évolution en coefficient multiplicateur. Puis, multiplie le prix initial par ce coefficient multiplicateur.`;
|
|
35
|
+
};
|
|
36
|
+
const getCorrection = (identifiers) => {
|
|
37
|
+
const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
|
|
38
|
+
const answer = getAnswer(identifiers);
|
|
39
|
+
const cm = (0, round_1.round)(1 + identifiers.percentRate / 100, 4);
|
|
40
|
+
const vd = identifiers.vd;
|
|
41
|
+
const percentRate = identifiers.percentRate;
|
|
42
|
+
return `Le coefficient multiplicateur associé à une ${evolution} de $${percentRate.frenchify()}\\%$ est :
|
|
43
|
+
|
|
44
|
+
${(0, alignTex_1.alignTex)([
|
|
45
|
+
["CM", "=", "1+\\frac{t}{100}"],
|
|
46
|
+
["", "=", `1+\\frac{${percentRate.frenchify()}}{100}`],
|
|
47
|
+
["", "=", cm.frenchify()],
|
|
48
|
+
])}
|
|
49
|
+
|
|
50
|
+
Si on note $V_d$ la valeur de départ et $V_a$ la valeur d'arrivée, alors on sait que :
|
|
51
|
+
|
|
52
|
+
$$
|
|
53
|
+
V_d\\times CM = V_a
|
|
54
|
+
$$
|
|
55
|
+
|
|
56
|
+
Le prix final arrondi au centième est donc :
|
|
57
|
+
|
|
58
|
+
${(0, alignTex_1.alignTex)([
|
|
59
|
+
["V_a", "=", (0, multiplyNode_1.multiply)(vd.frenchify(), cm.frenchify()).toTex()],
|
|
60
|
+
["", ...(0, approxOrEqual_1.approxOrEqual)(cm * vd, 2)],
|
|
61
|
+
])}
|
|
62
|
+
`;
|
|
63
|
+
};
|
|
64
|
+
const getKeys = (identifiers) => {
|
|
65
|
+
return [];
|
|
66
|
+
};
|
|
67
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
68
|
+
return (0, euroParser_1.euroParser)(ans) === answer + "€";
|
|
69
|
+
};
|
|
70
|
+
const getFindEndValueAfterEvolutionQuestion = () => {
|
|
71
|
+
const vd = (0, randfloat_1.randfloat)(1, 100, 2);
|
|
72
|
+
const percentRate = (0, randfloat_1.randfloat)(-100, 100, 2, [0]);
|
|
73
|
+
const identifiers = {
|
|
74
|
+
vd,
|
|
75
|
+
percentRate,
|
|
76
|
+
};
|
|
77
|
+
const question = {
|
|
78
|
+
answer: getAnswer(identifiers),
|
|
79
|
+
instruction: getInstruction(identifiers),
|
|
80
|
+
keys: getKeys(identifiers),
|
|
81
|
+
answerFormat: "tex",
|
|
82
|
+
identifiers,
|
|
83
|
+
hint: getHint(identifiers),
|
|
84
|
+
correction: getCorrection(identifiers),
|
|
85
|
+
};
|
|
86
|
+
return question;
|
|
87
|
+
};
|
|
88
|
+
exports.findEndValueAfterEvolution = {
|
|
89
|
+
id: "findEndValueAfterEvolution",
|
|
90
|
+
connector: "=",
|
|
91
|
+
label: "Retrouver un prix final à partir du prix initial et du taux d'évolution",
|
|
92
|
+
isSingleStep: true,
|
|
93
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getFindEndValueAfterEvolutionQuestion, nb),
|
|
94
|
+
qcmTimer: 60,
|
|
95
|
+
freeTimer: 60,
|
|
96
|
+
ggbTimer: 60,
|
|
97
|
+
getPropositions,
|
|
98
|
+
isAnswerValid,
|
|
99
|
+
subject: "Mathématiques",
|
|
100
|
+
getAnswer,
|
|
101
|
+
getCorrection,
|
|
102
|
+
getHint,
|
|
103
|
+
hasHintAndCorrection: true,
|
|
104
|
+
};
|
|
@@ -14,4 +14,5 @@ export * from "./evolutionRateFromValues";
|
|
|
14
14
|
export * from "./findStartValueAfterEvolution";
|
|
15
15
|
export * from "./subPopulationEffectifFromPercent";
|
|
16
16
|
export * from "./populationEffectifFromSubPopulation";
|
|
17
|
+
export * from "./findEndValueAfterEvolution";
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,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,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC"}
|
|
@@ -30,3 +30,4 @@ __exportStar(require("./evolutionRateFromValues"), exports);
|
|
|
30
30
|
__exportStar(require("./findStartValueAfterEvolution"), exports);
|
|
31
31
|
__exportStar(require("./subPopulationEffectifFromPercent"), exports);
|
|
32
32
|
__exportStar(require("./populationEffectifFromSubPopulation"), exports);
|
|
33
|
+
__exportStar(require("./findEndValueAfterEvolution"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./powersOfTenToDecimal"), exports);
|
|
|
23
23
|
__exportStar(require("./powersPower"), exports);
|
|
24
24
|
__exportStar(require("./powersProduct"), exports);
|
|
25
25
|
__exportStar(require("./scientificToDecimal"), exports);
|
|
26
|
+
__exportStar(require("./powersMixOperations"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
k: number;
|
|
6
|
+
l: number;
|
|
7
|
+
m: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const powersMixOperations: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=powersMixOperations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"powersMixOperations.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersMixOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwFF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAgBrD,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.powersMixOperations = 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 fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
8
|
+
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
9
|
+
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
10
|
+
const powerParser_1 = require("../../../tree/parsers/powerParser");
|
|
11
|
+
const doWhile_1 = require("../../../utils/doWhile");
|
|
12
|
+
const getStatementNode = (identifiers) => {
|
|
13
|
+
const { a, b, k, l, m } = identifiers;
|
|
14
|
+
const n = k + l * m;
|
|
15
|
+
return (0, fractionNode_1.frac)((0, multiplyNode_1.multiply)((0, powerNode_1.power)(a, k), (0, powerNode_1.power)((0, powerNode_1.power)(a, l), m)), (0, powerNode_1.power)(b, n));
|
|
16
|
+
};
|
|
17
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
18
|
+
const propositions = [];
|
|
19
|
+
const { a, b, k, l, m } = identifiers;
|
|
20
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
21
|
+
const ratio = (0, fractionNode_1.frac)(a, b).simplify();
|
|
22
|
+
while (propositions.length < n) {
|
|
23
|
+
const rand = (0, randint_1.randint)(2, 10);
|
|
24
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, (0, powerNode_1.power)(ratio, rand).toTex());
|
|
25
|
+
}
|
|
26
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
27
|
+
};
|
|
28
|
+
const getAnswer = (identifiers) => {
|
|
29
|
+
const statement = getStatementNode(identifiers);
|
|
30
|
+
return statement.simplify({ keepPowers: true }).toTex();
|
|
31
|
+
};
|
|
32
|
+
const getInstruction = (identifiers) => {
|
|
33
|
+
return `Écrire sous la forme d'une seule puissance :
|
|
34
|
+
|
|
35
|
+
$$
|
|
36
|
+
${getStatementNode(identifiers).toTex()}
|
|
37
|
+
$$`;
|
|
38
|
+
};
|
|
39
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {
|
|
40
|
+
// return ``;
|
|
41
|
+
// };
|
|
42
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
|
|
43
|
+
// return ``;
|
|
44
|
+
// };
|
|
45
|
+
const getKeys = (identifiers) => {
|
|
46
|
+
return [];
|
|
47
|
+
};
|
|
48
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
49
|
+
try {
|
|
50
|
+
const parsed = (0, powerParser_1.powerParser)(ans);
|
|
51
|
+
if (!parsed)
|
|
52
|
+
return false;
|
|
53
|
+
return parsed.simplify({ keepPowers: true }).toTex() === answer;
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const getPowersMixOperationsQuestion = (ops) => {
|
|
60
|
+
const finalPower = (0, randint_1.randint)(2, 10);
|
|
61
|
+
const a = (0, randint_1.randint)(2, 10);
|
|
62
|
+
const b = (0, randint_1.randint)(2, 10, [a]);
|
|
63
|
+
const l = (0, randint_1.randint)(-5, 6, [0, 1]);
|
|
64
|
+
const m = (0, doWhile_1.doWhile)(() => (0, randint_1.randint)(2, 6), (x) => x * l === finalPower);
|
|
65
|
+
const k = finalPower - l * m;
|
|
66
|
+
const identifiers = {
|
|
67
|
+
a,
|
|
68
|
+
b,
|
|
69
|
+
k,
|
|
70
|
+
l,
|
|
71
|
+
m,
|
|
72
|
+
};
|
|
73
|
+
const question = {
|
|
74
|
+
answer: getAnswer(identifiers),
|
|
75
|
+
instruction: getInstruction(identifiers),
|
|
76
|
+
keys: getKeys(identifiers),
|
|
77
|
+
answerFormat: "tex",
|
|
78
|
+
identifiers,
|
|
79
|
+
// hint: getHint(identifiers),
|
|
80
|
+
// correction: getCorrection(identifiers),
|
|
81
|
+
};
|
|
82
|
+
return question;
|
|
83
|
+
};
|
|
84
|
+
exports.powersMixOperations = {
|
|
85
|
+
id: "powersMixOperations",
|
|
86
|
+
connector: "=",
|
|
87
|
+
label: "Calculs avec des puissances : mélange d'opérations",
|
|
88
|
+
isSingleStep: true,
|
|
89
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getPowersMixOperationsQuestion(opts), nb),
|
|
90
|
+
qcmTimer: 60,
|
|
91
|
+
freeTimer: 60,
|
|
92
|
+
getPropositions,
|
|
93
|
+
isAnswerValid,
|
|
94
|
+
subject: "Mathématiques",
|
|
95
|
+
getInstruction,
|
|
96
|
+
// getHint,
|
|
97
|
+
// getCorrection,
|
|
98
|
+
getAnswer,
|
|
99
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confidenceInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sampling/confidenceInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAyHF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAiBpD,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.confidenceInterval = 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 addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
11
|
+
const fractionNode_1 = require("../../../tree/nodes/operators/fractionNode");
|
|
12
|
+
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
13
|
+
const closure_1 = require("../../../tree/nodes/sets/closure");
|
|
14
|
+
const intervalNode_1 = require("../../../tree/nodes/sets/intervalNode");
|
|
15
|
+
const intervalParser_1 = require("../../../tree/parsers/intervalParser");
|
|
16
|
+
const coinFlip_1 = require("../../../utils/alea/coinFlip");
|
|
17
|
+
const alignTex_1 = require("../../../utils/latex/alignTex");
|
|
18
|
+
const approxOrEqual_1 = require("../../../utils/latex/approxOrEqual");
|
|
19
|
+
const getPropositions = (nb, { answer, n, k, wordingType }) => {
|
|
20
|
+
const propositions = [];
|
|
21
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
22
|
+
while (propositions.length < nb) {
|
|
23
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, getAnswer({
|
|
24
|
+
n: (0, coinFlip_1.coinFlip)() ? n : 50 * (0, randint_1.randint)(1, 20),
|
|
25
|
+
k: (0, coinFlip_1.coinFlip)() ? k : (0, randfloat_1.randfloat)(0.2, 0.8, 2),
|
|
26
|
+
wordingType,
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
return (0, exercise_1.shuffleProps)(propositions, nb);
|
|
30
|
+
};
|
|
31
|
+
const getAnswer = (identifiers) => {
|
|
32
|
+
const { k, n } = identifiers;
|
|
33
|
+
const freq = k / n;
|
|
34
|
+
const oneOverSqrt = 1 / Math.sqrt(n);
|
|
35
|
+
const a = (0, round_1.round)(freq - oneOverSqrt, 2);
|
|
36
|
+
const b = (0, round_1.round)(freq + oneOverSqrt, 2);
|
|
37
|
+
return new intervalNode_1.IntervalNode(a.toTree(), b.toTree(), closure_1.ClosureType.FF).toTex();
|
|
38
|
+
};
|
|
39
|
+
const getInstruction = (identifiers) => {
|
|
40
|
+
const { k, n, wordingType } = identifiers;
|
|
41
|
+
switch (wordingType) {
|
|
42
|
+
case 1:
|
|
43
|
+
return `Un sondage effectué au sein d'un lycée montre que $${k}$ des $${n}$ élèves ont subi du harcèlement scolaire au lycée. À partir de ce sondage, à quel intervalle devrait appartenir la proportion nationale $p$ du harcèlement scolaire au lycée, au seuil de $95\\%$ ?`;
|
|
44
|
+
case 2:
|
|
45
|
+
return `Une étude sur la consommation de boissons énergétiques révèle que, sur un échantillon de $${n}$ personnes, $${k}$ déclarent en consommer régulièrement. À partir de cette étude, à quel intervalle devrait appartenir la proportion nationale $p$ de consomateurs de boissons énergétiques, au seuil de $95\\%$ ?`;
|
|
46
|
+
case 3:
|
|
47
|
+
default:
|
|
48
|
+
return `Une enquête relève que sur un échantillon de $${n}$ collégiens, $${k}$ utilisent les réseaux sociaux quotidiennement. À partir de cette enquête, à quel intervalle devrait appartenir la proportion nationale $p$ de collégiens qui utilisent les réseaux sociaux quotidiennement, au seuil de $95\\%$ ?`;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const getHint = (identifiers) => {
|
|
52
|
+
return `Si $f$ est la fréquence observée et $n$ est la taille de l'échantillon, alors l'intervalle de confiance au seuil de $95\\%$ est :
|
|
53
|
+
|
|
54
|
+
$$
|
|
55
|
+
\\left[f-\\frac{1}{\\sqrt{n}}; f+\\frac{1}{\\sqrt{n}}\\right]
|
|
56
|
+
$$
|
|
57
|
+
|
|
58
|
+
Cela signifie qu'on peut affirmer avec un taux de certitude de $95\\%$ que la proportion théorique est comprise entre $f-\\frac{1}{\\sqrt{n}}$ et $f+\\frac{1}{\\sqrt{n}}$.`;
|
|
59
|
+
};
|
|
60
|
+
const getCorrection = (identifiers) => {
|
|
61
|
+
const { k, n } = identifiers;
|
|
62
|
+
const freq = (0, round_1.round)(k / n, 2);
|
|
63
|
+
const oneOverSqrt = 1 / Math.sqrt(n);
|
|
64
|
+
const answer = getAnswer(identifiers);
|
|
65
|
+
const a = (0, substractNode_1.substract)(freq, (0, fractionNode_1.frac)(1, (0, sqrtNode_1.sqrt)(n))).toTex();
|
|
66
|
+
const b = (0, addNode_1.add)(freq, (0, fractionNode_1.frac)(1, (0, sqrtNode_1.sqrt)(n))).toTex();
|
|
67
|
+
return `La fréquence observée $f$ est $f = ${(0, fractionNode_1.frac)(k, n).toTex()} ${(0, approxOrEqual_1.approxOrEqual)(k / n, 2).join("")}$.
|
|
68
|
+
|
|
69
|
+
La taille de l'échantillon $n$ est $n = ${n.frenchify()}$.
|
|
70
|
+
|
|
71
|
+
On sait que l'intervalle de confiance au seuil de $95\\%$ est :
|
|
72
|
+
|
|
73
|
+
$$
|
|
74
|
+
\\left[f-\\frac{1}{\\sqrt{n}}; f+\\frac{1}{\\sqrt{n}}\\right]
|
|
75
|
+
$$
|
|
76
|
+
|
|
77
|
+
On peut donc affirmer avec un taux de certitude de $95\\%$ que la probabilité théorique $p$ devrait appartenir à l'intervalle :
|
|
78
|
+
|
|
79
|
+
${(0, alignTex_1.alignTex)([
|
|
80
|
+
["", `\\left[ ${a} ; ${b} \\right]`],
|
|
81
|
+
["=", answer],
|
|
82
|
+
])}
|
|
83
|
+
`;
|
|
84
|
+
};
|
|
85
|
+
const getKeys = (identifiers) => {
|
|
86
|
+
return ["lbracket", "semicolon", "rbracket"];
|
|
87
|
+
};
|
|
88
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
89
|
+
try {
|
|
90
|
+
const parsed = (0, intervalParser_1.intervalParser)(ans);
|
|
91
|
+
if (!parsed)
|
|
92
|
+
return false;
|
|
93
|
+
return parsed.toTex() === answer;
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const getConfidenceIntervalQuestion = (ops) => {
|
|
100
|
+
const n = 50 * (0, randint_1.randint)(1, 20);
|
|
101
|
+
const k = (0, randint_1.randint)(10, n - 10);
|
|
102
|
+
const identifiers = {
|
|
103
|
+
k,
|
|
104
|
+
n,
|
|
105
|
+
wordingType: (0, randint_1.randint)(1, 4),
|
|
106
|
+
};
|
|
107
|
+
const question = {
|
|
108
|
+
answer: getAnswer(identifiers),
|
|
109
|
+
instruction: getInstruction(identifiers),
|
|
110
|
+
keys: getKeys(identifiers),
|
|
111
|
+
answerFormat: "tex",
|
|
112
|
+
identifiers,
|
|
113
|
+
hint: getHint(identifiers),
|
|
114
|
+
correction: getCorrection(identifiers),
|
|
115
|
+
};
|
|
116
|
+
return question;
|
|
117
|
+
};
|
|
118
|
+
exports.confidenceInterval = {
|
|
119
|
+
id: "confidenceInterval",
|
|
120
|
+
connector: "=",
|
|
121
|
+
label: "Déterminer l'intervalle de confiance au seuil de $95\\%$",
|
|
122
|
+
isSingleStep: true,
|
|
123
|
+
generator: (nb, opts) => (0, getDistinctQuestions_1.getDistinctQuestions)(() => getConfidenceIntervalQuestion(opts), nb),
|
|
124
|
+
qcmTimer: 60,
|
|
125
|
+
freeTimer: 60,
|
|
126
|
+
getPropositions,
|
|
127
|
+
isAnswerValid,
|
|
128
|
+
subject: "Mathématiques",
|
|
129
|
+
getInstruction,
|
|
130
|
+
getHint,
|
|
131
|
+
getCorrection,
|
|
132
|
+
getAnswer,
|
|
133
|
+
hasHintAndCorrection: true,
|
|
134
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
p: number;
|
|
4
|
+
n: number;
|
|
5
|
+
wordingType: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const fluctuationInterval: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=fluctuationInterval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluctuationInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sampling/fluctuationInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,0BAA0B,CAAC;AAiBlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAiHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
|