math-exercises 3.0.23 → 3.0.25
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 +1 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +40 -15
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType3Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.js +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoType2.d.ts.map +1 -1
- package/lib/exercises/math/conversion/aeraConversion.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 +127 -94
- 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/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/dataRepresentations/testGen.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/testGen.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/testGen.js +64 -0
- package/lib/exercises/math/derivation/derivative/constanteDerivative.js +2 -2
- package/lib/exercises/math/geometry/areas/circleArea.d.ts.map +1 -1
- package/lib/exercises/math/geometry/areas/circleArea.js +19 -8
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnLine.js +2 -2
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +2 -2
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.js +48 -25
- package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +3 -3
- package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +3 -3
- 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/geometry/volumes/sphereVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/sphereVolume.js +31 -16
- package/lib/exercises/math/percent/findProportion.js +1 -1
- package/lib/exercises/math/percent/valuePercent.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageList.js +32 -18
- 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/sequences/sequenceEvaluation.d.ts.map +1 -1
- 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/geogebra/geogebraConstructor.d.ts +1 -0
- package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
- package/lib/geogebra/geogebraConstructor.js +3 -0
- package/lib/index.d.ts +9 -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/math/utils/random/randTupleInt.d.ts +4 -4
- package/lib/math/utils/random/randTupleInt.d.ts.map +1 -1
- package/lib/math/utils/random/randTupleInt.js +12 -8
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +2 -2
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAQtB,CAAC;AACF,eAAO,MAAM,iBAAiB,UACrB,WAAW,EAAE,aACT,MAAM,WACT,KAAK,GAAG,KAAK,SAUtB,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,WAAW,EAAE,KAAK,MAAM,kBAE3D,CAAC;AAEF,oBAAY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S,GACT,UAAU,GACV,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,8BAA8B,GAC9B,aAAa,GACb,YAAY,GACZ,SAAS,GACT,0BAA0B,GAC1B,WAAW,GACX,2BAA2B,GAC3B,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,wBAAwB,GACxB,WAAW,GACX,uBAAuB,GACvB,uBAAuB,GACvB,aAAa,GACb,aAAa,GACb,SAAS,GACT,qBAAqB,GACrB,oBAAoB,GACpB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,QAAQ,GACR,UAAU,GACV,uBAAuB,GACvB,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,UAAU,CAAC;AAEf,MAAM,MAAM,SAAS,GACjB,mBAAmB,GACnB,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,+CAA+C,GAC/C,OAAO,GACP,KAAK,GACL,wBAAwB,GACxB,SAAS,GACT,KAAK,GACL,aAAa,GACb,4BAA4B,GAC5B,oBAAoB,GACpB,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplyDecimalByTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"multiplyDecimalByTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAmGF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAmBvD,CAAC"}
|
|
@@ -6,29 +6,50 @@ import { DivideNode } from "../../../../tree/nodes/operators/divideNode.js";
|
|
|
6
6
|
import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
7
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
8
8
|
import { pluralize } from "../../../../utils/strings/pluralize.js";
|
|
9
|
-
const
|
|
10
|
-
const dec
|
|
11
|
-
const pow = randint(1, 4);
|
|
9
|
+
const getInstruction = (identifiers) => {
|
|
10
|
+
const { dec, pow, isDivide } = identifiers;
|
|
12
11
|
const factor = Math.pow(10, pow);
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
const statement = new (isDivide ? DivideNode : MultiplyNode)(dec.toTree(), factor.toTree());
|
|
13
|
+
return `Calculer : $${statement.toTex()}$`;
|
|
14
|
+
};
|
|
15
|
+
const getHint = (identifiers) => {
|
|
16
|
+
const { dec, pow, isDivide } = identifiers;
|
|
17
|
+
const factor = Math.pow(10, pow);
|
|
18
|
+
return `${isDivide ? "Diviser" : "Multiplier"} par $${factor.frenchify()}$ revient à déplacer la virgule de $${pow}$ ${pluralize("position", pow)} vers la ${isDivide ? "gauche" : "droite"}.`;
|
|
19
|
+
};
|
|
20
|
+
const getAnswer = (identifiers) => {
|
|
21
|
+
const { dec, pow, isDivide } = identifiers;
|
|
22
|
+
const answer = new Decimal(dec)
|
|
15
23
|
.multiplyByPowerOfTen(isDivide ? -pow : pow)
|
|
16
24
|
.toTree()
|
|
17
25
|
.toTex();
|
|
26
|
+
return answer;
|
|
27
|
+
};
|
|
28
|
+
const getCorrection = (identifiers) => {
|
|
29
|
+
const { dec, pow, isDivide } = identifiers;
|
|
30
|
+
const factor = Math.pow(10, pow);
|
|
18
31
|
const statement = new (isDivide ? DivideNode : MultiplyNode)(dec.toTree(), factor.toTree());
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
instruction: `Calculer : $${statement.toTex()}$`,
|
|
22
|
-
keys: [],
|
|
23
|
-
answerFormat: "tex",
|
|
24
|
-
identifiers: { dec: dec.value, pow, isDivide },
|
|
25
|
-
hint: `${isDivide ? "Diviser" : "Multiplier"} par $${factor.frenchify()}$ revient à déplacer la virgule de $${pow}$ ${pluralize("position", pow)} vers la ${isDivide ? "gauche" : "droite"}.`,
|
|
26
|
-
correction: `On déplace la virgule de $${pow}$ ${pluralize("position", pow)} vers la ${isDivide ? "gauche" : "droite"} :
|
|
32
|
+
const answer = getAnswer(identifiers);
|
|
33
|
+
return `On déplace la virgule de $${pow}$ ${pluralize("position", pow)} vers la ${isDivide ? "gauche" : "droite"} :
|
|
27
34
|
|
|
28
35
|
$$
|
|
29
36
|
${statement.toTex()} = ${answer}
|
|
30
37
|
$$
|
|
31
|
-
|
|
38
|
+
`;
|
|
39
|
+
};
|
|
40
|
+
const getMultiplyDecimalByTensQuestion = () => {
|
|
41
|
+
const dec = DecimalConstructor.random(1, 200, randint(1, 5));
|
|
42
|
+
const pow = randint(1, 4);
|
|
43
|
+
const isDivide = coinFlip();
|
|
44
|
+
const identifiers = { dec: dec.value, pow, isDivide };
|
|
45
|
+
const question = {
|
|
46
|
+
answer: getAnswer(identifiers),
|
|
47
|
+
instruction: getInstruction(identifiers),
|
|
48
|
+
keys: [],
|
|
49
|
+
answerFormat: "tex",
|
|
50
|
+
identifiers,
|
|
51
|
+
hint: getHint(identifiers),
|
|
52
|
+
correction: getCorrection(identifiers),
|
|
32
53
|
};
|
|
33
54
|
return question;
|
|
34
55
|
};
|
|
@@ -55,7 +76,7 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
55
76
|
export const multiplyDecimalByTens = {
|
|
56
77
|
id: "multiplyDecimalByTens",
|
|
57
78
|
connector: "=",
|
|
58
|
-
label: "Multiplier/diviser un décimal par
|
|
79
|
+
label: "Multiplier/diviser un décimal par $10$, $100$, ou $1000$",
|
|
59
80
|
levels: [],
|
|
60
81
|
isSingleStep: true,
|
|
61
82
|
sections: [],
|
|
@@ -66,4 +87,8 @@ export const multiplyDecimalByTens = {
|
|
|
66
87
|
isAnswerValid,
|
|
67
88
|
subject: "Mathématiques",
|
|
68
89
|
hasHintAndCorrection: true,
|
|
90
|
+
getInstruction,
|
|
91
|
+
getCorrection,
|
|
92
|
+
getHint,
|
|
93
|
+
getAnswer,
|
|
69
94
|
};
|
|
@@ -132,7 +132,7 @@ const isAnswerValid = (ans, { integer, integerFirst, rational }) => {
|
|
|
132
132
|
export const fractionAndIntegerDivision = {
|
|
133
133
|
id: "fractionAndIntegerDivision",
|
|
134
134
|
connector: "=",
|
|
135
|
-
label: "Division d'un entier
|
|
135
|
+
label: "Division d'un entier par une fraction et vice-versa",
|
|
136
136
|
levels: ["4ème", "3ème", "2nde", "2ndPro", "1rePro", "CAP"],
|
|
137
137
|
isSingleStep: false,
|
|
138
138
|
sections: ["Fractions"],
|
|
@@ -114,7 +114,7 @@ const isAnswerValid = (ans, { integer, rational, integerFirst, answer }, opts) =
|
|
|
114
114
|
export const fractionAndIntegerProduct = {
|
|
115
115
|
id: "fractionAndIntegerProduct",
|
|
116
116
|
connector: "=",
|
|
117
|
-
label: "Produit d'un entier
|
|
117
|
+
label: "Produit d'un entier par une fraction",
|
|
118
118
|
levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro"],
|
|
119
119
|
isSingleStep: false,
|
|
120
120
|
sections: ["Fractions"],
|
|
@@ -142,7 +142,7 @@ const options = [
|
|
|
142
142
|
export const equationType2Exercise = {
|
|
143
143
|
id: "equa2",
|
|
144
144
|
connector: "\\iff",
|
|
145
|
-
label: "
|
|
145
|
+
label: "Résoudre une équation du type $ax=b$",
|
|
146
146
|
levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
|
|
147
147
|
sections: ["Équations"],
|
|
148
148
|
isSingleStep: true,
|
|
@@ -93,7 +93,7 @@ const isAnswerValid = (ans, { answer, a, b, c }) => {
|
|
|
93
93
|
export const equationType3Exercise = {
|
|
94
94
|
id: "equa3",
|
|
95
95
|
connector: "\\iff",
|
|
96
|
-
label: "
|
|
96
|
+
label: "Résoudre une équation du type $ax+b=c$",
|
|
97
97
|
levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
|
|
98
98
|
sections: ["Équations"],
|
|
99
99
|
isSingleStep: false,
|
|
@@ -87,7 +87,7 @@ const isAnswerValid = (ans, { a, b, c, d }) => {
|
|
|
87
87
|
export const equationType4Exercise = {
|
|
88
88
|
id: "equa4",
|
|
89
89
|
connector: "\\iff",
|
|
90
|
-
label: "
|
|
90
|
+
label: "Résoudre une équation du type $ax+b=cx+d$",
|
|
91
91
|
levels: ["4ème", "3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
|
|
92
92
|
sections: ["Équations"],
|
|
93
93
|
isSingleStep: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factoType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"factoType2.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/factorisation/factoType2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAkIF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAiB5C,CAAC"}
|
|
@@ -104,7 +104,7 @@ export const aeraConversion = {
|
|
|
104
104
|
connector: "=",
|
|
105
105
|
getPropositions,
|
|
106
106
|
isAnswerValid,
|
|
107
|
-
label: "Conversion
|
|
107
|
+
label: "Conversion d'aires",
|
|
108
108
|
isSingleStep: true,
|
|
109
109
|
generator: (nb) => getDistinctQuestions(getAeraConversion, nb),
|
|
110
110
|
qcmTimer: 60,
|
|
@@ -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;AA8FF,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,46 @@ 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
|
+
`f = Function(${a}*x+${b}, 0, 1000)`,
|
|
34
|
+
`SetCaption(f, "$(d_1)$")`,
|
|
35
|
+
`ShowLabel(f,true)`,
|
|
36
|
+
`Text("Nombre \\ de \\ participants", (x(Corner(2)),50), true, true, -1)`,
|
|
37
|
+
`Text("Coût \\ en \\ €", (1, y(Corner(4))), true, true)`,
|
|
38
|
+
],
|
|
39
|
+
forbidShiftDragZoom: false,
|
|
118
40
|
gridDistance: [2, 500],
|
|
119
41
|
lockedAxesRatio: 2 / 500,
|
|
120
42
|
xAxis: {
|
|
121
|
-
label: "
|
|
43
|
+
// label: "$\\math{\\tiny \\text{Nb. de \\\\ participants}}$",
|
|
122
44
|
steps: 2,
|
|
123
45
|
showPositive: true,
|
|
124
46
|
},
|
|
125
47
|
yAxis: {
|
|
126
|
-
label: "
|
|
48
|
+
// label: "y",
|
|
127
49
|
steps: 500,
|
|
128
50
|
showPositive: true,
|
|
129
51
|
},
|
|
52
|
+
fontSize: 14,
|
|
130
53
|
});
|
|
54
|
+
const xMin = -2;
|
|
55
|
+
const xMax = xValue + 6;
|
|
56
|
+
const xDelta = xMax - xMin;
|
|
57
|
+
const yMin = -100;
|
|
58
|
+
const yMax = Math.max(yValue + 500, xDelta);
|
|
131
59
|
return ggb.getOptions({
|
|
132
|
-
coords: [-
|
|
60
|
+
coords: [-1, xValue + 6, -100, yValue + 500],
|
|
133
61
|
});
|
|
134
62
|
};
|
|
135
63
|
const getKeys = (identifiers) => {
|
|
@@ -139,9 +67,10 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
139
67
|
throw Error("VEA not implemented");
|
|
140
68
|
};
|
|
141
69
|
const getFunctionGraphReadingQuestion = (opts) => {
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
const yValue =
|
|
70
|
+
const b = randint(0, 2000);
|
|
71
|
+
const randPoint = [2 * randint(5, 20), 3000 + 500 * randint(1, 7)];
|
|
72
|
+
const yValue = randPoint[1];
|
|
73
|
+
const a = (yValue - b) / randPoint[0];
|
|
145
74
|
const identifiers = { a, b, yValue };
|
|
146
75
|
const question = {
|
|
147
76
|
answer: getAnswer(identifiers),
|
|
@@ -172,3 +101,107 @@ export const functionGraphReading = {
|
|
|
172
101
|
getGGBOptions,
|
|
173
102
|
hasGeogebra: true,
|
|
174
103
|
};
|
|
104
|
+
/***SVG */
|
|
105
|
+
/**
|
|
106
|
+
|
|
107
|
+
const width = 600;
|
|
108
|
+
const height = 300;
|
|
109
|
+
const margin = { top: 20, right: 20, bottom: 40, left: 50 };
|
|
110
|
+
const d3n = new D3Node();
|
|
111
|
+
const d3 = d3n.d3;
|
|
112
|
+
|
|
113
|
+
const svg = d3n.createSVG(width, height);
|
|
114
|
+
|
|
115
|
+
const xScale = d3
|
|
116
|
+
.scaleLinear()
|
|
117
|
+
.domain([0, 60])
|
|
118
|
+
.range([margin.left, width - margin.right]);
|
|
119
|
+
|
|
120
|
+
const yScale = d3
|
|
121
|
+
.scaleLinear()
|
|
122
|
+
.domain([0, 8000])
|
|
123
|
+
.range([height - margin.bottom, margin.top]);
|
|
124
|
+
|
|
125
|
+
const xAxis = d3.axisBottom(xScale).ticks(30).tickValues(d3.range(0, 61, 2));
|
|
126
|
+
const yAxis = d3
|
|
127
|
+
.axisLeft(yScale)
|
|
128
|
+
.ticks(16)
|
|
129
|
+
.tickValues(d3.range(0, 8500, 500));
|
|
130
|
+
|
|
131
|
+
svg
|
|
132
|
+
.append("g")
|
|
133
|
+
.attr("transform", `translate(0,${height - margin.bottom})`)
|
|
134
|
+
.call(xAxis);
|
|
135
|
+
|
|
136
|
+
svg.append("g").attr("transform", `translate(${margin.left},0)`).call(yAxis);
|
|
137
|
+
|
|
138
|
+
// Gridlines
|
|
139
|
+
const gridlinesX = d3
|
|
140
|
+
.axisBottom(xScale)
|
|
141
|
+
.tickSize(-height + margin.top + margin.bottom)
|
|
142
|
+
.tickFormat(() => "")
|
|
143
|
+
.tickValues(d3.range(0, 61, 2));
|
|
144
|
+
const gridlinesY = d3
|
|
145
|
+
.axisLeft(yScale)
|
|
146
|
+
.tickSize(-width + margin.left + margin.right)
|
|
147
|
+
.tickFormat(() => "")
|
|
148
|
+
.tickValues(d3.range(0, 8500, 500));
|
|
149
|
+
|
|
150
|
+
svg
|
|
151
|
+
.append("g")
|
|
152
|
+
.attr("class", "grid")
|
|
153
|
+
.attr("transform", `translate(0,${height - margin.bottom})`)
|
|
154
|
+
.call(gridlinesX);
|
|
155
|
+
|
|
156
|
+
svg
|
|
157
|
+
.append("g")
|
|
158
|
+
.attr("class", "grid")
|
|
159
|
+
.attr("transform", `translate(${margin.left},0)`)
|
|
160
|
+
.call(gridlinesY);
|
|
161
|
+
|
|
162
|
+
// Line
|
|
163
|
+
const line = d3
|
|
164
|
+
.line()
|
|
165
|
+
.x((d: any) => xScale(d))
|
|
166
|
+
.y((d: any) => yScale(d * a + b));
|
|
167
|
+
|
|
168
|
+
svg
|
|
169
|
+
.append("path")
|
|
170
|
+
.datum(d3.range(0, 61))
|
|
171
|
+
.attr("fill", "none")
|
|
172
|
+
.attr("stroke", "blue")
|
|
173
|
+
.attr("stroke-width", 1)
|
|
174
|
+
.attr("d", line);
|
|
175
|
+
|
|
176
|
+
// KaTeX math expression
|
|
177
|
+
const latexString = katex.renderToString("(d_1)", { throwOnError: false });
|
|
178
|
+
|
|
179
|
+
svg
|
|
180
|
+
.append("foreignObject")
|
|
181
|
+
.attr("x", xScale(18))
|
|
182
|
+
.attr("y", yScale(4500))
|
|
183
|
+
.attr("width", 50)
|
|
184
|
+
.attr("height", 30)
|
|
185
|
+
.html(
|
|
186
|
+
`<div style='font-size: 16px; font-weight: bold'>${latexString}</div>`,
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
// Labels
|
|
190
|
+
svg
|
|
191
|
+
.append("text")
|
|
192
|
+
.attr("x", width / 2)
|
|
193
|
+
.attr("y", height - 5)
|
|
194
|
+
.attr("text-anchor", "middle")
|
|
195
|
+
.attr("font-weight", "bold")
|
|
196
|
+
.text("Nombre de participants");
|
|
197
|
+
|
|
198
|
+
svg
|
|
199
|
+
.append("text")
|
|
200
|
+
.attr("x", margin.left)
|
|
201
|
+
.attr("y", margin.top - 5)
|
|
202
|
+
.attr("text-anchor", "middle")
|
|
203
|
+
.attr("font-weight", "bold")
|
|
204
|
+
.text("Coût en €");
|
|
205
|
+
${d3n.svgString()}
|
|
206
|
+
|
|
207
|
+
*/
|
|
@@ -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;AACrC,cAAc,cAAc,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"}
|