math-exercises 3.0.93 → 3.0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +0 -9
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +0 -9
- package/lib/exercises/math/calcul/decimals/decimalBoundingOnLine.d.ts +9 -0
- package/lib/exercises/math/calcul/decimals/decimalBoundingOnLine.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/decimalBoundingOnLine.js +171 -0
- package/lib/exercises/math/calcul/decimals/index.d.ts +1 -0
- package/lib/exercises/math/calcul/decimals/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/index.js +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts +0 -1
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +0 -1
- package/lib/exercises/math/functions/basics/countFunctionZeroes.d.ts +11 -0
- package/lib/exercises/math/functions/basics/countFunctionZeroes.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/countFunctionZeroes.js +197 -0
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.d.ts +11 -0
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.js +213 -0
- package/lib/exercises/math/functions/basics/index.d.ts +3 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +3 -1
- package/lib/exercises/math/functions/basics/isPointOnFunction.d.ts +10 -0
- package/lib/exercises/math/functions/basics/isPointOnFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/isPointOnFunction.js +133 -0
- package/lib/exercises/math/functions/cube/index.d.ts +1 -0
- package/lib/exercises/math/functions/cube/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/cube/index.js +1 -0
- package/lib/exercises/math/functions/cube/isPointOnCubicFunction.d.ts +9 -0
- package/lib/exercises/math/functions/cube/isPointOnCubicFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/cube/isPointOnCubicFunction.js +111 -0
- package/lib/exercises/math/functions/inverse/compareInverseValues.d.ts +10 -0
- package/lib/exercises/math/functions/inverse/compareInverseValues.d.ts.map +1 -0
- package/lib/exercises/math/functions/inverse/compareInverseValues.js +136 -0
- package/lib/exercises/math/functions/inverse/index.d.ts +3 -0
- package/lib/exercises/math/functions/inverse/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/inverse/index.js +2 -0
- package/lib/exercises/math/functions/inverse/isPointOnReciprocalFunction.d.ts +9 -0
- package/lib/exercises/math/functions/inverse/isPointOnReciprocalFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/inverse/isPointOnReciprocalFunction.js +117 -0
- package/lib/exercises/math/functions/sign/equationFromSignTable.d.ts +4 -1
- package/lib/exercises/math/functions/sign/equationFromSignTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/equationFromSignTable.js +25 -10
- package/lib/exercises/math/functions/sqrt/getImageOfSquareRootFunction.d.ts +8 -0
- package/lib/exercises/math/functions/sqrt/getImageOfSquareRootFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/sqrt/getImageOfSquareRootFunction.js +128 -0
- package/lib/exercises/math/functions/sqrt/index.d.ts +1 -0
- package/lib/exercises/math/functions/sqrt/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/sqrt/index.js +1 -0
- package/lib/exercises/math/functions/square/compareSquaredValues.d.ts +9 -0
- package/lib/exercises/math/functions/square/compareSquaredValues.d.ts.map +1 -0
- package/lib/exercises/math/functions/square/compareSquaredValues.js +143 -0
- package/lib/exercises/math/functions/square/imageOfSquareFunction.d.ts +8 -0
- package/lib/exercises/math/functions/square/imageOfSquareFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/square/imageOfSquareFunction.js +152 -0
- package/lib/exercises/math/functions/square/index.d.ts +2 -1
- package/lib/exercises/math/functions/square/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/square/index.js +3 -1
- package/lib/exercises/math/functions/square/squareImageIntervalWithGraph.d.ts +11 -0
- package/lib/exercises/math/functions/square/squareImageIntervalWithGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/square/squareImageIntervalWithGraph.js +174 -0
- package/lib/exercises/math/functions/variations/index.d.ts +1 -0
- package/lib/exercises/math/functions/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/index.js +1 -0
- package/lib/exercises/math/functions/variations/partialVarTableFromGraph.d.ts +10 -0
- package/lib/exercises/math/functions/variations/partialVarTableFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/variations/partialVarTableFromGraph.js +198 -0
- package/lib/exercises/math/functions/variations/varTableFromSentences.d.ts +2 -0
- package/lib/exercises/math/functions/variations/varTableFromSentences.d.ts.map +1 -0
- package/lib/exercises/math/functions/variations/varTableFromSentences.js +137 -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/powerNotation.d.ts +9 -0
- package/lib/exercises/math/powers/powerNotation.d.ts.map +1 -0
- package/lib/exercises/math/powers/powerNotation.js +126 -0
- package/lib/exercises/math/sets/index.d.ts +1 -0
- package/lib/exercises/math/sets/index.d.ts.map +1 -1
- package/lib/exercises/math/sets/index.js +1 -0
- package/lib/exercises/math/sets/isNumberDecimal.d.ts +11 -0
- package/lib/exercises/math/sets/isNumberDecimal.d.ts.map +1 -0
- package/lib/exercises/math/sets/isNumberDecimal.js +144 -0
- package/lib/index.d.ts +48 -42
- package/lib/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -8,15 +8,6 @@ export * from "./divisibiltyCriteria.js";
|
|
|
8
8
|
export * from "./ppcmCalcul.js";
|
|
9
9
|
export * from "./getParityBetweenTwoNumbers.js";
|
|
10
10
|
export * from "./primeNumberIdentification.js";
|
|
11
|
-
export * from "./imageOfSquareFunction.js";
|
|
12
|
-
export * from "./isNumberDecimal.js";
|
|
13
|
-
export * from "./isPointOnCubicFunction.js";
|
|
14
|
-
export * from "./isPointOnReciprocalFunction.js";
|
|
15
|
-
export * from "./isPointOnFunction.js";
|
|
16
11
|
export * from "./whichMultipleAmI.js";
|
|
17
12
|
export * from "./isMultipleOrDivisor.js";
|
|
18
|
-
export * from "./compareInverseValues.js";
|
|
19
|
-
export * from "./compareSquaredValues.js";
|
|
20
|
-
export * from "./decimalBoundingOnLine.js";
|
|
21
|
-
export * from "./findZeroesProductQuotient.js";
|
|
22
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC"}
|
|
@@ -8,14 +8,5 @@ export * from "./divisibiltyCriteria.js";
|
|
|
8
8
|
export * from "./ppcmCalcul.js";
|
|
9
9
|
export * from "./getParityBetweenTwoNumbers.js";
|
|
10
10
|
export * from "./primeNumberIdentification.js";
|
|
11
|
-
export * from "./imageOfSquareFunction.js";
|
|
12
|
-
export * from "./isNumberDecimal.js";
|
|
13
|
-
export * from "./isPointOnCubicFunction.js";
|
|
14
|
-
export * from "./isPointOnReciprocalFunction.js";
|
|
15
|
-
export * from "./isPointOnFunction.js";
|
|
16
11
|
export * from "./whichMultipleAmI.js";
|
|
17
12
|
export * from "./isMultipleOrDivisor.js";
|
|
18
|
-
export * from "./compareInverseValues.js";
|
|
19
|
-
export * from "./compareSquaredValues.js";
|
|
20
|
-
export * from "./decimalBoundingOnLine.js";
|
|
21
|
-
export * from "./findZeroesProductQuotient.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
point: PointIdentifiers;
|
|
5
|
+
bounding: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const decimalBoundingOnLine: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=decimalBoundingOnLine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decimalBoundingOnLine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/decimalBoundingOnLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAUtC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAkMF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAmBvD,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
6
|
+
import { round } from "../../../../math/utils/round.js";
|
|
7
|
+
import { InequationNode } from "../../../../tree/nodes/inequations/inequationNode.js";
|
|
8
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
9
|
+
import { doWhile } from "../../../../utils/doWhile.js";
|
|
10
|
+
const getPropositions = (n, context) => {
|
|
11
|
+
const { answer, point, bounding } = context;
|
|
12
|
+
const propositions = [];
|
|
13
|
+
addValidProp(propositions, answer);
|
|
14
|
+
const pointObj = PointConstructor.fromIdentifiers(point);
|
|
15
|
+
const x = round(pointObj.x.evaluate(), 2);
|
|
16
|
+
const vNode = new VariableNode(pointObj.name.toLocaleLowerCase());
|
|
17
|
+
const correctLower = round(Math.floor(x / bounding) * bounding, 2);
|
|
18
|
+
const correctUpper = round(correctLower + bounding, 2);
|
|
19
|
+
while (propositions.length < n) {
|
|
20
|
+
let wrongLower = round(correctLower + randfloat(-2, 2, 1), 1);
|
|
21
|
+
let wrongUpper = round(correctUpper + randfloat(-2, 2, 1), 1);
|
|
22
|
+
const node = new InequationNode([wrongLower.toTree(), vNode, wrongUpper.toTree()], ["<", "<"]);
|
|
23
|
+
tryToAddWrongProp(propositions, node.toTex());
|
|
24
|
+
}
|
|
25
|
+
return shuffleProps(propositions, n);
|
|
26
|
+
};
|
|
27
|
+
const getAnswer = ({ point, bounding }) => {
|
|
28
|
+
const pointObj = PointConstructor.fromIdentifiers(point);
|
|
29
|
+
const x = round(pointObj.x.evaluate(), 2);
|
|
30
|
+
const lowerBound = round(Math.floor(x / bounding) * bounding, 2);
|
|
31
|
+
const upperBound = round(lowerBound + bounding, 2);
|
|
32
|
+
const vNode = new VariableNode(pointObj.name.toLocaleLowerCase());
|
|
33
|
+
const inequation = new InequationNode([lowerBound.toTree(), vNode, upperBound.toTree()], ["<", "<"]);
|
|
34
|
+
return `${inequation.toTex()}`;
|
|
35
|
+
};
|
|
36
|
+
const getInstruction = ({ point, bounding }) => {
|
|
37
|
+
const pointObj = PointConstructor.fromIdentifiers(point);
|
|
38
|
+
return `Déterminer un encadrement décimal d'amplitude $${bounding.frenchify()}$ du nombre réel $${pointObj.name.toLocaleLowerCase()}$.
|
|
39
|
+
|
|
40
|
+
Donner une réponse sous la forme : $x < a < y$.`;
|
|
41
|
+
};
|
|
42
|
+
const getHint = ({ point }) => {
|
|
43
|
+
return `Pour encadrer le nombre, repère les deux nombres décimaux consécutifs de part et d'autre du nombre $${point.name.toLocaleLowerCase()}$. Cela donne un encadrement sous la forme $x<a<y$.
|
|
44
|
+
|
|
45
|
+
Par exemple, un encadrement à $10^{-1}$ de $14,25$ est :
|
|
46
|
+
|
|
47
|
+
$$
|
|
48
|
+
14,2 < 14,25 < 14,3
|
|
49
|
+
$$`;
|
|
50
|
+
};
|
|
51
|
+
const getCorrection = ({ point, bounding }) => {
|
|
52
|
+
const pointObj = PointConstructor.fromIdentifiers(point);
|
|
53
|
+
const x = round(pointObj.x.evaluate(), 2);
|
|
54
|
+
const firstDiv = round(x / bounding, 2);
|
|
55
|
+
const quotient = Math.floor(x / bounding);
|
|
56
|
+
const lowerBound = round(quotient * bounding, 2);
|
|
57
|
+
const upperBound = round(lowerBound + bounding, 2);
|
|
58
|
+
const inequation = getAnswer({ point, bounding });
|
|
59
|
+
const name = pointObj.name.toLocaleLowerCase();
|
|
60
|
+
return `On lit sur la droite que $${name} > ${lowerBound.frenchify()}$ et $${name} < ${upperBound.frenchify()}$.
|
|
61
|
+
|
|
62
|
+
Ainsi, un encadrement à $${bounding.frenchify()}$ de $${name}$ est :
|
|
63
|
+
|
|
64
|
+
$$
|
|
65
|
+
${inequation}
|
|
66
|
+
$$`;
|
|
67
|
+
};
|
|
68
|
+
const getGGBOptions = ({ point, bounding }) => {
|
|
69
|
+
const A = PointConstructor.fromIdentifiers(point);
|
|
70
|
+
const commands = [
|
|
71
|
+
...A.toGGBCommand({
|
|
72
|
+
style: 3,
|
|
73
|
+
size: 4,
|
|
74
|
+
label: "a",
|
|
75
|
+
}),
|
|
76
|
+
];
|
|
77
|
+
const ggb = new GeogebraConstructor({
|
|
78
|
+
commands,
|
|
79
|
+
forbidShiftDragZoom: true,
|
|
80
|
+
// gridDistance: [0.5, 1],
|
|
81
|
+
xAxis: {
|
|
82
|
+
hideNumbers: false,
|
|
83
|
+
steps: 0.1,
|
|
84
|
+
},
|
|
85
|
+
yAxis: {
|
|
86
|
+
hidden: true,
|
|
87
|
+
},
|
|
88
|
+
maxHeight: 100,
|
|
89
|
+
fontSize: 20,
|
|
90
|
+
});
|
|
91
|
+
return ggb.getOptions({
|
|
92
|
+
coords: [A.x.evaluate() - 2.2, A.x.evaluate() + 2.2, -0.2, 0.2],
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const getKeys = (identifiers) => {
|
|
96
|
+
return ["inf", "a"];
|
|
97
|
+
};
|
|
98
|
+
function parseInequationFromUser(input) {
|
|
99
|
+
const clean = input.replace(/\\text\{([A-Za-z])\}/g, "$1").replace(/\s/g, "");
|
|
100
|
+
const match = clean.match(/^([-\d,]+)(<|\\leq)([A-Za-z])(<|\\leq)([-\d,]+)$/);
|
|
101
|
+
if (!match)
|
|
102
|
+
return null;
|
|
103
|
+
const [, lowerStr, sym1, variableRaw, sym2, upperStr] = match;
|
|
104
|
+
const symbolMap = {
|
|
105
|
+
"<": "<",
|
|
106
|
+
"\\le": "\\le",
|
|
107
|
+
};
|
|
108
|
+
const variable = variableRaw.toUpperCase();
|
|
109
|
+
return {
|
|
110
|
+
lower: lowerStr.unfrenchify(),
|
|
111
|
+
upper: upperStr.unfrenchify(),
|
|
112
|
+
variable,
|
|
113
|
+
symbols: [symbolMap[sym1], symbolMap[sym2]],
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function constructInequationNodeFromParsed(parsed) {
|
|
117
|
+
const lowerNode = parsed.lower.toTree();
|
|
118
|
+
const upperNode = parsed.upper.toTree();
|
|
119
|
+
const variableNode = new VariableNode(parsed.variable);
|
|
120
|
+
return new InequationNode([lowerNode, variableNode, upperNode], parsed.symbols);
|
|
121
|
+
}
|
|
122
|
+
const isAnswerValid = (ans, { point, bounding, answer }) => {
|
|
123
|
+
// const parsed = parseInequationFromUser(ans);
|
|
124
|
+
// if (!parsed) return false;
|
|
125
|
+
// const userNode = constructInequationNodeFromParsed(parsed);
|
|
126
|
+
// return userNode.toTex() === answer;
|
|
127
|
+
return ans === answer;
|
|
128
|
+
};
|
|
129
|
+
const getDecimalBoundingOnLineQuestion = () => {
|
|
130
|
+
const x = doWhile(() => randfloat(-5, 5, 7), (a) => Math.abs(round(a, 1) - a) < 0.025);
|
|
131
|
+
const point = new Point("A", x, 0);
|
|
132
|
+
// const bounding = randfloat(0.1, 0.4, 1);
|
|
133
|
+
const bounding = 0.1;
|
|
134
|
+
const pointIdentifier = point.toIdentifiers();
|
|
135
|
+
const identifiers = {
|
|
136
|
+
point: pointIdentifier,
|
|
137
|
+
bounding,
|
|
138
|
+
};
|
|
139
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
140
|
+
};
|
|
141
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
142
|
+
return {
|
|
143
|
+
answer: getAnswer(identifiers),
|
|
144
|
+
instruction: getInstruction(identifiers),
|
|
145
|
+
keys: getKeys(identifiers),
|
|
146
|
+
answerFormat: "tex",
|
|
147
|
+
identifiers,
|
|
148
|
+
hint: getHint(identifiers),
|
|
149
|
+
correction: getCorrection(identifiers),
|
|
150
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
export const decimalBoundingOnLine = {
|
|
154
|
+
id: "decimalBoundingOnLine",
|
|
155
|
+
label: "Donner un encadrement d'un nombre placé sur une droite graduée",
|
|
156
|
+
isSingleStep: true,
|
|
157
|
+
generator: (nb) => getDistinctQuestions(() => getDecimalBoundingOnLineQuestion(), nb),
|
|
158
|
+
qcmTimer: 60,
|
|
159
|
+
freeTimer: 60,
|
|
160
|
+
getPropositions,
|
|
161
|
+
isAnswerValid,
|
|
162
|
+
subject: "Mathématiques",
|
|
163
|
+
getHint,
|
|
164
|
+
getCorrection,
|
|
165
|
+
getInstruction,
|
|
166
|
+
getAnswer,
|
|
167
|
+
getGGBOptions,
|
|
168
|
+
hasGeogebra: true,
|
|
169
|
+
getQuestionFromIdentifiers,
|
|
170
|
+
hasHintAndCorrection: true,
|
|
171
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC"}
|
|
@@ -14,7 +14,6 @@ export * from "./fractionsSumsPrimeDenominators.js";
|
|
|
14
14
|
export * from "./fractionsOperations.js";
|
|
15
15
|
export * from "./fractionSquare.js";
|
|
16
16
|
export * from "./fractionsSubstraction.js";
|
|
17
|
-
export * from "./powerNotation.js";
|
|
18
17
|
export * from "./fractionForbiddenValue.js";
|
|
19
18
|
export * from "./simplifyToFraction.js";
|
|
20
19
|
export * from "./evalFractionExpression.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC"}
|
|
@@ -14,7 +14,6 @@ export * from "./fractionsSumsPrimeDenominators.js";
|
|
|
14
14
|
export * from "./fractionsOperations.js";
|
|
15
15
|
export * from "./fractionSquare.js";
|
|
16
16
|
export * from "./fractionsSubstraction.js";
|
|
17
|
-
export * from "./powerNotation.js";
|
|
18
17
|
export * from "./fractionForbiddenValue.js";
|
|
19
18
|
export * from "./simplifyToFraction.js";
|
|
20
19
|
export * from "./evalFractionExpression.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
type: number;
|
|
4
|
+
a: number;
|
|
5
|
+
b: number;
|
|
6
|
+
c: number;
|
|
7
|
+
d: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const countFunctionZeroes: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=countFunctionZeroes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countFunctionZeroes.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/countFunctionZeroes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AA0BrC,KAAK,WAAW,GAAG;IAEjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyMF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
4
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { frac, } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
7
|
+
import { multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
9
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
10
|
+
const getPropositions = (n, { answer }) => {
|
|
11
|
+
const propositions = [];
|
|
12
|
+
addValidProp(propositions, answer);
|
|
13
|
+
tryToAddWrongProp(propositions, "0");
|
|
14
|
+
tryToAddWrongProp(propositions, "1");
|
|
15
|
+
tryToAddWrongProp(propositions, "2");
|
|
16
|
+
tryToAddWrongProp(propositions, "3");
|
|
17
|
+
return shuffleProps(propositions, n);
|
|
18
|
+
};
|
|
19
|
+
const getAnswer = (identifiers) => {
|
|
20
|
+
if (identifiers.type === 2) {
|
|
21
|
+
return "2";
|
|
22
|
+
}
|
|
23
|
+
if (identifiers.type === 0) {
|
|
24
|
+
return "0";
|
|
25
|
+
}
|
|
26
|
+
return "1";
|
|
27
|
+
};
|
|
28
|
+
const getFunc = (identifiers) => {
|
|
29
|
+
const { type, a, b, c, d } = identifiers;
|
|
30
|
+
if (type === 0) {
|
|
31
|
+
return a.frenchify();
|
|
32
|
+
}
|
|
33
|
+
if (type === 1) {
|
|
34
|
+
return new Affine(a, b).toTree().toTex();
|
|
35
|
+
}
|
|
36
|
+
if (type === 2) {
|
|
37
|
+
return multiply(new Affine(a, b).toTree(), new Affine(c, d).toTree()).toTex();
|
|
38
|
+
}
|
|
39
|
+
return frac(new Affine(a, b).toTree(), new Affine(c, d).toTree()).toTex();
|
|
40
|
+
};
|
|
41
|
+
const getInstruction = (identifiers) => {
|
|
42
|
+
return `Déterminer le nombre de valeurs d'annulation de la fonction suivante :
|
|
43
|
+
|
|
44
|
+
$$
|
|
45
|
+
f(x) = ${getFunc(identifiers)}
|
|
46
|
+
$$`;
|
|
47
|
+
};
|
|
48
|
+
const getHint = (identifiers) => {
|
|
49
|
+
const { type, a, b, c, d } = identifiers;
|
|
50
|
+
switch (type) {
|
|
51
|
+
case 0:
|
|
52
|
+
break;
|
|
53
|
+
case 1:
|
|
54
|
+
break;
|
|
55
|
+
case 2:
|
|
56
|
+
break;
|
|
57
|
+
case 3:
|
|
58
|
+
default:
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
return `Quelles sont les valeurs de $x$ telles que $f(x) = 0$ ?`;
|
|
62
|
+
};
|
|
63
|
+
const getCorrection = (identifiers) => {
|
|
64
|
+
const { type, a, b, c, d } = identifiers;
|
|
65
|
+
switch (type) {
|
|
66
|
+
case 0:
|
|
67
|
+
return `La fonction $f$ est constante égale à $${a.frenchify()}$.
|
|
68
|
+
|
|
69
|
+
Il n'y a donc aucune valeur de $x$ telle que $f(x) = 0$.
|
|
70
|
+
`;
|
|
71
|
+
case 1:
|
|
72
|
+
return `La fonction $f$ est une fonction affine.
|
|
73
|
+
|
|
74
|
+
Il y a une unique solution à l'équation $f(x) = 0$ : ici, c'est
|
|
75
|
+
|
|
76
|
+
$$
|
|
77
|
+
x = ${frac(-b, a).simplify().toTex()}
|
|
78
|
+
$$`;
|
|
79
|
+
case 2:
|
|
80
|
+
return `Un produit est nul si et seulement si un des deux facteurs est nul. Ici, chacun des facteurs est une fonction affine.
|
|
81
|
+
|
|
82
|
+
Il y a donc deux solutions à l'équation $f(x) = 0$. D'une part,
|
|
83
|
+
|
|
84
|
+
$$
|
|
85
|
+
x = ${frac(-b, a).simplify().toTex()}
|
|
86
|
+
$$
|
|
87
|
+
|
|
88
|
+
et d'autre part,
|
|
89
|
+
|
|
90
|
+
$$
|
|
91
|
+
x = ${frac(-d, c).simplify().toTex()}
|
|
92
|
+
$$`;
|
|
93
|
+
break;
|
|
94
|
+
case 3:
|
|
95
|
+
default:
|
|
96
|
+
return `Un quotient est nul si et seulement si le numérateur est nul et le dénominateur est non nul. Ici, le numérateur et le denominateur sont des fonctions affines.
|
|
97
|
+
|
|
98
|
+
Le numérateur est nul pour :
|
|
99
|
+
|
|
100
|
+
$$
|
|
101
|
+
x = ${frac(-b, a).simplify().toTex()}
|
|
102
|
+
$$
|
|
103
|
+
|
|
104
|
+
Pour cette valeur de $x$, le dénominateur n'est pas nul, puisqu'il vaut :
|
|
105
|
+
|
|
106
|
+
$$
|
|
107
|
+
${add(multiply(c, frac(-b, a).simplify()), d).toTex()}=${add(multiply(c, frac(-b, a)), d)
|
|
108
|
+
.simplify()
|
|
109
|
+
.toTex()}
|
|
110
|
+
$$
|
|
111
|
+
|
|
112
|
+
Il y a donc une seule valeur de $x$ telle que $f(x) = 0$.
|
|
113
|
+
`;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const getKeys = (identifiers) => {
|
|
118
|
+
return [];
|
|
119
|
+
};
|
|
120
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
121
|
+
try {
|
|
122
|
+
const ansNode = parseAlgebraic(ans);
|
|
123
|
+
const answerNode = parseAlgebraic(answer);
|
|
124
|
+
return ansNode.simplify().equals(answerNode.simplify());
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
return handleVEAError(err);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const getCountFunctionZeroes = () => {
|
|
131
|
+
const type = randint(0, 4);
|
|
132
|
+
//a
|
|
133
|
+
//ax+b
|
|
134
|
+
//(ax+b)(cx+d)
|
|
135
|
+
//(ax+b)/(cx+d)
|
|
136
|
+
let a = 0;
|
|
137
|
+
let b = 0;
|
|
138
|
+
let c = 0;
|
|
139
|
+
let d = 0;
|
|
140
|
+
switch (type) {
|
|
141
|
+
case 0:
|
|
142
|
+
a = randint(-10, 10, [0]);
|
|
143
|
+
break;
|
|
144
|
+
case 1:
|
|
145
|
+
const aff = AffineConstructor.random();
|
|
146
|
+
a = aff.a;
|
|
147
|
+
b = aff.b;
|
|
148
|
+
break;
|
|
149
|
+
case 2:
|
|
150
|
+
do {
|
|
151
|
+
a = randint(-10, 10, [0]);
|
|
152
|
+
b = randint(-10, 10);
|
|
153
|
+
c = randint(-10, 10, [0]);
|
|
154
|
+
d = randint(-10, 10, b === 0 ? [0] : undefined);
|
|
155
|
+
} while (d * b === a * c);
|
|
156
|
+
break;
|
|
157
|
+
case 3:
|
|
158
|
+
default:
|
|
159
|
+
do {
|
|
160
|
+
a = randint(-10, 10, [0]);
|
|
161
|
+
b = randint(-10, 10);
|
|
162
|
+
c = randint(-10, 10, [0]);
|
|
163
|
+
d = randint(-10, 10, b === 0 ? [0] : undefined);
|
|
164
|
+
} while (d * b === a * c);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
const identifiers = { a, b, c, d, type };
|
|
168
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
169
|
+
};
|
|
170
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
171
|
+
return {
|
|
172
|
+
answer: getAnswer(identifiers),
|
|
173
|
+
instruction: getInstruction(identifiers),
|
|
174
|
+
keys: getKeys(identifiers),
|
|
175
|
+
answerFormat: "tex",
|
|
176
|
+
identifiers,
|
|
177
|
+
hint: getHint(identifiers),
|
|
178
|
+
correction: getCorrection(identifiers),
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
export const countFunctionZeroes = {
|
|
182
|
+
id: "countFunctionZeroes",
|
|
183
|
+
label: "Déterminer le nombre de valeurs d'annulation d'une fonction",
|
|
184
|
+
isSingleStep: true,
|
|
185
|
+
generator: (nb, opts) => getDistinctQuestions(() => getCountFunctionZeroes(opts), nb),
|
|
186
|
+
qcmTimer: 60,
|
|
187
|
+
freeTimer: 60,
|
|
188
|
+
getPropositions,
|
|
189
|
+
isAnswerValid,
|
|
190
|
+
subject: "Mathématiques",
|
|
191
|
+
getInstruction,
|
|
192
|
+
getHint,
|
|
193
|
+
getCorrection,
|
|
194
|
+
getAnswer,
|
|
195
|
+
getQuestionFromIdentifiers,
|
|
196
|
+
hasHintAndCorrection: true,
|
|
197
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
type: number;
|
|
4
|
+
a: number;
|
|
5
|
+
b?: number;
|
|
6
|
+
c?: number;
|
|
7
|
+
d?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const findZeroesProductQuotient: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=findZeroesProductQuotient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findZeroesProductQuotient.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/findZeroesProductQuotient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAqCrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AA+MF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAkB3D,CAAC"}
|