math-exercises 3.0.84 → 3.0.85
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 +0 -7
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/decimalBoundingOnLine.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/decimalBoundingOnLine.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/decimalBoundingOnLine.js +171 -0
- package/lib/exercises/math/calcul/arithmetics/evalFractionExpression.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/evalFractionExpression.js +2 -3
- package/lib/exercises/math/calcul/arithmetics/index.d.ts +2 -0
- package/lib/exercises/math/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/index.js +2 -0
- package/lib/exercises/math/calcul/arithmetics/simplifyToFraction.d.ts +9 -0
- package/lib/exercises/math/calcul/arithmetics/simplifyToFraction.d.ts.map +1 -0
- package/lib/exercises/math/calcul/arithmetics/simplifyToFraction.js +168 -0
- package/lib/exercises/math/calcul/fractions/fractionForbiddenValue.d.ts +10 -0
- package/lib/exercises/math/calcul/fractions/fractionForbiddenValue.d.ts.map +1 -0
- package/lib/exercises/math/calcul/fractions/fractionForbiddenValue.js +100 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
- package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/index.js +1 -0
- package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/framing.js +38 -8
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/math/functions/absolute/absoluteValueInequations.js +34 -1
- package/lib/exercises/math/functions/basics/index.d.ts +0 -1
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -1
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts +1 -2
- package/lib/exercises/math/functions/basics/valueTableCompletion.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/valueTableCompletion.js +31 -104
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.d.ts.map +1 -1
- package/lib/exercises/math/functions/rationalFraction/rationalFractionForbiddenValue.js +26 -1
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -0
- package/lib/exercises/math/geometry/intervals/index.d.ts +2 -0
- package/lib/exercises/math/geometry/intervals/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/intervals/index.js +1 -0
- package/lib/exercises/math/geometry/intervals/intervalOnGraph.d.ts +8 -0
- package/lib/exercises/math/geometry/intervals/intervalOnGraph.d.ts.map +1 -0
- package/lib/exercises/math/geometry/intervals/intervalOnGraph.js +156 -0
- package/lib/exercises/math/probaStat/basicStats/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/basicStats/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicStats/index.js +1 -0
- package/lib/exercises/math/probaStat/basicStats/samplingFrequency.d.ts +7 -0
- package/lib/exercises/math/probaStat/basicStats/samplingFrequency.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/basicStats/samplingFrequency.js +106 -0
- package/lib/exercises/math/probaStat/getQuartileProportionQuestion.d.ts +12 -0
- package/lib/exercises/math/probaStat/getQuartileProportionQuestion.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/getQuartileProportionQuestion.js +178 -0
- package/lib/exercises/math/probaStat/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +1 -0
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts +4 -1
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +23 -9
- package/lib/index.d.ts +25 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts +1 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +4 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +1 -11
- package/lib/tests/exoTest.d.ts.map +1 -1
- package/lib/tests/exoTest.js +2 -9
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +2 -21
- package/lib/tree/nodes/functions/absNode.d.ts +2 -2
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +2 -2
- package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +2 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts +1 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +2 -1
- package/lib/tree/nodes/operators/fractionNode.js +44 -9
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +14 -4
- package/lib/utils/markdown/mdTable.d.ts +1 -1
- package/lib/utils/markdown/mdTable.d.ts.map +1 -1
- package/lib/utils/markdown/mdTable.js +5 -10
- package/package.json +1 -1
|
@@ -97,9 +97,6 @@ export type QCMGenerator<TIdentifiers, TOptions = {}> = (n: number, args: {
|
|
|
97
97
|
export type VEA<TIdentifiers, TOptions = {}> = (studentAnswer: string, args: {
|
|
98
98
|
answer: string;
|
|
99
99
|
} & TIdentifiers, options?: TOptions) => boolean;
|
|
100
|
-
export type TableVEA<TIdentifiers, TOptions = {}> = (studentAnswer: string[][], args: {
|
|
101
|
-
answerTable: string[][];
|
|
102
|
-
} & TIdentifiers, options?: TOptions) => boolean;
|
|
103
100
|
export type GGBVEA<TIdentifiers, TOptions = {}> = (studentAnswer: string[], args: {
|
|
104
101
|
ggbAnswer: string[];
|
|
105
102
|
} & TIdentifiers, options?: TOptions) => boolean;
|
|
@@ -109,7 +106,6 @@ export type GetCorrection<TIdentifiers, TOptions = {}> = (args: TIdentifiers, op
|
|
|
109
106
|
export type GetInstruction<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string;
|
|
110
107
|
export type GetStartStatement<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string;
|
|
111
108
|
export type GetAnswer<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string;
|
|
112
|
-
export type GetAnswerTable<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string[][];
|
|
113
109
|
export type GetKeys<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => (KeyId | KeyProps)[];
|
|
114
110
|
export type GetGGBAnswer<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => string[];
|
|
115
111
|
export type GetGGBOptions<TIdentifiers, TOptions = {}> = (args: TIdentifiers, options?: TOptions) => GeogebraOptions;
|
|
@@ -148,12 +144,10 @@ export interface Exercise<TIdentifiers = {}, TOptions = {}> {
|
|
|
148
144
|
qcmTimer?: number;
|
|
149
145
|
freeTimer?: number;
|
|
150
146
|
ggbTimer?: number;
|
|
151
|
-
valueTableTimer?: number;
|
|
152
147
|
getPropositions?: QCMGenerator<{
|
|
153
148
|
answer: string;
|
|
154
149
|
} & TIdentifiers, TOptions>;
|
|
155
150
|
isAnswerValid?: VEA<TIdentifiers, TOptions>;
|
|
156
|
-
isAnswerTableValid?: TableVEA<TIdentifiers, TOptions>;
|
|
157
151
|
isGGBAnswerValid?: GGBVEA<TIdentifiers, TOptions>;
|
|
158
152
|
hasGeogebra?: boolean;
|
|
159
153
|
subject: "Mathématiques" | "Chimie" | "Physique";
|
|
@@ -164,7 +158,6 @@ export interface Exercise<TIdentifiers = {}, TOptions = {}> {
|
|
|
164
158
|
getCorrection?: GetCorrection<TIdentifiers, TOptions>;
|
|
165
159
|
getKeys?: GetKeys<TIdentifiers, TOptions>;
|
|
166
160
|
getAnswer?: GetAnswer<TIdentifiers, TOptions>;
|
|
167
|
-
getAnswerTable?: GetAnswerTable<TIdentifiers, TOptions>;
|
|
168
161
|
getGGBAnswer?: GetGGBAnswer<TIdentifiers, TOptions>;
|
|
169
162
|
getGGBOptions?: GetGGBOptions<TIdentifiers, TOptions>;
|
|
170
163
|
getStudentGGBOptions?: GetStudentGGBOptions<TIdentifiers, TOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD,eAAO,MAAM,SAAS,iBACN,WAAW,EAAE,KACxB,MAAM,WACA,MAAM,IAAI,SAQpB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,iBAAiB,UACrB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAUtB,CAAC;AAEF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,KACjB,MAAM,sBACW,MAAM,kBAQ3B,CAAC;AAEF,oBAAY,qBAAqB;IAC/B,UAAU,eAAe;IACzB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AACD,oBAAY,mBAAmB;IAC7B,QAAQ,aAAa;IACrB,MAA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BAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,oBAAoB,GACpB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
|
|
@@ -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/arithmetics/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":"evalFractionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/evalFractionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"evalFractionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/evalFractionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAC;IACtB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoGF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
|
|
@@ -14,10 +14,9 @@ const getPropositions = (n, { answer }) => {
|
|
|
14
14
|
const propositions = [];
|
|
15
15
|
addValidProp(propositions, answer);
|
|
16
16
|
while (propositions.length < n) {
|
|
17
|
+
const newFrac = RationalConstructor.randomIrreductible().toTree().toTex();
|
|
17
18
|
const a = randint(-10, 11).frenchify();
|
|
18
|
-
const newValue = coinFlip()
|
|
19
|
-
? RationalConstructor.randomIrreductible().toTree().toTex()
|
|
20
|
-
: a;
|
|
19
|
+
const newValue = coinFlip() ? newFrac : a;
|
|
21
20
|
tryToAddWrongProp(propositions, newValue);
|
|
22
21
|
}
|
|
23
22
|
return shuffleProps(propositions, n);
|
|
@@ -26,4 +26,6 @@ export * from "./sqrtInequality.js";
|
|
|
26
26
|
export * from "./calculateDistanceWithAbsoluteValue.js";
|
|
27
27
|
export * from "./isNumberInInterval.js";
|
|
28
28
|
export * from "./evalFractionExpression.js";
|
|
29
|
+
export * from "./simplifyToFraction.js";
|
|
30
|
+
export * from "./decimalBoundingOnLine.js";
|
|
29
31
|
//# 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,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,yCAAyC,CAAC;AACxD,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,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,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,yCAAyC,CAAC;AACxD,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
|
|
@@ -26,3 +26,5 @@ export * from "./sqrtInequality.js";
|
|
|
26
26
|
export * from "./calculateDistanceWithAbsoluteValue.js";
|
|
27
27
|
export * from "./isNumberInInterval.js";
|
|
28
28
|
export * from "./evalFractionExpression.js";
|
|
29
|
+
export * from "./simplifyToFraction.js";
|
|
30
|
+
export * from "./decimalBoundingOnLine.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
type: number;
|
|
5
|
+
expr: NodeIdentifiers;
|
|
6
|
+
};
|
|
7
|
+
export declare const simplifyToFraction: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=simplifyToFraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simplifyToFraction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/simplifyToFraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAoB7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAqKF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAiBpD,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
5
|
+
import { add, isAddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { frac, } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
7
|
+
import { isMultiplyNode, multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
9
|
+
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
10
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
11
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
12
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
13
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
14
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
15
|
+
const getPropositions = (n, { answer }) => {
|
|
16
|
+
const propositions = [];
|
|
17
|
+
addValidProp(propositions, answer);
|
|
18
|
+
while (propositions.length < n) {
|
|
19
|
+
const a = randint(-10, 11, [0]);
|
|
20
|
+
const b = randint(-10, 11, [0]);
|
|
21
|
+
const powerExpr = power("x", randint(2, 5));
|
|
22
|
+
const expressions = [
|
|
23
|
+
add(a, frac(b, "x")),
|
|
24
|
+
multiply(frac(a, powerExpr), frac(b, powerExpr)),
|
|
25
|
+
multiply(frac(powerExpr, a), frac(powerExpr, b)),
|
|
26
|
+
];
|
|
27
|
+
const chosenExpr = random(expressions).simplify({
|
|
28
|
+
calculatePowers: true,
|
|
29
|
+
keepPowers: true,
|
|
30
|
+
});
|
|
31
|
+
tryToAddWrongProp(propositions, chosenExpr.toTex());
|
|
32
|
+
}
|
|
33
|
+
return shuffleProps(propositions, n);
|
|
34
|
+
};
|
|
35
|
+
const getAnswer = (identifiers) => {
|
|
36
|
+
const { expr } = identifiers;
|
|
37
|
+
const exprNode = reifyAlgebraic(expr);
|
|
38
|
+
const simplified = exprNode.simplify({ forbidFactorize: true });
|
|
39
|
+
return `${simplified.toTex()}`;
|
|
40
|
+
};
|
|
41
|
+
const getInstruction = (identifiers) => {
|
|
42
|
+
const { expr } = identifiers;
|
|
43
|
+
const exprNode = reifyAlgebraic(expr);
|
|
44
|
+
return `Écrire l'expression suivante sous forme d'une fraction :
|
|
45
|
+
|
|
46
|
+
$$
|
|
47
|
+
${exprNode.toTex()}
|
|
48
|
+
$$`;
|
|
49
|
+
};
|
|
50
|
+
const getHint = ({ expr }) => {
|
|
51
|
+
const exprNode = reifyAlgebraic(expr);
|
|
52
|
+
if (isAddNode(exprNode)) {
|
|
53
|
+
return `Écris le nombre entier sous la forme d'un fraction, en le mettant au même dénominateur que la fraction. Puis, additionne les deux fractions obtenues.`;
|
|
54
|
+
}
|
|
55
|
+
return `Multiplie les deux fractions entre elles (en multipliant les numérateurs entre eux et les dénominateurs entre eux). Puis, simplifie la fraction obtenue.`;
|
|
56
|
+
};
|
|
57
|
+
const getCorrection = ({ expr }) => {
|
|
58
|
+
const exprNode = reifyAlgebraic(expr);
|
|
59
|
+
const simplified = exprNode.simplify({ forbidFactorize: true });
|
|
60
|
+
let explanation = ``;
|
|
61
|
+
if (isAddNode(exprNode)) {
|
|
62
|
+
const entier = exprNode.leftChild;
|
|
63
|
+
const fraction = exprNode.rightChild;
|
|
64
|
+
explanation += `On met les deux termes au même dénominateur pour les additionner :
|
|
65
|
+
|
|
66
|
+
${alignTex([
|
|
67
|
+
[
|
|
68
|
+
exprNode.toTex(),
|
|
69
|
+
"=",
|
|
70
|
+
add(frac(multiply(entier, fraction.rightChild), fraction.rightChild), fraction).toTex(),
|
|
71
|
+
],
|
|
72
|
+
["", "=", simplified.toTex()],
|
|
73
|
+
])}`;
|
|
74
|
+
}
|
|
75
|
+
else if (isMultiplyNode(exprNode)) {
|
|
76
|
+
const frac1 = exprNode.leftChild;
|
|
77
|
+
const frac2 = exprNode.rightChild;
|
|
78
|
+
explanation += `
|
|
79
|
+
On multiplie les fractions, puis on simplifie :
|
|
80
|
+
|
|
81
|
+
${alignTex([
|
|
82
|
+
[
|
|
83
|
+
exprNode.toTex(),
|
|
84
|
+
"=",
|
|
85
|
+
frac(multiply(frac1.leftChild, frac2.leftChild), multiply(frac1.rightChild, frac2.rightChild)).toTex(),
|
|
86
|
+
],
|
|
87
|
+
["", "=", simplified.toTex()],
|
|
88
|
+
])}`;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const num = exprNode.leftChild;
|
|
92
|
+
const denum = exprNode.rightChild;
|
|
93
|
+
explanation += `Diviser par une fraction revient à multiplier par son inverse. On a donc :
|
|
94
|
+
|
|
95
|
+
${alignTex([
|
|
96
|
+
[exprNode.toTex(), "=", multiply(num, denum.toInversed()).toTex()],
|
|
97
|
+
["", "=", simplified.toTex()],
|
|
98
|
+
])}`;
|
|
99
|
+
}
|
|
100
|
+
return explanation;
|
|
101
|
+
};
|
|
102
|
+
const getKeys = (identifiers) => {
|
|
103
|
+
return [];
|
|
104
|
+
};
|
|
105
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
106
|
+
try {
|
|
107
|
+
const ansNode = parseAlgebraic(ans);
|
|
108
|
+
return ansNode.simplify({ forbidFactorize: true }).toTex() === answer;
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
return handleVEAError(err);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const getSimplifyToFractionQuestion = (ops) => {
|
|
115
|
+
const type = randint(1, 4);
|
|
116
|
+
const a = randint(-10, 11, [-1, 0, 1]);
|
|
117
|
+
const b = randint(-10, 11, [-1, 0, 1]);
|
|
118
|
+
const powerA = randint(1, 5);
|
|
119
|
+
const powerB = randint(1, 5, type === 3 ? [powerA] : []);
|
|
120
|
+
const powerANode = powerA === 1 ? new VariableNode("x") : power("x", powerA);
|
|
121
|
+
const powerBNode = powerB === 1 ? new VariableNode("x") : power("x", powerB);
|
|
122
|
+
let expr;
|
|
123
|
+
let order = [];
|
|
124
|
+
switch (type) {
|
|
125
|
+
case 1:
|
|
126
|
+
expr = add(a, frac(b, "x")).toIdentifiers();
|
|
127
|
+
break;
|
|
128
|
+
case 2:
|
|
129
|
+
order = shuffle([a.toTree(), b.toTree(), powerANode, powerBNode]);
|
|
130
|
+
expr = multiply(frac(order[0], order[1]), frac(order[2], order[3])).toIdentifiers();
|
|
131
|
+
break;
|
|
132
|
+
case 3:
|
|
133
|
+
default:
|
|
134
|
+
order = shuffle([a.toTree(), powerANode, powerBNode]);
|
|
135
|
+
expr = frac(order[0], frac(order[1], order[2])).toIdentifiers();
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
const identifiers = { type, expr };
|
|
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
|
+
};
|
|
151
|
+
};
|
|
152
|
+
export const simplifyToFraction = {
|
|
153
|
+
id: "simplifyToFraction",
|
|
154
|
+
label: "Écrire sous la forme d'une expression fractionnaire",
|
|
155
|
+
isSingleStep: true,
|
|
156
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSimplifyToFractionQuestion(opts), nb),
|
|
157
|
+
qcmTimer: 60,
|
|
158
|
+
freeTimer: 60,
|
|
159
|
+
getPropositions,
|
|
160
|
+
isAnswerValid,
|
|
161
|
+
subject: "Mathématiques",
|
|
162
|
+
getInstruction,
|
|
163
|
+
getHint,
|
|
164
|
+
getCorrection,
|
|
165
|
+
getAnswer,
|
|
166
|
+
getQuestionFromIdentifiers,
|
|
167
|
+
hasHintAndCorrection: true,
|
|
168
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
c: number;
|
|
6
|
+
d: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const fractionForbiddenValue: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=fractionForbiddenValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fractionForbiddenValue.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/fractions/fractionForbiddenValue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,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;AAqGF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Rational } from "../../../../math/numbers/rationals/rational.js";
|
|
4
|
+
import { Affine } from "../../../../math/polynomials/affine.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { equationResolutionTex } from "../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
+
import { FractionNode } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
8
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
9
|
+
const getInstruction = (identifiers) => {
|
|
10
|
+
const { a, b, c, d } = identifiers;
|
|
11
|
+
const affine1 = new Affine(a, b);
|
|
12
|
+
const affine2 = new Affine(c, d);
|
|
13
|
+
const fct = new FractionNode(affine1.toTree(), affine2.toTree());
|
|
14
|
+
const fctTex = fct.toTex();
|
|
15
|
+
return `On note :
|
|
16
|
+
|
|
17
|
+
$$
|
|
18
|
+
A = ${fctTex}
|
|
19
|
+
$$
|
|
20
|
+
|
|
21
|
+
Pour quelle valeur de $x$ ne peut-on pas calculer $A$ ?`;
|
|
22
|
+
};
|
|
23
|
+
const getAnswer = (identifiers) => {
|
|
24
|
+
const { a, b, c, d } = identifiers;
|
|
25
|
+
const answerTree = new Rational(-d, c).simplify().toTree();
|
|
26
|
+
const answer = answerTree.toTex();
|
|
27
|
+
return answer;
|
|
28
|
+
};
|
|
29
|
+
const getHint = (identifiers) => {
|
|
30
|
+
return `Il est interdit de diviser par $0$. Cherche donc la valeur de $x$ pour laquelle le dénominateur de $A$ vaut $0$.`;
|
|
31
|
+
};
|
|
32
|
+
const getCorrection = (identifiers) => {
|
|
33
|
+
const { a, b, c, d } = identifiers;
|
|
34
|
+
const equa = equationResolutionTex(c.toTree(), d.toTree(), (0).toTree(), (0).toTree());
|
|
35
|
+
return `On cherche la valeur de $x$ qui rend le dénominateur de $A$ nul.
|
|
36
|
+
|
|
37
|
+
On résout donc l'équation :
|
|
38
|
+
|
|
39
|
+
$$
|
|
40
|
+
${equa}
|
|
41
|
+
$$
|
|
42
|
+
|
|
43
|
+
On ne peut donc pas calculer $A$ pour $x = ${getAnswer(identifiers)}$.
|
|
44
|
+
`;
|
|
45
|
+
};
|
|
46
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
47
|
+
const question = {
|
|
48
|
+
answer: getAnswer(identifiers),
|
|
49
|
+
instruction: getInstruction(identifiers),
|
|
50
|
+
keys: [],
|
|
51
|
+
answerFormat: "tex",
|
|
52
|
+
identifiers,
|
|
53
|
+
hint: getHint(identifiers),
|
|
54
|
+
correction: getCorrection(identifiers),
|
|
55
|
+
};
|
|
56
|
+
return question;
|
|
57
|
+
};
|
|
58
|
+
const getRationalFractionForbiddenValueQuestion = () => {
|
|
59
|
+
const a = randint(-10, 11, [0]);
|
|
60
|
+
const b = randint(-10, 11);
|
|
61
|
+
//pour éviter affine2 = k*affine1
|
|
62
|
+
let c, d;
|
|
63
|
+
do {
|
|
64
|
+
c = randint(-10, 11, [0]);
|
|
65
|
+
d = randint(-10, 11);
|
|
66
|
+
} while (a * d - b * c === 0);
|
|
67
|
+
const identifiers = { a, b, c, d };
|
|
68
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
69
|
+
};
|
|
70
|
+
const getPropositions = (n, { answer, a, b, c, d }) => {
|
|
71
|
+
const propositions = [];
|
|
72
|
+
addValidProp(propositions, answer);
|
|
73
|
+
tryToAddWrongProp(propositions, new Rational(-b, a).simplify().toTree().toTex());
|
|
74
|
+
tryToAddWrongProp(propositions, d + "");
|
|
75
|
+
while (propositions.length < n) {
|
|
76
|
+
tryToAddWrongProp(propositions, randint(-10, 11) + "");
|
|
77
|
+
}
|
|
78
|
+
return shuffle(propositions);
|
|
79
|
+
};
|
|
80
|
+
const isAnswerValid = (ans, { c, d }) => {
|
|
81
|
+
const answerTree = new Rational(-d, c)
|
|
82
|
+
.simplify()
|
|
83
|
+
.toTree({ allowFractionToDecimal: true });
|
|
84
|
+
const texs = answerTree.toAllValidTexs();
|
|
85
|
+
return texs.includes(ans);
|
|
86
|
+
};
|
|
87
|
+
export const fractionForbiddenValue = {
|
|
88
|
+
id: "fractionForbiddenValue",
|
|
89
|
+
connector: "=",
|
|
90
|
+
label: "Déterminer la valeur interdite d'une fraction",
|
|
91
|
+
isSingleStep: true,
|
|
92
|
+
generator: (nb) => getDistinctQuestions(getRationalFractionForbiddenValueQuestion, nb),
|
|
93
|
+
qcmTimer: 60,
|
|
94
|
+
freeTimer: 60,
|
|
95
|
+
getPropositions,
|
|
96
|
+
isAnswerValid,
|
|
97
|
+
subject: "Mathématiques",
|
|
98
|
+
getQuestionFromIdentifiers,
|
|
99
|
+
hasHintAndCorrection: true,
|
|
100
|
+
};
|
|
@@ -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,oBAAoB,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,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/framing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/framing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAwBrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AA+NF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,WAAW,CAczC,CAAC"}
|