math-exercises 3.0.153 → 3.0.155
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/geometry/euclidianConstructions/buildMediatriceWithCompass.js +2 -2
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.js +3 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromCentralSymmetry.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromCentralSymmetry.js +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.js +1 -0
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableSituations.d.ts +11 -0
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableSituations.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableSituations.js +136 -0
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.js +3 -79
- package/lib/exercises/math/probaStat/stats1var/medianWithList.js +4 -4
- package/lib/exercises/math/spaceGeometry/solids/recognizeSolidFrom3D.js +1 -1
- package/lib/exercises/math/spaceGeometry/sphere/index.d.ts +0 -1
- package/lib/exercises/math/spaceGeometry/sphere/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/sphere/index.js +1 -1
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/geogebra/probas/probaWheelGGBCommands.d.ts +7 -0
- package/lib/geogebra/probas/probaWheelGGBCommands.d.ts.map +1 -0
- package/lib/geogebra/probas/probaWheelGGBCommands.js +79 -0
- package/lib/index.d.ts +0 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/line.d.ts +1 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +4 -2
- package/lib/math/geometry/point.d.ts +1 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +2 -2
- package/lib/server.js +4 -1
- package/package.json +1 -1
|
@@ -41,8 +41,8 @@ const getStudentGGBOptions = (identifiers) => {
|
|
|
41
41
|
const length = segment.getLength();
|
|
42
42
|
const studentGGB = new GeogebraConstructor({
|
|
43
43
|
commands: [
|
|
44
|
-
...pointA.toGGBCommand(),
|
|
45
|
-
...pointB.toGGBCommand(),
|
|
44
|
+
...pointA.toGGBCommand({ isSelectionnable: true }),
|
|
45
|
+
...pointB.toGGBCommand({ isSelectionnable: true }),
|
|
46
46
|
`Seg = Segment(${nameA},${nameB})`,
|
|
47
47
|
],
|
|
48
48
|
hideGrid: true,
|
package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPointFromAxialSymetry.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAGtC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"buildPointFromAxialSymetry.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/buildPointFromAxialSymetry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAGtC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAqHF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAiB5D,CAAC"}
|
|
@@ -47,10 +47,12 @@ const getStudentGGBOptions = (identifiers) => {
|
|
|
47
47
|
const point = PointConstructor.fromIdentifiers(identifiers.point);
|
|
48
48
|
const line = LineConstructor.fromIdentifiers(identifiers.line);
|
|
49
49
|
const commands = [
|
|
50
|
-
...point.toGGBCommand(),
|
|
50
|
+
...point.toGGBCommand({ isSelectionnable: true }),
|
|
51
51
|
...line.toGGBCommands(false, {
|
|
52
52
|
showLabel: true,
|
|
53
53
|
color: "black",
|
|
54
|
+
isSelectionnable: true,
|
|
55
|
+
isFixed: true,
|
|
54
56
|
}),
|
|
55
57
|
];
|
|
56
58
|
const sol = getSolutionPoint(identifiers);
|
package/lib/exercises/math/geometry/euclidianConstructions/buildPointFromCentralSymmetry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPointFromCentralSymmetry.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/buildPointFromCentralSymmetry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAMtC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;
|
|
1
|
+
{"version":3,"file":"buildPointFromCentralSymmetry.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/buildPointFromCentralSymmetry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAMtC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AA+MF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAe/D,CAAC"}
|
|
@@ -65,7 +65,7 @@ const getStudentGGBOptions = (identifiers) => {
|
|
|
65
65
|
const { namePointSrc, namePointCenter, pointsDict } = identifiers;
|
|
66
66
|
const [pointSrc, pointCenter] = [namePointSrc, namePointCenter].map((pointName) => PointConstructor.fromIdentifiers(pointsDict[pointName]));
|
|
67
67
|
const studentGGB = new GeogebraConstructor({
|
|
68
|
-
commands: [pointSrc, pointCenter].flatMap((point) => point.toGGBCommand()),
|
|
68
|
+
commands: [pointSrc, pointCenter].flatMap((point) => point.toGGBCommand({ isSelectionnable: true })),
|
|
69
69
|
hideGrid: true,
|
|
70
70
|
hideAxes: true,
|
|
71
71
|
customToolBar: toolBarConstructor({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type WheelItem = {
|
|
3
|
+
value: number;
|
|
4
|
+
indexColor: number;
|
|
5
|
+
};
|
|
6
|
+
type Identifiers = {
|
|
7
|
+
items: WheelItem[];
|
|
8
|
+
};
|
|
9
|
+
export declare const pickEquiprobableSituations: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=pickEquiprobableSituations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pickEquiprobableSituations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/pickEquiprobableSituations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB,CAAC;AA4IF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAkB5D,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { probaWheelGGBCommands } from "../../../../geogebra/probas/probaWheelGGBCommands.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
//on note le numéro du secteur obtenu
|
|
7
|
+
//on note la couleur du secteur obtenu
|
|
8
|
+
//on note la parité du numéro obtenu
|
|
9
|
+
const getPropositions = (n, { answer, items }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
addValidProp(propositions, answer);
|
|
12
|
+
const colors = [0, 0, 0, 0];
|
|
13
|
+
const nums = [0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
14
|
+
const pars = [0, 0];
|
|
15
|
+
for (let i = 0; i < items.length; i++) {
|
|
16
|
+
colors[items[i].indexColor]++;
|
|
17
|
+
nums[items[i].value]++;
|
|
18
|
+
if (items[i].value % 2 === 0)
|
|
19
|
+
pars[0]++;
|
|
20
|
+
else
|
|
21
|
+
pars[1]++;
|
|
22
|
+
}
|
|
23
|
+
if (colors.filter((e) => !!e).every((i) => i === colors[0]))
|
|
24
|
+
addValidProp(propositions, "On note la couleur du secteur obtenu", "raw");
|
|
25
|
+
else
|
|
26
|
+
tryToAddWrongProp(propositions, "On note la couleur du secteur obtenu", "raw");
|
|
27
|
+
if (nums.filter((e) => !!e).every((i) => i === nums[0]))
|
|
28
|
+
addValidProp(propositions, "On note le numéro du secteur obtenu", "raw");
|
|
29
|
+
else
|
|
30
|
+
tryToAddWrongProp(propositions, "On note le numéro du secteur obtenu", "raw");
|
|
31
|
+
if (pars.every((i) => i === pars[0]))
|
|
32
|
+
addValidProp(propositions, "On note la parité du secteur obtenu (pair ou impair)", "raw");
|
|
33
|
+
else
|
|
34
|
+
tryToAddWrongProp(propositions, "On note la parité du secteur obtenu (pair ou impair)", "raw");
|
|
35
|
+
return shuffleProps(propositions, n);
|
|
36
|
+
};
|
|
37
|
+
const getInstruction = (identifiers) => {
|
|
38
|
+
const { items } = identifiers;
|
|
39
|
+
return `On fait tourner la roue ci-dessous, dont les $${items.length}$ secteurs ont la même aire.
|
|
40
|
+
|
|
41
|
+
Parmi les situations proposées, laquelle ou lesquelles sont des situations d'équiprobabilité ?`;
|
|
42
|
+
};
|
|
43
|
+
const getHint = () => {
|
|
44
|
+
return "On est dans une situation d'équiprobabilité lorsque toutes les issues ont la même probabilité de se réaliser.";
|
|
45
|
+
};
|
|
46
|
+
const getCorrection = (identifiers) => {
|
|
47
|
+
const { items } = identifiers;
|
|
48
|
+
const colors = [0, 0, 0, 0];
|
|
49
|
+
const nums = [0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
50
|
+
const pars = [0, 0];
|
|
51
|
+
for (let i = 0; i < items.length; i++) {
|
|
52
|
+
colors[items[i].indexColor]++;
|
|
53
|
+
nums[items[i].value]++;
|
|
54
|
+
if (items[i].value % 2 === 0)
|
|
55
|
+
pars[0]++;
|
|
56
|
+
else
|
|
57
|
+
pars[1]++;
|
|
58
|
+
}
|
|
59
|
+
return `On détaille chaque situation :
|
|
60
|
+
|
|
61
|
+
-
|
|
62
|
+
-
|
|
63
|
+
- `;
|
|
64
|
+
};
|
|
65
|
+
const getGGBOptions = (identifiers) => {
|
|
66
|
+
const { items } = identifiers;
|
|
67
|
+
const ggb = new GeogebraConstructor({
|
|
68
|
+
commands: [...probaWheelGGBCommands(items)],
|
|
69
|
+
hideAxes: true,
|
|
70
|
+
hideGrid: true,
|
|
71
|
+
forbidShiftDragZoom: true,
|
|
72
|
+
});
|
|
73
|
+
return ggb.getOptions({
|
|
74
|
+
coords: [-15, 15, -15, 15],
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
const hasRightAnswer = (items) => {
|
|
78
|
+
const colors = [0, 0, 0, 0];
|
|
79
|
+
const nums = [0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
80
|
+
const pars = [0, 0];
|
|
81
|
+
for (let i = 0; i < items.length; i++) {
|
|
82
|
+
colors[items[i].indexColor]++;
|
|
83
|
+
nums[items[i].value]++;
|
|
84
|
+
if (items[i].value % 2 === 0)
|
|
85
|
+
pars[0]++;
|
|
86
|
+
else
|
|
87
|
+
pars[1]++;
|
|
88
|
+
}
|
|
89
|
+
return (colors.filter((e) => !!e).every((i) => i === colors[0]) ||
|
|
90
|
+
nums
|
|
91
|
+
.filter((e) => !!e)
|
|
92
|
+
.every((i) => i === nums[0] || pars.every((i) => i === pars[0])));
|
|
93
|
+
};
|
|
94
|
+
const getPickEquiprobableSituationsQuestion = () => {
|
|
95
|
+
let items = [];
|
|
96
|
+
do {
|
|
97
|
+
items = [];
|
|
98
|
+
for (let i = 0; i < 9; i++) {
|
|
99
|
+
items.push({
|
|
100
|
+
value: randint(1, 10),
|
|
101
|
+
indexColor: randint(0, 4),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
} while (!hasRightAnswer(items));
|
|
105
|
+
const identifiers = { items };
|
|
106
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
107
|
+
};
|
|
108
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
109
|
+
return {
|
|
110
|
+
instruction: getInstruction(identifiers),
|
|
111
|
+
keys: [],
|
|
112
|
+
answerFormat: "tex",
|
|
113
|
+
identifiers,
|
|
114
|
+
hint: getHint(identifiers),
|
|
115
|
+
correction: getCorrection(identifiers),
|
|
116
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
export const pickEquiprobableSituations = {
|
|
120
|
+
id: "pickEquiprobableSituations",
|
|
121
|
+
label: "Déterminer les situations d'équiprobabilité",
|
|
122
|
+
isSingleStep: true,
|
|
123
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPickEquiprobableSituationsQuestion(opts), nb),
|
|
124
|
+
qcmTimer: 60,
|
|
125
|
+
freeTimer: 60,
|
|
126
|
+
getPropositions,
|
|
127
|
+
subject: "Mathématiques",
|
|
128
|
+
getHint,
|
|
129
|
+
getCorrection,
|
|
130
|
+
getInstruction,
|
|
131
|
+
getGGBOptions,
|
|
132
|
+
hasGeogebra: true,
|
|
133
|
+
getQuestionFromIdentifiers,
|
|
134
|
+
answerType: "QCM",
|
|
135
|
+
isQCM: true,
|
|
136
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pickEquiprobableTo.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/pickEquiprobableTo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"pickEquiprobableTo.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/pickEquiprobableTo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAgIF,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA2NF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAmBpD,CAAC"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
-
import { blueMain,
|
|
3
|
+
import { blueMain, greenLight, orange, red } from "../../../../geogebra/colors.js";
|
|
4
4
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
-
import {
|
|
6
|
-
import { Vector } from "../../../../math/geometry/vector.js";
|
|
5
|
+
import { probaWheelGGBCommands } from "../../../../geogebra/probas/probaWheelGGBCommands.js";
|
|
7
6
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
8
|
-
import { round } from "../../../../math/utils/round.js";
|
|
9
|
-
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
10
|
-
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
11
7
|
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
12
8
|
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
13
9
|
import { random, randomMany } from "../../../../utils/alea/random.js";
|
|
@@ -15,78 +11,6 @@ import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
|
15
11
|
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
16
12
|
const colors = [red, blueMain, greenLight, orange];
|
|
17
13
|
const colorNames = ["rouge", "bleu", "vert", "orange"];
|
|
18
|
-
const createVector = (from, to, name, precision = 5) => {
|
|
19
|
-
return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
|
|
20
|
-
};
|
|
21
|
-
const createPoint = (x, y, name, precision = 5) => {
|
|
22
|
-
return new Point(name, round(x, precision), round(y, precision));
|
|
23
|
-
};
|
|
24
|
-
const rotatePoint = (target, angle, center, name, precision = 2) => {
|
|
25
|
-
const vSrc = createVector(center, target, "vSrc", precision);
|
|
26
|
-
const vRotated = vSrc.rotate(angle, "vRotated");
|
|
27
|
-
return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
|
|
28
|
-
};
|
|
29
|
-
const createPointWithWeights = (arrPointAndWeight) => {
|
|
30
|
-
return arrPointAndWeight.reduce((acc, [p, w]) => {
|
|
31
|
-
return new Point("acc", acc.x.evaluate() + w * p.x.evaluate(), acc.y.evaluate() + w * p.y.evaluate());
|
|
32
|
-
}, new Point("O", 0, 0));
|
|
33
|
-
};
|
|
34
|
-
const probaWheelGGBCommands = (arrItem) => {
|
|
35
|
-
const radius = 12;
|
|
36
|
-
const point0 = new Point("O", 0, 0);
|
|
37
|
-
function createWheelItemGGBCommands(wheelItem, i, angleInDegreesSector) {
|
|
38
|
-
const angleInRadiansSector = (angleInDegreesSector * PiNode.evaluate()) / 180.0;
|
|
39
|
-
const point1Raw = new Point("P1", radius, 0);
|
|
40
|
-
const point2Raw = new Point("P2", radius * Math.cos(angleInRadiansSector), radius * Math.sin(angleInRadiansSector));
|
|
41
|
-
const angleInRadiansRotate = (2 * PiNode.evaluate() * (1.0 * i + 0.5)) / arrItem.length + //center wrt sector
|
|
42
|
-
(PiNode.evaluate() * 3.0) / 2.0; //put first sector on top
|
|
43
|
-
const [point1, point2] = [point1Raw, point2Raw].map((pointRaw) => {
|
|
44
|
-
return rotatePoint(pointRaw, -angleInRadiansRotate, point0, "rotated", 3);
|
|
45
|
-
});
|
|
46
|
-
const pointForLabel = createPointWithWeights([
|
|
47
|
-
[point0, 0.24],
|
|
48
|
-
[point1, 0.38],
|
|
49
|
-
[point2, 0.38],
|
|
50
|
-
]);
|
|
51
|
-
return [
|
|
52
|
-
//circular sector
|
|
53
|
-
`C_${i} = CircularSector(${point0.toMathString()}, ${point1.toMathString()}, ${point2.toMathString()})`,
|
|
54
|
-
`SetFixed(C_${i}, true, false)`,
|
|
55
|
-
`SetColor(C_${i}, "${colorWithOpacity(colors[wheelItem.indexColor], 80)}")`,
|
|
56
|
-
`SetLineThickness(C_${i}, 1)`,
|
|
57
|
-
//border
|
|
58
|
-
`Cb_${i} = CircularSector(${point0.toMathString()}, ${point1.toMathString()}, ${point2.toMathString()})`,
|
|
59
|
-
`SetFixed(Cb_${i}, true, false)`,
|
|
60
|
-
`SetColor(Cb_${i}, "#FF000000")`,
|
|
61
|
-
`SetLineThickness(Cb_${i}, 1)`,
|
|
62
|
-
//label
|
|
63
|
-
`L_${i} = Text("$\\large \\text{${wheelItem.value}}$", ${pointForLabel.toMathString()}, false, true, 0, 0)`,
|
|
64
|
-
`SetFixed(L_${i}, true, false)`,
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
return [
|
|
68
|
-
...arrItem.flatMap((wheelItem, i) => {
|
|
69
|
-
const angleInDegreesSector = 360.0 * (1.0 / arrItem.length);
|
|
70
|
-
const itemCommands = createWheelItemGGBCommands(wheelItem, i, angleInDegreesSector);
|
|
71
|
-
return [...itemCommands];
|
|
72
|
-
}),
|
|
73
|
-
//circle border
|
|
74
|
-
`C = Circle(${point0.toMathString()}, ${radius * 1.05})`,
|
|
75
|
-
`SetFixed(C, true, false)`,
|
|
76
|
-
//triangle
|
|
77
|
-
...(() => {
|
|
78
|
-
const pointTL = new Point("TL", -0.03 * radius, radius + 0.03 * radius);
|
|
79
|
-
const pointTR = new Point("TR", +0.03 * radius, radius + 0.03 * radius);
|
|
80
|
-
const pointB = new Point("TB", 0, radius - 0.03 * radius);
|
|
81
|
-
return [
|
|
82
|
-
`T = Polygon(${pointTL.toMathString()},${pointTR.toMathString()},${pointB.toMathString()})`,
|
|
83
|
-
`SetFilling(T, 1)`,
|
|
84
|
-
`SetColor(T, "#FF000000")`,
|
|
85
|
-
`SetFixed(T, true, false)`,
|
|
86
|
-
];
|
|
87
|
-
})(),
|
|
88
|
-
];
|
|
89
|
-
};
|
|
90
14
|
const getDictEventsAndProba = (arrItem) => {
|
|
91
15
|
const outDict = {};
|
|
92
16
|
const indexesColorsUsed = [
|
|
@@ -356,7 +280,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
356
280
|
export const pickEquiprobableTo = {
|
|
357
281
|
id: "pickEquiprobableTo",
|
|
358
282
|
connector: "=",
|
|
359
|
-
label: "Déterminer les situations équiprobables",
|
|
283
|
+
label: "Déterminer les situations équiprobables à une situation donnée",
|
|
360
284
|
isSingleStep: true,
|
|
361
285
|
generator: (nb, opts) => getDistinctQuestions(() => getPickEquiprobableToQuestion(opts), nb),
|
|
362
286
|
qcmTimer: 60,
|
|
@@ -70,7 +70,7 @@ const getMedianList = (optsIn) => {
|
|
|
70
70
|
const arrayedOptions = optsIn;
|
|
71
71
|
const opts = {
|
|
72
72
|
nbValues: random(arrayedOptions.nbValues ?? optsDefault.nbValues),
|
|
73
|
-
isOrdered: optsIn?.isOrdered ??
|
|
73
|
+
isOrdered: optsIn?.isOrdered ?? false,
|
|
74
74
|
};
|
|
75
75
|
const length = Number(opts.nbValues);
|
|
76
76
|
const randomValues = [...Array(length).keys()].map(() => randint(1, 20));
|
|
@@ -123,9 +123,9 @@ const options = [
|
|
|
123
123
|
},
|
|
124
124
|
];
|
|
125
125
|
export const medianWithList = {
|
|
126
|
-
id: "
|
|
126
|
+
id: "medianWithListOrdered",
|
|
127
127
|
connector: "=",
|
|
128
|
-
label: "Calcul de la médiane d'une liste de valeurs",
|
|
128
|
+
label: "Calcul de la médiane d'une liste de valeurs ordonnée",
|
|
129
129
|
isSingleStep: false,
|
|
130
130
|
generator: (nb, opts) => getDistinctQuestions(() => getMedianList(Object.assign({}, opts, { isOrdered: true })), nb),
|
|
131
131
|
options,
|
|
@@ -138,7 +138,7 @@ export const medianWithList = {
|
|
|
138
138
|
hasHintAndCorrection: true,
|
|
139
139
|
};
|
|
140
140
|
export const medianWithListUnorderedVariant = {
|
|
141
|
-
id: "
|
|
141
|
+
id: "medianWithList",
|
|
142
142
|
connector: "=",
|
|
143
143
|
label: "Calcul de la médiane d'une liste de valeurs non ordonnée",
|
|
144
144
|
isSingleStep: false,
|
|
@@ -275,7 +275,7 @@ const getGGBOptions = (identifiers, optsIn) => {
|
|
|
275
275
|
const projection = +opts.projection;
|
|
276
276
|
const ggb = new GeogebraConstructor({
|
|
277
277
|
commands,
|
|
278
|
-
forbidShiftDragZoom: projection
|
|
278
|
+
forbidShiftDragZoom: projection !== 1,
|
|
279
279
|
is3D: true,
|
|
280
280
|
projection,
|
|
281
281
|
projectionParam: projection === 1 ? 500 : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/sphere/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/sphere/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./pickIsPointInSphereOrBall.js";
|
|
2
|
-
export * from "./sphereLatLonReading.js";
|
|
2
|
+
// export * from "./sphereLatLonReading.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toGGBCommandsProps.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toGGBCommandsProps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
1
|
+
{"version":3,"file":"toGGBCommandsProps.d.ts","sourceRoot":"","sources":["../../../../src/exercises/utils/geogebra/toGGBCommandsProps.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probaWheelGGBCommands.d.ts","sourceRoot":"","sources":["../../../src/geogebra/probas/probaWheelGGBCommands.ts"],"names":[],"mappings":"AAwDA,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AACF,eAAO,MAAM,qBAAqB,GAAI,SAAS,SAAS,EAAE,aAwFzD,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Point } from "../../math/geometry/point.js";
|
|
2
|
+
import { Vector } from "../../math/geometry/vector.js";
|
|
3
|
+
import { round } from "../../math/utils/round.js";
|
|
4
|
+
import { PiNode } from "../../tree/nodes/numbers/piNode.js";
|
|
5
|
+
import { add } from "../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { substract } from "../../tree/nodes/operators/substractNode.js";
|
|
7
|
+
import { colors, colorWithOpacity } from "../colors.js";
|
|
8
|
+
const createVector = (from, to, name, precision = 5) => {
|
|
9
|
+
return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
|
|
10
|
+
};
|
|
11
|
+
const createPoint = (x, y, name, precision = 5) => {
|
|
12
|
+
return new Point(name, round(x, precision), round(y, precision));
|
|
13
|
+
};
|
|
14
|
+
const rotatePoint = (target, angle, center, name, precision = 2) => {
|
|
15
|
+
const vSrc = createVector(center, target, "vSrc", precision);
|
|
16
|
+
const vRotated = vSrc.rotate(angle, "vRotated");
|
|
17
|
+
return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
|
|
18
|
+
};
|
|
19
|
+
const createPointWithWeights = (arrPointAndWeight) => {
|
|
20
|
+
return arrPointAndWeight.reduce((acc, [p, w]) => {
|
|
21
|
+
return new Point("acc", acc.x.evaluate() + w * p.x.evaluate(), acc.y.evaluate() + w * p.y.evaluate());
|
|
22
|
+
}, new Point("O", 0, 0));
|
|
23
|
+
};
|
|
24
|
+
export const probaWheelGGBCommands = (arrItem) => {
|
|
25
|
+
const radius = 12;
|
|
26
|
+
const point0 = new Point("O", 0, 0);
|
|
27
|
+
function createWheelItemGGBCommands(wheelItem, i, angleInDegreesSector) {
|
|
28
|
+
const angleInRadiansSector = (angleInDegreesSector * PiNode.evaluate()) / 180.0;
|
|
29
|
+
const point1Raw = new Point("P1", radius, 0);
|
|
30
|
+
const point2Raw = new Point("P2", radius * Math.cos(angleInRadiansSector), radius * Math.sin(angleInRadiansSector));
|
|
31
|
+
const angleInRadiansRotate = (2 * PiNode.evaluate() * (1.0 * i + 0.5)) / arrItem.length + //center wrt sector
|
|
32
|
+
(PiNode.evaluate() * 3.0) / 2.0; //put first sector on top
|
|
33
|
+
const [point1, point2] = [point1Raw, point2Raw].map((pointRaw) => {
|
|
34
|
+
return rotatePoint(pointRaw, -angleInRadiansRotate, point0, "rotated", 3);
|
|
35
|
+
});
|
|
36
|
+
const pointForLabel = createPointWithWeights([
|
|
37
|
+
[point0, 0.24],
|
|
38
|
+
[point1, 0.38],
|
|
39
|
+
[point2, 0.38],
|
|
40
|
+
]);
|
|
41
|
+
return [
|
|
42
|
+
//circular sector
|
|
43
|
+
`C_${i} = CircularSector(${point0.toMathString()}, ${point1.toMathString()}, ${point2.toMathString()})`,
|
|
44
|
+
`SetFixed(C_${i}, true, false)`,
|
|
45
|
+
`SetColor(C_${i}, "${colorWithOpacity(colors[wheelItem.indexColor], 80)}")`,
|
|
46
|
+
`SetLineThickness(C_${i}, 1)`,
|
|
47
|
+
//border
|
|
48
|
+
`Cb_${i} = CircularSector(${point0.toMathString()}, ${point1.toMathString()}, ${point2.toMathString()})`,
|
|
49
|
+
`SetFixed(Cb_${i}, true, false)`,
|
|
50
|
+
`SetColor(Cb_${i}, "#FF000000")`,
|
|
51
|
+
`SetLineThickness(Cb_${i}, 1)`,
|
|
52
|
+
//label
|
|
53
|
+
`L_${i} = Text("$\\large \\text{${wheelItem.value}}$", ${pointForLabel.toMathString()}, false, true, 0, 0)`,
|
|
54
|
+
`SetFixed(L_${i}, true, false)`,
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
return [
|
|
58
|
+
...arrItem.flatMap((wheelItem, i) => {
|
|
59
|
+
const angleInDegreesSector = 360.0 * (1.0 / arrItem.length);
|
|
60
|
+
const itemCommands = createWheelItemGGBCommands(wheelItem, i, angleInDegreesSector);
|
|
61
|
+
return [...itemCommands];
|
|
62
|
+
}),
|
|
63
|
+
//circle border
|
|
64
|
+
`C = Circle(${point0.toMathString()}, ${radius * 1.05})`,
|
|
65
|
+
`SetFixed(C, true, false)`,
|
|
66
|
+
//triangle
|
|
67
|
+
...(() => {
|
|
68
|
+
const pointTL = new Point("TL", -0.03 * radius, radius + 0.03 * radius);
|
|
69
|
+
const pointTR = new Point("TR", +0.03 * radius, radius + 0.03 * radius);
|
|
70
|
+
const pointB = new Point("TB", 0, radius - 0.03 * radius);
|
|
71
|
+
return [
|
|
72
|
+
`T = Polygon(${pointTL.toMathString()},${pointTR.toMathString()},${pointB.toMathString()})`,
|
|
73
|
+
`SetFilling(T, 1)`,
|
|
74
|
+
`SetColor(T, "#FF000000")`,
|
|
75
|
+
`SetFixed(T, true, false)`,
|
|
76
|
+
];
|
|
77
|
+
})(),
|
|
78
|
+
];
|
|
79
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -3102,13 +3102,6 @@ declare const mathExercises: (Exercise<{
|
|
|
3102
3102
|
nbs: number[];
|
|
3103
3103
|
radius: number;
|
|
3104
3104
|
isSphere: boolean;
|
|
3105
|
-
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3106
|
-
pointsDict: Record<string, {
|
|
3107
|
-
latLon: import("./math/geometry/point.js").PointIdentifiers;
|
|
3108
|
-
"3d": import("./math/geometry/spacePoint.js").SpacePointIdentifiers;
|
|
3109
|
-
}>;
|
|
3110
|
-
isLatitude: boolean;
|
|
3111
|
-
namePointTarget: string;
|
|
3112
3105
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3113
3106
|
indexFamily: number;
|
|
3114
3107
|
indexPattern: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -44,7 +44,7 @@ export declare class Line {
|
|
|
44
44
|
toCartesianCoeffs(): AlgebraicNode[];
|
|
45
45
|
toTex(): string;
|
|
46
46
|
toTexNoLeftRight(): string;
|
|
47
|
-
toGGBCommands(shouldBuildPoints: boolean, { isFixed, showLabel, showUnderlyingPointsLabel, color, label, }?: ToGGBCommandsProps): string[];
|
|
47
|
+
toGGBCommands(shouldBuildPoints: boolean, { isFixed, isSelectionnable, showLabel, showUnderlyingPointsLabel, color, label, }?: ToGGBCommandsProps): string[];
|
|
48
48
|
intersect(line: Line, intersectName?: string): Point;
|
|
49
49
|
translate(x: AlgebraicNode | number, y: AlgebraicNode | number): Line;
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAG1F,OAAO,EAAE,aAAa,EAAE,MAAM,mCA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
204
204
|
toTexNoLeftRight() {
|
|
205
205
|
return this.name.replace("\\left", "").replace("\\right", "");
|
|
206
206
|
}
|
|
207
|
-
toGGBCommands(shouldBuildPoints, { isFixed = true, showLabel = false, showUnderlyingPointsLabel = true,
|
|
207
|
+
toGGBCommands(shouldBuildPoints, { isFixed = true, isSelectionnable = false, showLabel = false, showUnderlyingPointsLabel = true,
|
|
208
208
|
// showUnderlyingPoints = true,
|
|
209
209
|
color = undefined, label = undefined, } = {}) {
|
|
210
210
|
const commands = [];
|
|
211
211
|
if (shouldBuildPoints) {
|
|
212
212
|
const ACommands = this.pointA.toGGBCommand({
|
|
213
213
|
isFixed,
|
|
214
|
+
isSelectionnable,
|
|
214
215
|
showLabel: showUnderlyingPointsLabel,
|
|
215
216
|
});
|
|
216
217
|
const BCommands = this.pointB.toGGBCommand({
|
|
217
218
|
isFixed,
|
|
219
|
+
isSelectionnable,
|
|
218
220
|
showLabel: showUnderlyingPointsLabel,
|
|
219
221
|
});
|
|
220
222
|
commands.push(...ACommands, ...BCommands, `${this.ggbName}=Line(${this.pointA.name},${this.pointB.name})`);
|
|
@@ -223,7 +225,7 @@ export class Line {
|
|
|
223
225
|
commands.push(`${this.ggbName}=Line(${this.pointA.toMathString()},${this.pointB.toMathString()})`);
|
|
224
226
|
}
|
|
225
227
|
commands.push(...[
|
|
226
|
-
`SetFixed(${this.ggbName},${isFixed ? "true" : "false"},${
|
|
228
|
+
`SetFixed(${this.ggbName},${isFixed ? "true" : "false"},${isSelectionnable ? "true" : "false"})`,
|
|
227
229
|
`ShowLabel(${this.ggbName},${showLabel ? "true" : "false"})`,
|
|
228
230
|
]);
|
|
229
231
|
if (label) {
|
|
@@ -50,7 +50,7 @@ export declare class Point {
|
|
|
50
50
|
equals(B: Point): boolean;
|
|
51
51
|
isAligned(B: Point, C: Point): boolean;
|
|
52
52
|
toMathString(): string;
|
|
53
|
-
toGGBCommand({ isFixed, showLabel, style, size, color, label, }?: ToGGBCommandsProps): string[];
|
|
53
|
+
toGGBCommand({ isFixed, isSelectionnable, showLabel, style, size, color, label, }?: ToGGBCommandsProps): string[];
|
|
54
54
|
rotate(angle: number, _center: Point): Point;
|
|
55
55
|
centralSymetric(center: Point, name?: string): Point;
|
|
56
56
|
project(line: Line, name?: string): Point;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/math/geometry/point.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,eAAe,EAChB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQvC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;CACpB,CAAC;AACF,8BAAsB,gBAAgB;IACpC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE;IAGrC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM;IAKhC,MAAM,CAAC,MAAM,CAAC,IAAI,SAAM;IAGxB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAM,EAAE,GAAG,SAAK,GAAG,KAAK;IAMvD,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,gBAAgB;IAQpD,MAAM,CAAC,SAAS,CACd,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,EACE,OAAa,EACb,WAAW,GACZ,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO;IAQpD,MA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MAAM;IAIlB,UAAU,IAAI,MAAM;IAIpB,UAAU,IAAI,MAAM;IAIpB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,KAAK;IAOzC,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,SAAM,GAAG,KAAK;IAQrC,UAAU,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAK5B,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,aAAa;IAMvC,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,OAAO;IAGzB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK;IAK5B,YAAY;IAGZ,YAAY,CAAC,EACX,OAAc,EACd,gBAAwB,EACxB,SAAgB,EAChB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,GACN,GAAE,kBAAuB;IAsB1B,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK;IAiBpC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,SAAkB;IAIrD,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,SAAkB;IAI1C,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,SAAkB;IAKhD,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe;IAG/B,SAAS,CAAC,CAAC,EAAE,aAAa,GAAG,MAAM,EAAE,CAAC,EAAE,aAAa,GAAG,MAAM;CAO/D"}
|
|
@@ -155,10 +155,10 @@ export class Point {
|
|
|
155
155
|
toMathString() {
|
|
156
156
|
return `(${this.x.toMathString()}, ${this.y.toMathString()})`;
|
|
157
157
|
}
|
|
158
|
-
toGGBCommand({ isFixed = true, showLabel = true, style, size, color, label, } = {}) {
|
|
158
|
+
toGGBCommand({ isFixed = true, isSelectionnable = false, showLabel = true, style, size, color, label, } = {}) {
|
|
159
159
|
const commands = [
|
|
160
160
|
`${this.name} = (${this.x.toMathString()}, ${this.y.toMathString()})`,
|
|
161
|
-
`SetFixed(${this.name},${isFixed ? "true" : "false"},${
|
|
161
|
+
`SetFixed(${this.name},${isFixed ? "true" : "false"},${isSelectionnable ? "true" : "false"})`,
|
|
162
162
|
`ShowLabel(${this.name},${showLabel ? "true" : "false"})`,
|
|
163
163
|
];
|
|
164
164
|
if (label !== undefined) {
|
package/lib/server.js
CHANGED
|
@@ -84,7 +84,10 @@ const runServer = () => {
|
|
|
84
84
|
const identifiers = req.query.identifiers
|
|
85
85
|
? JSON.parse(decodeURIComponent(req.query.identifiers))
|
|
86
86
|
: undefined;
|
|
87
|
-
const
|
|
87
|
+
const hasAnswer = !!req.query.answer && req.query.answer !== "undefined";
|
|
88
|
+
const answer = hasAnswer
|
|
89
|
+
? JSON.parse(decodeURIComponent(req.query.answer))
|
|
90
|
+
: "";
|
|
88
91
|
const exo = allExercises.find((exo) => exo.id == exoId);
|
|
89
92
|
if (!exo) {
|
|
90
93
|
res.send("Exo not found");
|