math-exercises 3.0.22 → 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/exercise.d.ts +2 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +60 -28
- 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/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/secondDegreeDerivative.js +5 -3
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/thirdDegreeDerivative.js +5 -3
- package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expFactorization.js +5 -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/primitive/polynomialPrimitive.d.ts.map +1 -1
- package/lib/exercises/math/primitive/polynomialPrimitive.js +47 -16
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +3 -3
- 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/index.d.ts +2 -0
- package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts +11 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +167 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/index.js +1 -0
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +38 -26
- 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/geogebra/geogebraConstructor.d.ts +2 -0
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +6 -0
- package/lib/index.d.ts +12 -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 +3 -1
- package/lib/math/geometry/spacePoint.d.ts.map +1 -1
- package/lib/math/geometry/spacePoint.js +19 -2
- package/lib/math/spaceGeometry/prism.d.ts +4 -0
- package/lib/math/spaceGeometry/prism.d.ts.map +1 -0
- package/lib/math/spaceGeometry/prism.js +3 -0
- package/lib/tree/nodes/algebraicNode.d.ts +4 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.d.ts +2 -2
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +4 -1
- package/lib/tree/nodes/functions/sinNode.d.ts +2 -2
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +4 -1
- package/lib/tree/nodes/functions/tanNode.d.ts +2 -2
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +4 -1
- 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
|
@@ -57,6 +57,8 @@ export type GeogebraOptions = {
|
|
|
57
57
|
lockedAxesRatio?: number | false;
|
|
58
58
|
xAxis?: GeogebraAxisOptions;
|
|
59
59
|
yAxis?: GeogebraAxisOptions;
|
|
60
|
+
zAxis?: GeogebraAxisOptions;
|
|
61
|
+
viewDirectionVector?: number[];
|
|
60
62
|
};
|
|
61
63
|
export type KeyboardOptions = {
|
|
62
64
|
parenthesisShouldNotProduceLeftRight?: boolean;
|
|
@@ -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,yBA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ation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"multiplicationEquation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/multiplicationEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAarC,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;AAwHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
|
|
@@ -8,6 +8,55 @@ import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
|
8
8
|
import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
|
|
9
9
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
10
10
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
11
|
+
const getStatementNode = (identifiers) => {
|
|
12
|
+
const { a, b, c, d } = identifiers;
|
|
13
|
+
const polynome1 = new Polynomial([b, a]);
|
|
14
|
+
const polynome2 = new Polynomial([d, c]);
|
|
15
|
+
const statement = new MultiplyNode(polynome1.toTree(), polynome2.toTree());
|
|
16
|
+
return statement;
|
|
17
|
+
};
|
|
18
|
+
const getStartStatement = (identifiers) => {
|
|
19
|
+
return `${getStatementNode(identifiers).toTex()} = 0`;
|
|
20
|
+
};
|
|
21
|
+
const getInstruction = (identifiers) => {
|
|
22
|
+
return `Résoudre :
|
|
23
|
+
|
|
24
|
+
$$
|
|
25
|
+
${getStartStatement(identifiers)}
|
|
26
|
+
$$`;
|
|
27
|
+
};
|
|
28
|
+
const getAnswer = (identifiers) => {
|
|
29
|
+
const { a, b, c, d } = identifiers;
|
|
30
|
+
const sol1 = new Rational(-b, a).simplify().toTree();
|
|
31
|
+
const sol2 = new Rational(-d, c).simplify().toTree();
|
|
32
|
+
const sortedSols = -b / a < -d / c ? [sol1, sol2] : [sol2, sol1];
|
|
33
|
+
const answer = new EquationSolutionNode(new DiscreteSetNode(sortedSols)).toTex();
|
|
34
|
+
return answer;
|
|
35
|
+
};
|
|
36
|
+
const getHint = (identifiers) => {
|
|
37
|
+
return "Un produit est nul si et seulement si un des deux facteurs est nul. Donc, il faut trouver les valeurs de $x$ qui rendent un des deux facteurs nuls.";
|
|
38
|
+
};
|
|
39
|
+
const getCorrection = (identifiers) => {
|
|
40
|
+
const { a, b, c, d } = identifiers;
|
|
41
|
+
const polynome1 = new Polynomial([b, a]);
|
|
42
|
+
const polynome2 = new Polynomial([d, c]);
|
|
43
|
+
const sol1 = new Rational(-b, a).simplify().toTree();
|
|
44
|
+
const sol2 = new Rational(-d, c).simplify().toTree();
|
|
45
|
+
return `Un produit est nul si et seulement si un des deux facteurs est nul. On résout donc deux équations :
|
|
46
|
+
|
|
47
|
+
${alignTex([
|
|
48
|
+
["", getStartStatement(identifiers)],
|
|
49
|
+
[
|
|
50
|
+
"\\iff",
|
|
51
|
+
`${polynome1.toTree().toTex()} = 0 \\text{ ou } ${polynome2
|
|
52
|
+
.toTree()
|
|
53
|
+
.toTex()} = 0`,
|
|
54
|
+
],
|
|
55
|
+
["\\iff", `x=${sol1.toTex()} \\text{ ou } x=${sol2.toTex()}`],
|
|
56
|
+
])}
|
|
57
|
+
|
|
58
|
+
Ainsi, $${getAnswer(identifiers)}$`;
|
|
59
|
+
};
|
|
11
60
|
const getMultiplicationEquation = () => {
|
|
12
61
|
// (ax + b)(cx + d) = 0
|
|
13
62
|
let a, b, c, d;
|
|
@@ -17,35 +66,16 @@ const getMultiplicationEquation = () => {
|
|
|
17
66
|
c = randint(-9, 10, [0]);
|
|
18
67
|
d = randint(-9, 10, [0]);
|
|
19
68
|
} while (a / c === b / d);
|
|
20
|
-
const
|
|
21
|
-
const polynome2 = new Polynomial([d, c]);
|
|
22
|
-
const sol1 = new Rational(-b, a).simplify().toTree();
|
|
23
|
-
const sol2 = new Rational(-d, c).simplify().toTree();
|
|
24
|
-
const sortedSols = -b / a < -d / c ? [sol1, sol2] : [sol2, sol1];
|
|
25
|
-
const answer = new EquationSolutionNode(new DiscreteSetNode(sortedSols)).toTex();
|
|
26
|
-
const statementTex = new MultiplyNode(polynome1.toTree(), polynome2.toTree()).toTex();
|
|
69
|
+
const identifiers = { a, b, c, d };
|
|
27
70
|
const question = {
|
|
28
|
-
instruction:
|
|
29
|
-
startStatement:
|
|
30
|
-
answer,
|
|
71
|
+
instruction: getInstruction(identifiers),
|
|
72
|
+
startStatement: getStartStatement(identifiers),
|
|
73
|
+
answer: getAnswer(identifiers),
|
|
31
74
|
keys: ["x", "S", "equal", "lbrace", "rbrace", "semicolon", "ou"],
|
|
32
75
|
answerFormat: "tex",
|
|
33
|
-
identifiers
|
|
34
|
-
hint:
|
|
35
|
-
correction:
|
|
36
|
-
|
|
37
|
-
${alignTex([
|
|
38
|
-
["", `${statementTex} = 0`],
|
|
39
|
-
[
|
|
40
|
-
"\\iff",
|
|
41
|
-
`${polynome1.toTree().toTex()} = 0 \\text{ ou } ${polynome2
|
|
42
|
-
.toTree()
|
|
43
|
-
.toTex()} = 0`,
|
|
44
|
-
],
|
|
45
|
-
["\\iff", `x=${sol1.toTex()} \\text{ ou } x=${sol2.toTex()}`],
|
|
46
|
-
])}
|
|
47
|
-
|
|
48
|
-
Ainsi, $${answer}$`,
|
|
76
|
+
identifiers,
|
|
77
|
+
hint: getHint(identifiers),
|
|
78
|
+
correction: getCorrection(identifiers),
|
|
49
79
|
};
|
|
50
80
|
return question;
|
|
51
81
|
};
|
|
@@ -82,8 +112,6 @@ export const multiplicationEquation = {
|
|
|
82
112
|
id: "multiplicationEquation",
|
|
83
113
|
connector: "\\iff",
|
|
84
114
|
label: "Résoudre une équation produit nul",
|
|
85
|
-
levels: ["2nde", "1reESM", "1reSpé", "1reTech"],
|
|
86
|
-
sections: ["Équations"],
|
|
87
115
|
isSingleStep: false,
|
|
88
116
|
generator: (nb) => getDistinctQuestions(getMultiplicationEquation, nb),
|
|
89
117
|
qcmTimer: 60,
|
|
@@ -92,4 +120,8 @@ export const multiplicationEquation = {
|
|
|
92
120
|
isAnswerValid,
|
|
93
121
|
subject: "Mathématiques",
|
|
94
122
|
hasHintAndCorrection: true,
|
|
123
|
+
getInstruction,
|
|
124
|
+
getAnswer,
|
|
125
|
+
getCorrection,
|
|
126
|
+
getHint,
|
|
95
127
|
};
|
|
@@ -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"}
|