math-exercises 2.2.18 → 2.2.20

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.
Files changed (58) hide show
  1. package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts +8 -0
  2. package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts.map +1 -0
  3. package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.js +117 -0
  4. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +2 -0
  5. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -0
  6. package/lib/exercises/math/geometry/euclidianConstructions/index.js +17 -0
  7. package/lib/exercises/math/geometry/index.d.ts +2 -0
  8. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  9. package/lib/exercises/math/geometry/index.js +3 -0
  10. package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts +8 -0
  11. package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -0
  12. package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +118 -0
  13. package/lib/exercises/math/geometry/shapes/basicShapesRecognition.d.ts +8 -0
  14. package/lib/exercises/math/geometry/shapes/basicShapesRecognition.d.ts.map +1 -0
  15. package/lib/exercises/math/geometry/shapes/basicShapesRecognition.js +83 -0
  16. package/lib/exercises/math/geometry/shapes/index.d.ts +3 -0
  17. package/lib/exercises/math/geometry/shapes/index.d.ts.map +1 -0
  18. package/lib/exercises/math/geometry/shapes/index.js +18 -0
  19. package/lib/exercises/math/geometry/triangles/index.d.ts +1 -0
  20. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -0
  21. package/lib/exercises/math/geometry/triangles/index.js +2 -0
  22. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts +1 -0
  23. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts.map +1 -0
  24. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.js +55 -0
  25. package/lib/exercises/math/probaStat/conditionalProbability.d.ts +5 -3
  26. package/lib/exercises/math/probaStat/conditionalProbability.d.ts.map +1 -1
  27. package/lib/exercises/math/probaStat/conditionalProbability.js +145 -19
  28. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
  29. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +3 -4
  30. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.d.ts.map +1 -1
  31. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.js +3 -4
  32. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +6 -0
  33. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -0
  34. package/lib/exercises/utils/geogebra/toGGBCommandsProps.js +2 -0
  35. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
  36. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  37. package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -0
  38. package/lib/exercises/utils/geometry/randomSegmentName.d.ts +2 -0
  39. package/lib/exercises/utils/geometry/randomSegmentName.d.ts.map +1 -0
  40. package/lib/exercises/utils/geometry/randomSegmentName.js +10 -0
  41. package/lib/index.d.ts +14 -3
  42. package/lib/index.d.ts.map +1 -1
  43. package/lib/math/geometry/line.d.ts +10 -2
  44. package/lib/math/geometry/line.d.ts.map +1 -1
  45. package/lib/math/geometry/line.js +47 -5
  46. package/lib/math/geometry/point.d.ts +3 -1
  47. package/lib/math/geometry/point.d.ts.map +1 -1
  48. package/lib/math/geometry/point.js +16 -2
  49. package/lib/math/geometry/ray.d.ts +15 -0
  50. package/lib/math/geometry/ray.d.ts.map +1 -0
  51. package/lib/math/geometry/ray.js +44 -0
  52. package/lib/math/geometry/segment.d.ts +16 -0
  53. package/lib/math/geometry/segment.d.ts.map +1 -0
  54. package/lib/math/geometry/segment.js +47 -0
  55. package/lib/tree/parsers/isSegmentName.d.ts +2 -0
  56. package/lib/tree/parsers/isSegmentName.d.ts.map +1 -0
  57. package/lib/tree/parsers/isSegmentName.js +15 -0
  58. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ A: number[];
4
+ B: number[];
5
+ };
6
+ export declare const buildMediatriceWithCompass: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=buildMediatriceWithCompass.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildMediatriceWithCompass.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;CACb,CAAC;AAsGF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAe5D,CAAC"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildMediatriceWithCompass = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const isGGBLine_1 = require("../../../../exercises/utils/geogebra/isGGBLine");
6
+ const toolBarConstructor_1 = require("../../../../exercises/utils/geogebra/toolBarConstructor");
7
+ const randomSegmentName_1 = require("../../../../exercises/utils/geometry/randomSegmentName");
8
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
9
+ const colors_1 = require("../../../../geogebra/colors");
10
+ const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
11
+ const point_1 = require("../../../../math/geometry/point");
12
+ const segment_1 = require("../../../../math/geometry/segment");
13
+ const getBuildMediatriceWithCompassQuestion = () => {
14
+ const segmentName = (0, randomSegmentName_1.randomSegmentName)();
15
+ const A = segmentName[0];
16
+ const B = segmentName[1];
17
+ const pointA = point_1.PointConstructor.random(A);
18
+ const pointB = point_1.PointConstructor.random(B);
19
+ const segment = new segment_1.Segment(pointA, pointB);
20
+ const length = segment.getLength();
21
+ const [xa, ya] = [pointA.x.evaluate({}), pointA.y.evaluate({})];
22
+ const [xb, yb] = [pointB.x.evaluate({}), pointB.y.evaluate({})];
23
+ const xMin = Math.min(xa, xb) - length;
24
+ const xMax = Math.max(xa, xb) + length;
25
+ const yMin = Math.min(ya, yb) - length;
26
+ const yMax = Math.max(ya, yb) + length;
27
+ const ggbAnswer = [
28
+ ...pointA.toGGBCommand(),
29
+ ...pointB.toGGBCommand(),
30
+ `Seg = Segment(${A},${B})`,
31
+ `C_1 = Circle(${A},${B})`,
32
+ `C_2 = Circle(${B},${A})`,
33
+ `I_1 = Intersect(C_1, C_2,1)`,
34
+ `I_2 = Intersect(C_1, C_2,2)`,
35
+ `Ans = Line(I_1,I_2)`,
36
+ `SetColor(Ans, "${colors_1.greenDark}")`,
37
+ ];
38
+ const studentGGB = new geogebraConstructor_1.GeogebraConstructor({
39
+ commands: [
40
+ ...pointA.toGGBCommand(),
41
+ ...pointB.toGGBCommand(),
42
+ `Seg = Segment(${A},${B})`,
43
+ ],
44
+ hideGrid: true,
45
+ hideAxes: true,
46
+ customToolBar: (0, toolBarConstructor_1.toolBarConstructor)({
47
+ join: true,
48
+ circleTwoPoints: true,
49
+ intersect: true,
50
+ }),
51
+ });
52
+ const question = {
53
+ ggbAnswer: ggbAnswer,
54
+ instruction: `Avec les outils disponibles, tracer la médiatrice du segment $[${segmentName}]$.`,
55
+ keys: [],
56
+ answerFormat: "tex",
57
+ identifiers: {
58
+ A: [xa, ya],
59
+ B: [xb, yb],
60
+ },
61
+ studentGgbOptions: studentGGB.getOptions({
62
+ coords: [xMin, xMax, yMin, yMax],
63
+ }),
64
+ };
65
+ return question;
66
+ };
67
+ const getPropositions = (n, { answer }) => {
68
+ const propositions = [];
69
+ (0, exercise_1.addValidProp)(propositions, answer);
70
+ while (propositions.length < n) {
71
+ throw Error("QCM not implemented");
72
+ }
73
+ return (0, exercise_1.shuffleProps)(propositions, n);
74
+ };
75
+ const isGGBAnswerValid = (ans, { ggbAnswer, A, B }) => {
76
+ const lines = ans.filter((s) => (0, isGGBLine_1.isGGBLine)(s));
77
+ const segmentPointA = new point_1.Point("Seg_A", A[0].toTree(), A[1].toTree());
78
+ const segmentPointB = new point_1.Point("Seg_B", B[0].toTree(), B[1].toTree());
79
+ if (!lines.length)
80
+ return false;
81
+ for (const line of lines) {
82
+ const formatted = line
83
+ .replace(" ", "")
84
+ .replace("Line", "")
85
+ .replace("[", "")
86
+ .replace("]", "")
87
+ .split("=")[1];
88
+ const [nameA, nameB] = formatted.split(",");
89
+ const pointACmd = ans.find((s) => s.startsWith(nameA));
90
+ const pointBCmd = ans.find((s) => s.startsWith(nameB));
91
+ if (!pointACmd || !pointBCmd)
92
+ return false;
93
+ const pointA = point_1.PointConstructor.fromGGBCommand(pointACmd);
94
+ const pointB = point_1.PointConstructor.fromGGBCommand(pointBCmd);
95
+ if (pointA.distanceTo(segmentPointA) - pointA.distanceTo(segmentPointB) <
96
+ 0.0000001 &&
97
+ pointB.distanceTo(segmentPointA) - pointB.distanceTo(segmentPointB) <
98
+ 0.0000001)
99
+ return true;
100
+ }
101
+ return false;
102
+ };
103
+ exports.buildMediatriceWithCompass = {
104
+ id: "buildMediatriceWithCompass",
105
+ connector: "=",
106
+ label: "Tracer une médiatrice avec un compas",
107
+ levels: [],
108
+ isSingleStep: true,
109
+ sections: [],
110
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getBuildMediatriceWithCompassQuestion, nb),
111
+ qcmTimer: 60,
112
+ freeTimer: 60,
113
+ getPropositions,
114
+ isGGBAnswerValid,
115
+ subject: "Mathématiques",
116
+ answerType: "GGB",
117
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./buildMediatriceWithCompass";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./buildMediatriceWithCompass"), exports);
@@ -6,4 +6,6 @@ export * from "./thales";
6
6
  export * from "./vectors";
7
7
  export * from "./convexity";
8
8
  export * from "./volumes";
9
+ export * from "./euclidianConstructions";
10
+ export * from "./shapes";
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAE1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC"}
@@ -22,3 +22,6 @@ __exportStar(require("./thales"), exports);
22
22
  __exportStar(require("./vectors"), exports);
23
23
  __exportStar(require("./convexity"), exports);
24
24
  __exportStar(require("./volumes"), exports);
25
+ // export * from "./triangles";
26
+ __exportStar(require("./euclidianConstructions"), exports);
27
+ __exportStar(require("./shapes"), exports);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ type: number;
4
+ commands: string[];
5
+ };
6
+ export declare const basicShapesNaming: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=basicShapesNaming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basicShapesNaming.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/shapes/basicShapesNaming.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAsGxD,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAenD,CAAC"}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.basicShapesNaming = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
7
+ const line_1 = require("../../../../math/geometry/line");
8
+ const ray_1 = require("../../../../math/geometry/ray");
9
+ const segment_1 = require("../../../../math/geometry/segment");
10
+ const randint_1 = require("../../../../math/utils/random/randint");
11
+ //!!Difficile de rendre cet exo non pur QCM car taper la parenthèse ouvre un environnement left/right ce qui empeche de taper des demi droites [AB)
12
+ //!solutions que je vois :
13
+ //! créer une touche parenthèse qui n'ouvre pas left/right (faisable mais relou)
14
+ //! créer des touches [..], (..) et [..) directement (mais il faut déplacer le curseur vers la gauche dans ce cas)
15
+ const getBasicShapesNamingQuestion = () => {
16
+ let answer = "";
17
+ const commands = [];
18
+ const type = (0, randint_1.randint)(1, 4);
19
+ let startPointName = "";
20
+ switch (type) {
21
+ case 1: //segment
22
+ const segment = segment_1.SegmentConstructor.random();
23
+ commands.push(...segment.toGGBCommands(true));
24
+ answer = segment.name;
25
+ break;
26
+ case 2: //demi-droite
27
+ const ray = ray_1.RayConstructor.random();
28
+ commands.push(...ray.toGGBCommands(true));
29
+ answer = ray.name;
30
+ startPointName = ray.startPoint.name;
31
+ break;
32
+ case 3: //droite
33
+ default:
34
+ const line = line_1.LineConstructor.random();
35
+ commands.push(...line.toGGBCommands(true));
36
+ answer = line.name;
37
+ break;
38
+ }
39
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
40
+ commands,
41
+ hideAxes: true,
42
+ hideGrid: true,
43
+ });
44
+ // const letters = answer.substring(1, answer.length - 1).split("") as KeyId[];
45
+ // console.log(letters);
46
+ const question = {
47
+ answer,
48
+ instruction: `Comment se nomme la figure suivante ?`,
49
+ // keys: ["lbracket", "rbracket", ...letters],
50
+ // keys: [{
51
+ // id: "custom",
52
+ // label: "[...]",
53
+ // labelType: "tex",
54
+ // mathfieldInstructions: {
55
+ // method: "write",
56
+ // content: "[$1]"
57
+ // }
58
+ // }],
59
+ answerFormat: "tex",
60
+ identifiers: { type, commands },
61
+ ggbOptions: ggb.getOptions({
62
+ coords: [-15, 15, -15, 15],
63
+ }),
64
+ hint: `On rappelle que :
65
+
66
+ - Une longueur se note $AB$ ;
67
+ - Un segment se note $[AB]$ ;
68
+ - Une demi-droite d'origine $A$ se note $[AB)$ ;
69
+ - Une droite se note $(AB)$.
70
+ `,
71
+ correction: `La figure tracée est ${type === 1
72
+ ? "un segment"
73
+ : type === 2
74
+ ? `une demi-droite d'origine ${startPointName}$`
75
+ : "une droite"}.
76
+
77
+ Cette figure se nomme donc $${answer}$.`,
78
+ };
79
+ return question;
80
+ };
81
+ const getPropositions = (n, { answer }) => {
82
+ const propositions = [];
83
+ (0, exercise_1.addValidProp)(propositions, answer);
84
+ const name = answer
85
+ .replace("\\left(", "")
86
+ .replace("\\right)", "")
87
+ .replace("[", "")
88
+ .replace("]", "")
89
+ .replace(")", "");
90
+ (0, exercise_1.tryToAddWrongProp)(propositions, "[" + name + "]");
91
+ (0, exercise_1.tryToAddWrongProp)(propositions, "[" + name + ")");
92
+ (0, exercise_1.tryToAddWrongProp)(propositions, "\\left(" + name + "\\right)");
93
+ (0, exercise_1.tryToAddWrongProp)(propositions, name);
94
+ return (0, exercise_1.shuffleProps)(propositions, n);
95
+ };
96
+ const isAnswerValid = (ans, { type, answer }) => {
97
+ const reversedAnswer = answer[0] + answer[2] + answer[1] + answer[3];
98
+ if (type === 2)
99
+ return ans === answer;
100
+ else {
101
+ return ans === answer || ans === reversedAnswer;
102
+ }
103
+ };
104
+ exports.basicShapesNaming = {
105
+ id: "basicShapesNaming",
106
+ connector: "=",
107
+ label: "Nommer un segment/une demi-droite/une droite",
108
+ levels: [],
109
+ isSingleStep: true,
110
+ sections: [],
111
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getBasicShapesNamingQuestion, nb),
112
+ qcmTimer: 60,
113
+ freeTimer: 60,
114
+ getPropositions,
115
+ isAnswerValid,
116
+ subject: "Mathématiques",
117
+ answerType: "QCU",
118
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ type: number;
4
+ commands: string[];
5
+ };
6
+ export declare const basicShapesRecognition: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=basicShapesRecognition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basicShapesRecognition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/shapes/basicShapesRecognition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAmExD,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.basicShapesRecognition = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
7
+ const line_1 = require("../../../../math/geometry/line");
8
+ const point_1 = require("../../../../math/geometry/point");
9
+ const ray_1 = require("../../../../math/geometry/ray");
10
+ const segment_1 = require("../../../../math/geometry/segment");
11
+ const randint_1 = require("../../../../math/utils/random/randint");
12
+ const randomLetter_1 = require("../../../../utils/strings/randomLetter");
13
+ const getBasicShapesRecognitionQuestion = () => {
14
+ let answer = "";
15
+ const commands = [];
16
+ const type = (0, randint_1.randint)(0, 4);
17
+ switch (type) {
18
+ case 0: //point
19
+ answer = "Un point";
20
+ const point = point_1.PointConstructor.random((0, randomLetter_1.randomLetter)(true));
21
+ commands.push(...point.toGGBCommand());
22
+ break;
23
+ case 1: //segment
24
+ answer = "Un segment";
25
+ const segment = segment_1.SegmentConstructor.random();
26
+ commands.push(...segment.toGGBCommands(true));
27
+ break;
28
+ case 2: //demi-droite
29
+ answer = "Une demi-droite";
30
+ const ray = ray_1.RayConstructor.random();
31
+ commands.push(...ray.toGGBCommands(true));
32
+ break;
33
+ case 3: //droite
34
+ default:
35
+ answer = "Une droite";
36
+ const line = line_1.LineConstructor.random();
37
+ commands.push(...line.toGGBCommands(true));
38
+ break;
39
+ }
40
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
41
+ commands,
42
+ hideAxes: true,
43
+ hideGrid: true,
44
+ });
45
+ const question = {
46
+ answer,
47
+ instruction: `Quel est le type d'objet tracé ci-dessous ?`,
48
+ keys: [],
49
+ answerFormat: "raw",
50
+ identifiers: { type, commands },
51
+ ggbOptions: ggb.getOptions({
52
+ coords: [-15, 15, -15, 15],
53
+ }),
54
+ };
55
+ return question;
56
+ };
57
+ const getPropositions = (n, { answer }) => {
58
+ const propositions = [];
59
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
60
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Un point", "raw");
61
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Une droite", "raw");
62
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Un segment", "raw");
63
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Une demi-droite", "raw");
64
+ return (0, exercise_1.shuffleProps)(propositions, n);
65
+ };
66
+ const isAnswerValid = (ans, { answer }) => {
67
+ return ans === answer;
68
+ };
69
+ exports.basicShapesRecognition = {
70
+ id: "basicShapesRecognition",
71
+ connector: "=",
72
+ label: "Reconnaître un point / un segment / une demi-droite / une droite",
73
+ levels: [],
74
+ isSingleStep: true,
75
+ sections: [],
76
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getBasicShapesRecognitionQuestion, nb),
77
+ qcmTimer: 60,
78
+ freeTimer: 60,
79
+ getPropositions,
80
+ isAnswerValid,
81
+ subject: "Mathématiques",
82
+ answerType: "QCU",
83
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./basicShapesRecognition";
2
+ export * from "./basicShapesNaming";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/shapes/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./basicShapesRecognition"), exports);
18
+ __exportStar(require("./basicShapesNaming"), exports);
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ // export * from './traceMedianInTriangle'
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=traceMedianInTriangle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traceMedianInTriangle.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/traceMedianInTriangle.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ // import {
3
+ // Exercise,
4
+ // Proposition,
5
+ // QCMGenerator,
6
+ // Question,
7
+ // QuestionGenerator,
8
+ // VEA,
9
+ // GGBVEA,
10
+ // addValidProp,
11
+ // shuffleProps,
12
+ // tryToAddWrongProp,
13
+ // } from '../../../../exercises/exercise';
14
+ // import { getDistinctQuestions } from '../../../../exercises/utils/getDistinctQuestions';
15
+ // type Identifiers = {
16
+ // };
17
+ // const getTraceMedianInTriangleQuestion: QuestionGenerator<Identifiers> = ()=>{
18
+ // const question: Question<Identifiers> = {
19
+ // answer,
20
+ // instruction: ``,
21
+ // keys: [],
22
+ // answerFormat: 'tex',
23
+ // identifiers : {}
24
+ // };
25
+ // return question;
26
+ // }
27
+ // const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
28
+ // const propositions: Proposition[] = [];
29
+ // addValidProp(propositions, answer);
30
+ // while (propositions.length < n) {
31
+ // throw Error("QCM not implemented")
32
+ // }
33
+ // return shuffleProps(propositions, n);
34
+ // };
35
+ // const isAnswerValid: VEA<Identifiers> = (ans, {answer})=>{
36
+ // throw Error("VEA not implemented")
37
+ // }
38
+ // const isGGBAnswerValid: GGBVEA<Identifiers> = (ans, {ggbAnswer}) => {
39
+ // throw Error("GGBVea not implemented")
40
+ // }
41
+ // export const traceMedianInTriangle: Exercise<Identifiers> = {
42
+ // id: 'traceMedianInTriangle',
43
+ // connector: "",
44
+ // label: "",
45
+ // levels: [],
46
+ // isSingleStep: true,
47
+ // sections: [],
48
+ // generator: (nb: number) => getDistinctQuestions(getTraceMedianInTriangleQuestion, nb),
49
+ // qcmTimer: 60,
50
+ // freeTimer: 60,
51
+ // getPropositions,
52
+ // isAnswerValid,
53
+ // isGGBAnswerValid,
54
+ // subject: "Mathématiques"
55
+ // };
@@ -1,9 +1,11 @@
1
1
  import { Exercise } from "../../exercise";
2
2
  type Identifiers = {
3
3
  flip: number;
4
- pA: number;
5
- pB: number;
6
- pAB: number;
4
+ pA?: number;
5
+ pB?: number;
6
+ pAB?: number;
7
+ pA_B?: number;
8
+ pB_A?: number;
7
9
  };
8
10
  export declare const conditionalProbability: Exercise<Identifiers>;
9
11
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"conditionalProbability.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/conditionalProbability.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAIxB,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAuHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
1
+ {"version":3,"file":"conditionalProbability.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/conditionalProbability.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAKxB,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAyNF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}