math-exercises 2.2.14 → 2.2.16

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 (176) hide show
  1. package/lib/exercises/exercise.d.ts +28 -32
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +9 -3
  5. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +12 -8
  7. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/fractions/fractionAndIntegerProduct.js +6 -2
  9. package/lib/exercises/math/calcul/fractions/fractionsDivision.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/fractions/fractionsDivision.js +10 -4
  11. package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/fractions/fractionsProduct.js +6 -2
  13. package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/ordering/framing.js +0 -1
  15. package/lib/exercises/math/calcul/proportionality/scaleCalculation.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/proportionality/scaleCalculation.js +4 -2
  17. package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts.map +1 -1
  18. package/lib/exercises/math/calcul/proportionality/scaleUsage.js +4 -2
  19. package/lib/exercises/math/calcul/rounding/rounding.d.ts.map +1 -1
  20. package/lib/exercises/math/calcul/rounding/rounding.js +7 -3
  21. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.d.ts.map +1 -1
  22. package/lib/exercises/math/calculLitteral/distributivity/canonicalFormDevelopment.js +11 -5
  23. package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
  24. package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.js +14 -2
  25. package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
  26. package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.js +14 -2
  27. package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
  28. package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.js +14 -2
  29. package/lib/exercises/math/calculLitteral/equation/equationSimpleSquare.js +1 -1
  30. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -1
  31. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
  32. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.js +12 -2
  33. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
  34. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.js +12 -2
  35. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
  36. package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq3.js +12 -2
  37. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.d.ts.map +1 -1
  38. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalForm.js +12 -2
  39. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.d.ts.map +1 -1
  40. package/lib/exercises/math/calculLitteral/factorisation/factorizeCanonicalFormWithSqrt.js +12 -4
  41. package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
  42. package/lib/exercises/math/derivation/derivative/thirdDegreeFunctionVariation.js +6 -6
  43. package/lib/exercises/math/derivation/derivativeNumberReading.d.ts.map +1 -1
  44. package/lib/exercises/math/derivation/derivativeNumberReading.js +5 -6
  45. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.d.ts.map +1 -1
  46. package/lib/exercises/math/functions/affines/affineExpressionFromTwoImages.js +14 -2
  47. package/lib/exercises/math/functions/affines/affineExpressionReading.d.ts.map +1 -1
  48. package/lib/exercises/math/functions/affines/affineExpressionReading.js +5 -6
  49. package/lib/exercises/math/functions/affines/interceptReading.d.ts.map +1 -1
  50. package/lib/exercises/math/functions/affines/interceptReading.js +5 -6
  51. package/lib/exercises/math/functions/affines/leadingCoefficient.js +5 -5
  52. package/lib/exercises/math/functions/basics/graphicEquation.js +5 -5
  53. package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
  54. package/lib/exercises/math/functions/basics/graphicInequation.js +4 -6
  55. package/lib/exercises/math/functions/basics/imageFunctionGeogebra.d.ts.map +1 -1
  56. package/lib/exercises/math/functions/basics/imageFunctionGeogebra.js +2 -4
  57. package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
  58. package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +4 -6
  59. package/lib/exercises/math/functions/basics/twoFunctionsEquation.d.ts.map +1 -1
  60. package/lib/exercises/math/functions/basics/twoFunctionsEquation.js +4 -6
  61. package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
  62. package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +4 -6
  63. package/lib/exercises/math/functions/parity/parityFromGraph.js +6 -6
  64. package/lib/exercises/math/functions/trinoms/rootsReading.d.ts.map +1 -1
  65. package/lib/exercises/math/functions/trinoms/rootsReading.js +4 -7
  66. package/lib/exercises/math/functions/trinoms/summitReading.d.ts.map +1 -1
  67. package/lib/exercises/math/functions/trinoms/summitReading.js +5 -4
  68. package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
  69. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +5 -4
  70. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  71. package/lib/exercises/math/geometry/areas/triangleArea.js +5 -4
  72. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
  73. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +8 -8
  74. package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -1
  75. package/lib/exercises/math/geometry/cartesian/directionVector.js +6 -5
  76. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.d.ts.map +1 -1
  77. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +9 -8
  78. package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
  79. package/lib/exercises/math/geometry/cartesian/placeAPoint.js +9 -7
  80. package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -1
  81. package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +12 -6
  82. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts.map +1 -1
  83. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +7 -6
  84. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +6 -6
  85. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  86. package/lib/exercises/math/geometry/pythagore/pythagore.js +5 -4
  87. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  88. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +5 -4
  89. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  90. package/lib/exercises/math/geometry/thales/thales.js +5 -4
  91. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  92. package/lib/exercises/math/geometry/thales/thalesCalcul.js +5 -4
  93. package/lib/exercises/math/geometry/vectors/coordinatesReading.d.ts.map +1 -1
  94. package/lib/exercises/math/geometry/vectors/coordinatesReading.js +5 -6
  95. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.d.ts.map +1 -1
  96. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.js +10 -8
  97. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +5 -5
  98. package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.d.ts.map +1 -1
  99. package/lib/exercises/math/geometry/vectors/scalarProductViaCoords.js +5 -1
  100. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
  101. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +5 -3
  102. package/lib/exercises/math/geometry/volumes/coneVolume.js +6 -6
  103. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +6 -6
  104. package/lib/exercises/math/geometry/volumes/sphereVolume.js +6 -6
  105. package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts.map +1 -1
  106. package/lib/exercises/math/geometry/volumes/volumeOfCube.js +5 -4
  107. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts.map +1 -1
  108. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +5 -4
  109. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
  110. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +12 -11
  111. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -1
  112. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +5 -4
  113. package/lib/exercises/math/limits/limitReading.js +6 -6
  114. package/lib/exercises/math/percent/applyPercent.d.ts.map +1 -1
  115. package/lib/exercises/math/percent/applyPercent.js +10 -2
  116. package/lib/exercises/math/percent/averageEvolutionRate.d.ts.map +1 -1
  117. package/lib/exercises/math/percent/averageEvolutionRate.js +9 -4
  118. package/lib/exercises/math/percent/cmToEvolution.d.ts.map +1 -1
  119. package/lib/exercises/math/percent/cmToEvolution.js +3 -1
  120. package/lib/exercises/math/percent/globalPercent.d.ts.map +1 -1
  121. package/lib/exercises/math/percent/globalPercent.js +5 -3
  122. package/lib/exercises/math/probaStat/probabilityTree.d.ts.map +1 -1
  123. package/lib/exercises/math/probaStat/probabilityTree.js +5 -4
  124. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  125. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +5 -4
  126. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +13 -13
  127. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.js +10 -10
  128. package/lib/exercises/math/sequences/sequencePlot.d.ts.map +1 -1
  129. package/lib/exercises/math/sequences/sequencePlot.js +10 -12
  130. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts.map +1 -1
  131. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +3 -1
  132. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  133. package/lib/exercises/math/trigonometry/trigonometry.js +5 -4
  134. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  135. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +5 -4
  136. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  137. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +5 -4
  138. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
  139. package/lib/exercises/pc/calibrationCurveOfSolution.js +11 -8
  140. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
  141. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +15 -5
  142. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -1
  143. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +0 -1
  144. package/lib/exercises/pc/math/proportionnalityCoeffFromLine.d.ts.map +1 -1
  145. package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +7 -6
  146. package/lib/exercises/pc/mecanicalWaves/elongationReading.d.ts.map +1 -1
  147. package/lib/exercises/pc/mecanicalWaves/elongationReading.js +7 -6
  148. package/lib/exercises/pc/mole/concentrationReading.d.ts.map +1 -1
  149. package/lib/exercises/pc/mole/concentrationReading.js +8 -6
  150. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.d.ts.map +1 -1
  151. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.js +2 -3
  152. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
  153. package/lib/exercises/pc/motion/typeOfAcceleration.js +5 -4
  154. package/lib/exercises/pc/motion/typeOfMovement.js +4 -4
  155. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -1
  156. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +5 -4
  157. package/lib/exercises/pc/sound/findPeriodFromGraph.d.ts.map +1 -1
  158. package/lib/exercises/pc/sound/findPeriodFromGraph.js +7 -5
  159. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.d.ts.map +1 -1
  160. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.js +7 -6
  161. package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
  162. package/lib/exercises/utils/getDistinctQuestions.js +2 -1
  163. package/lib/geogebra/geogebraConstructor.d.ts +18 -23
  164. package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
  165. package/lib/geogebra/geogebraConstructor.js +23 -16
  166. package/lib/index.d.ts +1 -76
  167. package/lib/index.d.ts.map +1 -1
  168. package/lib/index.js +1 -57
  169. package/lib/prototypesEnhancement.d.ts +14 -0
  170. package/lib/prototypesEnhancement.d.ts.map +1 -0
  171. package/lib/prototypesEnhancement.js +26 -0
  172. package/lib/server.d.ts +1 -12
  173. package/lib/server.d.ts.map +1 -1
  174. package/lib/server.js +1 -24
  175. package/lib/utils/alignTex.js +2 -2
  176. package/package.json +3 -2
@@ -19,9 +19,10 @@ const getElongationReadingQuestion = () => {
19
19
  `f(x) = If(x>=0, ${amplitude}*cos(x* (2*PI)/${period}))`,
20
20
  `SetColor(f, "${(0, colors_1.randomColor)()}")`,
21
21
  ];
22
- const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
23
- isGridSimple: true,
24
- axisLabels: ["$\\tiny \\text{Temps (s)}$", "$\\tiny \\text{y (cm)}$"],
22
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
23
+ commands,
24
+ xAxis: { label: "$\\tiny \\text{Temps (s)}$" },
25
+ yAxis: { label: "$\\tiny \\text{y (cm)}$" },
25
26
  });
26
27
  const frac = new fractionNode_1.FractionNode(new multiplyNode_1.MultiplyNode((2).toTree(), piNode_1.PiNode), period.toTree()).simplify();
27
28
  const node = new multiplyNode_1.MultiplyNode(amplitude.toTree(), new cosNode_1.CosNode(new multiplyNode_1.MultiplyNode(frac, new variableNode_1.VariableNode("t"))));
@@ -31,9 +32,9 @@ const getElongationReadingQuestion = () => {
31
32
  keys: ["y", "t", "pi", "cos", "equal"],
32
33
  answerFormat: "tex",
33
34
  identifiers: { amplitude, period },
34
- commands: ggb.commands,
35
- options: ggb.getOptions(),
36
- coords: [-1, 20, -10, 10],
35
+ ggbOptions: ggb.getOptions({
36
+ coords: [-1, 20, -10, 10],
37
+ }),
37
38
  };
38
39
  return question;
39
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"concentrationReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/mole/concentrationReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AA0CtB,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
1
+ {"version":3,"file":"concentrationReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/mole/concentrationReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AA4CtB,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
@@ -14,10 +14,12 @@ const getConcentrationReadingQuestion = () => {
14
14
  `SetFixed(L, true)`,
15
15
  `SetColor(L, "${(0, colors_1.randomColor)()}")`,
16
16
  ];
17
- const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
17
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
18
+ commands,
18
19
  isGridSimple: false,
19
- isAxesRatioFixed: false,
20
- axisLabels: ["$\\tiny C (\\text{mol}\\cdot \\text{L}^{-1})$", "$\\tiny A$"],
20
+ lockedAxesRatio: false,
21
+ xAxis: { label: "$\\tiny C (\\text{mol}\\cdot \\text{L}^{-1})$" },
22
+ yAxis: { label: "$\\tiny A$" },
21
23
  });
22
24
  const question = {
23
25
  answer: concentration + "",
@@ -25,9 +27,9 @@ const getConcentrationReadingQuestion = () => {
25
27
  keys: [],
26
28
  answerFormat: "tex",
27
29
  identifiers: {},
28
- commands: ggb.commands,
29
- options: ggb.getOptions(),
30
- coords: [-1, concentration + 2, -1, absorbtion + 2],
30
+ ggbOptions: ggb.getOptions({
31
+ coords: [-1, concentration + 2, -1, absorbtion + 2],
32
+ }),
31
33
  };
32
34
  return question;
33
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"characteristicsOfVelocityVector.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/motion/characteristicsOfVelocityVector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAqFF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAajE,CAAC"}
1
+ {"version":3,"file":"characteristicsOfVelocityVector.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/motion/characteristicsOfVelocityVector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAoFF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAajE,CAAC"}
@@ -13,8 +13,7 @@ const getCharacteristicsOfVelocityVectorQuestion = () => {
13
13
  answer: exo.answer.frenchify(),
14
14
  instruction: exo.instruction,
15
15
  keys: [],
16
- commands: exo.ggb.commands,
17
- coords: exo.ggbCoords,
16
+ ggbOptions: exo.ggb.getOptions({ coords: exo.ggbCoords }),
18
17
  answerFormat: "tex",
19
18
  identifiers: { norm: exo.answer },
20
19
  };
@@ -43,7 +42,7 @@ const generateExercise = () => {
43
42
  const answer = ggb.speedVector.norm;
44
43
  return {
45
44
  instruction,
46
- ggb: new geogebraConstructor_1.GeogebraConstructor(ggb.commands, { isAxesRatioFixed: true }),
45
+ ggb: new geogebraConstructor_1.GeogebraConstructor({ commands: ggb.commands }),
47
46
  ggbCoords: ggb.coords,
48
47
  answer,
49
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"typeOfAcceleration.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/motion/typeOfAcceleration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAmFtB,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
1
+ {"version":3,"file":"typeOfAcceleration.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/motion/typeOfAcceleration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAoFtB,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
@@ -11,9 +11,9 @@ const getTypeOfAccelerationQuestion = () => {
11
11
  const question = {
12
12
  answer: exo.answer,
13
13
  instruction: exo.instruction,
14
- commands: exo.ggb.object.commands,
15
- options: exo.ggb.object.getOptions(),
16
- coords: exo.ggb.coords,
14
+ ggbOptions: exo.ggb.object.getOptions({
15
+ coords: exo.ggb.coords,
16
+ }),
17
17
  keys: [],
18
18
  answerFormat: "raw",
19
19
  identifiers: {},
@@ -51,7 +51,8 @@ const generateExo = () => {
51
51
  const generateGgb = (typeOfAcceleration) => {
52
52
  const points = getPoints(typeOfAcceleration);
53
53
  return {
54
- object: new geogebraConstructor_1.GeogebraConstructor(points.points, {
54
+ object: new geogebraConstructor_1.GeogebraConstructor({
55
+ commands: points.points,
55
56
  hideAxes: true,
56
57
  hideGrid: true,
57
58
  }),
@@ -13,9 +13,9 @@ const getTypeOfMovementQuestion = () => {
13
13
  const question = {
14
14
  answer: exo.answer,
15
15
  instruction: exo.instruction,
16
- commands: ggb.commands,
17
- coords: exo.coords,
18
- options: ggb.getOptions(),
16
+ ggbOptions: ggb.getOptions({
17
+ coords: exo.coords,
18
+ }),
19
19
  keys: [],
20
20
  answerFormat: "raw",
21
21
  identifiers: {},
@@ -76,7 +76,7 @@ const getGgb = (movementType) => {
76
76
  break;
77
77
  }
78
78
  return {
79
- ggb: new geogebraConstructor_1.GeogebraConstructor(commands, {}),
79
+ ggb: new geogebraConstructor_1.GeogebraConstructor({ commands }),
80
80
  coords,
81
81
  };
82
82
  };
@@ -1 +1 @@
1
- {"version":3,"file":"recognizeRefractionOrReflectionAngles.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/recognizeRefractionOrReflectionAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAkHtB,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAavE,CAAC"}
1
+ {"version":3,"file":"recognizeRefractionOrReflectionAngles.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/recognizeRefractionOrReflectionAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG,EAAE,CAAC;AAmHtB,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAavE,CAAC"}
@@ -23,9 +23,9 @@ const getRecognizeRefractionOrReflectionAnglesQuestion = () => {
23
23
  answer: exo.isAsking,
24
24
  instruction: `Un rayon arrive sur la surface de séparation entre deux milieux. Comment appelle-t-on l'angle représenté ci-dessous ?`,
25
25
  keys: [],
26
- commands: exo.ggb.commands,
27
- coords: exo.coords,
28
- options: exo.ggb.getOptions(),
26
+ ggbOptions: exo.ggb.getOptions({
27
+ coords: exo.coords,
28
+ }),
29
29
  answerFormat: "raw",
30
30
  identifiers: {},
31
31
  };
@@ -76,7 +76,8 @@ const generateExercise = () => {
76
76
  `SetColor(Second,"#0a6a01")`,
77
77
  `SetColor(Ang,"#6a0101")`,
78
78
  ];
79
- const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
79
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
80
+ commands,
80
81
  hideGrid: true,
81
82
  hideAxes: true,
82
83
  });
@@ -1 +1 @@
1
- {"version":3,"file":"findPeriodFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/sound/findPeriodFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;CAC1B,CAAC;AAkEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
1
+ {"version":3,"file":"findPeriodFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/sound/findPeriodFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;CAC1B,CAAC;AAoEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
@@ -37,8 +37,10 @@ const getFindPeriodFromGraphQuestion = () => {
37
37
  for (let i = 1; i < 10; i++) {
38
38
  commands.push(`S_{${i}} = Translate(S, (${i * period}, 0))`, `SetFixed(S_{${i}}, true)`, `SetColor(S_{${i}}, "${color}")`);
39
39
  }
40
- const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
41
- axisLabels: ["$\\tiny Temps (ms)$", "$\\tiny Tension (V)$"],
40
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
41
+ commands,
42
+ xAxis: { label: "$\\tiny Temps (ms)$" },
43
+ yAxis: { label: "$\\tiny Tension (V)$" },
42
44
  isGridSimple: true,
43
45
  });
44
46
  const question = {
@@ -47,9 +49,9 @@ const getFindPeriodFromGraphQuestion = () => {
47
49
  keys: [],
48
50
  answerFormat: "tex",
49
51
  identifiers: { period, splinePoints },
50
- commands: ggb.commands,
51
- options: ggb.getOptions(),
52
- coords: [0, 20, -8, 8],
52
+ ggbOptions: ggb.getOptions({
53
+ coords: [0, 20, -8, 8],
54
+ }),
53
55
  };
54
56
  return question;
55
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"findPeriodOrFrequencyFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/sound/findPeriodOrFrequencyFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;CAC1B,CAAC;AAqFF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAchE,CAAC"}
1
+ {"version":3,"file":"findPeriodOrFrequencyFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/sound/findPeriodOrFrequencyFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;CAC1B,CAAC;AAsFF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAchE,CAAC"}
@@ -38,9 +38,10 @@ const getFindPeriodOrFrequencyFromGraphQuestion = () => {
38
38
  for (let i = 1; i < 10; i++) {
39
39
  commands.push(`S_{${i}} = Translate(S, (${i * period}, 0))`, `SetFixed(S_{${i}}, true)`, `SetColor(S_{${i}}, "${color}")`);
40
40
  }
41
- const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
42
- axisLabels: ["$\\tiny Temps (ms)$", "$\\tiny Tension (V)$"],
43
- isGridSimple: true,
41
+ const ggb = new geogebraConstructor_1.GeogebraConstructor({
42
+ commands,
43
+ xAxis: { label: "$\\tiny Temps (ms)$" },
44
+ yAxis: { label: "$\\tiny Tension (V)$" },
44
45
  });
45
46
  const isAsking = (0, coinFlip_1.coinFlip)() ? `période` : `fréquence`;
46
47
  const frequency = (1 / period) * 1000;
@@ -54,9 +55,9 @@ const getFindPeriodOrFrequencyFromGraphQuestion = () => {
54
55
  keys: [],
55
56
  answerFormat: "tex",
56
57
  identifiers: { period, frequency, splinePoints },
57
- commands: ggb.commands,
58
- options: ggb.getOptions(),
59
- coords: [0, 20, -8, 8],
58
+ ggbOptions: ggb.getOptions({
59
+ coords: [0, 20, -8, 8],
60
+ }),
60
61
  };
61
62
  return question;
62
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getDistinctQuestions.d.ts","sourceRoot":"","sources":["../../../src/exercises/utils/getDistinctQuestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,WAOnD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,cACpB,MAAM,SAAS,GAAG,CAAC,MAC1B,MAAM,QACJ,MAAM,KACX,SAAS,GAAG,CAAC,EAmBf,CAAC"}
1
+ {"version":3,"file":"getDistinctQuestions.d.ts","sourceRoot":"","sources":["../../../src/exercises/utils/getDistinctQuestions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,WAOnD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,cACpB,MAAM,SAAS,GAAG,CAAC,MAC1B,MAAM,QACJ,MAAM,KACX,SAAS,GAAG,CAAC,EAoBf,CAAC"}
@@ -30,7 +30,8 @@ const getDistinctQuestions = (generator, nb, max) => {
30
30
  question = generator();
31
31
  } while (res.some((q) => q.instruction === question.instruction &&
32
32
  q.answer === question.answer &&
33
- (!q.commands || equalTab(q.commands, question.commands))));
33
+ (!q.ggbOptions?.commands ||
34
+ equalTab(q.ggbOptions?.commands, question.ggbOptions?.commands))));
34
35
  res.push(question);
35
36
  }
36
37
  return res;
@@ -1,14 +1,4 @@
1
- type GeogebraOptions = {
2
- isAxesRatioFixed?: boolean;
3
- gridDistance?: [number, number] | false;
4
- hideAxes?: boolean;
5
- hideGrid?: boolean;
6
- isGridBold?: boolean;
7
- isGridSimple?: boolean;
8
- isXAxesNatural?: boolean;
9
- axisLabels?: string[];
10
- is3D?: boolean;
11
- };
1
+ import { GeogebraAxisOptions, GeogebraOptions } from "../exercises/exercise";
12
2
  type GetAdaptedCoords = {
13
3
  xMin: number;
14
4
  xMax: number;
@@ -18,20 +8,25 @@ type GetAdaptedCoords = {
18
8
  zMax?: number;
19
9
  forceShowAxes?: boolean;
20
10
  };
11
+ type GetOptionsProps = {
12
+ coords: number[];
13
+ };
21
14
  export declare class GeogebraConstructor {
22
- commands: string[];
23
- gridDistance: [number, number] | false;
24
- hideGrid: boolean;
25
- hideAxes: boolean;
26
- isGridSimple: boolean;
27
- isGridBold: boolean;
28
- is3D: boolean;
29
- isAxesRatioFixed: boolean;
30
- isXAxesNatural: boolean;
31
- axisLabels?: string[];
32
- constructor(commands: string[], options: GeogebraOptions | undefined);
15
+ customToolBar?: string;
16
+ forbidShiftDragZoom?: boolean;
17
+ commands?: string[];
18
+ is3D?: boolean;
19
+ gridDistance?: [number, number] | false;
20
+ hideGrid?: boolean;
21
+ hideAxes?: boolean;
22
+ isGridSimple?: boolean;
23
+ isGridBold?: boolean;
24
+ lockedAxesRatio?: number | false;
25
+ xAxis?: GeogebraAxisOptions;
26
+ yAxis?: GeogebraAxisOptions;
27
+ constructor(options: Omit<GeogebraOptions, "coords">);
33
28
  getAdaptedCoords({ xMin, xMax, yMin, yMax, zMin, zMax, forceShowAxes, }: GetAdaptedCoords): number[];
34
- getOptions(): GeogebraOptions;
29
+ getOptions({ coords }: GetOptionsProps): GeogebraOptions;
35
30
  }
36
31
  export {};
37
32
  //# sourceMappingURL=geogebraConstructor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"geogebraConstructor.d.ts","sourceRoot":"","sources":["../../src/geogebra/geogebraConstructor.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,CAA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AC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AACF,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AACF,qBAAa,mBAAmB;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACjC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,mBAAmB,CAAC;gBAEhB,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC;IAepD,gBAAgB,CAAC,EACf,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,aAAa,GACd,EAAE,gBAAgB;IAyCnB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,eAAe,GAAG,eAAe;CAiBzD"}
@@ -1,18 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GeogebraConstructor = void 0;
4
+ const toolBarConstructor_1 = require("../exercises/utils/geogebra/toolBarConstructor");
4
5
  class GeogebraConstructor {
5
- constructor(commands, options) {
6
- this.commands = commands;
7
- this.isAxesRatioFixed = options?.isAxesRatioFixed ?? true;
6
+ constructor(options) {
7
+ this.customToolBar = options?.customToolBar ?? (0, toolBarConstructor_1.toolBarConstructor)({});
8
+ this.forbidShiftDragZoom = options?.forbidShiftDragZoom;
9
+ this.commands = options.commands;
10
+ this.is3D = options?.is3D;
8
11
  this.gridDistance = options?.gridDistance ?? [1, 1];
9
- this.hideGrid = options?.hideGrid ?? false;
10
- this.hideAxes = options?.hideAxes ?? false;
11
- this.isGridBold = options?.isGridBold ?? false;
12
- this.isGridSimple = options?.isGridSimple ?? false;
13
- this.isXAxesNatural = options?.isXAxesNatural ?? false;
14
- this.axisLabels = options?.axisLabels ?? undefined;
15
- this.is3D = options?.is3D ?? false;
12
+ this.hideGrid = options?.hideGrid;
13
+ this.hideAxes = options?.hideAxes;
14
+ this.isGridBold = options?.isGridBold;
15
+ this.isGridSimple = options?.isGridSimple ?? true;
16
+ this.lockedAxesRatio = options?.lockedAxesRatio ?? 1;
17
+ this.xAxis = options?.xAxis;
18
+ this.yAxis = options?.yAxis;
16
19
  }
17
20
  getAdaptedCoords({ xMin, xMax, yMin, yMax, zMin, zMax, forceShowAxes, }) {
18
21
  const showAxes = forceShowAxes ?? this.hideAxes ? false : true;
@@ -54,17 +57,21 @@ class GeogebraConstructor {
54
57
  return coords;
55
58
  }
56
59
  }
57
- getOptions() {
60
+ getOptions({ coords }) {
58
61
  return {
62
+ customToolBar: this.customToolBar,
63
+ forbidShiftDragZoom: this.forbidShiftDragZoom,
64
+ commands: this.commands,
65
+ coords: coords,
66
+ is3D: this.is3D,
67
+ gridDistance: this.gridDistance,
59
68
  hideAxes: this.hideAxes,
60
69
  hideGrid: this.hideGrid,
61
70
  isGridBold: this.isGridBold,
62
71
  isGridSimple: this.isGridSimple,
63
- gridDistance: this.gridDistance,
64
- isAxesRatioFixed: this.isAxesRatioFixed,
65
- isXAxesNatural: this.isXAxesNatural,
66
- axisLabels: this.axisLabels,
67
- is3D: this.is3D,
72
+ lockedAxesRatio: this.lockedAxesRatio,
73
+ xAxis: this.xAxis,
74
+ yAxis: this.yAxis,
68
75
  };
69
76
  }
70
77
  }
package/lib/index.d.ts CHANGED
@@ -1,47 +1,4 @@
1
- import { AlgebraicNode } from "./tree/nodes/algebraicNode";
2
- declare global {
3
- interface Number {
4
- toTree: () => AlgebraicNode;
5
- frenchify: () => string;
6
- toScientific: (decimals?: number) => AlgebraicNode;
7
- }
8
- interface String {
9
- toTree: () => AlgebraicNode;
10
- unfrenchify: () => number;
11
- }
12
- }
13
- /**
14
- * TODO
15
- * Décimal : permettre facilement -0.xxx
16
- * Tree shaking export
17
- *
18
- * VEA:
19
- * -> -3x est bien transofmré en -3*x, x*(-3) mais pas en -x*3
20
- * ->> faire le meme delire que pour les power mais pour les opposite ?
21
- * c'est à dire créer toutes les permuts en déplacant le moins qquepart
22
- * -> faire des nodes pour les Ensembles de nombre
23
- *
24
- * !-> choses pour lesquelles la v1 ne marchera pas :
25
- * !-- fractions non réduites
26
- * !-- nbs décimaux avec des 0
27
- * !-- nb quelconque de moins, genre -3*-4 ou -x/-y
28
- * !-> pour ces choses là il faut obligatoirement parser la rpéonse élève ?
29
- *
30
- * Passer les sqrtNode en tree-iable
31
- *
32
- *
33
- *
34
- * !!!à fix :
35
- * ! fraction réductible
36
- * ! 0,20 au lieu de 0,2
37
- * ! moins partout dans fraction
38
- * !puissances négatives vers inverse fraction
39
- * ! simplification du ln
40
- * ! meileure gestion des [] : le clavier devriat pouvoir produire des left/right ;
41
- * !aussi en tapant [ puis diviser, le crochet passe en numérateur
42
- * ! espace tous les 3 chiffres dans un nb (le clavier doit le fournir aussi!)
43
-
44
- */
1
+ import "./prototypesEnhancement";
45
2
  declare const mathExercises: (import("./exercises/exercise").Exercise<{
46
3
  numbers: number[];
47
4
  }> | import("./exercises/exercise").Exercise<{
@@ -642,38 +599,6 @@ declare const mathExercises: (import("./exercises/exercise").Exercise<{
642
599
  ineqSymbol: import("./math/inequations/inequation").InegalitySymbols;
643
600
  intervals: {
644
601
  a: number;
645
- /**
646
- * TODO
647
- * Décimal : permettre facilement -0.xxx
648
- * Tree shaking export
649
- *
650
- * VEA:
651
- * -> -3x est bien transofmré en -3*x, x*(-3) mais pas en -x*3
652
- * ->> faire le meme delire que pour les power mais pour les opposite ?
653
- * c'est à dire créer toutes les permuts en déplacant le moins qquepart
654
- * -> faire des nodes pour les Ensembles de nombre
655
- *
656
- * !-> choses pour lesquelles la v1 ne marchera pas :
657
- * !-- fractions non réduites
658
- * !-- nbs décimaux avec des 0
659
- * !-- nb quelconque de moins, genre -3*-4 ou -x/-y
660
- * !-> pour ces choses là il faut obligatoirement parser la rpéonse élève ?
661
- *
662
- * Passer les sqrtNode en tree-iable
663
- *
664
- *
665
- *
666
- * !!!à fix :
667
- * ! fraction réductible
668
- * ! 0,20 au lieu de 0,2
669
- * ! moins partout dans fraction
670
- * !puissances négatives vers inverse fraction
671
- * ! simplification du ln
672
- * ! meileure gestion des [] : le clavier devriat pouvoir produire des left/right ;
673
- * !aussi en tapant [ puis diviser, le crochet passe en numérateur
674
- * ! espace tous les 3 chiffres dans un nb (le clavier doit le fournir aussi!)
675
-
676
- */
677
602
  b: number;
678
603
  closure: import("./tree/nodes/sets/closure").ClosureType;
679
604
  }[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;IACD,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,WAAW,EAAE,MAAM,MAAM,CAAC;KAC3B;CACF;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BE;AAEF,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA+B,CAAC;AACnD,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
package/lib/index.js CHANGED
@@ -24,65 +24,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.pcExercises = exports.mathExercises = void 0;
27
- // import { exercises } from "./exercises/exercises";
28
- const numberNode_1 = require("./tree/nodes/numbers/numberNode");
29
27
  const MathExercises = __importStar(require("./exercises/math"));
30
28
  const PCExercises = __importStar(require("./exercises/pc"));
31
- const infiniteNode_1 = require("./tree/nodes/numbers/infiniteNode");
32
- const toScientific_1 = require("./utils/numberPrototype/toScientific");
33
- const variableNode_1 = require("./tree/nodes/variables/variableNode");
34
- String.prototype.unfrenchify = function () {
35
- return Number(this.valueOf().replace(",", "."));
36
- };
37
- String.prototype.toTree = function () {
38
- return new variableNode_1.VariableNode(this.valueOf());
39
- };
40
- Number.prototype.toTree = function () {
41
- const value = this.valueOf();
42
- if (value === Infinity)
43
- return infiniteNode_1.PlusInfinityNode;
44
- if (value === -Infinity)
45
- return infiniteNode_1.MinusInfinityNode;
46
- return new numberNode_1.NumberNode(value);
47
- };
48
- Number.prototype.frenchify = function () {
49
- return (this.valueOf() + "").replace(".", ",");
50
- };
51
- Number.prototype.toScientific = function (decimals) {
52
- return (0, toScientific_1.toScientific)(this.valueOf(), decimals);
53
- };
54
- /**
55
- * TODO
56
- * Décimal : permettre facilement -0.xxx
57
- * Tree shaking export
58
- *
59
- * VEA:
60
- * -> -3x est bien transofmré en -3*x, x*(-3) mais pas en -x*3
61
- * ->> faire le meme delire que pour les power mais pour les opposite ?
62
- * c'est à dire créer toutes les permuts en déplacant le moins qquepart
63
- * -> faire des nodes pour les Ensembles de nombre
64
- *
65
- * !-> choses pour lesquelles la v1 ne marchera pas :
66
- * !-- fractions non réduites
67
- * !-- nbs décimaux avec des 0
68
- * !-- nb quelconque de moins, genre -3*-4 ou -x/-y
69
- * !-> pour ces choses là il faut obligatoirement parser la rpéonse élève ?
70
- *
71
- * Passer les sqrtNode en tree-iable
72
- *
73
- *
74
- *
75
- * !!!à fix :
76
- * ! fraction réductible
77
- * ! 0,20 au lieu de 0,2
78
- * ! moins partout dans fraction
79
- * !puissances négatives vers inverse fraction
80
- * ! simplification du ln
81
- * ! meileure gestion des [] : le clavier devriat pouvoir produire des left/right ;
82
- * !aussi en tapant [ puis diviser, le crochet passe en numérateur
83
- * ! espace tous les 3 chiffres dans un nb (le clavier doit le fournir aussi!)
84
-
85
- */
29
+ require("./prototypesEnhancement");
86
30
  const mathExercises = Object.values(MathExercises);
87
31
  exports.mathExercises = mathExercises;
88
32
  const pcExercises = Object.values(PCExercises);
@@ -0,0 +1,14 @@
1
+ import { AlgebraicNode } from "./tree/nodes/algebraicNode";
2
+ declare global {
3
+ interface Number {
4
+ toTree: () => AlgebraicNode;
5
+ frenchify: () => string;
6
+ toScientific: (decimals?: number) => AlgebraicNode;
7
+ }
8
+ interface String {
9
+ toTree: () => AlgebraicNode;
10
+ unfrenchify: () => number;
11
+ }
12
+ }
13
+ export {};
14
+ //# sourceMappingURL=prototypesEnhancement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prototypesEnhancement.d.ts","sourceRoot":"","sources":["../src/prototypesEnhancement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;IACD,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,WAAW,EAAE,MAAM,MAAM,CAAC;KAC3B;CACF;AAqBD,OAAO,EAAE,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const infiniteNode_1 = require("./tree/nodes/numbers/infiniteNode");
4
+ const numberNode_1 = require("./tree/nodes/numbers/numberNode");
5
+ const variableNode_1 = require("./tree/nodes/variables/variableNode");
6
+ const toScientific_1 = require("./utils/numberPrototype/toScientific");
7
+ String.prototype.toTree = function () {
8
+ return new variableNode_1.VariableNode(this.valueOf());
9
+ };
10
+ String.prototype.unfrenchify = function () {
11
+ return Number(this.valueOf().replace(",", "."));
12
+ };
13
+ Number.prototype.toTree = function () {
14
+ const value = this.valueOf();
15
+ if (value === Infinity)
16
+ return infiniteNode_1.PlusInfinityNode;
17
+ if (value === -Infinity)
18
+ return infiniteNode_1.MinusInfinityNode;
19
+ return new numberNode_1.NumberNode(value);
20
+ };
21
+ Number.prototype.frenchify = function () {
22
+ return (this.valueOf() + "").replace(".", ",");
23
+ };
24
+ Number.prototype.toScientific = function (decimals) {
25
+ return (0, toScientific_1.toScientific)(this.valueOf(), decimals);
26
+ };
package/lib/server.d.ts CHANGED
@@ -1,13 +1,2 @@
1
- import { AlgebraicNode } from "./tree/nodes/algebraicNode";
2
- declare global {
3
- interface Number {
4
- toTree: () => AlgebraicNode;
5
- frenchify: () => string;
6
- toScientific: (decimals?: number) => AlgebraicNode;
7
- }
8
- interface String {
9
- toTree: () => AlgebraicNode;
10
- unfrenchify: () => number;
11
- }
12
- }
1
+ import "./prototypesEnhancement";
13
2
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAwC3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;QACxB,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;KACpD;IACD,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,WAAW,EAAE,MAAM,MAAM,CAAC;KAC3B;CACF"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AA2CA,OAAO,yBAAyB,CAAC"}