math-exercises 2.2.17 → 2.2.19

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 (100) hide show
  1. package/lib/exercises/exercise.d.ts +1 -1
  2. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +9 -0
  4. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +9 -0
  6. package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/operations/expressionNature.js +1 -0
  8. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.d.ts +9 -0
  9. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.d.ts.map +1 -0
  10. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.js +77 -0
  11. package/lib/exercises/math/calcul/ordering/index.d.ts +1 -0
  12. package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
  13. package/lib/exercises/math/calcul/ordering/index.js +1 -0
  14. package/lib/exercises/math/functions/basics/imageFunction.js +1 -1
  15. package/lib/exercises/math/geometry/areas/triangleArea.js +1 -1
  16. package/lib/exercises/math/geometry/cartesian/index.d.ts +1 -0
  17. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  18. package/lib/exercises/math/geometry/cartesian/index.js +2 -0
  19. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts +8 -0
  20. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.d.ts.map +1 -0
  21. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.js +101 -0
  22. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts +8 -0
  23. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.d.ts.map +1 -0
  24. package/lib/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.js +103 -0
  25. package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts +8 -0
  26. package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.d.ts.map +1 -0
  27. package/lib/exercises/math/geometry/euclidianConstructions/buildMediatriceWithCompass.js +125 -0
  28. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts +2 -0
  29. package/lib/exercises/math/geometry/euclidianConstructions/index.d.ts.map +1 -0
  30. package/lib/exercises/math/geometry/euclidianConstructions/index.js +17 -0
  31. package/lib/exercises/math/geometry/index.d.ts +1 -0
  32. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  33. package/lib/exercises/math/geometry/index.js +2 -0
  34. package/lib/exercises/math/geometry/triangles/index.d.ts +1 -0
  35. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -0
  36. package/lib/exercises/math/geometry/triangles/index.js +2 -0
  37. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts +1 -0
  38. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts.map +1 -0
  39. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.js +55 -0
  40. package/lib/exercises/math/geometry/vectors/scalarProductViaCos.js +1 -1
  41. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +1 -1
  42. package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -1
  43. package/lib/exercises/math/percent/htToTTC.js +16 -1
  44. package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -1
  45. package/lib/exercises/math/percent/ttcToHT.js +16 -1
  46. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
  47. package/lib/exercises/math/probaStat/stats1var/averageList.js +21 -0
  48. package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
  49. package/lib/exercises/math/probaStat/stats1var/etendueList.js +9 -0
  50. package/lib/exercises/pc/calibrationCurveOfSolution.js +1 -1
  51. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
  52. package/lib/exercises/pc/chemicalElements/calculateProtonsNumberFromMass.js +1 -1
  53. package/lib/exercises/pc/chemicalElements/findAtomEntitiesNumberFromMass.js +1 -1
  54. package/lib/exercises/pc/chemicalElements/findAtomicStructureElement.js +1 -1
  55. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromElectronicConfiguration.js +1 -1
  56. package/lib/exercises/pc/chemicalElements/findValenceElectronsNumberFromTable.js +1 -1
  57. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +1 -1
  58. package/lib/exercises/pc/chemicalElements/massOrVolumeProportion.js +1 -1
  59. package/lib/exercises/pc/chemicalReactions/calculateCombustionEnergy.js +1 -1
  60. package/lib/exercises/pc/dosage/beerLambertRandomValue.js +1 -1
  61. package/lib/exercises/pc/energy/energyTransfer.js +1 -1
  62. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +1 -1
  63. package/lib/exercises/pc/mole/molarMass.js +1 -1
  64. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.js +1 -1
  65. package/lib/exercises/pc/motion/motionReference.js +1 -1
  66. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
  67. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  68. package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -0
  69. package/lib/exercises/utils/geometry/randomSegmentName.d.ts +2 -0
  70. package/lib/exercises/utils/geometry/randomSegmentName.d.ts.map +1 -0
  71. package/lib/exercises/utils/geometry/randomSegmentName.js +10 -0
  72. package/lib/geogebra/geogebraConstructor.js +1 -1
  73. package/lib/index.d.ts +10 -0
  74. package/lib/index.d.ts.map +1 -1
  75. package/lib/math/geometry/line.d.ts +1 -1
  76. package/lib/math/geometry/line.d.ts.map +1 -1
  77. package/lib/math/geometry/line.js +12 -3
  78. package/lib/math/geometry/point.d.ts +1 -0
  79. package/lib/math/geometry/point.d.ts.map +1 -1
  80. package/lib/math/geometry/point.js +10 -0
  81. package/lib/math/geometry/segment.d.ts +9 -0
  82. package/lib/math/geometry/segment.d.ts.map +1 -0
  83. package/lib/math/geometry/segment.js +16 -0
  84. package/lib/tree/nodes/inequations/inequationNode.js +1 -1
  85. package/lib/tree/parsers/numberParser.d.ts +2 -0
  86. package/lib/tree/parsers/numberParser.d.ts.map +1 -0
  87. package/lib/tree/parsers/numberParser.js +11 -0
  88. package/lib/utils/strings/isLetter.d.ts +2 -0
  89. package/lib/utils/strings/isLetter.d.ts.map +1 -0
  90. package/lib/utils/strings/isLetter.js +7 -0
  91. package/lib/utils/strings/pluralize.d.ts +2 -0
  92. package/lib/utils/strings/pluralize.d.ts.map +1 -0
  93. package/lib/utils/strings/pluralize.js +12 -0
  94. package/lib/utils/strings/randomLetter.d.ts +2 -0
  95. package/lib/utils/strings/randomLetter.d.ts.map +1 -0
  96. package/lib/utils/strings/randomLetter.js +11 -0
  97. package/lib/utils/strings/requiresApostropheBefore.d.ts +2 -0
  98. package/lib/utils/strings/requiresApostropheBefore.d.ts.map +1 -0
  99. package/lib/utils/strings/requiresApostropheBefore.js +7 -0
  100. package/package.json +1 -1
@@ -14,7 +14,7 @@ export type Proposition = {
14
14
  export type GeogebraAxisOptions = {
15
15
  steps?: number;
16
16
  hiddden?: boolean;
17
- showNumbers?: boolean;
17
+ hideNumbers?: boolean;
18
18
  label?: string;
19
19
  natural?: boolean;
20
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"multiplyDecimalByNegativeTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAgDF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
1
+ {"version":3,"file":"multiplyDecimalByNegativeTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AA6DF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAe/D,CAAC"}
@@ -6,6 +6,7 @@ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQ
6
6
  const decimal_1 = require("../../../../math/numbers/decimals/decimal");
7
7
  const randint_1 = require("../../../../math/utils/random/randint");
8
8
  const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
9
+ const pluralize_1 = require("../../../../utils/strings/pluralize");
9
10
  const getMultiplyDecimalByNegativeTensQuestion = () => {
10
11
  const dec = decimal_1.DecimalConstructor.random(1, 200, (0, randint_1.randint)(1, 5));
11
12
  const pow = -(0, randint_1.randint)(1, 4);
@@ -18,6 +19,13 @@ const getMultiplyDecimalByNegativeTensQuestion = () => {
18
19
  keys: [],
19
20
  answerFormat: "tex",
20
21
  identifiers: { dec: dec.value, pow },
22
+ hint: `Multiplier par $${factor.frenchify()}$ revient à déplacer la virgule de $${-pow}$ ${(0, pluralize_1.pluralize)("position", -pow)} vers la gauche.`,
23
+ correction: `On déplace la virgule de $${-pow}$ ${(0, pluralize_1.pluralize)("position", -pow)} vers la gauche :
24
+
25
+ $$
26
+ ${statement.toTex()} = ${answer}
27
+ $$
28
+ `,
21
29
  };
22
30
  return question;
23
31
  };
@@ -50,4 +58,5 @@ exports.multiplyDecimalByNegativeTens = {
50
58
  getPropositions,
51
59
  isAnswerValid,
52
60
  subject: "Mathématiques",
61
+ hasHintAndCorrection: true,
53
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"multiplyDecimalByTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAsDF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAcvD,CAAC"}
1
+ {"version":3,"file":"multiplyDecimalByTens.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/decimals/multiplyDecimalByTens.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAqEF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
@@ -8,6 +8,7 @@ const randint_1 = require("../../../../math/utils/random/randint");
8
8
  const divideNode_1 = require("../../../../tree/nodes/operators/divideNode");
9
9
  const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
10
10
  const coinFlip_1 = require("../../../../utils/coinFlip");
11
+ const pluralize_1 = require("../../../../utils/strings/pluralize");
11
12
  const getMultiplyDecimalByTensQuestion = () => {
12
13
  const dec = decimal_1.DecimalConstructor.random(1, 200, (0, randint_1.randint)(1, 5));
13
14
  const pow = (0, randint_1.randint)(1, 4);
@@ -24,6 +25,13 @@ const getMultiplyDecimalByTensQuestion = () => {
24
25
  keys: [],
25
26
  answerFormat: "tex",
26
27
  identifiers: { dec: dec.value, pow, isDivide },
28
+ hint: `${isDivide ? "Diviser" : "Multiplier"} par $${factor.frenchify()}$ revient à déplacer la virgule de $${pow}$ ${(0, pluralize_1.pluralize)("position", pow)} vers la ${isDivide ? "gauche" : "droite"}.`,
29
+ correction: `On déplace la virgule de $${pow}$ ${(0, pluralize_1.pluralize)("position", pow)} vers la ${isDivide ? "gauche" : "droite"} :
30
+
31
+ $$
32
+ ${statement.toTex()} = ${answer}
33
+ $$
34
+ `,
27
35
  };
28
36
  return question;
29
37
  };
@@ -60,4 +68,5 @@ exports.multiplyDecimalByTens = {
60
68
  getPropositions,
61
69
  isAnswerValid,
62
70
  subject: "Mathématiques",
71
+ hasHintAndCorrection: true,
63
72
  };
@@ -1 +1 @@
1
- {"version":3,"file":"expressionNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/expressionNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAoLnE,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
1
+ {"version":3,"file":"expressionNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/operations/expressionNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAoLnE,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAgBlD,CAAC"}
@@ -178,4 +178,5 @@ exports.expressionNature = {
178
178
  getPropositions,
179
179
  isAnswerValid,
180
180
  subject: "Mathématiques",
181
+ answerType: "QCU",
181
182
  };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ type: number;
4
+ a: number;
5
+ b: number;
6
+ };
7
+ export declare const decimalOrderingNoRelatives: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=decimalOrderingNoRelatives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decimalOrderingNoRelatives.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/decimalOrderingNoRelatives.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAgE1D,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAe5D,CAAC"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decimalOrderingNoRelatives = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const randfloat_1 = require("../../../../math/utils/random/randfloat");
7
+ const randint_1 = require("../../../../math/utils/random/randint");
8
+ const coinFlip_1 = require("../../../../utils/coinFlip");
9
+ const getDecimalOrderingNoRelativesQuestion = () => {
10
+ const type = (0, randint_1.randint)(1, 5);
11
+ let a = 0;
12
+ let b = 0;
13
+ while (b == a) {
14
+ switch (type) {
15
+ case 1:
16
+ //x vs x.y
17
+ a = (0, randint_1.randint)(0, 100);
18
+ b = (0, randfloat_1.randfloat)(Math.floor(a), Math.floor(a) + 1, (0, randint_1.randint)(1, 3));
19
+ break;
20
+ case 2:
21
+ //x.y vs x.y
22
+ a = (0, randfloat_1.randfloat)(0, 100, 1);
23
+ b = (0, randfloat_1.randfloat)(Math.floor(a), Math.floor(a) + 1, 1);
24
+ break;
25
+ case 3:
26
+ //x.yy vs x.yy
27
+ a = (0, randfloat_1.randfloat)(0, 100, 2);
28
+ b = (0, randfloat_1.randfloat)(Math.floor(a), Math.floor(a) + 1, 2);
29
+ break;
30
+ case 4:
31
+ default:
32
+ //x.yy vs x ou x.y
33
+ a = (0, randfloat_1.randfloat)(0, 100, 2);
34
+ b = (0, coinFlip_1.coinFlip)()
35
+ ? Math.floor(a)
36
+ : (0, randfloat_1.randfloat)(Math.floor(a), Math.floor(a) + 1, 1);
37
+ break;
38
+ }
39
+ }
40
+ const answer = a < b ? "<" : a === b ? "=" : ">";
41
+ const question = {
42
+ answer,
43
+ instruction: `Compléter par le bon symbole :
44
+
45
+ $$${a.frenchify()}\\ ...... \\ ${b.frenchify()}$$`,
46
+ keys: [],
47
+ answerFormat: "tex",
48
+ identifiers: { type, a, b },
49
+ };
50
+ return question;
51
+ };
52
+ const getPropositions = (n, { answer }) => {
53
+ const propositions = [];
54
+ (0, exercise_1.addValidProp)(propositions, answer);
55
+ (0, exercise_1.tryToAddWrongProp)(propositions, "<");
56
+ (0, exercise_1.tryToAddWrongProp)(propositions, ">");
57
+ (0, exercise_1.tryToAddWrongProp)(propositions, "=");
58
+ return (0, exercise_1.shuffleProps)(propositions, n);
59
+ };
60
+ const isAnswerValid = (ans, { answer }) => {
61
+ return ans === answer;
62
+ };
63
+ exports.decimalOrderingNoRelatives = {
64
+ id: "decimalOrderingNoRelatives",
65
+ connector: "\\iff",
66
+ label: "Comparer des nombres décimaux (sans relatifs)",
67
+ levels: [],
68
+ isSingleStep: true,
69
+ sections: [],
70
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getDecimalOrderingNoRelativesQuestion, nb),
71
+ qcmTimer: 60,
72
+ freeTimer: 60,
73
+ getPropositions,
74
+ isAnswerValid,
75
+ subject: "Mathématiques",
76
+ answerType: "QCU",
77
+ };
@@ -1,4 +1,5 @@
1
1
  export * from "./integerOrdering";
2
2
  export * from "./decimalOrdering";
3
3
  export * from "./framing";
4
+ export * from "./decimalOrderingNoRelatives";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/ordering/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,8BAA8B,CAAC"}
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./integerOrdering"), exports);
18
18
  __exportStar(require("./decimalOrdering"), exports);
19
19
  __exportStar(require("./framing"), exports);
20
+ __exportStar(require("./decimalOrderingNoRelatives"), exports);
@@ -19,7 +19,7 @@ const getImageFunction = () => {
19
19
  const flip = (0, coinFlip_1.coinFlip)();
20
20
  const statement = `Soit $f(x) = ${(rand ? polynome1 : polynome2)
21
21
  .toTree()
22
- .toTex()}. Calculer ${flip ? `l'image de $${xValue}$ par $f$.` : `$f(${xValue})$.`}`;
22
+ .toTex()}$. Calculer ${flip ? `l'image de $${xValue}$ par $f$.` : `$f(${xValue})$.`}`;
23
23
  const answer = rand
24
24
  ? polynome1.calculate(xValue) + ""
25
25
  : polynome2.calculate(xValue) + "";
@@ -7,7 +7,7 @@ const geogebraConstructor_1 = require("../../../../geogebra/geogebraConstructor"
7
7
  const triangles_1 = require("../../../../math/geometry/triangles");
8
8
  const rational_1 = require("../../../../math/numbers/rationals/rational");
9
9
  const randint_1 = require("../../../../math/utils/random/randint");
10
- const randomLetter_1 = require("../../../../utils/randomLetter");
10
+ const randomLetter_1 = require("../../../../utils/strings/randomLetter");
11
11
  const shuffle_1 = require("../../../../utils/shuffle");
12
12
  const getTriangleArea = () => {
13
13
  const vertices = [];
@@ -6,4 +6,5 @@ export * from "./directionVector";
6
6
  export * from "./directionVectorEquation";
7
7
  export * from "./drawAlineInGGB";
8
8
  export * from "./placeAPoint";
9
+ export * from "./pointCoordinatesNoAxisNumbers";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iCAAiC,CAAC"}
@@ -22,3 +22,5 @@ __exportStar(require("./directionVector"), exports);
22
22
  __exportStar(require("./directionVectorEquation"), exports);
23
23
  __exportStar(require("./drawAlineInGGB"), exports);
24
24
  __exportStar(require("./placeAPoint"), exports);
25
+ __exportStar(require("./pointCoordinatesNoAxisNumbers"), exports);
26
+ // export * from "./pointCoordinatesNoOrthonorm";
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ export declare const pointCoordinatesNoAxisNumbers: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=pointCoordinatesNoAxisNumbers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointCoordinatesNoAxisNumbers.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinatesNoAxisNumbers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwGF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pointCoordinatesNoAxisNumbers = 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 point_1 = require("../../../../math/geometry/point");
8
+ const randint_1 = require("../../../../math/utils/random/randint");
9
+ const getPointCoordinatesNoAxisNumbersQuestion = () => {
10
+ const x = (0, randint_1.randint)(-10, 10);
11
+ const y = (0, randint_1.randint)(-10, 10);
12
+ let xMin = x - 2;
13
+ let xMax = x + 2;
14
+ let yMin = y - 2;
15
+ let yMax = y + 2;
16
+ yMax = yMax < 2 ? 2 : yMax;
17
+ yMin = yMin > -2 ? -2 : yMin;
18
+ xMin = xMin > -2 ? -2 : xMin;
19
+ xMax = xMax < 2 ? 2 : xMax;
20
+ const instruction = `Lire les coordonnées du point $A$ représenté dans le repère ci-dessous : `;
21
+ const commands = [
22
+ `A = (${x}, ${y})`,
23
+ `ShowLabel(A, true)`,
24
+ // `SetPointStyle(A, 0)`,
25
+ `SetPointSize(A, 4)`,
26
+ `SetFixed(A, true)`,
27
+ "O = (0,0)",
28
+ `SetFixed(O, true)`,
29
+ `ShowLabel(O, true)`,
30
+ `SetPointSize(O, 4)`,
31
+ "I = (1,0)",
32
+ `SetFixed(I, true)`,
33
+ `ShowLabel(I, true)`,
34
+ `SetPointSize(I, 4)`,
35
+ "J = (0,1)",
36
+ `SetFixed(J, true)`,
37
+ `ShowLabel(J, true)`,
38
+ `SetPointSize(J, 4)`,
39
+ ];
40
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
41
+ commands,
42
+ xAxis: {
43
+ hideNumbers: true,
44
+ },
45
+ yAxis: {
46
+ hideNumbers: true,
47
+ },
48
+ });
49
+ const A = new point_1.Point("A", x.toTree(), y.toTree());
50
+ const question = {
51
+ answer: A.toCoords(),
52
+ instruction,
53
+ ggbOptions: ggb.getOptions({
54
+ coords: ggb.getAdaptedCoords({
55
+ xMin,
56
+ xMax,
57
+ yMin,
58
+ yMax,
59
+ forceShowAxes: true,
60
+ }),
61
+ }),
62
+ keys: ["x", "y", "semicolon"],
63
+ answerFormat: "tex",
64
+ identifiers: { x, y },
65
+ };
66
+ return question;
67
+ };
68
+ const getPropositions = (n, { answer, x, y }) => {
69
+ const propositions = [];
70
+ (0, exercise_1.addValidProp)(propositions, answer, "tex");
71
+ const points = [
72
+ new point_1.Point("A", (x + 1).toTree(), (y + 1).toTree()),
73
+ new point_1.Point("A", (x - 1).toTree(), (y - 1).toTree()),
74
+ new point_1.Point("A", (x - 1).toTree(), (y + 1).toTree()),
75
+ new point_1.Point("A", (x + 1).toTree(), (x - 1).toTree()),
76
+ ];
77
+ points.forEach((point) => (0, exercise_1.tryToAddWrongProp)(propositions, point.toCoords()));
78
+ while (propositions.length < n) {
79
+ const wrongAnswer = new point_1.Point("A", (0, randint_1.randint)(-10, 10).toTree(), (0, randint_1.randint)(-10, 10).toTree());
80
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toCoords(), "tex");
81
+ }
82
+ return (0, exercise_1.shuffleProps)(propositions, n);
83
+ };
84
+ const isAnswerValid = (ans, { answer, x, y }) => {
85
+ const valid = new point_1.Point("A", x.toTree(), y.toTree()).toCoords();
86
+ return ans === valid;
87
+ };
88
+ exports.pointCoordinatesNoAxisNumbers = {
89
+ id: "pointCoordinatesNoAxisNumbers",
90
+ label: "Lire les coordonnées d'un point (sans nombres sur les axes)",
91
+ levels: ["1rePro"],
92
+ isSingleStep: true,
93
+ sections: ["Géométrie cartésienne"],
94
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPointCoordinatesNoAxisNumbersQuestion, nb),
95
+ qcmTimer: 60,
96
+ freeTimer: 60,
97
+ getPropositions,
98
+ isAnswerValid,
99
+ subject: "Mathématiques",
100
+ hasGeogebra: true,
101
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ export declare const pointCoordinatesNoOrthonorm: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=pointCoordinatesNoOrthonorm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointCoordinatesNoOrthonorm.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/cartesian/pointCoordinatesNoOrthonorm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAc7D,CAAC"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pointCoordinatesNoOrthonorm = 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 point_1 = require("../../../../math/geometry/point");
8
+ const randint_1 = require("../../../../math/utils/random/randint");
9
+ const random_1 = require("../../../../utils/random");
10
+ const getPointCoordinatesNoAxisNumbersQuestion = () => {
11
+ const x = (0, randint_1.randint)(-10, 10);
12
+ const y = (0, randint_1.randint)(-10, 10);
13
+ let xMin = x - 2;
14
+ let xMax = x + 2;
15
+ let yMin = y - 2;
16
+ let yMax = y + 2;
17
+ yMax = yMax < 2 ? 2 : yMax;
18
+ yMin = yMin > -2 ? -2 : yMin;
19
+ xMin = xMin > -2 ? -2 : xMin;
20
+ xMax = xMax < 2 ? 2 : xMax;
21
+ const instruction = `Lire les coordonnées du point $A$ représenté dans le repère ci-dessous : `;
22
+ const commands = [
23
+ `A = (${x}, ${y})`,
24
+ `ShowLabel(A, true)`,
25
+ // `SetPointStyle(A, 0)`,
26
+ `SetPointSize(A, 4)`,
27
+ `SetFixed(A, true)`,
28
+ "O = (0,0)",
29
+ `SetFixed(O, true)`,
30
+ `ShowLabel(O, true)`,
31
+ `SetPointSize(O, 4)`,
32
+ "I = (1,0)",
33
+ `SetFixed(I, true)`,
34
+ `ShowLabel(I, true)`,
35
+ `SetPointSize(I, 4)`,
36
+ "J = (0,1)",
37
+ `SetFixed(J, true)`,
38
+ `ShowLabel(J, true)`,
39
+ `SetPointSize(J, 4)`,
40
+ ];
41
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
42
+ commands,
43
+ xAxis: {
44
+ hideNumbers: true,
45
+ },
46
+ yAxis: {
47
+ hideNumbers: true,
48
+ },
49
+ lockedAxesRatio: (0, random_1.random)([0.5, 2]),
50
+ });
51
+ const A = new point_1.Point("A", x.toTree(), y.toTree());
52
+ const question = {
53
+ answer: A.toCoords(),
54
+ instruction,
55
+ ggbOptions: ggb.getOptions({
56
+ coords: ggb.getAdaptedCoords({
57
+ xMin,
58
+ xMax,
59
+ yMin,
60
+ yMax,
61
+ forceShowAxes: true,
62
+ }),
63
+ }),
64
+ keys: ["x", "y", "semicolon"],
65
+ answerFormat: "tex",
66
+ identifiers: { x, y },
67
+ };
68
+ return question;
69
+ };
70
+ const getPropositions = (n, { answer, x, y }) => {
71
+ const propositions = [];
72
+ (0, exercise_1.addValidProp)(propositions, answer, "tex");
73
+ const points = [
74
+ new point_1.Point("A", (x + 1).toTree(), (y + 1).toTree()),
75
+ new point_1.Point("A", (x - 1).toTree(), (y - 1).toTree()),
76
+ new point_1.Point("A", (x - 1).toTree(), (y + 1).toTree()),
77
+ new point_1.Point("A", (x + 1).toTree(), (x - 1).toTree()),
78
+ ];
79
+ points.forEach((point) => (0, exercise_1.tryToAddWrongProp)(propositions, point.toCoords()));
80
+ while (propositions.length < n) {
81
+ const wrongAnswer = new point_1.Point("A", (0, randint_1.randint)(-10, 10).toTree(), (0, randint_1.randint)(-10, 10).toTree());
82
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toCoords(), "tex");
83
+ }
84
+ return (0, exercise_1.shuffleProps)(propositions, n);
85
+ };
86
+ const isAnswerValid = (ans, { answer, x, y }) => {
87
+ const valid = new point_1.Point("A", x.toTree(), y.toTree()).toCoords();
88
+ return ans === valid;
89
+ };
90
+ exports.pointCoordinatesNoOrthonorm = {
91
+ id: "pointCoordinatesNoOrthonorm",
92
+ label: "Lire les coordonnées d'un point (repère non-orthonormé)",
93
+ levels: ["1rePro"],
94
+ isSingleStep: true,
95
+ sections: ["Géométrie cartésienne"],
96
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getPointCoordinatesNoAxisNumbersQuestion, nb),
97
+ qcmTimer: 60,
98
+ freeTimer: 60,
99
+ getPropositions,
100
+ isAnswerValid,
101
+ subject: "Mathématiques",
102
+ hasGeogebra: true,
103
+ };
@@ -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;AA8GF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAe5D,CAAC"}
@@ -0,0 +1,125 @@
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
+ `SetFixed(${A}, true)`,
31
+ `SetFixed(${B}, true)`,
32
+ `ShowLabel(${A}, true)`,
33
+ `ShowLabel(${B}, true)`,
34
+ `Seg = Segment(${A},${B})`,
35
+ `C_1 = Circle(${A},${B})`,
36
+ `C_2 = Circle(${B},${A})`,
37
+ `I_1 = Intersect(C_1, C_2,1)`,
38
+ `I_2 = Intersect(C_1, C_2,2)`,
39
+ `Ans = Line(I_1,I_2)`,
40
+ `SetColor(Ans, "${colors_1.greenDark}")`,
41
+ ];
42
+ const studentGGB = new geogebraConstructor_1.GeogebraConstructor({
43
+ commands: [
44
+ `${pointA.toGGBCommand()}`,
45
+ `${pointB.toGGBCommand()}`,
46
+ `SetFixed(${A}, true)`,
47
+ `SetFixed(${B}, true)`,
48
+ `ShowLabel(${A}, true)`,
49
+ `ShowLabel(${B}, true)`,
50
+ `Seg = Segment(${A},${B})`,
51
+ ],
52
+ hideGrid: true,
53
+ hideAxes: true,
54
+ customToolBar: (0, toolBarConstructor_1.toolBarConstructor)({
55
+ join: true,
56
+ circleTwoPoints: true,
57
+ intersect: true,
58
+ }),
59
+ });
60
+ const question = {
61
+ ggbAnswer: ggbAnswer,
62
+ instruction: `Avec les outils disponibles, tracer la médiatrice du segment $[${segmentName}]$.`,
63
+ keys: [],
64
+ answerFormat: "tex",
65
+ identifiers: {
66
+ A: [xa, ya],
67
+ B: [xb, yb],
68
+ },
69
+ studentGgbOptions: studentGGB.getOptions({
70
+ coords: [xMin, xMax, yMin, yMax],
71
+ }),
72
+ };
73
+ return question;
74
+ };
75
+ const getPropositions = (n, { answer }) => {
76
+ const propositions = [];
77
+ (0, exercise_1.addValidProp)(propositions, answer);
78
+ while (propositions.length < n) {
79
+ throw Error("QCM not implemented");
80
+ }
81
+ return (0, exercise_1.shuffleProps)(propositions, n);
82
+ };
83
+ const isGGBAnswerValid = (ans, { ggbAnswer, A, B }) => {
84
+ const lines = ans.filter((s) => (0, isGGBLine_1.isGGBLine)(s));
85
+ const segmentPointA = new point_1.Point("Seg_A", A[0].toTree(), A[1].toTree());
86
+ const segmentPointB = new point_1.Point("Seg_B", B[0].toTree(), B[1].toTree());
87
+ if (!lines.length)
88
+ return false;
89
+ for (const line of lines) {
90
+ const formatted = line
91
+ .replace(" ", "")
92
+ .replace("Line", "")
93
+ .replace("[", "")
94
+ .replace("]", "")
95
+ .split("=")[1];
96
+ const [nameA, nameB] = formatted.split(",");
97
+ const pointACmd = ans.find((s) => s.startsWith(nameA));
98
+ const pointBCmd = ans.find((s) => s.startsWith(nameB));
99
+ if (!pointACmd || !pointBCmd)
100
+ return false;
101
+ const pointA = point_1.PointConstructor.fromGGBCommand(pointACmd);
102
+ const pointB = point_1.PointConstructor.fromGGBCommand(pointBCmd);
103
+ if (pointA.distanceTo(segmentPointA) - pointA.distanceTo(segmentPointB) <
104
+ 0.0000001 &&
105
+ pointB.distanceTo(segmentPointA) - pointB.distanceTo(segmentPointB) <
106
+ 0.0000001)
107
+ return true;
108
+ }
109
+ return false;
110
+ };
111
+ exports.buildMediatriceWithCompass = {
112
+ id: "buildMediatriceWithCompass",
113
+ connector: "=",
114
+ label: "Tracer une médiatrice avec un compas",
115
+ levels: [],
116
+ isSingleStep: true,
117
+ sections: [],
118
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getBuildMediatriceWithCompassQuestion, nb),
119
+ qcmTimer: 60,
120
+ freeTimer: 60,
121
+ getPropositions,
122
+ isGGBAnswerValid,
123
+ subject: "Mathématiques",
124
+ answerType: "GGB",
125
+ };
@@ -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,5 @@ export * from "./thales";
6
6
  export * from "./vectors";
7
7
  export * from "./convexity";
8
8
  export * from "./volumes";
9
+ export * from "./euclidianConstructions";
9
10
  //# sourceMappingURL=index.d.ts.map