math-exercises 2.1.23 → 2.1.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.
Files changed (55) hide show
  1. package/lib/exercises/exercise.d.ts +1 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/functions/basics/index.d.ts +1 -0
  4. package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
  5. package/lib/exercises/math/functions/basics/index.js +1 -0
  6. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts +8 -0
  7. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -0
  8. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +104 -0
  9. package/lib/exercises/math/geometry/index.d.ts +1 -0
  10. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  11. package/lib/exercises/math/geometry/index.js +1 -0
  12. package/lib/exercises/math/geometry/volumes/coneVolume.d.ts +8 -0
  13. package/lib/exercises/math/geometry/volumes/coneVolume.d.ts.map +1 -0
  14. package/lib/exercises/math/geometry/volumes/coneVolume.js +97 -0
  15. package/lib/exercises/math/geometry/volumes/index.d.ts +8 -0
  16. package/lib/exercises/math/geometry/volumes/index.d.ts.map +1 -0
  17. package/lib/exercises/math/geometry/volumes/index.js +23 -0
  18. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts +10 -0
  19. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -0
  20. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +130 -0
  21. package/lib/exercises/math/geometry/volumes/sphereVolume.d.ts +7 -0
  22. package/lib/exercises/math/geometry/volumes/sphereVolume.d.ts.map +1 -0
  23. package/lib/exercises/math/geometry/volumes/sphereVolume.js +87 -0
  24. package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts +7 -0
  25. package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts.map +1 -0
  26. package/lib/exercises/math/geometry/volumes/volumeOfCube.js +70 -0
  27. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts +12 -0
  28. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts.map +1 -0
  29. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +143 -0
  30. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts +13 -0
  31. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -0
  32. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +143 -0
  33. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts +13 -0
  34. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -0
  35. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +134 -0
  36. package/lib/exercises/math/index.d.ts +1 -0
  37. package/lib/exercises/math/index.d.ts.map +1 -1
  38. package/lib/exercises/math/index.js +1 -0
  39. package/lib/exercises/math/suites/index.d.ts +3 -0
  40. package/lib/exercises/math/suites/index.d.ts.map +1 -0
  41. package/lib/exercises/math/suites/index.js +18 -0
  42. package/lib/exercises/math/suites/sequenceEvaluation.d.ts +10 -0
  43. package/lib/exercises/math/suites/sequenceEvaluation.d.ts.map +1 -0
  44. package/lib/exercises/math/suites/sequenceEvaluation.js +143 -0
  45. package/lib/exercises/math/suites/sequencePlot.d.ts +9 -0
  46. package/lib/exercises/math/suites/sequencePlot.d.ts.map +1 -0
  47. package/lib/exercises/math/suites/sequencePlot.js +88 -0
  48. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  49. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +2 -6
  50. package/lib/geogebra/geogebraConstructor.d.ts +5 -1
  51. package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
  52. package/lib/geogebra/geogebraConstructor.js +37 -13
  53. package/lib/index.d.ts +44 -0
  54. package/lib/index.d.ts.map +1 -1
  55. package/package.json +1 -1
@@ -28,6 +28,7 @@ export interface Question<TIdentifiers = {}> {
28
28
  isGridSimple?: boolean;
29
29
  isAxesRatioFixed?: boolean;
30
30
  isXAxesNatural?: boolean;
31
+ is3D?: boolean;
31
32
  };
32
33
  style?: {
33
34
  tableHasNoHeader?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,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,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ,CAAC,YAAY,GAAG,EAAE;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,EA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ClB,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,CAAC"}
1
+ {"version":3,"file":"exercise.d.ts","sourceRoot":"","sources":["../../src/exercises/exercise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAI3C,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,MAAM,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAElC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,WAAW,QAAQ,CAAC,YAAY,GAAG,EAAE;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC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,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,CAAC"}
@@ -6,4 +6,5 @@ export * from "./graphicEquation";
6
6
  export * from "./graphicInequation";
7
7
  export * from "./twoFunctionsEquation";
8
8
  export * from "./twoFunctionsInequation";
9
+ export * from "./inverseImageFunctionTable";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC"}
@@ -22,3 +22,4 @@ __exportStar(require("./graphicEquation"), exports);
22
22
  __exportStar(require("./graphicInequation"), exports);
23
23
  __exportStar(require("./twoFunctionsEquation"), exports);
24
24
  __exportStar(require("./twoFunctionsInequation"), exports);
25
+ __exportStar(require("./inverseImageFunctionTable"), exports);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ xValues: number[];
4
+ imageValues: number[];
5
+ };
6
+ export declare const inverseImageFunctionTable: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=inverseImageFunctionTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inverseImageFunctionTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/inverseImageFunctionTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AA8GF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inverseImageFunctionTable = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const polynomial_1 = require("../../../../math/polynomials/polynomial");
7
+ const randint_1 = require("../../../../math/utils/random/randint");
8
+ const coinFlip_1 = require("../../../../utils/coinFlip");
9
+ const random_1 = require("../../../../utils/random");
10
+ const getInverseImageFunctionTableQuestion = () => {
11
+ const exercise = generateExercise();
12
+ const instruction = `Soit un tableau de valeurs représentant la fonction $f$. Déterminer ${exercise.isAskingImage ? `l'image de` : `le ou les antécédents de`} $${exercise.questionValue}$ par $f$
13
+ ${exercise.exoTable.table}`;
14
+ const question = {
15
+ answer: `${exercise.answer}`,
16
+ instruction,
17
+ keys: ["x", "equal"],
18
+ answerFormat: "tex",
19
+ style: { tableHasNoHeader: true },
20
+ identifiers: {
21
+ xValues: exercise.exoTable.xValues,
22
+ imageValues: exercise.exoTable.imageValues,
23
+ },
24
+ };
25
+ return question;
26
+ };
27
+ const getPropositions = (n, { answer, xValues, imageValues }) => {
28
+ const propositions = [];
29
+ (0, exercise_1.addValidProp)(propositions, answer);
30
+ generatePropositions(xValues, imageValues, answer).forEach((value) => (0, exercise_1.tryToAddWrongProp)(propositions, value));
31
+ while (propositions.length < n) {
32
+ let randProp = (0, randint_1.randint)(+answer - 10, +answer + 11, [+answer]);
33
+ (0, exercise_1.tryToAddWrongProp)(propositions, randProp + "");
34
+ }
35
+ return (0, exercise_1.shuffleProps)(propositions, n);
36
+ };
37
+ const isAnswerValid = (ans, { answer }) => {
38
+ return [ans, ans.split("=")[1]].includes(answer);
39
+ };
40
+ const generateTable = (f) => {
41
+ const xValues = generateXValues();
42
+ const imageValues = xValues.map((value) => f.calculate(value));
43
+ return {
44
+ xValues,
45
+ imageValues,
46
+ table: `
47
+ |$x$|${xValues
48
+ .map((value) => `$${value}$`)
49
+ .reduce((prev, curr) => prev + "|" + curr)}|
50
+ |-|-|-|-|-|-|
51
+ |$f(x)$|${imageValues
52
+ .map((value) => `$${value}$`)
53
+ .reduce((prev, curr) => prev + "|" + curr)}|
54
+ `,
55
+ };
56
+ };
57
+ const generateXValues = () => {
58
+ const xValues = [];
59
+ for (let i = 0; i < 5; i++) {
60
+ let value;
61
+ do {
62
+ value = (0, randint_1.randint)(-11, 11);
63
+ } while (xValues.includes(value));
64
+ xValues.push(value);
65
+ }
66
+ xValues.sort((a, b) => {
67
+ return a - b;
68
+ });
69
+ return xValues;
70
+ };
71
+ const generateExercise = () => {
72
+ const polynom = new polynomial_1.Polynomial([(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-5, 6, [0])]);
73
+ const exoTable = generateTable(polynom);
74
+ const isAskingImage = (0, coinFlip_1.coinFlip)();
75
+ const questionValue = isAskingImage
76
+ ? (0, random_1.random)(exoTable.xValues)
77
+ : (0, random_1.random)(exoTable.imageValues);
78
+ const answer = isAskingImage
79
+ ? polynom.calculate(questionValue)
80
+ : exoTable.xValues.find((value, index) => exoTable.imageValues[index] === questionValue);
81
+ return { polynom, exoTable, isAskingImage, questionValue, answer };
82
+ };
83
+ const generatePropositions = (xValues, imageValues, answer) => {
84
+ const filteredXValues = xValues.filter((value) => value !== +answer);
85
+ const firstProp = (0, random_1.random)(filteredXValues);
86
+ const secondProp = (0, random_1.random)(filteredXValues
87
+ .concat(imageValues)
88
+ .filter((value) => ![firstProp, +answer].includes(value)));
89
+ const thirdProp = (0, random_1.random)(imageValues.filter((value) => value !== secondProp));
90
+ return [firstProp + "", secondProp + "", thirdProp + ""];
91
+ };
92
+ exports.inverseImageFunctionTable = {
93
+ id: "inverseImageFunctionTable",
94
+ label: "Déterminer l'image ou l'antécédent d'un nombre à partir d'un tableau de valeurs d'une fonction",
95
+ levels: ["3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
96
+ isSingleStep: true,
97
+ sections: ["Fonctions"],
98
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getInverseImageFunctionTableQuestion, nb),
99
+ qcmTimer: 60,
100
+ freeTimer: 60,
101
+ getPropositions,
102
+ isAnswerValid,
103
+ subject: "Mathématiques",
104
+ };
@@ -5,4 +5,5 @@ export * from "./pythagore";
5
5
  export * from "./thales";
6
6
  export * from "./vectors";
7
7
  export * from "./convexity";
8
+ export * from "./volumes";
8
9
  //# 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"}
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"}
@@ -21,3 +21,4 @@ __exportStar(require("./pythagore"), exports);
21
21
  __exportStar(require("./thales"), exports);
22
22
  __exportStar(require("./vectors"), exports);
23
23
  __exportStar(require("./convexity"), exports);
24
+ __exportStar(require("./volumes"), exports);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ radius: number;
4
+ height: number;
5
+ };
6
+ export declare const coneVolume: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=coneVolume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coneVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/coneVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwGF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,WAAW,CAa5C,CAAC"}
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.coneVolume = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const randint_1 = require("../../../../math/utils/random/randint");
7
+ const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
8
+ const round_1 = require("../../../../math/utils/round");
9
+ const getConeVolumeQuestion = () => {
10
+ let radius, height;
11
+ do {
12
+ radius = (0, randint_1.randint)(1, 11);
13
+ height = (0, randint_1.randint)(2, 12);
14
+ } while (height <= radius);
15
+ const volume = (0, round_1.round)((1 / 3) * Math.PI * Math.pow(radius, 2) * height, 2)
16
+ .toTree()
17
+ .toTex();
18
+ const xMin = -radius - 5;
19
+ const xMax = radius + 5;
20
+ const yMin = -radius - 5;
21
+ const yMax = radius + 5;
22
+ const zMax = height + 5;
23
+ const commands = [
24
+ `A = (0, 0, 0)`,
25
+ `B = (0, 0, ${height})`,
26
+ `SetFixed(A, true)`,
27
+ `SetFixed(B, true)`,
28
+ `SetVisibleInView(A, -1, false)`,
29
+ `SetVisibleInView(B, -1, false)`,
30
+ `Cone(A, B, ${radius})`,
31
+ ];
32
+ const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
33
+ isGridSimple: true,
34
+ isAxesRatioFixed: false,
35
+ hideAxes: true,
36
+ hideGrid: true,
37
+ is3D: true,
38
+ });
39
+ const question = {
40
+ answer: volume,
41
+ instruction: `Le cône ci-dessous a une base de rayon $${radius}$ et une hauteur de $${height}$. Calculer son volume (arrondir au centième).`,
42
+ commands: ggb.commands,
43
+ coords: [xMin, xMax, yMin, yMax, 0, zMax],
44
+ options: ggb.getOptions(),
45
+ keys: [],
46
+ answerFormat: "tex",
47
+ identifiers: { radius, height },
48
+ };
49
+ return question;
50
+ };
51
+ const getPropositions = (n, { answer, radius, height }) => {
52
+ const propositions = [];
53
+ (0, exercise_1.addValidProp)(propositions, answer);
54
+ const wrongVolume1 = (0, round_1.round)(Math.PI * Math.pow(radius, 2) * height, 2)
55
+ .toTree()
56
+ .toTex();
57
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume1);
58
+ const wrongVolume2 = (0, round_1.round)((1 / 3) * Math.PI * radius * height, 2)
59
+ .toTree()
60
+ .toTex();
61
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume2);
62
+ const wrongVolume3 = (0, round_1.round)(3 * Math.PI * Math.pow(radius, 2) * height, 2)
63
+ .toTree()
64
+ .toTex();
65
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume3);
66
+ while (propositions.length < n) {
67
+ let wrongRadius, wrongHeight;
68
+ do {
69
+ wrongRadius = (0, randint_1.randint)(1, 5);
70
+ wrongHeight = (0, randint_1.randint)(2, 10);
71
+ } while (wrongHeight <= wrongRadius);
72
+ const wrongVolume = (0, round_1.round)((1 / 3) * Math.PI * Math.pow(wrongRadius, 2) * wrongHeight, 2)
73
+ .toTree()
74
+ .toTex();
75
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume);
76
+ }
77
+ return (0, exercise_1.shuffleProps)(propositions, n);
78
+ };
79
+ const isAnswerValid = (ans, { answer, radius, height }) => {
80
+ const validanswer = (0, round_1.round)((1 / 3) * Math.PI * Math.pow(radius, 2) * height, 2).toTree();
81
+ const latexs = validanswer.toAllValidTexs();
82
+ return latexs.includes(ans);
83
+ };
84
+ exports.coneVolume = {
85
+ id: "coneVolume",
86
+ label: "Calculer le volume d'un cône",
87
+ levels: ["2nde"],
88
+ isSingleStep: true,
89
+ sections: ["Géométrie euclidienne"],
90
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getConeVolumeQuestion, nb),
91
+ qcmTimer: 60,
92
+ freeTimer: 60,
93
+ getPropositions,
94
+ isAnswerValid,
95
+ hasGeogebra: true,
96
+ subject: "Mathématiques",
97
+ };
@@ -0,0 +1,8 @@
1
+ export * from "./volumeOfCube";
2
+ export * from "./volumeOfPyramidWithSquareOrRectBase";
3
+ export * from "./volumeOfPyramidWithTriangleRectBase";
4
+ export * from "./volumeOfPyramidWithTriangleBase";
5
+ export * from "./coneVolume";
6
+ export * from "./sphereVolume";
7
+ export * from "./parallelepipedVolume";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mCAAmC,CAAC;AAClD,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,23 @@
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("./volumeOfCube"), exports);
18
+ __exportStar(require("./volumeOfPyramidWithSquareOrRectBase"), exports);
19
+ __exportStar(require("./volumeOfPyramidWithTriangleRectBase"), exports);
20
+ __exportStar(require("./volumeOfPyramidWithTriangleBase"), exports);
21
+ __exportStar(require("./coneVolume"), exports);
22
+ __exportStar(require("./sphereVolume"), exports);
23
+ __exportStar(require("./parallelepipedVolume"), exports);
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ length: number;
4
+ width: number;
5
+ height: number;
6
+ angle: number;
7
+ };
8
+ export declare const parallelepipedVolume: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=parallelepipedVolume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelepipedVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/parallelepipedVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAmIF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parallelepipedVolume = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const randint_1 = require("../../../../math/utils/random/randint");
7
+ const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
8
+ const round_1 = require("../../../../math/utils/round");
9
+ const colors_1 = require("../../../../geogebra/colors");
10
+ const getParallelepipedVolumeQuestion = () => {
11
+ const length = (0, randint_1.randint)(50, 110) / 10;
12
+ const width = (0, randint_1.randint)(50, 110) / 10;
13
+ const height = (0, randint_1.randint)(50, 80) / 10;
14
+ const angle = (0, randint_1.randint)(30, 90);
15
+ const angleRad = (angle * Math.PI) / 180;
16
+ const yOffset = height * Math.cos(angleRad);
17
+ const zOffset = height * Math.sin(angleRad);
18
+ const volume = (0, round_1.round)(length * width * height, 2)
19
+ .toTree()
20
+ .toTex();
21
+ const xMin = -length / 2 - 5;
22
+ const xMax = length / 2 + 5;
23
+ const yMin = -width / 2 - 5;
24
+ const yMax = width / 2 + yOffset + 5;
25
+ const zMax = height + zOffset + 5;
26
+ const zMin = -5;
27
+ const points = [`A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`];
28
+ const commands = [
29
+ `A = (${-length / 2}, ${-width / 2}, 0)`,
30
+ `B = (${-length / 2}, ${width / 2}, 0)`,
31
+ `C = (${length / 2}, ${width / 2}, 0)`,
32
+ `D = (${length / 2}, ${-width / 2}, 0)`,
33
+ `E = (${-length / 2}, ${-width / 2 + yOffset}, ${zOffset})`,
34
+ `F = (${-length / 2}, ${width / 2 + yOffset}, ${zOffset})`,
35
+ `G = (${length / 2}, ${width / 2 + yOffset}, ${zOffset})`,
36
+ `H = (${length / 2}, ${-width / 2 + yOffset}, ${zOffset})`,
37
+ `P1 = Polygon(A, B, F, E)`, // Side 1
38
+ `SetColor(P1, "${colors_1.orange}")`, // Color for side 1
39
+ `P2 = Polygon(B, C, G, F)`, // Side 2
40
+ `SetColor(P2, "${colors_1.orange}")`, // Color for side 2
41
+ `P3 = Polygon(C, D, H, G)`, // Side 3
42
+ `SetColor(P3, "${colors_1.orange}")`, // Color for side 3
43
+ `P4 = Polygon(D, A, E, H)`, // Side 4
44
+ `SetColor(P4, "${colors_1.orange}")`, // Color for side 4
45
+ `P5 = Polygon(A, B, C, D)`, // Base
46
+ `SetColor(P5, "${colors_1.orange}")`, // Color for base
47
+ `P6 = Polygon(E, F, G, H)`, // Top
48
+ `SetColor(P6, "${colors_1.orange}")`, // Color for top
49
+ `ShowLabel(A, true)`,
50
+ `ShowLabel(B, true)`,
51
+ `ShowLabel(C, true)`,
52
+ `ShowLabel(D, true)`,
53
+ `ShowLabel(E, true)`,
54
+ `ShowLabel(F, true)`,
55
+ `ShowLabel(G, true)`,
56
+ `ShowLabel(H, true)`,
57
+ `SetFixed(A, true)`,
58
+ `SetFixed(B, true)`,
59
+ `SetFixed(C, true)`,
60
+ `SetFixed(D, true)`,
61
+ `SetFixed(E, true)`,
62
+ `SetFixed(F, true)`,
63
+ `SetFixed(G, true)`,
64
+ `SetFixed(H, true)`,
65
+ `ZoomIn(${xMin}, ${yMin}, ${xMax}, ${yMax}, ${zMin}, ${zMax})`,
66
+ ];
67
+ const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
68
+ isGridSimple: true,
69
+ isAxesRatioFixed: false,
70
+ is3D: true,
71
+ hideAxes: true,
72
+ hideGrid: true,
73
+ });
74
+ const question = {
75
+ answer: volume,
76
+ instruction: `Le parallélépipède $ABCDEFGH$ ci-dessous a une longueur de $${length.frenchify()}$, une largeur de $${width.frenchify()}$, et une hauteur de $${height.frenchify()}$. Calculer son volume (arrondir au centième).`,
77
+ commands: ggb.commands,
78
+ coords: [xMin, xMax, yMin, yMax, zMin, zMax],
79
+ options: ggb.getOptions(),
80
+ keys: [],
81
+ answerFormat: "tex",
82
+ identifiers: { length, width, height, angle },
83
+ };
84
+ return question;
85
+ };
86
+ const getPropositions = (n, { answer, length, width, height }) => {
87
+ const propositions = [];
88
+ (0, exercise_1.addValidProp)(propositions, answer);
89
+ const wrongVolume1 = (0, round_1.round)(length * width, 2)
90
+ .toTree()
91
+ .toTex();
92
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume1);
93
+ const wrongVolume2 = (0, round_1.round)(width * height, 2)
94
+ .toTree()
95
+ .toTex();
96
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume2);
97
+ const wrongVolume3 = (0, round_1.round)(length * height, 2)
98
+ .toTree()
99
+ .toTex();
100
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume3);
101
+ while (propositions.length < n) {
102
+ const wrongLength = length + 1;
103
+ const wrongWidth = width + 1;
104
+ const wrongHeight = height + 1;
105
+ const wrongVolume = (0, round_1.round)(wrongLength * wrongWidth * wrongHeight, 2)
106
+ .toTree()
107
+ .toTex();
108
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume);
109
+ }
110
+ return (0, exercise_1.shuffleProps)(propositions, n);
111
+ };
112
+ const isAnswerValid = (ans, { answer, length, width, height }) => {
113
+ const validanswer = (0, round_1.round)(length * width * height, 2).toTree();
114
+ const latexs = validanswer.toAllValidTexs();
115
+ return latexs.includes(ans);
116
+ };
117
+ exports.parallelepipedVolume = {
118
+ id: "parallelepipedVolume",
119
+ label: "Calculer le volume d'un parallélépipède",
120
+ levels: ["2nde"],
121
+ isSingleStep: true,
122
+ sections: ["Géométrie euclidienne"],
123
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getParallelepipedVolumeQuestion, nb),
124
+ qcmTimer: 60,
125
+ freeTimer: 60,
126
+ getPropositions,
127
+ isAnswerValid,
128
+ hasGeogebra: true,
129
+ subject: "Mathématiques",
130
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ radius: number;
4
+ };
5
+ export declare const sphereVolume: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=sphereVolume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sphereVolume.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/sphereVolume.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAqFF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAa9C,CAAC"}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sphereVolume = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const randint_1 = require("../../../../math/utils/random/randint");
7
+ const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor");
8
+ const round_1 = require("../../../../math/utils/round");
9
+ const getSphereVolumeQuestion = () => {
10
+ const radius = (0, randint_1.randint)(10, 110) / 10;
11
+ const volume = (0, round_1.round)((4 / 3) * Math.PI * Math.pow(radius, 3), 2)
12
+ .toTree()
13
+ .toTex();
14
+ const xMin = -radius - 5;
15
+ const xMax = radius + 5;
16
+ const yMin = -radius - 5;
17
+ const yMax = radius + 5;
18
+ const zMax = radius + 5;
19
+ const zMin = -radius - 5;
20
+ const commands = [
21
+ `A = (0, 0, 0)`,
22
+ `Sphere(A, ${radius})`,
23
+ `SetFixed(A, true)`,
24
+ `SetVisibleInView(A, -1, false)`,
25
+ ];
26
+ const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
27
+ isGridSimple: true,
28
+ isAxesRatioFixed: false,
29
+ is3D: true,
30
+ hideAxes: true,
31
+ hideGrid: true,
32
+ });
33
+ const question = {
34
+ answer: volume,
35
+ instruction: `La sphère ci-dessous a un rayon de $${radius.frenchify()}$. Calculer son volume (arrondir au centième).`,
36
+ commands: ggb.commands,
37
+ coords: [xMin, xMax, yMin, yMax, zMin, zMax],
38
+ options: ggb.getOptions(),
39
+ keys: [],
40
+ answerFormat: "tex",
41
+ identifiers: { radius },
42
+ };
43
+ return question;
44
+ };
45
+ const getPropositions = (n, { answer, radius }) => {
46
+ const propositions = [];
47
+ (0, exercise_1.addValidProp)(propositions, answer);
48
+ const wrongVolume1 = (0, round_1.round)(Math.PI * Math.pow(radius, 2) * radius, 2)
49
+ .toTree()
50
+ .toTex();
51
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume1);
52
+ const wrongVolume2 = (0, round_1.round)((4 / 3) * Math.PI * radius * 3, 2)
53
+ .toTree()
54
+ .toTex();
55
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume2);
56
+ const wrongVolume3 = (0, round_1.round)((1 / 3) * Math.PI * Math.pow(radius, 3), 2)
57
+ .toTree()
58
+ .toTex();
59
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume3);
60
+ while (propositions.length < n) {
61
+ const wrongRadius = radius + 1;
62
+ const wrongVolume = (0, round_1.round)((4 / 3) * Math.PI * Math.pow(wrongRadius, 3), 2)
63
+ .toTree()
64
+ .toTex();
65
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongVolume);
66
+ }
67
+ return (0, exercise_1.shuffleProps)(propositions, n);
68
+ };
69
+ const isAnswerValid = (ans, { answer, radius }) => {
70
+ const validanswer = (0, round_1.round)((4 / 3) * Math.PI * Math.pow(radius, 3), 2).toTree();
71
+ const latexs = validanswer.toAllValidTexs();
72
+ return latexs.includes(ans);
73
+ };
74
+ exports.sphereVolume = {
75
+ id: "sphereVolume",
76
+ label: "Calculer le volume d'une sphère",
77
+ levels: ["2nde"],
78
+ isSingleStep: true,
79
+ sections: ["Géométrie euclidienne"],
80
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSphereVolumeQuestion, nb),
81
+ qcmTimer: 60,
82
+ freeTimer: 60,
83
+ getPropositions,
84
+ isAnswerValid,
85
+ hasGeogebra: true,
86
+ subject: "Mathématiques",
87
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ cubeSide: number;
4
+ };
5
+ export declare const volumeOfCube: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=volumeOfCube.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volumeOfCube.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/volumes/volumeOfCube.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAgEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAe9C,CAAC"}