math-exercises 3.0.112 → 3.0.114
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/dataRepresentations/boxPlotReading.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/boxPlotReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlotReading.js +133 -0
- package/lib/exercises/math/dataRepresentations/boxPlotReadingPercentages.d.ts +11 -0
- package/lib/exercises/math/dataRepresentations/boxPlotReadingPercentages.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlotReadingPercentages.js +198 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts +2 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/index.js +2 -0
- package/lib/exercises/math/functions/affines/drawAffineFrom2Points.d.ts +10 -0
- package/lib/exercises/math/functions/affines/drawAffineFrom2Points.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/drawAffineFrom2Points.js +151 -0
- package/lib/exercises/math/functions/affines/index.d.ts +1 -0
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +1 -0
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts +1 -1
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.js +7 -7
- package/lib/index.d.ts +12 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/CloudPoints.d.ts +1 -1
- package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +5 -5
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
type QuartileIndex = 0 | 1 | 2 | 3 | 4;
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
quartileIndex: QuartileIndex;
|
|
5
|
+
quartiles: number[];
|
|
6
|
+
};
|
|
7
|
+
export declare const boxPlotReading: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=boxPlotReading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxPlotReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/boxPlotReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA0IF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAmBhD,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
|
+
const getPropositions = (n, { answer, quartiles }) => {
|
|
7
|
+
const propositions = [];
|
|
8
|
+
addValidProp(propositions, answer);
|
|
9
|
+
[0, 1, 2, 3, 4].forEach((qIndex) => {
|
|
10
|
+
tryToAddWrongProp(propositions, quartiles[qIndex].frenchify());
|
|
11
|
+
});
|
|
12
|
+
return shuffleProps(propositions, n);
|
|
13
|
+
};
|
|
14
|
+
const getAnswer = (identifiers) => {
|
|
15
|
+
const { quartileIndex, quartiles } = identifiers;
|
|
16
|
+
return quartiles[quartileIndex].frenchify();
|
|
17
|
+
};
|
|
18
|
+
const getFrenchStringForOfQuartile = (quartileIndex) => {
|
|
19
|
+
switch (quartileIndex) {
|
|
20
|
+
case 0:
|
|
21
|
+
return "du minimum";
|
|
22
|
+
case 1:
|
|
23
|
+
return "du premier quartile";
|
|
24
|
+
case 2:
|
|
25
|
+
return "de la médiane";
|
|
26
|
+
case 3:
|
|
27
|
+
return "du troisième quartile";
|
|
28
|
+
case 4:
|
|
29
|
+
return "du maximum";
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const getInstruction = (identifiers) => {
|
|
33
|
+
const { quartileIndex } = identifiers;
|
|
34
|
+
return `On a représenté une série statistique à une variable sous forme d'une boîte à moustaches.
|
|
35
|
+
|
|
36
|
+
Quelle est la valeur ${getFrenchStringForOfQuartile(quartileIndex)} ?
|
|
37
|
+
`;
|
|
38
|
+
};
|
|
39
|
+
const getHint = () => {
|
|
40
|
+
return `Une boîte à moustaches permet de lire les indicateurs statistiques d'une série. Chaque trait vertical représente un indicateur. Ces indicateurs sont rangés dans l'ordre : minimum, premier quartile, médiane, troisième quartile, maximum.`;
|
|
41
|
+
};
|
|
42
|
+
const getCorrection = (identifiers) => {
|
|
43
|
+
const { quartileIndex, quartiles } = identifiers;
|
|
44
|
+
//https://heureuxhasarddocsbucket.s3.eu-west-3.amazonaws.com/mathliveV2/activities/quizzes/generator/boxplot.png
|
|
45
|
+
return `Une boîte à moustache permet de lire les indicateurs statistiques d'une série :
|
|
46
|
+
|
|
47
|
+

|
|
48
|
+
|
|
49
|
+
La valeur ${getFrenchStringForOfQuartile(quartileIndex)} est donc ici $ ${quartiles[quartileIndex]} $.`;
|
|
50
|
+
};
|
|
51
|
+
const getGGBOptions = (identifiers) => {
|
|
52
|
+
const { quartiles } = identifiers;
|
|
53
|
+
const [q0, q1, q2, q3, q4] = quartiles;
|
|
54
|
+
const yOffset = 2;
|
|
55
|
+
const yScale = 0.8;
|
|
56
|
+
const commands = [
|
|
57
|
+
`BM = BoxPlot(${yOffset}, ${yScale}, ${q0}, ${q1}, ${q2}, ${q3}, ${q4})`,
|
|
58
|
+
`ShowLabel(BM, false)`,
|
|
59
|
+
];
|
|
60
|
+
const ggb = new GeogebraConstructor({
|
|
61
|
+
commands,
|
|
62
|
+
forbidShiftDragZoom: false,
|
|
63
|
+
lockedAxesRatio: false,
|
|
64
|
+
// gridDistance: [0.5, 1],
|
|
65
|
+
xAxis: {
|
|
66
|
+
hideNumbers: false,
|
|
67
|
+
steps: 1,
|
|
68
|
+
},
|
|
69
|
+
yAxis: {
|
|
70
|
+
hidden: true,
|
|
71
|
+
},
|
|
72
|
+
maxHeight: 100,
|
|
73
|
+
fontSize: 20,
|
|
74
|
+
});
|
|
75
|
+
return ggb.getOptions({
|
|
76
|
+
coords: ggb.getAdaptedCoords({
|
|
77
|
+
xMin: q0,
|
|
78
|
+
xMax: q4,
|
|
79
|
+
yMin: -2,
|
|
80
|
+
yMax: 5,
|
|
81
|
+
}),
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
const getKeys = () => {
|
|
85
|
+
return [];
|
|
86
|
+
};
|
|
87
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
88
|
+
return numberVEA(ans, answer);
|
|
89
|
+
};
|
|
90
|
+
const getBoxPlotReadingQuestion = () => {
|
|
91
|
+
const [q0, q1] = [0, 1]
|
|
92
|
+
.map((_) => randint(0, 8))
|
|
93
|
+
.toSorted((i1, i2) => i1 - i2);
|
|
94
|
+
const [q3, q4] = [0, 1]
|
|
95
|
+
.map((_) => randint(12, 20))
|
|
96
|
+
.toSorted((i1, i2) => i1 - i2);
|
|
97
|
+
const q2 = randint(q1, q3, [q1]); //we prevent q2 from being equal to q1 or q3
|
|
98
|
+
const quartiles = [q0, q1, q2, q3, q4];
|
|
99
|
+
const quartileIndex = randint(0, 5);
|
|
100
|
+
const identifiers = { quartileIndex, quartiles };
|
|
101
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
102
|
+
};
|
|
103
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
104
|
+
return {
|
|
105
|
+
answer: getAnswer(identifiers),
|
|
106
|
+
instruction: getInstruction(identifiers),
|
|
107
|
+
keys: getKeys(identifiers),
|
|
108
|
+
answerFormat: "tex",
|
|
109
|
+
identifiers,
|
|
110
|
+
hint: getHint(identifiers),
|
|
111
|
+
correction: getCorrection(identifiers),
|
|
112
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export const boxPlotReading = {
|
|
116
|
+
id: "boxPlotReading",
|
|
117
|
+
label: "Lire les indicateurs statistiques sur une boîte à moustaches",
|
|
118
|
+
isSingleStep: true,
|
|
119
|
+
generator: (nb, opts) => getDistinctQuestions(() => getBoxPlotReadingQuestion(opts), nb),
|
|
120
|
+
qcmTimer: 60,
|
|
121
|
+
freeTimer: 60,
|
|
122
|
+
getPropositions,
|
|
123
|
+
isAnswerValid,
|
|
124
|
+
subject: "Mathématiques",
|
|
125
|
+
getHint,
|
|
126
|
+
getCorrection,
|
|
127
|
+
getInstruction,
|
|
128
|
+
getAnswer,
|
|
129
|
+
getGGBOptions,
|
|
130
|
+
hasGeogebra: true,
|
|
131
|
+
getQuestionFromIdentifiers,
|
|
132
|
+
hasHintAndCorrection: true,
|
|
133
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
type QuartileIndex = 0 | 1 | 2 | 3 | 4;
|
|
3
|
+
type QuestionType = "below" | "between" | "above";
|
|
4
|
+
type Identifiers = {
|
|
5
|
+
quartiles: number[];
|
|
6
|
+
arrQuartileIndex: QuartileIndex[];
|
|
7
|
+
typeQ: QuestionType;
|
|
8
|
+
};
|
|
9
|
+
export declare const boxPlotReadingPercentages: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=boxPlotReadingPercentages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxPlotReadingPercentages.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/boxPlotReadingPercentages.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,aAAa,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEvC,KAAK,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAElD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,gBAAgB,EAAE,aAAa,EAAE,CAAC;IAClC,KAAK,EAAE,YAAY,CAAC;CACrB,CAAC;AA0NF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAmB3D,CAAC"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
7
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
8
|
+
import { probaLawFlip } from "../../../utils/alea/probaLawFlip.js";
|
|
9
|
+
import { random, randomMany } from "../../../utils/alea/random.js";
|
|
10
|
+
const getPropositions = (n, { answer }) => {
|
|
11
|
+
const propositions = [];
|
|
12
|
+
addValidProp(propositions, answer);
|
|
13
|
+
[0, 25, 50, 75, 100].forEach((percentage) => {
|
|
14
|
+
tryToAddWrongProp(propositions, percentage.frenchify());
|
|
15
|
+
});
|
|
16
|
+
return shuffleProps(propositions, n);
|
|
17
|
+
};
|
|
18
|
+
const getAnswer = (identifiers) => {
|
|
19
|
+
const { arrQuartileIndex } = identifiers;
|
|
20
|
+
return multiply(substract(arrQuartileIndex[1], arrQuartileIndex[0]), 25)
|
|
21
|
+
.simplify()
|
|
22
|
+
.toTex();
|
|
23
|
+
};
|
|
24
|
+
const getFrenchStringForDuQuartile = (quartileIndex) => {
|
|
25
|
+
switch (quartileIndex) {
|
|
26
|
+
case 0:
|
|
27
|
+
return "du minimum";
|
|
28
|
+
case 1:
|
|
29
|
+
return "du premier quartile";
|
|
30
|
+
case 2:
|
|
31
|
+
return "de la médiane";
|
|
32
|
+
case 3:
|
|
33
|
+
return "du troisième quartile";
|
|
34
|
+
case 4:
|
|
35
|
+
return "du maximum";
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const getInstruction = (identifiers) => {
|
|
39
|
+
const { quartiles, arrQuartileIndex, typeQ } = identifiers;
|
|
40
|
+
const vMin = quartiles[arrQuartileIndex[0]];
|
|
41
|
+
const vMax = quartiles[arrQuartileIndex[1]];
|
|
42
|
+
return `On a représenté une série statistique à une variable sous forme d'une boîte à moustaches.
|
|
43
|
+
${(() => {
|
|
44
|
+
switch (typeQ) {
|
|
45
|
+
case "below":
|
|
46
|
+
return `Quelle est la proportion de valeurs (en pourcentage) qui sont inférieures ou égales à $${vMax}$ ?`;
|
|
47
|
+
case "between":
|
|
48
|
+
return `Quelle est la proportion de valeurs (en pourcentage) qui sont comprises entre $${vMin}$ et $${vMax}$ ?`;
|
|
49
|
+
case "above":
|
|
50
|
+
return `Quelle est la proportion de valeurs (en pourcentage) qui sont supérieures ou égales à $${vMin}$ ?`;
|
|
51
|
+
}
|
|
52
|
+
})()}
|
|
53
|
+
`;
|
|
54
|
+
};
|
|
55
|
+
const getHint = () => {
|
|
56
|
+
return `$25\\%$ des données sont inférieures ou égales au premier quartile ($Q_1$).
|
|
57
|
+
|
|
58
|
+
$50\\%$ des données sont inférieures ou égales à la médiane ($Q_2$).
|
|
59
|
+
|
|
60
|
+
$75\\%$ des données sont inférieures ou égales au troisième quartile ($Q_3$).`;
|
|
61
|
+
};
|
|
62
|
+
const getCorrection = (identifiers) => {
|
|
63
|
+
const { quartiles, arrQuartileIndex, typeQ } = identifiers;
|
|
64
|
+
const texPercentage = getAnswer(identifiers);
|
|
65
|
+
switch (typeQ) {
|
|
66
|
+
case "below":
|
|
67
|
+
return `D'après la boîte à moustaches, $ ${quartiles[arrQuartileIndex[1]]} $ est la valeur ${getFrenchStringForDuQuartile(arrQuartileIndex[1])}.
|
|
68
|
+
|
|
69
|
+
La proportion de valeurs inférieures ou égales à $ ${quartiles[arrQuartileIndex[1]]} $ est donc $${texPercentage}\\%$.`;
|
|
70
|
+
case "between":
|
|
71
|
+
return `D'après la boîte à moustaches, $ ${quartiles[arrQuartileIndex[0]]} $ est la valeur ${getFrenchStringForDuQuartile(arrQuartileIndex[0])} , et $ ${quartiles[arrQuartileIndex[1]]} $ est la valeur ${getFrenchStringForDuQuartile(arrQuartileIndex[1])}.
|
|
72
|
+
|
|
73
|
+
La proportion de valeurs comprises entre $ ${quartiles[arrQuartileIndex[0]]} $ et $ ${quartiles[arrQuartileIndex[1]]} $ est donc $${texPercentage}\\%$.`;
|
|
74
|
+
case "above":
|
|
75
|
+
return `D'après la boîte à moustaches, $ ${quartiles[arrQuartileIndex[0]]} $ est la valeur ${getFrenchStringForDuQuartile(arrQuartileIndex[0])}.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
La proportion de valeurs supérieures ou égales à $ ${quartiles[arrQuartileIndex[0]]} $ est donc $${texPercentage}\\%$.`;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const getGGBOptions = (identifiers) => {
|
|
82
|
+
const { quartiles } = identifiers;
|
|
83
|
+
const [q0, q1, q2, q3, q4] = quartiles;
|
|
84
|
+
const yOffset = 2;
|
|
85
|
+
const yScale = 0.8;
|
|
86
|
+
const commands = [
|
|
87
|
+
`BM = BoxPlot(${yOffset}, ${yScale}, ${q0}, ${q1}, ${q2}, ${q3}, ${q4})`,
|
|
88
|
+
`ShowLabel(BM, false)`,
|
|
89
|
+
];
|
|
90
|
+
const ggb = new GeogebraConstructor({
|
|
91
|
+
commands,
|
|
92
|
+
forbidShiftDragZoom: false,
|
|
93
|
+
lockedAxesRatio: false,
|
|
94
|
+
// gridDistance: [0.5, 1],
|
|
95
|
+
xAxis: {
|
|
96
|
+
hideNumbers: false,
|
|
97
|
+
steps: 1,
|
|
98
|
+
},
|
|
99
|
+
yAxis: {
|
|
100
|
+
hidden: true,
|
|
101
|
+
},
|
|
102
|
+
maxHeight: 100,
|
|
103
|
+
fontSize: 20,
|
|
104
|
+
});
|
|
105
|
+
return ggb.getOptions({
|
|
106
|
+
coords: ggb.getAdaptedCoords({
|
|
107
|
+
xMin: q0,
|
|
108
|
+
xMax: q4,
|
|
109
|
+
yMin: -2,
|
|
110
|
+
yMax: 5,
|
|
111
|
+
}),
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
const getKeys = () => {
|
|
115
|
+
return [];
|
|
116
|
+
};
|
|
117
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
118
|
+
return numberVEA(ans, answer);
|
|
119
|
+
};
|
|
120
|
+
const getBoxPlotReadingPercentagesQuestion = () => {
|
|
121
|
+
const arrBounds = probaLawFlip([
|
|
122
|
+
[
|
|
123
|
+
[
|
|
124
|
+
{ min: 0, max: 8 },
|
|
125
|
+
{ min: 12, max: 20 },
|
|
126
|
+
],
|
|
127
|
+
0.6,
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
[
|
|
131
|
+
{ min: -8, max: 0 },
|
|
132
|
+
{ min: 20, max: 28 },
|
|
133
|
+
],
|
|
134
|
+
0.2,
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
[
|
|
138
|
+
{ min: -20, max: -12 },
|
|
139
|
+
{ min: 0, max: 8 },
|
|
140
|
+
],
|
|
141
|
+
0.2,
|
|
142
|
+
],
|
|
143
|
+
]);
|
|
144
|
+
const [q0, q1] = [0, 1]
|
|
145
|
+
.map((_) => randint(arrBounds[0].min, arrBounds[0].max))
|
|
146
|
+
.toSorted((i1, i2) => i1 - i2);
|
|
147
|
+
const [q3, q4] = [0, 1]
|
|
148
|
+
.map((_) => randint(arrBounds[1].min, arrBounds[1].max))
|
|
149
|
+
.toSorted((i1, i2) => i1 - i2);
|
|
150
|
+
const q2 = randint(q1, q3, [q1]); //we prevent q2 from being equal to q1 or q3
|
|
151
|
+
const quartiles = [q0, q1, q2, q3, q4];
|
|
152
|
+
const arrQuartileIndexAvailable = [
|
|
153
|
+
0,
|
|
154
|
+
...(q0 !== q1 ? [1] : []),
|
|
155
|
+
2,
|
|
156
|
+
...(q3 !== q4 ? [3] : []),
|
|
157
|
+
4,
|
|
158
|
+
];
|
|
159
|
+
const arrQuartileIndex = randomMany(arrQuartileIndexAvailable, 2).toSorted((i1, i2) => i1 - i2);
|
|
160
|
+
const typeQ = random([
|
|
161
|
+
...(arrQuartileIndex[0] === 0 ? ["below"] : []),
|
|
162
|
+
"between",
|
|
163
|
+
...(arrQuartileIndex[1] === 4 ? ["above"] : []),
|
|
164
|
+
]);
|
|
165
|
+
const identifiers = { quartiles, arrQuartileIndex, typeQ };
|
|
166
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
167
|
+
};
|
|
168
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
169
|
+
return {
|
|
170
|
+
answer: getAnswer(identifiers),
|
|
171
|
+
instruction: getInstruction(identifiers),
|
|
172
|
+
keys: getKeys(identifiers),
|
|
173
|
+
answerFormat: "tex",
|
|
174
|
+
identifiers,
|
|
175
|
+
hint: getHint(identifiers),
|
|
176
|
+
correction: getCorrection(identifiers),
|
|
177
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
export const boxPlotReadingPercentages = {
|
|
181
|
+
id: "boxPlotReadingPercentages",
|
|
182
|
+
label: "Lire des proportions sur une boîte à moustaches",
|
|
183
|
+
isSingleStep: true,
|
|
184
|
+
generator: (nb, opts) => getDistinctQuestions(() => getBoxPlotReadingPercentagesQuestion(opts), nb),
|
|
185
|
+
qcmTimer: 60,
|
|
186
|
+
freeTimer: 60,
|
|
187
|
+
getPropositions,
|
|
188
|
+
isAnswerValid,
|
|
189
|
+
subject: "Mathématiques",
|
|
190
|
+
getHint,
|
|
191
|
+
getCorrection,
|
|
192
|
+
getInstruction,
|
|
193
|
+
getAnswer,
|
|
194
|
+
getGGBOptions,
|
|
195
|
+
hasGeogebra: true,
|
|
196
|
+
getQuestionFromIdentifiers,
|
|
197
|
+
hasHintAndCorrection: true,
|
|
198
|
+
};
|
|
@@ -2,4 +2,6 @@ export * from "./tableReading.js";
|
|
|
2
2
|
export * from "./barChartReading.js";
|
|
3
3
|
export * from "./functionGraphReading.js";
|
|
4
4
|
export * from "./pieChartReading.js";
|
|
5
|
+
export * from "./boxPlotReadingPercentages.js";
|
|
6
|
+
export * from "./boxPlotReading.js";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC"}
|
|
@@ -2,6 +2,8 @@ export * from "./tableReading.js";
|
|
|
2
2
|
export * from "./barChartReading.js";
|
|
3
3
|
export * from "./functionGraphReading.js";
|
|
4
4
|
export * from "./pieChartReading.js";
|
|
5
|
+
export * from "./boxPlotReadingPercentages.js";
|
|
6
|
+
export * from "./boxPlotReading.js";
|
|
5
7
|
// export * from "./testGen.js";
|
|
6
8
|
// export * from "./testGenGGB.js";
|
|
7
9
|
// export * from "./testGenStudentGGB.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
pointIdsA: PointIdentifiers;
|
|
5
|
+
pointIdsB: PointIdentifiers;
|
|
6
|
+
funcName: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const drawAffineFrom2Points: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=drawAffineFrom2Points.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawAffineFrom2Points.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFrom2Points.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAMtC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAiKF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAgBvD,CAAC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { isGGBLine } from "../../../../exercises/utils/geogebra/isGGBLine.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
4
|
+
import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
|
|
5
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
6
|
+
import { random, randomMany } from "../../../../utils/alea/random.js";
|
|
7
|
+
import { Line } from "../../../../math/geometry/line.js";
|
|
8
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
9
|
+
const getHint = () => {
|
|
10
|
+
return `Si $f$ est une fonction telle que $f(x) = y$,
|
|
11
|
+
alors la courbe représentative de f passe par le point de coordonnées $(x;y)$.
|
|
12
|
+
Détermine deux points par lesquels passe la droite représentative de la fonction.`;
|
|
13
|
+
};
|
|
14
|
+
const getCorrection = (identifiers) => {
|
|
15
|
+
const { pointIdsA, pointIdsB, funcName } = identifiers;
|
|
16
|
+
const pointA = PointConstructor.fromIdentifiers(pointIdsA);
|
|
17
|
+
const pointB = PointConstructor.fromIdentifiers(pointIdsB);
|
|
18
|
+
return `La fonction $${funcName}$ est une fonction affine.
|
|
19
|
+
Sa représentation graphique est une droite, que l'on va nommer $d$.
|
|
20
|
+
|
|
21
|
+
On sait que $ ${funcName}(${pointA.x.toTex()}) = ${pointA.y.toTex()} $.
|
|
22
|
+
C'est-à-dire que le point de coordonnées $(${pointA.x.toTex()}; ${pointA.y.toTex()})$ appartient à $d$.
|
|
23
|
+
|
|
24
|
+
On sait que $ ${funcName}(${pointB.x.toTex()}) = ${pointB.y.toTex()} $.
|
|
25
|
+
C'est-à-dire que le point de coordonnées $(${pointB.x.toTex()}; ${pointB.y.toTex()})$ appartient également à $d$.
|
|
26
|
+
|
|
27
|
+
On place donc les deux points de coordonnées $(${pointA.x.toTex()}; ${pointA.y.toTex()})$ et $(${pointB.x.toTex()}; ${pointB.y.toTex()})$,
|
|
28
|
+
puis on trace la droite passant par ces deux points.`;
|
|
29
|
+
};
|
|
30
|
+
const getInstruction = (identifiers) => {
|
|
31
|
+
const { pointIdsA, pointIdsB, funcName } = identifiers;
|
|
32
|
+
const pointA = PointConstructor.fromIdentifiers(pointIdsA);
|
|
33
|
+
const pointB = PointConstructor.fromIdentifiers(pointIdsB);
|
|
34
|
+
return `La fonction $${funcName}$ est affine telle que :
|
|
35
|
+
|
|
36
|
+
$ ${funcName}(${pointA.x.toTex()}) = ${pointA.y.toTex()} $ et
|
|
37
|
+
$ ${funcName}(${pointB.x.toTex()}) = ${pointB.y.toTex()} $.
|
|
38
|
+
|
|
39
|
+
Dans le repère, tracer la représentation graphique de la fonction $${funcName}$.`;
|
|
40
|
+
};
|
|
41
|
+
const getStudentGGBOptions = (identifiers) => {
|
|
42
|
+
const { pointIdsA, pointIdsB } = identifiers;
|
|
43
|
+
const pointA = PointConstructor.fromIdentifiers(pointIdsA);
|
|
44
|
+
const pointB = PointConstructor.fromIdentifiers(pointIdsB);
|
|
45
|
+
const studentGGB = new GeogebraConstructor({
|
|
46
|
+
isGridSimple: true,
|
|
47
|
+
customToolBar: toolBarConstructor({
|
|
48
|
+
join: true,
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
const [xA, xB, yA, yB] = [pointA.x, pointB.x, pointA.y, pointB.y].map((node) => node.evaluate());
|
|
52
|
+
const [xMin, xMax, yMin, yMax] = [
|
|
53
|
+
Math.min(xA, xB),
|
|
54
|
+
Math.max(xA, xB),
|
|
55
|
+
Math.min(yA, yB),
|
|
56
|
+
Math.max(yA, yB),
|
|
57
|
+
];
|
|
58
|
+
return studentGGB.getOptions({
|
|
59
|
+
coords: studentGGB.getAdaptedCoords({
|
|
60
|
+
xMin,
|
|
61
|
+
xMax,
|
|
62
|
+
yMax,
|
|
63
|
+
yMin,
|
|
64
|
+
forceShowAxes: true,
|
|
65
|
+
}),
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const getGGBAnswer = (identifiers) => {
|
|
69
|
+
const { pointIdsA, pointIdsB } = identifiers;
|
|
70
|
+
const pointA = PointConstructor.fromIdentifiers(pointIdsA);
|
|
71
|
+
const pointB = PointConstructor.fromIdentifiers(pointIdsB);
|
|
72
|
+
return [
|
|
73
|
+
`(${pointA.x.evaluate()},${pointA.y.evaluate()})`,
|
|
74
|
+
`(${pointB.x.evaluate()},${pointB.y.evaluate()})`,
|
|
75
|
+
`Line[A, B]`,
|
|
76
|
+
];
|
|
77
|
+
};
|
|
78
|
+
const getDrawAffineFrom2PointsQuestion = () => {
|
|
79
|
+
const availableCoordValues = [...Array(21).keys()].map((i) => i - 10);
|
|
80
|
+
const [xA, xB] = randomMany(availableCoordValues, 2); //this prevents building vertical lines
|
|
81
|
+
const [yA, yB] = [0, 1].map((_) => random(availableCoordValues));
|
|
82
|
+
const pointA = new Point("A", xA, yA);
|
|
83
|
+
const pointB = new Point("B", xB, yB);
|
|
84
|
+
const funcName = random(["f", "g", "h"]);
|
|
85
|
+
const identifiers = {
|
|
86
|
+
pointIdsA: pointA.toIdentifiers(),
|
|
87
|
+
pointIdsB: pointB.toIdentifiers(),
|
|
88
|
+
funcName,
|
|
89
|
+
};
|
|
90
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
91
|
+
};
|
|
92
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
93
|
+
const question = {
|
|
94
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
95
|
+
instruction: getInstruction(identifiers),
|
|
96
|
+
keys: [],
|
|
97
|
+
answerFormat: "tex",
|
|
98
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
99
|
+
identifiers,
|
|
100
|
+
hint: getHint(identifiers),
|
|
101
|
+
correction: getCorrection(identifiers),
|
|
102
|
+
};
|
|
103
|
+
return question;
|
|
104
|
+
};
|
|
105
|
+
const isGGBAnswerValid = (ans, { pointIdsA, pointIdsB }) => {
|
|
106
|
+
try {
|
|
107
|
+
//parse la line (si +1, faux)
|
|
108
|
+
// parse le spoints de la line
|
|
109
|
+
//transformer en vrai droite
|
|
110
|
+
// checker si A et B sont sur la droite
|
|
111
|
+
const lines = ans.filter((s) => isGGBLine(s));
|
|
112
|
+
if (lines.length !== 1)
|
|
113
|
+
return false;
|
|
114
|
+
const pointNames = lines[0]
|
|
115
|
+
.split("Line")[1]
|
|
116
|
+
.replace("[", "")
|
|
117
|
+
.replace("]", "")
|
|
118
|
+
.replace(" ", "")
|
|
119
|
+
.split(",");
|
|
120
|
+
const pointCmds = ans.filter((s) => s.startsWith(pointNames[0] + "=") || s.startsWith(pointNames[1] + "="));
|
|
121
|
+
const pointsCoords = pointCmds.map((cmd) => cmd
|
|
122
|
+
.split("=")[1]
|
|
123
|
+
.replace("(", "")
|
|
124
|
+
.replace(")", "")
|
|
125
|
+
.split(",")
|
|
126
|
+
.map((n) => Number(n)));
|
|
127
|
+
const points = pointsCoords.map((coord) => new Point("A", coord[0], coord[1]));
|
|
128
|
+
const line = new Line(points[0], points[1]);
|
|
129
|
+
const A = PointConstructor.fromIdentifiers(pointIdsA);
|
|
130
|
+
const B = PointConstructor.fromIdentifiers(pointIdsB);
|
|
131
|
+
return line.includes(A, 0.5) && line.includes(B, 0.5);
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
return handleVEAError(err);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
export const drawAffineFrom2Points = {
|
|
138
|
+
id: "drawAffineFrom2Points",
|
|
139
|
+
label: "Tracer la représentation graphique d'une fonction affine à partir de deux images",
|
|
140
|
+
isSingleStep: true,
|
|
141
|
+
answerType: "GGB",
|
|
142
|
+
generator: (nb) => getDistinctQuestions(getDrawAffineFrom2PointsQuestion, nb),
|
|
143
|
+
ggbTimer: 60,
|
|
144
|
+
isGGBAnswerValid,
|
|
145
|
+
subject: "Mathématiques",
|
|
146
|
+
getGGBAnswer,
|
|
147
|
+
getInstruction,
|
|
148
|
+
getStudentGGBOptions,
|
|
149
|
+
getQuestionFromIdentifiers,
|
|
150
|
+
hasHintAndCorrection: true,
|
|
151
|
+
};
|
|
@@ -12,5 +12,6 @@ export * from "./affineAdjustmentComplete.js";
|
|
|
12
12
|
export * from "./affineMeanValue.js";
|
|
13
13
|
export * from "./affineExpressionFromTwoImages.js";
|
|
14
14
|
export * from "./affineFromExercise.js";
|
|
15
|
+
export * from "./drawAffineFrom2Points.js";
|
|
15
16
|
export * from "./drawAffineFromLitExp.js";
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC"}
|
|
@@ -12,4 +12,5 @@ export * from "./affineAdjustmentComplete.js";
|
|
|
12
12
|
export * from "./affineMeanValue.js";
|
|
13
13
|
export * from "./affineExpressionFromTwoImages.js";
|
|
14
14
|
export * from "./affineFromExercise.js";
|
|
15
|
+
export * from "./drawAffineFrom2Points.js";
|
|
15
16
|
export * from "./drawAffineFromLitExp.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
-
import { CloudPointsIdentifiers } from "../../../../math/geometry/
|
|
2
|
+
import { CloudPointsIdentifiers } from "../../../../math/geometry/CloudPoints.js";
|
|
3
3
|
type Identifiers = {
|
|
4
4
|
isJustified: boolean;
|
|
5
5
|
cloudPointsIdentifiers: CloudPointsIdentifiers;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
4
|
-
import { CloudPoints, CloudPointsConstructor, } from "../../../../math/geometry/
|
|
4
|
+
import { CloudPoints, CloudPointsConstructor, } from "../../../../math/geometry/CloudPoints.js";
|
|
5
5
|
import { PointConstructor } from "../../../../math/geometry/point.js";
|
|
6
6
|
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
7
7
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticFindAntecedent.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"arithmeticFindAntecedent.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindAntecedent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA2HF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAiB1D,CAAC"}
|
|
@@ -20,7 +20,7 @@ $$
|
|
|
20
20
|
|
|
21
21
|
Calculer la valeur de $ ${varName} $ pour laquelle $ u_${varName} = ${uTex} $.`;
|
|
22
22
|
};
|
|
23
|
-
const getPropositions = (
|
|
23
|
+
const getPropositions = (nb, { answer, a, b, n }) => {
|
|
24
24
|
const propositions = [];
|
|
25
25
|
addValidProp(propositions, answer);
|
|
26
26
|
const affineWithN = new Affine(a, b, varName);
|
|
@@ -28,16 +28,16 @@ const getPropositions = (nb_prop, { answer, a, b, n }) => {
|
|
|
28
28
|
tryToAddWrongProp(propositions, new Affine(a, b).solve(0).toTex());
|
|
29
29
|
tryToAddWrongProp(propositions, affineWithN.calculate(u).toTree().toTex());
|
|
30
30
|
tryToAddWrongProp(propositions, new NumberNode(n + 1).toTex());
|
|
31
|
-
if (propositions.length <
|
|
31
|
+
if (propositions.length < nb) {
|
|
32
32
|
if (n - 1 >= 0) {
|
|
33
33
|
tryToAddWrongProp(propositions, new NumberNode(n - 1).toTex());
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
while (propositions.length <
|
|
36
|
+
while (propositions.length < nb) {
|
|
37
37
|
const wrongAnswer = NumberNodeConstructor.random(0, 20);
|
|
38
38
|
tryToAddWrongProp(propositions, wrongAnswer.toTex());
|
|
39
39
|
}
|
|
40
|
-
return shuffleProps(propositions,
|
|
40
|
+
return shuffleProps(propositions, nb);
|
|
41
41
|
};
|
|
42
42
|
const getAnswer = (identifiers) => {
|
|
43
43
|
const { n } = identifiers;
|
|
@@ -66,13 +66,13 @@ $$
|
|
|
66
66
|
${equationResolutionTex(a.toTree(), b.toTree(), (0).toTree(), u.toTree(), varName)}
|
|
67
67
|
$$`;
|
|
68
68
|
};
|
|
69
|
-
const getKeys = (
|
|
69
|
+
const getKeys = () => {
|
|
70
70
|
return [];
|
|
71
71
|
};
|
|
72
|
-
const isAnswerValid = (ans, { answer
|
|
72
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
73
73
|
return numberVEA(ans, answer);
|
|
74
74
|
};
|
|
75
|
-
const getArithmeticFindAntecedentQuestion = (
|
|
75
|
+
const getArithmeticFindAntecedentQuestion = () => {
|
|
76
76
|
const affine = AffineConstructor.random(undefined, {
|
|
77
77
|
excludes: [0],
|
|
78
78
|
});
|
package/lib/index.d.ts
CHANGED
|
@@ -851,6 +851,10 @@ declare const mathExercises: (Exercise<{
|
|
|
851
851
|
phrase: number;
|
|
852
852
|
initial: number;
|
|
853
853
|
growth: number;
|
|
854
|
+
}, object, string | number | boolean | string[]> | Exercise<{
|
|
855
|
+
pointIdsA: import("./math/geometry/point.js").PointIdentifiers;
|
|
856
|
+
pointIdsB: import("./math/geometry/point.js").PointIdentifiers;
|
|
857
|
+
funcName: string;
|
|
854
858
|
}, object, string | number | boolean | string[]> | Exercise<{
|
|
855
859
|
correctA: number;
|
|
856
860
|
correctB: number;
|
|
@@ -2099,7 +2103,7 @@ declare const mathExercises: (Exercise<{
|
|
|
2099
2103
|
yValues: number[];
|
|
2100
2104
|
}, object, string | number | boolean | string[]> | Exercise<{
|
|
2101
2105
|
isJustified: boolean;
|
|
2102
|
-
cloudPointsIdentifiers: import("./math/geometry/
|
|
2106
|
+
cloudPointsIdentifiers: import("./math/geometry/CloudPoints.js").CloudPointsIdentifiers;
|
|
2103
2107
|
}, object, string | number | boolean | string[]> | Exercise<{
|
|
2104
2108
|
pA: number;
|
|
2105
2109
|
pB: number;
|
|
@@ -2616,6 +2620,13 @@ declare const mathExercises: (Exercise<{
|
|
|
2616
2620
|
}, object, string | number | boolean | string[]> | Exercise<{
|
|
2617
2621
|
points: number[][];
|
|
2618
2622
|
labels: string[];
|
|
2623
|
+
}, object, string | number | boolean | string[]> | Exercise<{
|
|
2624
|
+
quartiles: number[];
|
|
2625
|
+
arrQuartileIndex: (0 | 1 | 2 | 3 | 4)[];
|
|
2626
|
+
typeQ: "below" | "between" | "above";
|
|
2627
|
+
}, object, string | number | boolean | string[]> | Exercise<{
|
|
2628
|
+
quartileIndex: 0 | 1 | 2 | 3 | 4;
|
|
2629
|
+
quartiles: number[];
|
|
2619
2630
|
}, object, string | number | boolean | string[]>)[];
|
|
2620
2631
|
declare const pcExercises: (Exercise<{
|
|
2621
2632
|
numbers: number[];
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"CloudPoints.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/CloudPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAMpE,MAAM,MAAM,sBAAsB,GAAG;IACnC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC,CAAC;AACF,8BAAsB,sBAAsB;IAC1C,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM;IAU9B,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM;CAyBrC;AAED,qBAAa,WAAW;IACtB,MAAM,EAAE,KAAK,EAAE,CAAC;gBAEJ,MAAM,EAAE,KAAK,EAAE;IAI3B,aAAa,IAAI,sBAAsB;IAMvC,kBAAkB,IAAI,SAAS;IA8C/B,mBAAmB;CAsBpB"}
|
|
@@ -38,6 +38,6 @@ export declare class EqualNode implements AlgebraicNode {
|
|
|
38
38
|
toDetailedEvaluation(vars: Record<string, AlgebraicNode>): EqualNode;
|
|
39
39
|
isVerified(): boolean;
|
|
40
40
|
}
|
|
41
|
-
export declare const equationResolutionTex: (a: AlgebraicNode, b: AlgebraicNode, c: AlgebraicNode, d: AlgebraicNode,
|
|
41
|
+
export declare const equationResolutionTex: (a: AlgebraicNode, b: AlgebraicNode, c: AlgebraicNode, d: AlgebraicNode, strVar?: string) => string | string[];
|
|
42
42
|
export {};
|
|
43
43
|
//# sourceMappingURL=equalNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equalNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/equations/equalNode.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,e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,MAAM,EAAE,CAAC;CAClB,CAAC;AACF,qBAAa,SAAU,YAAW,aAAa;IAC7C,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IASpB,aAAa,IAAI,oBAAoB;IAQrC,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAmBpC,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAM5C,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAIf,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe;IAQ/B,OAAO;IAIP,OAAO;IAIP,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc;IAqG9C,UAAU,IAAI,aAAa;IAG3B,MAAM,IAAI,OAAO;IAGjB,QAAQ,IAAI,MAAM;IAGlB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,SAAS;IAMpE,UAAU;CAIX;AAED,eAAO,MAAM,qBAAqB,GAChC,GAAG,aAAa,EAChB,GAAG,aAAa,EAChB,GAAG,aAAa,EAChB,GAAG,aAAa,EAChB,SAAQ,MAAY,sBAgErB,CAAC"}
|
|
@@ -199,7 +199,7 @@ export class EqualNode {
|
|
|
199
199
|
return this.leftChild.simplify().equals(this.rightChild.simplify());
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
export const equationResolutionTex = (a, b, c, d,
|
|
202
|
+
export const equationResolutionTex = (a, b, c, d, strVar = "x") => {
|
|
203
203
|
//(+-a)x(+-b) = (+-c)x(+-d)
|
|
204
204
|
const steps = [];
|
|
205
205
|
const iteration = (a, b, c, d) => {
|
|
@@ -211,24 +211,24 @@ export const equationResolutionTex = (a, b, c, d, str__var = "x") => {
|
|
|
211
211
|
//ax = d
|
|
212
212
|
if (aEv === 1) {
|
|
213
213
|
//x = d
|
|
214
|
-
steps.push(`${
|
|
214
|
+
steps.push(`${strVar}=${d.toTex()}`);
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
217
|
else {
|
|
218
218
|
//ax = d
|
|
219
|
-
steps.push(`${multiply(a,
|
|
219
|
+
steps.push(`${multiply(a, strVar).toTex()}=${d.toTex()}`);
|
|
220
220
|
iteration((1).toTree(), (0).toTree(), (0).toTree(), frac(d, a).simplify());
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
else {
|
|
224
|
-
steps.push(`${monom(a, 1, { variable:
|
|
224
|
+
steps.push(`${monom(a, 1, { variable: strVar }).toTex()}=${add(monom(c, 1, { variable: strVar }), d).toTex()}`);
|
|
225
225
|
//ax = c!x + d
|
|
226
226
|
iteration(substract(a, c).simplify(), (0).toTree(), (0).toTree(), d);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
else {
|
|
230
230
|
//ax + b! = cx + d
|
|
231
|
-
steps.push(`${add(multiply(a,
|
|
231
|
+
steps.push(`${add(multiply(a, strVar), b).simplify().toTex()}=${add(multiply(c, strVar), d)
|
|
232
232
|
.simplify()
|
|
233
233
|
.toTex()}`);
|
|
234
234
|
iteration(a, (0).toTree(), c, substract(d, b).simplify());
|