math-exercises 3.0.23 → 3.0.24
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/calculLitteral/distributivity/secondIdentity.js +1 -1
- package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts +104 -0
- package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/functionGraphReading.js +119 -94
- package/lib/exercises/math/dataRepresentations/index.d.ts +1 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/index.js +1 -0
- package/lib/exercises/math/dataRepresentations/pieChartReading.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/pieChartReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/pieChartReading.js +171 -0
- package/lib/exercises/math/derivation/derivative/constanteDerivative.js +2 -2
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +3 -0
- package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +2 -1
- package/lib/exercises/math/probaStat/stats1var/averageList.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts +8 -0
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +105 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +36 -10
- package/lib/geogebra/colors.d.ts +1 -0
- package/lib/geogebra/colors.d.ts.map +1 -1
- package/lib/geogebra/colors.js +3 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +7 -1
- package/lib/math/geometry/angle.d.ts +2 -0
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +11 -4
- package/lib/math/geometry/spacePoint.d.ts +1 -0
- package/lib/math/geometry/spacePoint.d.ts.map +1 -1
- package/lib/math/geometry/spacePoint.js +3 -0
- package/lib/utils/strings/getLetter.d.ts +2 -0
- package/lib/utils/strings/getLetter.d.ts.map +1 -0
- package/lib/utils/strings/getLetter.js +3 -0
- package/package.json +1 -1
|
@@ -6,4 +6,108 @@ type Identifiers = {
|
|
|
6
6
|
};
|
|
7
7
|
export declare const functionGraphReading: Exercise<Identifiers>;
|
|
8
8
|
export {};
|
|
9
|
+
/***SVG */
|
|
10
|
+
/**
|
|
11
|
+
|
|
12
|
+
const width = 600;
|
|
13
|
+
const height = 300;
|
|
14
|
+
const margin = { top: 20, right: 20, bottom: 40, left: 50 };
|
|
15
|
+
const d3n = new D3Node();
|
|
16
|
+
const d3 = d3n.d3;
|
|
17
|
+
|
|
18
|
+
const svg = d3n.createSVG(width, height);
|
|
19
|
+
|
|
20
|
+
const xScale = d3
|
|
21
|
+
.scaleLinear()
|
|
22
|
+
.domain([0, 60])
|
|
23
|
+
.range([margin.left, width - margin.right]);
|
|
24
|
+
|
|
25
|
+
const yScale = d3
|
|
26
|
+
.scaleLinear()
|
|
27
|
+
.domain([0, 8000])
|
|
28
|
+
.range([height - margin.bottom, margin.top]);
|
|
29
|
+
|
|
30
|
+
const xAxis = d3.axisBottom(xScale).ticks(30).tickValues(d3.range(0, 61, 2));
|
|
31
|
+
const yAxis = d3
|
|
32
|
+
.axisLeft(yScale)
|
|
33
|
+
.ticks(16)
|
|
34
|
+
.tickValues(d3.range(0, 8500, 500));
|
|
35
|
+
|
|
36
|
+
svg
|
|
37
|
+
.append("g")
|
|
38
|
+
.attr("transform", `translate(0,${height - margin.bottom})`)
|
|
39
|
+
.call(xAxis);
|
|
40
|
+
|
|
41
|
+
svg.append("g").attr("transform", `translate(${margin.left},0)`).call(yAxis);
|
|
42
|
+
|
|
43
|
+
// Gridlines
|
|
44
|
+
const gridlinesX = d3
|
|
45
|
+
.axisBottom(xScale)
|
|
46
|
+
.tickSize(-height + margin.top + margin.bottom)
|
|
47
|
+
.tickFormat(() => "")
|
|
48
|
+
.tickValues(d3.range(0, 61, 2));
|
|
49
|
+
const gridlinesY = d3
|
|
50
|
+
.axisLeft(yScale)
|
|
51
|
+
.tickSize(-width + margin.left + margin.right)
|
|
52
|
+
.tickFormat(() => "")
|
|
53
|
+
.tickValues(d3.range(0, 8500, 500));
|
|
54
|
+
|
|
55
|
+
svg
|
|
56
|
+
.append("g")
|
|
57
|
+
.attr("class", "grid")
|
|
58
|
+
.attr("transform", `translate(0,${height - margin.bottom})`)
|
|
59
|
+
.call(gridlinesX);
|
|
60
|
+
|
|
61
|
+
svg
|
|
62
|
+
.append("g")
|
|
63
|
+
.attr("class", "grid")
|
|
64
|
+
.attr("transform", `translate(${margin.left},0)`)
|
|
65
|
+
.call(gridlinesY);
|
|
66
|
+
|
|
67
|
+
// Line
|
|
68
|
+
const line = d3
|
|
69
|
+
.line()
|
|
70
|
+
.x((d: any) => xScale(d))
|
|
71
|
+
.y((d: any) => yScale(d * a + b));
|
|
72
|
+
|
|
73
|
+
svg
|
|
74
|
+
.append("path")
|
|
75
|
+
.datum(d3.range(0, 61))
|
|
76
|
+
.attr("fill", "none")
|
|
77
|
+
.attr("stroke", "blue")
|
|
78
|
+
.attr("stroke-width", 1)
|
|
79
|
+
.attr("d", line);
|
|
80
|
+
|
|
81
|
+
// KaTeX math expression
|
|
82
|
+
const latexString = katex.renderToString("(d_1)", { throwOnError: false });
|
|
83
|
+
|
|
84
|
+
svg
|
|
85
|
+
.append("foreignObject")
|
|
86
|
+
.attr("x", xScale(18))
|
|
87
|
+
.attr("y", yScale(4500))
|
|
88
|
+
.attr("width", 50)
|
|
89
|
+
.attr("height", 30)
|
|
90
|
+
.html(
|
|
91
|
+
`<div style='font-size: 16px; font-weight: bold'>${latexString}</div>`,
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
// Labels
|
|
95
|
+
svg
|
|
96
|
+
.append("text")
|
|
97
|
+
.attr("x", width / 2)
|
|
98
|
+
.attr("y", height - 5)
|
|
99
|
+
.attr("text-anchor", "middle")
|
|
100
|
+
.attr("font-weight", "bold")
|
|
101
|
+
.text("Nombre de participants");
|
|
102
|
+
|
|
103
|
+
svg
|
|
104
|
+
.append("text")
|
|
105
|
+
.attr("x", margin.left)
|
|
106
|
+
.attr("y", margin.top - 5)
|
|
107
|
+
.attr("text-anchor", "middle")
|
|
108
|
+
.attr("font-weight", "bold")
|
|
109
|
+
.text("Coût en €");
|
|
110
|
+
${d3n.svgString()}
|
|
111
|
+
|
|
112
|
+
*/
|
|
9
113
|
//# sourceMappingURL=functionGraphReading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functionGraphReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/functionGraphReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"functionGraphReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/functionGraphReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqFF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAiBtD,CAAC;;AAEF,UAAU;AACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGE"}
|
|
@@ -4,8 +4,6 @@ import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
|
|
|
4
4
|
import { Affine } from "../../../math/polynomials/affine.js";
|
|
5
5
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
6
|
import { round } from "../../../math/utils/round.js";
|
|
7
|
-
import { D3Node } from "d3-node";
|
|
8
|
-
import katex from "katex";
|
|
9
7
|
const getPropositions = (n, { answer }) => {
|
|
10
8
|
const propositions = [];
|
|
11
9
|
addValidProp(propositions, answer);
|
|
@@ -20,116 +18,38 @@ const getAnswer = (identifiers) => {
|
|
|
20
18
|
};
|
|
21
19
|
const getInstruction = (identifiers) => {
|
|
22
20
|
const { yValue, a, b } = identifiers;
|
|
23
|
-
const width = 600;
|
|
24
|
-
const height = 300;
|
|
25
|
-
const margin = { top: 20, right: 20, bottom: 40, left: 50 };
|
|
26
|
-
const d3n = new D3Node();
|
|
27
|
-
const d3 = d3n.d3;
|
|
28
|
-
const svg = d3n.createSVG(width, height);
|
|
29
|
-
const xScale = d3
|
|
30
|
-
.scaleLinear()
|
|
31
|
-
.domain([0, 60])
|
|
32
|
-
.range([margin.left, width - margin.right]);
|
|
33
|
-
const yScale = d3
|
|
34
|
-
.scaleLinear()
|
|
35
|
-
.domain([0, 8000])
|
|
36
|
-
.range([height - margin.bottom, margin.top]);
|
|
37
|
-
const xAxis = d3.axisBottom(xScale).ticks(30).tickValues(d3.range(0, 61, 2));
|
|
38
|
-
const yAxis = d3
|
|
39
|
-
.axisLeft(yScale)
|
|
40
|
-
.ticks(16)
|
|
41
|
-
.tickValues(d3.range(0, 8500, 500));
|
|
42
|
-
svg
|
|
43
|
-
.append("g")
|
|
44
|
-
.attr("transform", `translate(0,${height - margin.bottom})`)
|
|
45
|
-
.call(xAxis);
|
|
46
|
-
svg.append("g").attr("transform", `translate(${margin.left},0)`).call(yAxis);
|
|
47
|
-
// Gridlines
|
|
48
|
-
const gridlinesX = d3
|
|
49
|
-
.axisBottom(xScale)
|
|
50
|
-
.tickSize(-height + margin.top + margin.bottom)
|
|
51
|
-
.tickFormat(() => "")
|
|
52
|
-
.tickValues(d3.range(0, 61, 2));
|
|
53
|
-
const gridlinesY = d3
|
|
54
|
-
.axisLeft(yScale)
|
|
55
|
-
.tickSize(-width + margin.left + margin.right)
|
|
56
|
-
.tickFormat(() => "")
|
|
57
|
-
.tickValues(d3.range(0, 8500, 500));
|
|
58
|
-
svg
|
|
59
|
-
.append("g")
|
|
60
|
-
.attr("class", "grid")
|
|
61
|
-
.attr("transform", `translate(0,${height - margin.bottom})`)
|
|
62
|
-
.call(gridlinesX);
|
|
63
|
-
svg
|
|
64
|
-
.append("g")
|
|
65
|
-
.attr("class", "grid")
|
|
66
|
-
.attr("transform", `translate(${margin.left},0)`)
|
|
67
|
-
.call(gridlinesY);
|
|
68
|
-
// Line
|
|
69
|
-
const line = d3
|
|
70
|
-
.line()
|
|
71
|
-
.x((d) => xScale(d))
|
|
72
|
-
.y((d) => yScale(d * a + b));
|
|
73
|
-
svg
|
|
74
|
-
.append("path")
|
|
75
|
-
.datum(d3.range(0, 61))
|
|
76
|
-
.attr("fill", "none")
|
|
77
|
-
.attr("stroke", "blue")
|
|
78
|
-
.attr("stroke-width", 1)
|
|
79
|
-
.attr("d", line);
|
|
80
|
-
// KaTeX math expression
|
|
81
|
-
const latexString = katex.renderToString("(d_1)", { throwOnError: false });
|
|
82
|
-
svg
|
|
83
|
-
.append("foreignObject")
|
|
84
|
-
.attr("x", xScale(18))
|
|
85
|
-
.attr("y", yScale(4500))
|
|
86
|
-
.attr("width", 50)
|
|
87
|
-
.attr("height", 30)
|
|
88
|
-
.html(`<div style='font-size: 16px; font-weight: bold'>${latexString}</div>`);
|
|
89
|
-
// Labels
|
|
90
|
-
svg
|
|
91
|
-
.append("text")
|
|
92
|
-
.attr("x", width / 2)
|
|
93
|
-
.attr("y", height - 5)
|
|
94
|
-
.attr("text-anchor", "middle")
|
|
95
|
-
.attr("font-weight", "bold")
|
|
96
|
-
.text("Nombre de participants");
|
|
97
|
-
svg
|
|
98
|
-
.append("text")
|
|
99
|
-
.attr("x", margin.left)
|
|
100
|
-
.attr("y", margin.top - 5)
|
|
101
|
-
.attr("text-anchor", "middle")
|
|
102
|
-
.attr("font-weight", "bold")
|
|
103
|
-
.text("Coût en €");
|
|
104
21
|
return `La droite $(d_1)$ modélise l'évolution du coût total d'un voyage scolaire en fonction du nombre de participants.
|
|
105
22
|
|
|
106
|
-
Si le coût total du voyage est de $${yValue}€$, quel est le nombre de participants
|
|
107
|
-
|
|
108
|
-
${d3n.svgString()}`;
|
|
23
|
+
Si le coût total du voyage est de $${yValue}€$, quel est le nombre de participants ?`;
|
|
109
24
|
};
|
|
110
25
|
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
111
26
|
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
112
27
|
const getGGBOptions = (identifiers) => {
|
|
113
28
|
const { a, b, yValue } = identifiers;
|
|
114
29
|
const affine = new Affine(a, b);
|
|
30
|
+
const xValue = (yValue - b) / a;
|
|
115
31
|
const ggb = new GeogebraConstructor({
|
|
116
|
-
commands: [
|
|
117
|
-
|
|
32
|
+
commands: [
|
|
33
|
+
`Function(${a}*x+${b}, 0, 10000)`,
|
|
34
|
+
`Text("\\tiny Nombre \\ de \\ participants", (x(Corner(2)), -200), true, true, -1, -1)`,
|
|
35
|
+
`Text("\\tiny Coût \\ en \\ €", (-5, y(Corner(4))), true, true)`,
|
|
36
|
+
],
|
|
37
|
+
forbidShiftDragZoom: false,
|
|
118
38
|
gridDistance: [2, 500],
|
|
119
39
|
lockedAxesRatio: 2 / 500,
|
|
120
40
|
xAxis: {
|
|
121
|
-
label: "
|
|
41
|
+
// label: "$\\math{\\tiny \\text{Nb. de \\\\ participants}}$",
|
|
122
42
|
steps: 2,
|
|
123
43
|
showPositive: true,
|
|
124
44
|
},
|
|
125
45
|
yAxis: {
|
|
126
|
-
label: "
|
|
46
|
+
// label: "y",
|
|
127
47
|
steps: 500,
|
|
128
48
|
showPositive: true,
|
|
129
49
|
},
|
|
130
50
|
});
|
|
131
51
|
return ggb.getOptions({
|
|
132
|
-
coords: [-5,
|
|
52
|
+
coords: [-5, xValue + 10, -500, yValue + 500],
|
|
133
53
|
});
|
|
134
54
|
};
|
|
135
55
|
const getKeys = (identifiers) => {
|
|
@@ -139,9 +59,10 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
139
59
|
throw Error("VEA not implemented");
|
|
140
60
|
};
|
|
141
61
|
const getFunctionGraphReadingQuestion = (opts) => {
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
const yValue =
|
|
62
|
+
const b = randint(0, 2000);
|
|
63
|
+
const randPoint = [2 * randint(5, 20), 3000 + 500 * randint(1, 7)];
|
|
64
|
+
const yValue = randPoint[1];
|
|
65
|
+
const a = (yValue - b) / randPoint[0];
|
|
145
66
|
const identifiers = { a, b, yValue };
|
|
146
67
|
const question = {
|
|
147
68
|
answer: getAnswer(identifiers),
|
|
@@ -172,3 +93,107 @@ export const functionGraphReading = {
|
|
|
172
93
|
getGGBOptions,
|
|
173
94
|
hasGeogebra: true,
|
|
174
95
|
};
|
|
96
|
+
/***SVG */
|
|
97
|
+
/**
|
|
98
|
+
|
|
99
|
+
const width = 600;
|
|
100
|
+
const height = 300;
|
|
101
|
+
const margin = { top: 20, right: 20, bottom: 40, left: 50 };
|
|
102
|
+
const d3n = new D3Node();
|
|
103
|
+
const d3 = d3n.d3;
|
|
104
|
+
|
|
105
|
+
const svg = d3n.createSVG(width, height);
|
|
106
|
+
|
|
107
|
+
const xScale = d3
|
|
108
|
+
.scaleLinear()
|
|
109
|
+
.domain([0, 60])
|
|
110
|
+
.range([margin.left, width - margin.right]);
|
|
111
|
+
|
|
112
|
+
const yScale = d3
|
|
113
|
+
.scaleLinear()
|
|
114
|
+
.domain([0, 8000])
|
|
115
|
+
.range([height - margin.bottom, margin.top]);
|
|
116
|
+
|
|
117
|
+
const xAxis = d3.axisBottom(xScale).ticks(30).tickValues(d3.range(0, 61, 2));
|
|
118
|
+
const yAxis = d3
|
|
119
|
+
.axisLeft(yScale)
|
|
120
|
+
.ticks(16)
|
|
121
|
+
.tickValues(d3.range(0, 8500, 500));
|
|
122
|
+
|
|
123
|
+
svg
|
|
124
|
+
.append("g")
|
|
125
|
+
.attr("transform", `translate(0,${height - margin.bottom})`)
|
|
126
|
+
.call(xAxis);
|
|
127
|
+
|
|
128
|
+
svg.append("g").attr("transform", `translate(${margin.left},0)`).call(yAxis);
|
|
129
|
+
|
|
130
|
+
// Gridlines
|
|
131
|
+
const gridlinesX = d3
|
|
132
|
+
.axisBottom(xScale)
|
|
133
|
+
.tickSize(-height + margin.top + margin.bottom)
|
|
134
|
+
.tickFormat(() => "")
|
|
135
|
+
.tickValues(d3.range(0, 61, 2));
|
|
136
|
+
const gridlinesY = d3
|
|
137
|
+
.axisLeft(yScale)
|
|
138
|
+
.tickSize(-width + margin.left + margin.right)
|
|
139
|
+
.tickFormat(() => "")
|
|
140
|
+
.tickValues(d3.range(0, 8500, 500));
|
|
141
|
+
|
|
142
|
+
svg
|
|
143
|
+
.append("g")
|
|
144
|
+
.attr("class", "grid")
|
|
145
|
+
.attr("transform", `translate(0,${height - margin.bottom})`)
|
|
146
|
+
.call(gridlinesX);
|
|
147
|
+
|
|
148
|
+
svg
|
|
149
|
+
.append("g")
|
|
150
|
+
.attr("class", "grid")
|
|
151
|
+
.attr("transform", `translate(${margin.left},0)`)
|
|
152
|
+
.call(gridlinesY);
|
|
153
|
+
|
|
154
|
+
// Line
|
|
155
|
+
const line = d3
|
|
156
|
+
.line()
|
|
157
|
+
.x((d: any) => xScale(d))
|
|
158
|
+
.y((d: any) => yScale(d * a + b));
|
|
159
|
+
|
|
160
|
+
svg
|
|
161
|
+
.append("path")
|
|
162
|
+
.datum(d3.range(0, 61))
|
|
163
|
+
.attr("fill", "none")
|
|
164
|
+
.attr("stroke", "blue")
|
|
165
|
+
.attr("stroke-width", 1)
|
|
166
|
+
.attr("d", line);
|
|
167
|
+
|
|
168
|
+
// KaTeX math expression
|
|
169
|
+
const latexString = katex.renderToString("(d_1)", { throwOnError: false });
|
|
170
|
+
|
|
171
|
+
svg
|
|
172
|
+
.append("foreignObject")
|
|
173
|
+
.attr("x", xScale(18))
|
|
174
|
+
.attr("y", yScale(4500))
|
|
175
|
+
.attr("width", 50)
|
|
176
|
+
.attr("height", 30)
|
|
177
|
+
.html(
|
|
178
|
+
`<div style='font-size: 16px; font-weight: bold'>${latexString}</div>`,
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
// Labels
|
|
182
|
+
svg
|
|
183
|
+
.append("text")
|
|
184
|
+
.attr("x", width / 2)
|
|
185
|
+
.attr("y", height - 5)
|
|
186
|
+
.attr("text-anchor", "middle")
|
|
187
|
+
.attr("font-weight", "bold")
|
|
188
|
+
.text("Nombre de participants");
|
|
189
|
+
|
|
190
|
+
svg
|
|
191
|
+
.append("text")
|
|
192
|
+
.attr("x", margin.left)
|
|
193
|
+
.attr("y", margin.top - 5)
|
|
194
|
+
.attr("text-anchor", "middle")
|
|
195
|
+
.attr("font-weight", "bold")
|
|
196
|
+
.text("Coût en €");
|
|
197
|
+
${d3n.svgString()}
|
|
198
|
+
|
|
199
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAGlC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pieChartReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/pieChartReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAuBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAoLF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAiBjD,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { blueExtraDark, colorWithOpacity, greenDark, orange, pinkDark, purpleDark, red, } from "../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { Angle } from "../../../math/geometry/angle.js";
|
|
6
|
+
import { Point } from "../../../math/geometry/point.js";
|
|
7
|
+
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
8
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
9
|
+
import { round } from "../../../math/utils/round.js";
|
|
10
|
+
import { percentParser } from "../../../tree/parsers/percentParser.js";
|
|
11
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
12
|
+
import { getLetter } from "../../../utils/strings/getLetter.js";
|
|
13
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
14
|
+
const propositions = [];
|
|
15
|
+
addValidProp(propositions, answer);
|
|
16
|
+
const { points } = identifiers;
|
|
17
|
+
const pointsObj = points.map((p, i) => new Point(getLetter(i, true), p[0], p[1]));
|
|
18
|
+
const angle = new Angle([pointsObj[1], new Point("O", 0, 0), pointsObj[0]]);
|
|
19
|
+
const angleValue = angle.evaluate();
|
|
20
|
+
tryToAddWrongProp(propositions, angleValue.frenchify() + "\\%");
|
|
21
|
+
tryToAddWrongProp(propositions, `${round(100 / points.length, 1)}\\%`);
|
|
22
|
+
tryToAddWrongProp(propositions, round((angleValue * 100) / 180, 2).frenchify() + "\\%");
|
|
23
|
+
while (propositions.length < n) {
|
|
24
|
+
tryToAddWrongProp(propositions, randfloat(8, 80, 2).frenchify() + "\\%");
|
|
25
|
+
}
|
|
26
|
+
return shuffleProps(propositions, n);
|
|
27
|
+
};
|
|
28
|
+
const getAnswer = (identifiers) => {
|
|
29
|
+
const { points } = identifiers;
|
|
30
|
+
const pointsObj = points.map((p, i) => new Point(getLetter(i, true), p[0], p[1]));
|
|
31
|
+
const angle = new Angle([pointsObj[1], new Point("O", 0, 0), pointsObj[0]]);
|
|
32
|
+
const angleValue = angle.evaluate();
|
|
33
|
+
return round((angleValue * 100) / 360, 2).frenchify() + "\\%";
|
|
34
|
+
};
|
|
35
|
+
const getInstruction = (identifiers) => {
|
|
36
|
+
return `Ci-dessous est donnée la répartition des communications effectuées par des lycéens avec leur téléphone portable.
|
|
37
|
+
|
|
38
|
+
Quelle proportion des communications effectuées, les communications audio représentent-elles ?
|
|
39
|
+
|
|
40
|
+
Arrondir au centième.`;
|
|
41
|
+
};
|
|
42
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
43
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
44
|
+
const getGGBOptions = (identifiers) => {
|
|
45
|
+
const { points, labels } = identifiers;
|
|
46
|
+
const pointsObj = points.map((p, i) => new Point(getLetter(i, true), p[0], p[1]));
|
|
47
|
+
// const reversedPoints = pointsObj.reverse();
|
|
48
|
+
const colors = [greenDark, orange, pinkDark, purpleDark, red];
|
|
49
|
+
const angle = new Angle([pointsObj[1], new Point("O", 0, 0), pointsObj[0]]);
|
|
50
|
+
const getMidPoint = (nextPoint, prevPoint) => {
|
|
51
|
+
const [xA, yA] = prevPoint;
|
|
52
|
+
const angleA = Math.atan2(yA, xA);
|
|
53
|
+
const [xB, yB] = nextPoint;
|
|
54
|
+
const angleB = Math.atan2(yB, xB);
|
|
55
|
+
// const angleM = (angleA + angleB) / 2;
|
|
56
|
+
const angleM = angleA +
|
|
57
|
+
Math.atan2(Math.sin(angleB - angleA), Math.cos(angleB - angleA)) / 2;
|
|
58
|
+
return [1.2 * Math.cos(angleM), 1.2 * Math.sin(angleM)];
|
|
59
|
+
return [
|
|
60
|
+
(1.2 * (xA + xB)) / Math.sqrt((xA + xB) ** 2 + (yA + yB) ** 2 + 0.1),
|
|
61
|
+
(1.2 * (yA + yB)) / Math.sqrt((xA + xB) ** 2 + (yA + yB) ** 2 + 0.1),
|
|
62
|
+
];
|
|
63
|
+
};
|
|
64
|
+
const ggb = new GeogebraConstructor({
|
|
65
|
+
commands: [
|
|
66
|
+
`C = Circle((0,0), 1)`,
|
|
67
|
+
`SetLineThickness(C, 1)`,
|
|
68
|
+
// ...pointsObj.flatMap((p) => p.toGGBCommand()),
|
|
69
|
+
...pointsObj.flatMap((p, i) => [
|
|
70
|
+
`C_${i} = CircularSector((0,0), ${pointsObj[(i + 1 + pointsObj.length) % pointsObj.length].toMathString()}, ${p.toMathString()})`,
|
|
71
|
+
`SetColor(C_${i}, "${colorWithOpacity(colors[i], 80)}")`,
|
|
72
|
+
`SetLineThickness(C_${i}, 0)`,
|
|
73
|
+
// `SetCaption(C_${i}, "$\\tiny \\text{${labels[i]}}$")`,
|
|
74
|
+
// `ShowLabel(C_${i}, true)`,
|
|
75
|
+
// `Text("$\\tiny \\text{${labels[i]
|
|
76
|
+
// .split(" ")
|
|
77
|
+
// .join("\\\\")}}$", (${getMidPoint(
|
|
78
|
+
// points[(i + 1 + points.length) % points.length],
|
|
79
|
+
// points[i],
|
|
80
|
+
// ).join(",")}), true, true, 1, 0)`,
|
|
81
|
+
`Text("$\\tiny \\text{${labels[i]
|
|
82
|
+
.split(" ")
|
|
83
|
+
.join("\\\\")}}$", (${getMidPoint(points[(i + 1 + points.length) % points.length], points[i]).join(",")}), true, true, 0, 0)`,
|
|
84
|
+
]),
|
|
85
|
+
...angle.toCommands({
|
|
86
|
+
showValue: points[1][0] === 1 ? false : true,
|
|
87
|
+
pointsAreNotBuilt: true,
|
|
88
|
+
thickness: 1,
|
|
89
|
+
color: blueExtraDark,
|
|
90
|
+
}),
|
|
91
|
+
],
|
|
92
|
+
hideAxes: true,
|
|
93
|
+
hideGrid: true,
|
|
94
|
+
forbidShiftDragZoom: true,
|
|
95
|
+
});
|
|
96
|
+
return ggb.getOptions({
|
|
97
|
+
coords: [-1.4, 1.4, -1.4, 1.4],
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
const getKeys = (identifiers) => {
|
|
101
|
+
return ["percent"];
|
|
102
|
+
};
|
|
103
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
104
|
+
try {
|
|
105
|
+
const parsed = percentParser(ans, true);
|
|
106
|
+
return parsed === answer;
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
return handleVEAError(err);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const getPieChartReadingQuestion = (opts) => {
|
|
113
|
+
const labels = [
|
|
114
|
+
"communications audio",
|
|
115
|
+
"communications vidéo",
|
|
116
|
+
"messagerie électronique",
|
|
117
|
+
"autre",
|
|
118
|
+
"messages SMS",
|
|
119
|
+
];
|
|
120
|
+
const getPointFromPrev = (prevPoint, degAngle) => {
|
|
121
|
+
const radAngle = -(degAngle * Math.PI) / 180;
|
|
122
|
+
return [
|
|
123
|
+
round(prevPoint[0] * Math.cos(radAngle) - prevPoint[1] * Math.sin(radAngle), 6),
|
|
124
|
+
round(prevPoint[0] * Math.sin(radAngle) + prevPoint[1] * Math.cos(radAngle), 6),
|
|
125
|
+
];
|
|
126
|
+
};
|
|
127
|
+
const angles = [5 * randint(6, 30)];
|
|
128
|
+
for (let i = 0; i < labels.length - 1; i++) {
|
|
129
|
+
const remaining = 360 - angles.reduce((acc, curr) => acc + curr);
|
|
130
|
+
if (i === labels.length - 1)
|
|
131
|
+
angles.push(remaining);
|
|
132
|
+
else
|
|
133
|
+
angles.push(randint(30, Math.min(100, remaining - 30)));
|
|
134
|
+
}
|
|
135
|
+
const points = [[0, 1]];
|
|
136
|
+
for (let i = 0; i < angles.length - 1; i++) {
|
|
137
|
+
points.push(getPointFromPrev(points[i], angles[i]));
|
|
138
|
+
}
|
|
139
|
+
const identifiers = {
|
|
140
|
+
labels,
|
|
141
|
+
points,
|
|
142
|
+
};
|
|
143
|
+
const question = {
|
|
144
|
+
answer: getAnswer(identifiers),
|
|
145
|
+
instruction: getInstruction(identifiers),
|
|
146
|
+
keys: getKeys(identifiers),
|
|
147
|
+
answerFormat: "tex",
|
|
148
|
+
identifiers,
|
|
149
|
+
// hint: getHint(identifiers),
|
|
150
|
+
// correction: getCorrection(identifiers),
|
|
151
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
152
|
+
};
|
|
153
|
+
return question;
|
|
154
|
+
};
|
|
155
|
+
export const pieChartReading = {
|
|
156
|
+
id: "pieChartReading",
|
|
157
|
+
label: "Convertir un angle en pourcentage dans un diagramme circulaire",
|
|
158
|
+
isSingleStep: true,
|
|
159
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPieChartReadingQuestion(opts), nb),
|
|
160
|
+
qcmTimer: 60,
|
|
161
|
+
freeTimer: 60,
|
|
162
|
+
getPropositions,
|
|
163
|
+
isAnswerValid,
|
|
164
|
+
subject: "Mathématiques",
|
|
165
|
+
// getHint,
|
|
166
|
+
// getCorrection,
|
|
167
|
+
getInstruction,
|
|
168
|
+
getAnswer,
|
|
169
|
+
getGGBOptions,
|
|
170
|
+
hasGeogebra: true,
|
|
171
|
+
};
|
|
@@ -12,10 +12,10 @@ const getAnswer = () => "0";
|
|
|
12
12
|
const getInstruction = (identifiers) => {
|
|
13
13
|
const tex = identifiers.tex;
|
|
14
14
|
return `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par :
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
$$
|
|
17
17
|
f(x) = ${tex}
|
|
18
|
-
|
|
18
|
+
$$`;
|
|
19
19
|
};
|
|
20
20
|
export const getConstanteDerivative = () => {
|
|
21
21
|
const c = NombreConstructor.random();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythagoreOrThales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/pythagoreOrThales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAkBtC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IAEzB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CAQnB,CAAC;AA+MF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"pythagoreOrThales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/pythagoreOrThales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAkBtC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IAEzB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CAQnB,CAAC;AA+MF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAqBnD,CAAC"}
|
|
@@ -191,6 +191,9 @@ export const pythagoreOrThales = {
|
|
|
191
191
|
getGGBOptions,
|
|
192
192
|
hasGeogebra: true,
|
|
193
193
|
answerType: "QCU",
|
|
194
|
+
pdfOptions: {
|
|
195
|
+
shouldSpreadPropositions: true,
|
|
196
|
+
},
|
|
194
197
|
};
|
|
195
198
|
const getSubTriangle = ({ triangle, insidePointsNames, ratio, isPapillon, }) => {
|
|
196
199
|
const [A, B, C] = triangle.points;
|
|
@@ -149,9 +149,10 @@ const getGGBOptions = (identifiers) => {
|
|
|
149
149
|
shapeObject.drawSidesDecoration();
|
|
150
150
|
}
|
|
151
151
|
const cmds = shapeObject.toGGBCommands();
|
|
152
|
+
shapeObject.points;
|
|
152
153
|
const ggb = new GeogebraConstructor({ hideAxes: true, hideGrid: true });
|
|
153
154
|
ggb.commands = cmds;
|
|
154
|
-
return ggb.getOptions({ coords:
|
|
155
|
+
return ggb.getOptions({ coords: ggb.getCoordsForPoints(shapeObject.points) });
|
|
155
156
|
};
|
|
156
157
|
const getKeys = (identifiers) => {
|
|
157
158
|
return [];
|
|
@@ -31,7 +31,7 @@ const getAverageListQuestion = () => {
|
|
|
31
31
|
keys: [],
|
|
32
32
|
answerFormat: "tex",
|
|
33
33
|
identifiers,
|
|
34
|
-
hint: "La moyenne d'une liste de valeurs est la somme
|
|
34
|
+
hint: "La moyenne d'une liste de valeurs est la somme des valeurs divisée par le nombre de valeurs.",
|
|
35
35
|
correction: `
|
|
36
36
|
On additionne toutes les valeurs :
|
|
37
37
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
indicatorAsked: string;
|
|
4
|
+
values: number[];
|
|
5
|
+
};
|
|
6
|
+
export declare const choseReasoningForIndicator: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=choseReasoningForIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choseReasoningForIndicator.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/choseReasoningForIndicator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAuHF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAgB5D,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
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 { AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
5
|
+
import { operatorComposition } from "../../../../tree/utilities/operatorComposition.js";
|
|
6
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
7
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
8
|
+
import { average } from "../../../../utils/average.js";
|
|
9
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
10
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
11
|
+
const propositions = [];
|
|
12
|
+
addValidProp(propositions, answer, "raw");
|
|
13
|
+
const { values, indicatorAsked } = identifiers;
|
|
14
|
+
const avg = average(values);
|
|
15
|
+
const max = Math.max(...values);
|
|
16
|
+
tryToAddWrongProp(propositions, `La ${indicatorAsked} est $${avg}$ car $\\frac{${operatorComposition(AddNode, values.map((v) => v.toTree())).toTex()}}{${values.length}} = ${avg}$`, "raw");
|
|
17
|
+
tryToAddWrongProp(propositions, `La ${indicatorAsked} est $${avg}$ car c'est la moitié de $${max}$.`, "raw");
|
|
18
|
+
tryToAddWrongProp(propositions, `La ${indicatorAsked} est $${avg}$ car la valeur $${avg}$ est au milieu de la série.`, "raw");
|
|
19
|
+
tryToAddWrongProp(propositions, `La ${indicatorAsked} est $${avg}$ car il y a dans la série autant de valeurs inférieures à $${avg}$ que de valeurs supérieures à $${avg}$.`, "raw");
|
|
20
|
+
return shuffleProps(propositions, n);
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
const { values, indicatorAsked } = identifiers;
|
|
24
|
+
const avg = average(values);
|
|
25
|
+
return indicatorAsked === "moyenne"
|
|
26
|
+
? `La moyenne est $${avg}$ car $\\frac{${operatorComposition(AddNode, values.map((v) => v.toTree())).toTex()}}{${values.length}} = ${avg}$`
|
|
27
|
+
: `La médiane est $${avg}$ car il y a dans la série autant de valeurs inférieures à $${avg}$ que de valeurs supérieures à $${avg}$.`;
|
|
28
|
+
};
|
|
29
|
+
const getInstruction = (identifiers) => {
|
|
30
|
+
const { values, indicatorAsked } = identifiers;
|
|
31
|
+
const avg = average(values);
|
|
32
|
+
return `Voici une série de valeurs :
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
${values.join("\\ ; \\ ")}
|
|
36
|
+
$$
|
|
37
|
+
|
|
38
|
+
La ${indicatorAsked} de cette série est $${avg}$.
|
|
39
|
+
|
|
40
|
+
Quelle est la justification correcte ?`;
|
|
41
|
+
};
|
|
42
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
43
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
44
|
+
const getKeys = (identifiers) => {
|
|
45
|
+
return [];
|
|
46
|
+
};
|
|
47
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
48
|
+
try {
|
|
49
|
+
throw Error("VEA not implemented");
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
return handleVEAError(err);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const getChoseReasoningForIndicatorQuestion = (ops) => {
|
|
56
|
+
const max = 2 * randint(5, 20);
|
|
57
|
+
const x = max / 2;
|
|
58
|
+
let otherValues = [];
|
|
59
|
+
const miserablyDo = () => {
|
|
60
|
+
const b = randint(x + 1, 2 * x);
|
|
61
|
+
const c = randint(x + 1, 2 * x);
|
|
62
|
+
let remaining = 4 * x - b - c;
|
|
63
|
+
const d = randint(0, Math.min(remaining + 1, x));
|
|
64
|
+
remaining -= d;
|
|
65
|
+
const e = randint(0, Math.min(remaining + 1, x));
|
|
66
|
+
remaining -= e;
|
|
67
|
+
const f = remaining;
|
|
68
|
+
otherValues = [max, b, c, d, e, f];
|
|
69
|
+
};
|
|
70
|
+
do {
|
|
71
|
+
miserablyDo();
|
|
72
|
+
} while (otherValues[otherValues.length - 1] >= x);
|
|
73
|
+
const shuffled = shuffle(otherValues);
|
|
74
|
+
shuffled.splice(3, 0, x);
|
|
75
|
+
const identifiers = {
|
|
76
|
+
values: shuffled,
|
|
77
|
+
indicatorAsked: random(["moyenne", "médiane"]),
|
|
78
|
+
};
|
|
79
|
+
const question = {
|
|
80
|
+
answer: getAnswer(identifiers),
|
|
81
|
+
instruction: getInstruction(identifiers),
|
|
82
|
+
keys: getKeys(identifiers),
|
|
83
|
+
answerFormat: "raw",
|
|
84
|
+
identifiers,
|
|
85
|
+
// hint: getHint(identifiers),
|
|
86
|
+
// correction: getCorrection(identifiers),
|
|
87
|
+
};
|
|
88
|
+
return question;
|
|
89
|
+
};
|
|
90
|
+
export const choseReasoningForIndicator = {
|
|
91
|
+
id: "choseReasoningForIndicator",
|
|
92
|
+
label: "Trouver le bon raisonnement pour déterminer une moyenne/une médiane",
|
|
93
|
+
isSingleStep: true,
|
|
94
|
+
generator: (nb, opts) => getDistinctQuestions(() => getChoseReasoningForIndicatorQuestion(opts), nb),
|
|
95
|
+
qcmTimer: 60,
|
|
96
|
+
freeTimer: 60,
|
|
97
|
+
getPropositions,
|
|
98
|
+
isAnswerValid,
|
|
99
|
+
subject: "Mathématiques",
|
|
100
|
+
getInstruction,
|
|
101
|
+
// getHint,
|
|
102
|
+
// getCorrection,
|
|
103
|
+
getAnswer,
|
|
104
|
+
answerType: "QCU",
|
|
105
|
+
};
|
|
@@ -12,4 +12,5 @@ export * from "./standardDeviationList.js";
|
|
|
12
12
|
export * from "./standardDeviationTable.js";
|
|
13
13
|
export * from "./interquartilesList.js";
|
|
14
14
|
export * from "./interquartilesTable.js";
|
|
15
|
+
export * from "./choseReasoningForIndicator.js";
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sCAAsC,CAAC;AACrD,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sCAAsC,CAAC;AACrD,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spaceCoordinatesInPrism.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"spaceCoordinatesInPrism.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAyKF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAiBzD,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js
|
|
|
4
4
|
import { SpacePoint } from "../../../../math/geometry/spacePoint.js";
|
|
5
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
6
|
import { random } from "../../../../utils/alea/random.js";
|
|
7
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
7
8
|
const getPoints = (identifiers) => {
|
|
8
9
|
const { l, L, h } = identifiers;
|
|
9
10
|
const zeroTree = (0).toTree();
|
|
@@ -47,7 +48,9 @@ Les coordonnées du point $${givenPoints[1]}$ sont $${points
|
|
|
47
48
|
.find((p) => p.name === givenPoints[1])
|
|
48
49
|
.toCoords()}$.
|
|
49
50
|
|
|
50
|
-
Quelles sont les coordonnées du point $${askedPoint}$
|
|
51
|
+
Quelles sont les coordonnées du point $${askedPoint}$ ?
|
|
52
|
+
|
|
53
|
+
*On pourra tourner la fenêtre graphique.*`;
|
|
51
54
|
};
|
|
52
55
|
// const getHint : GetHint<Identifiers> = (identifiers)=>{
|
|
53
56
|
// }
|
|
@@ -56,15 +59,16 @@ Quelles sont les coordonnées du point $${askedPoint}$ ?`;
|
|
|
56
59
|
const getGGBOptions = (identifiers) => {
|
|
57
60
|
const { askedPoint, givenPoints, L, l, h } = identifiers;
|
|
58
61
|
const points = getPoints(identifiers);
|
|
62
|
+
const shownPoints = points.filter((p) => [askedPoint, ...givenPoints].includes(p.name));
|
|
59
63
|
const commands = [
|
|
60
|
-
...
|
|
64
|
+
...shownPoints.flatMap((p) => p.toGGBCommand({ color: "black", size: 2 })),
|
|
61
65
|
`P = Prism(${points
|
|
62
66
|
.slice(0, 5)
|
|
63
|
-
.map((p) => p.
|
|
67
|
+
.map((p) => p.toMathString())
|
|
64
68
|
.join(",")})`,
|
|
65
|
-
`SetVisibleInView(J, -1, false)`,
|
|
66
|
-
`SetVisibleInView(K, -1, false)`,
|
|
67
|
-
`SetVisibleInView(I, -1, false)`,
|
|
69
|
+
// `SetVisibleInView(J, -1, false)`,
|
|
70
|
+
// `SetVisibleInView(K, -1, false)`,
|
|
71
|
+
// `SetVisibleInView(I, -1, false)`,
|
|
68
72
|
`SetColor(P, "#20000000")`,
|
|
69
73
|
`SetLineThickness(P, 1)`,
|
|
70
74
|
];
|
|
@@ -99,13 +103,35 @@ const getSpaceCoordinatesInPrismQuestion = (opts) => {
|
|
|
99
103
|
const l = randint(2, 10);
|
|
100
104
|
const L = randint(2, 10);
|
|
101
105
|
const h = randint(2, 10);
|
|
106
|
+
const points = getPoints({ L, l, h });
|
|
102
107
|
const letters = ["A", "B", "C", "D", "E", "F", "G", "H"];
|
|
103
|
-
const
|
|
104
|
-
const givenPointOne =
|
|
105
|
-
const
|
|
108
|
+
const shuffled = shuffle(points.slice(1));
|
|
109
|
+
const givenPointOne = shuffled[0];
|
|
110
|
+
const pointOneCoords = givenPointOne.getEvaluatedCoords();
|
|
111
|
+
let givenPointTwo;
|
|
112
|
+
for (let i = 1; i < shuffled.length; i++) {
|
|
113
|
+
const p = shuffled[i];
|
|
114
|
+
const coords = p.getEvaluatedCoords();
|
|
115
|
+
if (coords[0] + pointOneCoords[0] === 0 ||
|
|
116
|
+
coords[1] + pointOneCoords[0] === 0 ||
|
|
117
|
+
coords[2] + pointOneCoords[2] === 0)
|
|
118
|
+
continue;
|
|
119
|
+
const absDiffCoeffs = coords.map((c, i) => Math.abs(c - pointOneCoords[i]));
|
|
120
|
+
const validCoeffs = absDiffCoeffs.filter((e) => e !== 0);
|
|
121
|
+
if (validCoeffs.length < 2)
|
|
122
|
+
continue;
|
|
123
|
+
givenPointTwo = p;
|
|
124
|
+
}
|
|
125
|
+
const askedPoint = random(letters, [
|
|
126
|
+
"A",
|
|
127
|
+
givenPointOne.name,
|
|
128
|
+
givenPointTwo.name,
|
|
129
|
+
]);
|
|
130
|
+
// const givenPointOne = random(letters, ["A", askedPoint]);
|
|
131
|
+
// const givenPointTwo = random(letters, ["A", askedPoint, givenPointOne]);
|
|
106
132
|
const identifiers = {
|
|
107
133
|
askedPoint,
|
|
108
|
-
givenPoints: [givenPointOne, givenPointTwo],
|
|
134
|
+
givenPoints: [givenPointOne.name, givenPointTwo.name],
|
|
109
135
|
l,
|
|
110
136
|
L,
|
|
111
137
|
h,
|
package/lib/geogebra/colors.d.ts
CHANGED
|
@@ -22,4 +22,5 @@ export declare const purpleDark = "#522AAB";
|
|
|
22
22
|
export declare const purples: string[];
|
|
23
23
|
export declare const colors: string[];
|
|
24
24
|
export declare const randomColor: () => string;
|
|
25
|
+
export declare const colorWithOpacity: (color: string, opacity: number) => string;
|
|
25
26
|
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/geogebra/colors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,YAAY,CAAC;AAC7B,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM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AAS,YAAY,CAAC;AACnC,eAAO,MAAM,SAAS,YAAY,CAAC;AACnC,eAAO,MAAM,MAAM,UAAqC,CAAC;AAEzD,eAAO,MAAM,SAAS,YAAY,CAAC;AACnC,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,KAAK,UAAiD,CAAC;AAEpE,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,UAAU,YAAY,CAAC;AACpC,eAAO,MAAM,UAAU,YAAY,CAAC;AACpC,eAAO,MAAM,OAAO,UAAwC,CAAC;AAC7D,eAAO,MAAM,MAAM,UAAyD,CAAC;AAE7E,eAAO,MAAM,WAAW,cAEvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAW,MAAM,WAAW,MAAM,WAE9D,CAAC"}
|
package/lib/geogebra/colors.js
CHANGED
|
@@ -25,3 +25,6 @@ export const colors = [...reds, ...oranges, ...greens, ...blues, ...purples];
|
|
|
25
25
|
export const randomColor = () => {
|
|
26
26
|
return random(colors);
|
|
27
27
|
};
|
|
28
|
+
export const colorWithOpacity = (color, opacity) => {
|
|
29
|
+
return `#${opacity < 10 ? `0+${opacity}` : opacity}${color.substring(1)}`;
|
|
30
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1527,6 +1527,9 @@ declare const mathExercises: (Exercise<{
|
|
|
1527
1527
|
}, {}> | Exercise<{
|
|
1528
1528
|
sortedValues: number[];
|
|
1529
1529
|
effectifs: number[];
|
|
1530
|
+
}, {}> | Exercise<{
|
|
1531
|
+
indicatorAsked: string;
|
|
1532
|
+
values: number[];
|
|
1530
1533
|
}, {}> | Exercise<{
|
|
1531
1534
|
xValues: number[];
|
|
1532
1535
|
yValues: number[];
|
|
@@ -1882,6 +1885,9 @@ declare const mathExercises: (Exercise<{
|
|
|
1882
1885
|
}, {}> | Exercise<{
|
|
1883
1886
|
values: number[][];
|
|
1884
1887
|
caseAsked: number;
|
|
1888
|
+
}, {}> | Exercise<{
|
|
1889
|
+
points: number[][];
|
|
1890
|
+
labels: string[];
|
|
1885
1891
|
}, {}>)[];
|
|
1886
1892
|
declare const pcExercises: (Exercise<{
|
|
1887
1893
|
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;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/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;AAG7D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"latexTester.d.ts","sourceRoot":"","sources":["../src/latexTester.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"latexTester.d.ts","sourceRoot":"","sources":["../src/latexTester.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAAW,MAAM,2CAgKxC,CAAC"}
|
package/lib/latexTester.js
CHANGED
|
@@ -23,7 +23,13 @@ export const latexTester = (latex, isDefaultInMathMode = false) => {
|
|
|
23
23
|
if (inDoubleDollarMode &&
|
|
24
24
|
nextNextChar !== undefined &&
|
|
25
25
|
nextNextChar !== "\n") {
|
|
26
|
-
throw new Error(`Whitespace missing after double dollar, got char ${nextNextChar}`);
|
|
26
|
+
throw new Error(`Whitespace missing after start double dollar, got char ${nextNextChar}`);
|
|
27
|
+
}
|
|
28
|
+
if (!inDoubleDollarMode &&
|
|
29
|
+
nextNextChar !== undefined &&
|
|
30
|
+
nextNextChar !== "\n" &&
|
|
31
|
+
nextNextChar !== " ") {
|
|
32
|
+
throw new Error(`Whitespace missing after end double dollar, got char ${nextNextChar}`);
|
|
27
33
|
}
|
|
28
34
|
i++;
|
|
29
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angle.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/angle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAMlE,OAAO,EAAE,KAAK,EAAoB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"angle.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/angle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAMlE,OAAO,EAAE,KAAK,EAAoB,gBAAgB,EAAE,MAAM,YA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C;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CA0BF"}
|
|
@@ -196,14 +196,21 @@ export class Angle {
|
|
|
196
196
|
}
|
|
197
197
|
toCommands(opts) {
|
|
198
198
|
const name = `angle_{${this.points[0].name}${this.points[1].name}${this.points[2].name}}`;
|
|
199
|
-
const cmds = [
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
const cmds = [];
|
|
200
|
+
if (opts?.pointsAreNotBuilt) {
|
|
201
|
+
cmds.push(`${name} = Angle(${this.points[0].toMathString()},${this.points[1].toMathString()},${this.points[2].toMathString()}, xAxis)`);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
cmds.push(`${name} = Angle(${this.points[0].name},${this.points[1].name},${this.points[2].name}, xAxis)`);
|
|
205
|
+
}
|
|
206
|
+
cmds.push(`ShowLabel(${name}, ${opts?.showValue ? "true" : "false"})`);
|
|
203
207
|
cmds.push(`SetCaption(${name}, "$\\footnotesize ${round(this.evaluate(), 1).frenchify() + "°"}$")`);
|
|
204
208
|
if (opts?.color) {
|
|
205
209
|
cmds.push(`SetColor(${name}, "${opts.color}")`);
|
|
206
210
|
}
|
|
211
|
+
if (opts?.thickness !== undefined) {
|
|
212
|
+
cmds.push(`SetLineThickness(${name}, ${opts?.thickness})`);
|
|
213
|
+
}
|
|
207
214
|
return cmds;
|
|
208
215
|
}
|
|
209
216
|
}
|
|
@@ -18,6 +18,7 @@ export declare class SpacePoint {
|
|
|
18
18
|
constructor(name: string, x: AlgebraicNode, y: AlgebraicNode, z: AlgebraicNode);
|
|
19
19
|
getCoords(): AlgebraicNode[];
|
|
20
20
|
getEvaluatedCoords(): number[];
|
|
21
|
+
toMathString(): string;
|
|
21
22
|
toTex(): string;
|
|
22
23
|
toTexWithCoords(): string;
|
|
23
24
|
toCoords(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spacePoint.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/spacePoint.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MAAM,CAAC,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,SAAS,EACjB,KAAK,CAAC,EAAE,SAAS,EACjB,KAAK,CAAC,EAAE,SAAS,GAChB,UAAU;IAyBb,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE;IA4BtC,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,GAAE,MAAY;CAWrD;AAED,qBAAa,UAAU;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;IACjB,CAAC,EAAE,aAAa,CAAC;gBAEf,IAAI,EAAE,MAAM,EACZ,CAAC,EAAE,aAAa,EAChB,CAAC,EAAE,aAAa,EAChB,CAAC,EAAE,aAAa;IAQlB,SAAS;IAGT,kBAAkB;IAGlB,YAAY;IAGZ,KAAK,IAAI,MAAM;IAIf,eAAe,IAAI,MAAM;IAKzB,QAAQ,IAAI,MAAM;IAIlB,QAAQ,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,SAAM,GAAG,UAAU;IAkB/C,UAAU,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM;IAIjC,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO;IAG9B,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU;IAOtC,YAAY,CAAC,EACX,OAAc,EACd,SAAgB,EAChB,KAAK,EACL,IAAI,EACJ,KAAK,GACN,GAAE,kBAAuB;CAmB3B"}
|
|
@@ -48,6 +48,9 @@ export class SpacePoint {
|
|
|
48
48
|
getEvaluatedCoords() {
|
|
49
49
|
return this.getCoords().map((e) => e.evaluate({}));
|
|
50
50
|
}
|
|
51
|
+
toMathString() {
|
|
52
|
+
return `(${this.x.toMathString()}, ${this.y.toMathString()}, ${this.z.toMathString()})`;
|
|
53
|
+
}
|
|
51
54
|
toTex() {
|
|
52
55
|
return `${this.name}`;
|
|
53
56
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getLetter.d.ts","sourceRoot":"","sources":["../../../src/utils/strings/getLetter.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,MAAO,MAAM,QAAQ,OAAO,WAEjD,CAAC"}
|