math-exercises 3.0.29 → 3.0.31

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 (175) hide show
  1. package/lib/exercises/math/calcul/arithmetics/euclideanDivision.js +2 -2
  2. package/lib/exercises/math/calcul/fractions/fractionSquare.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/fractions/fractionSquare.js +4 -0
  4. package/lib/exercises/math/calcul/fractions/fractionsProduct.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/fractions/fractionsProduct.js +4 -2
  6. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts +11 -0
  7. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.d.ts.map +1 -0
  8. package/lib/exercises/math/calcul/fractions/fractionsSubstraction.js +106 -0
  9. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +1 -1
  10. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +1 -1
  11. package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
  12. package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
  13. package/lib/exercises/math/calcul/fractions/index.js +1 -0
  14. package/lib/exercises/math/calcul/fractions/periodicWritingToFraction.js +1 -1
  15. package/lib/exercises/math/calcul/fractions/simplifyFraction.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/fractions/simplifyFraction.js +19 -10
  17. package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
  18. package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +23 -7
  19. package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.d.ts.map +1 -1
  20. package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.js +4 -0
  21. package/lib/exercises/math/calcul/sign/signFromAx.d.ts.map +1 -1
  22. package/lib/exercises/math/calcul/sign/signFromAx.js +4 -0
  23. package/lib/exercises/math/calculLitteral/distributivity/allIdentities.js +3 -3
  24. package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.d.ts +8 -0
  25. package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.d.ts.map +1 -0
  26. package/lib/exercises/math/calculLitteral/distributivity/doubleDistri.js +155 -0
  27. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts +11 -0
  28. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts.map +1 -0
  29. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.js +147 -0
  30. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts +11 -0
  31. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts.map +1 -0
  32. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.js +150 -0
  33. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts +11 -0
  34. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts.map +1 -0
  35. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.js +143 -0
  36. package/lib/exercises/math/calculLitteral/distributivity/index.d.ts +5 -5
  37. package/lib/exercises/math/calculLitteral/distributivity/index.d.ts.map +1 -1
  38. package/lib/exercises/math/calculLitteral/distributivity/index.js +5 -5
  39. package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.d.ts +9 -0
  40. package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.d.ts.map +1 -0
  41. package/lib/exercises/math/calculLitteral/distributivity/simpleDistri.js +116 -0
  42. package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.d.ts.map +1 -1
  43. package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.js +1 -0
  44. package/lib/exercises/math/calculLitteral/equation/equa1.d.ts +11 -0
  45. package/lib/exercises/math/calculLitteral/equation/equa1.d.ts.map +1 -0
  46. package/lib/exercises/math/calculLitteral/equation/equa1.js +111 -0
  47. package/lib/exercises/math/calculLitteral/equation/equa2.d.ts +17 -0
  48. package/lib/exercises/math/calculLitteral/equation/equa2.d.ts.map +1 -0
  49. package/lib/exercises/math/calculLitteral/equation/equa2.js +164 -0
  50. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts +12 -0
  51. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -0
  52. package/lib/exercises/math/calculLitteral/equation/equa3.js +113 -0
  53. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts +13 -0
  54. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts.map +1 -0
  55. package/lib/exercises/math/calculLitteral/equation/equa4.js +106 -0
  56. package/lib/exercises/math/calculLitteral/equation/index.d.ts +4 -4
  57. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  58. package/lib/exercises/math/calculLitteral/equation/index.js +4 -4
  59. package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.d.ts.map +1 -1
  60. package/lib/exercises/math/calculLitteral/simplifying/reduceExpression.js +5 -1
  61. package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.d.ts.map +1 -1
  62. package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.js +4 -0
  63. package/lib/exercises/math/dataRepresentations/functionGraphReading.d.ts.map +1 -1
  64. package/lib/exercises/math/dataRepresentations/functionGraphReading.js +4 -0
  65. package/lib/exercises/math/dataRepresentations/pieChartReading.d.ts.map +1 -1
  66. package/lib/exercises/math/dataRepresentations/pieChartReading.js +4 -0
  67. package/lib/exercises/math/derivation/derivative/expDerivativeOne.d.ts.map +1 -1
  68. package/lib/exercises/math/derivation/derivative/expDerivativeOne.js +0 -6
  69. package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
  70. package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.js +30 -0
  71. package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
  72. package/lib/exercises/math/functions/affines/leadingCoefficient.js +26 -11
  73. package/lib/exercises/math/functions/logarithm/logSimplifiying.js +1 -1
  74. package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts +1 -1
  75. package/lib/exercises/math/geometry/areas/rightTriangleArea.d.ts.map +1 -1
  76. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +1 -1
  77. package/lib/exercises/math/geometry/areas/triangleArea.d.ts +1 -1
  78. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  79. package/lib/exercises/math/geometry/areas/triangleArea.js +1 -1
  80. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
  81. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +6 -2
  82. package/lib/exercises/math/geometry/index.d.ts +1 -0
  83. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  84. package/lib/exercises/math/geometry/index.js +1 -1
  85. package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
  86. package/lib/exercises/math/geometry/lines/linesRelativePositions.js +4 -0
  87. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts +1 -1
  88. package/lib/exercises/math/geometry/pythagore/pythagore.d.ts.map +1 -1
  89. package/lib/exercises/math/geometry/pythagore/pythagore.js +1 -1
  90. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts +1 -1
  91. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  92. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +1 -1
  93. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts +4 -4
  94. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
  95. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +4 -4
  96. package/lib/exercises/math/geometry/thales/thales.d.ts +1 -1
  97. package/lib/exercises/math/geometry/thales/thales.d.ts.map +1 -1
  98. package/lib/exercises/math/geometry/thales/thales.js +1 -1
  99. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts +1 -1
  100. package/lib/exercises/math/geometry/thales/thalesCalcul.d.ts.map +1 -1
  101. package/lib/exercises/math/geometry/thales/thalesCalcul.js +1 -1
  102. package/lib/exercises/math/geometry/triangles/index.d.ts +1 -1
  103. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
  104. package/lib/exercises/math/geometry/triangles/index.js +2 -1
  105. package/lib/exercises/math/geometry/triangles/triangleNature.d.ts +9 -0
  106. package/lib/exercises/math/geometry/triangles/triangleNature.d.ts.map +1 -0
  107. package/lib/exercises/math/geometry/triangles/triangleNature.js +121 -0
  108. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts +9 -0
  109. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts.map +1 -0
  110. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.js +134 -0
  111. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts +1 -1
  112. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.d.ts.map +1 -1
  113. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaNorms.js +1 -1
  114. package/lib/exercises/math/percent/findRightCalculForPriceEvolution.d.ts +10 -0
  115. package/lib/exercises/math/percent/findRightCalculForPriceEvolution.d.ts.map +1 -0
  116. package/lib/exercises/math/percent/findRightCalculForPriceEvolution.js +117 -0
  117. package/lib/exercises/math/percent/index.d.ts +1 -1
  118. package/lib/exercises/math/percent/index.d.ts.map +1 -1
  119. package/lib/exercises/math/percent/index.js +1 -1
  120. package/lib/exercises/math/percent/percentToDecimal.js +2 -2
  121. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  122. package/lib/exercises/math/powers/powersOfTenToDecimal.js +4 -0
  123. package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
  124. package/lib/exercises/math/powers/powersProduct.js +10 -14
  125. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
  126. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +4 -0
  127. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -1
  128. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +4 -0
  129. package/lib/exercises/math/squareRoots/simpifySquareRoot.js +1 -1
  130. package/lib/exercises/math/squareRoots/squareRootsProducts.js +1 -1
  131. package/lib/exercises/math/trigonometry/trigonometry.d.ts +1 -1
  132. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  133. package/lib/exercises/math/trigonometry/trigonometry.js +1 -1
  134. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts +1 -1
  135. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  136. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +1 -1
  137. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts +1 -1
  138. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  139. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +2 -2
  140. package/lib/exercises/pc/index.d.ts +4 -4
  141. package/lib/exercises/pc/index.d.ts.map +1 -1
  142. package/lib/exercises/pc/index.js +4 -4
  143. package/lib/index.d.ts +23 -15
  144. package/lib/index.d.ts.map +1 -1
  145. package/lib/math/geometry/angle.d.ts +6 -0
  146. package/lib/math/geometry/angle.d.ts.map +1 -1
  147. package/lib/math/geometry/angle.js +20 -7
  148. package/lib/math/geometry/quadrilaterals/parallelogram.d.ts +23 -0
  149. package/lib/math/geometry/quadrilaterals/parallelogram.d.ts.map +1 -0
  150. package/lib/math/geometry/quadrilaterals/parallelogram.js +65 -0
  151. package/lib/math/geometry/quadrilaterals/quadrilateral.d.ts +15 -0
  152. package/lib/math/geometry/quadrilaterals/quadrilateral.d.ts.map +1 -0
  153. package/lib/math/geometry/quadrilaterals/quadrilateral.js +38 -0
  154. package/lib/math/geometry/quadrilaterals/rectangle.d.ts +24 -0
  155. package/lib/math/geometry/quadrilaterals/rectangle.d.ts.map +1 -0
  156. package/lib/math/geometry/quadrilaterals/rectangle.js +59 -0
  157. package/lib/math/geometry/quadrilaterals/rhombus.d.ts +19 -0
  158. package/lib/math/geometry/quadrilaterals/rhombus.d.ts.map +1 -0
  159. package/lib/math/geometry/quadrilaterals/rhombus.js +41 -0
  160. package/lib/math/geometry/quadrilaterals/square.d.ts +22 -0
  161. package/lib/math/geometry/quadrilaterals/square.d.ts.map +1 -0
  162. package/lib/math/geometry/quadrilaterals/square.js +38 -0
  163. package/lib/math/geometry/triangles/equilateralTriangle.d.ts +21 -0
  164. package/lib/math/geometry/triangles/equilateralTriangle.d.ts.map +1 -0
  165. package/lib/math/geometry/triangles/equilateralTriangle.js +52 -0
  166. package/lib/math/geometry/triangles/isoceleTriangle.d.ts +23 -0
  167. package/lib/math/geometry/triangles/isoceleTriangle.d.ts.map +1 -0
  168. package/lib/math/geometry/triangles/isoceleTriangle.js +66 -0
  169. package/lib/math/geometry/triangles/rightTriangle.d.ts +31 -0
  170. package/lib/math/geometry/triangles/rightTriangle.d.ts.map +1 -0
  171. package/lib/math/geometry/triangles/rightTriangle.js +108 -0
  172. package/lib/math/geometry/triangles/triangle.d.ts +68 -0
  173. package/lib/math/geometry/triangles/triangle.d.ts.map +1 -0
  174. package/lib/math/geometry/triangles/triangle.js +240 -0
  175. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"pieChartReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/pieChartReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAuBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAkLF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAiBjD,CAAC"}
1
+ {"version":3,"file":"pieChartReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/pieChartReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAuBrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAuLF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAkBjD,CAAC"}
@@ -138,6 +138,9 @@ const getPieChartReadingQuestion = (opts) => {
138
138
  labels,
139
139
  points,
140
140
  };
141
+ return getQuestionFromIdentifiers(identifiers);
142
+ };
143
+ const getQuestionFromIdentifiers = (identifiers) => {
141
144
  const question = {
142
145
  answer: getAnswer(identifiers),
143
146
  instruction: getInstruction(identifiers),
@@ -166,4 +169,5 @@ export const pieChartReading = {
166
169
  getAnswer,
167
170
  getGGBOptions,
168
171
  hasGeogebra: true,
172
+ getQuestionFromIdentifiers,
169
173
  };
@@ -1 +1 @@
1
- {"version":3,"file":"expDerivativeOne.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/expDerivativeOne.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsFF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}
1
+ {"version":3,"file":"expDerivativeOne.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/expDerivativeOne.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+EF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}
@@ -58,12 +58,6 @@ const isAnswerValid = (ans, { answer, a, b }) => {
58
58
  const parsed = parseAlgebraic(ans);
59
59
  if (!parsed)
60
60
  return false;
61
- console.log(parsed
62
- .simplify({
63
- towardsDistribute: true,
64
- forbidFactorize: true,
65
- })
66
- .toTex());
67
61
  return (parsed
68
62
  .simplify({
69
63
  towardsDistribute: true,
@@ -1 +1 @@
1
- {"version":3,"file":"powerFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/powerFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA0HF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
1
+ {"version":3,"file":"powerFunctionDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/powerFunctionDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAsJF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAiBzD,CAAC"}
@@ -7,6 +7,31 @@ import { PowerNode } from "../../../../tree/nodes/operators/powerNode.js";
7
7
  import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
8
8
  import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
9
9
  import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
10
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
11
+ const getHint = (identifiers) => {
12
+ return `On rappelle que la dérivée de la fonction $kx^n$ est :
13
+
14
+ $$
15
+ k\\times n \\times x^{n-1}
16
+ $$`;
17
+ };
18
+ const getCorrection = (identifiers) => {
19
+ const { a, power } = identifiers;
20
+ return `La dérivée de la fonction $kx^n$ est :
21
+
22
+ $$
23
+ k\\times n \\times x^{n-1}
24
+ $$
25
+
26
+ Ici, on a $k = ${a}$ et $n = ${power}$.
27
+
28
+ On obtient donc :
29
+
30
+ ${alignTex([
31
+ ["f'(x)", "=", `${a} \\times ${power} \\times x^{${power}-1}`],
32
+ ["", "=", getAnswer(identifiers)],
33
+ ])}`;
34
+ };
10
35
  const getInstruction = (identifiers) => {
11
36
  const { a, power } = identifiers;
12
37
  const statement = new MultiplyNode(new NumberNode(a), new PowerNode(new VariableNode("x"), new NumberNode(power)));
@@ -35,6 +60,8 @@ const getPowerFunctionDerivative = () => {
35
60
  keys: ["x"],
36
61
  answerFormat: "tex",
37
62
  identifiers,
63
+ hint: getHint(identifiers),
64
+ correction: getCorrection(identifiers),
38
65
  };
39
66
  return question;
40
67
  };
@@ -85,4 +112,7 @@ export const powerFunctionDerivative = {
85
112
  subject: "Mathématiques",
86
113
  getInstruction,
87
114
  getAnswer,
115
+ getHint,
116
+ getCorrection,
117
+ hasHintAndCorrection: true,
88
118
  };
@@ -1 +1 @@
1
- {"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAgEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
1
+ {"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA4EF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAkBpD,CAAC"}
@@ -8,13 +8,17 @@ import { randint } from "../../../../math/utils/random/randint.js";
8
8
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
9
9
  import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
10
10
  import { shuffle } from "../../../../utils/alea/shuffle.js";
11
- const getLeadingCoefficientQuestion = () => {
12
- let xA, yA, xB, yB;
13
- [xA, yA] = [1, 2].map((el) => randint(-5, 6));
14
- xB = xA > 0 ? randint(xA - 4, 6, [xA]) : randint(-4, xA + 5, [xA]); // l'écart entre les deux points ne soit pas grand
15
- yB = yA > 0 ? randint(yA - 4, 6) : randint(-4, yA + 5);
11
+ const getInstruction = (identifiers) => {
12
+ return "Déterminer le coefficient directeur de la droite représentée ci-dessous : ";
13
+ };
14
+ const getAnswer = (identifiers) => {
15
+ const { xA, yA, xB, yB } = identifiers;
16
16
  const a = frac(yB - yA, xB - xA).simplify();
17
17
  const answer = a.toTex();
18
+ return answer;
19
+ };
20
+ const getGGBOptions = (identifiers) => {
21
+ const { xA, yA, xB, yB } = identifiers;
18
22
  const xMin = Math.min(xA, xB);
19
23
  const xMax = Math.max(xA, xB);
20
24
  const yMin = Math.min(yA, yB);
@@ -27,15 +31,23 @@ const getLeadingCoefficientQuestion = () => {
27
31
  const ggb = new GeogebraConstructor({
28
32
  commands,
29
33
  });
34
+ return ggb.getOptions({
35
+ coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
36
+ });
37
+ };
38
+ const getLeadingCoefficientQuestion = () => {
39
+ let xA, yA, xB, yB;
40
+ [xA, yA] = [1, 2].map((el) => randint(-5, 6));
41
+ xB = xA > 0 ? randint(xA - 4, 6, [xA]) : randint(-4, xA + 5, [xA]); // l'écart entre les deux points ne soit pas grand
42
+ yB = yA > 0 ? randint(yA - 4, 6) : randint(-4, yA + 5);
43
+ const identifiers = { xA, xB, yA, yB };
30
44
  const question = {
31
- instruction: "Déterminer le coefficient directeur de la droite représentée ci-dessous : ",
32
- answer,
45
+ instruction: getInstruction(identifiers),
46
+ answer: getAnswer(identifiers),
33
47
  keys: [],
34
- ggbOptions: ggb.getOptions({
35
- coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
36
- }),
48
+ ggbOptions: getGGBOptions(identifiers),
37
49
  answerFormat: "tex",
38
- identifiers: { xA, xB, yA, yB },
50
+ identifiers,
39
51
  };
40
52
  return question;
41
53
  };
@@ -67,4 +79,7 @@ export const leadingCoefficient = {
67
79
  isAnswerValid,
68
80
  hasGeogebra: true,
69
81
  subject: "Mathématiques",
82
+ getAnswer,
83
+ getInstruction,
84
+ getGGBOptions,
70
85
  };
@@ -21,7 +21,7 @@ const getStatementNode = (identifiers) => {
21
21
  }
22
22
  };
23
23
  const getInstruction = (identifiers) => {
24
- return `Ecrire le nombre suivant sous la forme $\\ln\\left(a\\right)$ :
24
+ return `Écrire le nombre suivant sous la forme $\\ln\\left(a\\right)$ :
25
25
 
26
26
  $$
27
27
  ${getStatementNode(identifiers).toTex()}
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  /**!! old */
5
5
  triangleIdentifiers: TriangleIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"rightTriangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/rightTriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAKtE,KAAK,WAAW,GAAG;IACjB,YAAY;IAEZ,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAgEF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAcnD,CAAC"}
1
+ {"version":3,"file":"rightTriangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/rightTriangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAKhF,KAAK,WAAW,GAAG;IACjB,YAAY;IAEZ,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AAgEF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAcnD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
- import { RightTriangleConstructor } from "../../../../math/geometry/rightTriangle.js";
4
+ import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
5
5
  import { Rational } from "../../../../math/numbers/rationals/rational.js";
6
6
  import { randint } from "../../../../math/utils/random/randint.js";
7
7
  import { shuffle } from "../../../../utils/alea/shuffle.js";
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  import { SegmentIdentifiers } from "../../../../math/geometry/segment.js";
4
4
  type Identifiers = {
5
5
  triangleIdentifiers: TriangleIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AASzC,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AAKxC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA6GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
1
+ {"version":3,"file":"triangleArea.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/areas/triangleArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AASnD,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AAKxC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA6GF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAiB9C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
- import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangle.js";
4
+ import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
5
5
  import { randint } from "../../../../math/utils/random/randint.js";
6
6
  import { randomLetter } from "../../../../utils/strings/randomLetter.js";
7
7
  import { shuffle } from "../../../../utils/alea/shuffle.js";
@@ -1 +1 @@
1
- {"version":3,"file":"pythagoreOrThales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/pythagoreOrThales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAkBtC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IAEzB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CAQnB,CAAC;AA+MF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAqBnD,CAAC"}
1
+ {"version":3,"file":"pythagoreOrThales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidian/pythagoreOrThales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAkBtC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IAEzB,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CAQnB,CAAC;AAoNF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAsBnD,CAAC"}
@@ -3,9 +3,9 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { Angle } from "../../../../math/geometry/angle.js";
5
5
  import { PointConstructor, } from "../../../../math/geometry/point.js";
6
- import { RightTriangleConstructor } from "../../../../math/geometry/rightTriangle.js";
6
+ import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
7
7
  import { Segment, } from "../../../../math/geometry/segment.js";
8
- import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangle.js";
8
+ import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
9
9
  import { VectorConstructor } from "../../../../math/geometry/vector.js";
10
10
  import { round } from "../../../../math/utils/round.js";
11
11
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
@@ -162,6 +162,9 @@ const getPythagoreOrThalesQuestion = (opts) => {
162
162
  isAskingLength,
163
163
  isSegmentHeight,
164
164
  };
165
+ return getQuestionFromIdentifiers(identifiers);
166
+ };
167
+ const getQuestionFromIdentifiers = (identifiers) => {
165
168
  const question = {
166
169
  answer: getAnswer(identifiers),
167
170
  instruction: getInstruction(identifiers),
@@ -194,6 +197,7 @@ export const pythagoreOrThales = {
194
197
  pdfOptions: {
195
198
  shouldSpreadPropositions: true,
196
199
  },
200
+ getQuestionFromIdentifiers,
197
201
  };
198
202
  const getSubTriangle = ({ triangle, insidePointsNames, ratio, isPapillon, }) => {
199
203
  const [A, B, C] = triangle.points;
@@ -13,4 +13,5 @@ export * from "./parametric/index.js";
13
13
  export * from "./quadrilaterals/index.js";
14
14
  export * from "./angles/index.js";
15
15
  export * from "./lines/index.js";
16
+ export * from "./triangles/index.js";
16
17
  //# 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,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/geometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
@@ -6,7 +6,6 @@ export * from "./thales/index.js";
6
6
  export * from "./vectors/index.js";
7
7
  export * from "./convexity/index.js";
8
8
  export * from "./volumes/index.js";
9
- // export * from "./triangles.js";
10
9
  export * from "./euclidianConstructions/index.js";
11
10
  export * from "./shapes/index.js";
12
11
  export * from "./euclidian/index.js";
@@ -14,3 +13,4 @@ export * from "./parametric/index.js";
14
13
  export * from "./quadrilaterals/index.js";
15
14
  export * from "./angles/index.js";
16
15
  export * from "./lines/index.js";
16
+ export * from "./triangles/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"linesRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/linesRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE/D,WAAW,EAAE,MAAM,CAAC;CAKrB,CAAC;AA+IF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAmBxD,CAAC"}
1
+ {"version":3,"file":"linesRelativePositions.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/lines/linesRelativePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE/D,WAAW,EAAE,MAAM,CAAC;CAKrB,CAAC;AAoJF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAoBxD,CAAC"}
@@ -107,6 +107,9 @@ const getLinesRelativePositionsQuestion = (opts) => {
107
107
  const lines = [d1, d2, d3, d4, d5];
108
108
  const coupleAsked = randint(0, 4);
109
109
  const identifiers = { lines, coupleAsked };
110
+ return getQuestionFromIdentifiers(identifiers);
111
+ };
112
+ const getQuestionFromIdentifiers = (identifiers) => {
110
113
  const question = {
111
114
  answer: getAnswer(identifiers),
112
115
  instruction: getInstruction(identifiers),
@@ -137,4 +140,5 @@ export const linesRelativePositions = {
137
140
  hasGeogebra: true,
138
141
  maxAllowedQuestions: 4,
139
142
  answerType: "QCU",
143
+ getQuestionFromIdentifiers,
140
144
  };
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  triangleIdentifiers: TriangleIdentifiers;
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAUzC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA8DF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
1
+ {"version":3,"file":"pythagore.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAUnD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA8DF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
@@ -5,7 +5,7 @@ import { AddNode } from "../../../../tree/nodes/operators/addNode.js";
5
5
  import { EqualNode } from "../../../../tree/nodes/equations/equalNode.js";
6
6
  import { SquareNode } from "../../../../tree/nodes/operators/powerNode.js";
7
7
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
8
- import { RightTriangleConstructor } from "../../../../math/geometry/rightTriangle.js";
8
+ import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
9
9
  const getPythagore = () => {
10
10
  const triangle = RightTriangleConstructor.randomNiceSides({
11
11
  randomName: true,
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  sideAsked: number;
5
5
  triangleIdentifiers: TriangleIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAiBzC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA+EF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
1
+ {"version":3,"file":"pythagoreCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/pythagore/pythagoreCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAiBnD,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC;AA+EF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
@@ -3,7 +3,7 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { shuffle } from "../../../../utils/alea/shuffle.js";
5
5
  import { random } from "../../../../utils/alea/random.js";
6
- import { RightTriangleConstructor } from "../../../../math/geometry/rightTriangle.js";
6
+ import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
7
7
  import { sqrtVEA } from "../../../../exercises/vea/sqrtVEA.js";
8
8
  import { square } from "../../../../tree/nodes/operators/powerNode.js";
9
9
  import { randfloat } from "../../../../math/utils/random/randfloat.js";
@@ -1,8 +1,8 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { ParallelogramIdentifiers } from "../../../../math/geometry/parallelogram.js";
3
- import { RectangleIdentifiers } from "../../../../math/geometry/rectangle.js";
4
- import { RhombusIdentifiers } from "../../../../math/geometry/rhombus.js";
5
- import { SquareIdentifiers } from "../../../../math/geometry/square.js";
2
+ import { ParallelogramIdentifiers } from "../../../../math/geometry/quadrilaterals/parallelogram.js";
3
+ import { RectangleIdentifiers } from "../../../../math/geometry/quadrilaterals/rectangle.js";
4
+ import { RhombusIdentifiers } from "../../../../math/geometry/quadrilaterals/rhombus.js";
5
+ import { SquareIdentifiers } from "../../../../math/geometry/quadrilaterals/square.js";
6
6
  type Identifiers = {
7
7
  shape: string;
8
8
  showDiagonals: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"quadrilateralRecognition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,wBAAwB,EACzB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAEL,oBAAoB,EACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAGL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAEL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAIvC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EACZ,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,wBAAwB,CAAC;CAC9B,CAAC;AA0MF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAoB1D,CAAC"}
1
+ {"version":3,"file":"quadrilateralRecognition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAEL,wBAAwB,EACzB,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAEL,oBAAoB,EACrB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAGL,kBAAkB,EACnB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAEL,iBAAiB,EAClB,MAAM,8CAA8C,CAAC;AAItD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EACZ,oBAAoB,GACpB,iBAAiB,GACjB,kBAAkB,GAClB,wBAAwB,CAAC;CAC9B,CAAC;AA0MF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAoB1D,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
- import { ParallelogramConstructor, } from "../../../../math/geometry/parallelogram.js";
5
- import { RectangleConstructor, } from "../../../../math/geometry/rectangle.js";
6
- import { RhombusConstructor, } from "../../../../math/geometry/rhombus.js";
7
- import { SquareConstructor, } from "../../../../math/geometry/square.js";
4
+ import { ParallelogramConstructor, } from "../../../../math/geometry/quadrilaterals/parallelogram.js";
5
+ import { RectangleConstructor, } from "../../../../math/geometry/quadrilaterals/rectangle.js";
6
+ import { RhombusConstructor, } from "../../../../math/geometry/quadrilaterals/rhombus.js";
7
+ import { SquareConstructor, } from "../../../../math/geometry/quadrilaterals/square.js";
8
8
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
9
9
  import { random } from "../../../../utils/alea/random.js";
10
10
  const getPropositions = (n, { answer }) => {
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  ratio: number;
5
5
  triangleIdentifiers: TriangleIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAuBzC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAyFF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAoIF,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjD,CAAC"}
1
+ {"version":3,"file":"thales.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thales.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAuBnD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAyFF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAoIF,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjD,CAAC"}
@@ -2,7 +2,7 @@ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, tryToAddWrong
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { Segment } from "../../../../math/geometry/segment.js";
5
- import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangle.js";
5
+ import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
6
6
  import { VectorConstructor } from "../../../../math/geometry/vector.js";
7
7
  import { randfloat } from "../../../../math/utils/random/randfloat.js";
8
8
  import { MultiEqualNode } from "../../../../tree/nodes/equations/multiEqualNode.js";
@@ -1,5 +1,5 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
- import { TriangleIdentifiers } from "../../../../math/geometry/triangle.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
3
  type Identifiers = {
4
4
  ratio: number;
5
5
  triangleIdentifiers: TriangleIdentifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAqBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAQzC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA8DF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBvD,CAAC"}
1
+ {"version":3,"file":"thalesCalcul.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/thales/thalesCalcul.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAqBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAQnD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAmJF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AA8DF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBvD,CAAC"}
@@ -3,7 +3,7 @@ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQue
3
3
  import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
4
4
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
5
  import { Segment } from "../../../../math/geometry/segment.js";
6
- import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangle.js";
6
+ import { Triangle, TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
7
7
  import { VectorConstructor } from "../../../../math/geometry/vector.js";
8
8
  import { randfloat } from "../../../../math/utils/random/randfloat.js";
9
9
  import { round } from "../../../../math/utils/round.js";
@@ -1,2 +1,2 @@
1
- export {};
1
+ export * from "./triangleThirdAngleValue.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/index.ts"],"names":[],"mappings":"AAEA,cAAc,8BAA8B,CAAC"}
@@ -1,2 +1,3 @@
1
- export {};
2
1
  // export * from './traceMedianInTriangle'
2
+ // export * from "./triangleNature.js";
3
+ export * from "./triangleThirdAngleValue.js";
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
+ type Identifiers = {
4
+ triangleIdentifiers: TriangleIdentifiers;
5
+ type: number;
6
+ };
7
+ export declare const triangleNature: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=triangleNature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triangleNature.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/triangles/triangleNature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,mBAAmB,EACpB,MAAM,2CAA2C,CAAC;AAInD,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA+GF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { addValidProp, shuffleProps, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
+ import { EquilateralTriangleConstructor } from "../../../../math/geometry/triangles/equilateralTriangle.js";
5
+ import { IsoceleTriangleConstructor } from "../../../../math/geometry/triangles/isoceleTriangle.js";
6
+ import { RightTriangleConstructor } from "../../../../math/geometry/triangles/rightTriangle.js";
7
+ import { TriangleConstructor, } from "../../../../math/geometry/triangles/triangle.js";
8
+ import { randint } from "../../../../math/utils/random/randint.js";
9
+ const getPropositions = (n, { answer }) => {
10
+ const propositions = [];
11
+ addValidProp(propositions, answer);
12
+ while (propositions.length < n) {
13
+ throw Error("QCM not implemented");
14
+ }
15
+ return shuffleProps(propositions, n);
16
+ };
17
+ const getAnswer = (identifiers) => {
18
+ return "";
19
+ };
20
+ const getInstruction = (identifiers) => {
21
+ return "";
22
+ };
23
+ // const getHint: GetHint<Identifiers> = (identifiers) => {};
24
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
25
+ const getGGBOptions = (identifiers) => {
26
+ const { triangleIdentifiers, type } = identifiers;
27
+ let triangle;
28
+ switch (type) {
29
+ case 0:
30
+ triangle = TriangleConstructor.fromIdentifiers(triangleIdentifiers);
31
+ break;
32
+ case 1:
33
+ triangle =
34
+ IsoceleTriangleConstructor.fromIdentifiers(triangleIdentifiers);
35
+ triangle.drawSidesDecoration();
36
+ break;
37
+ case 2:
38
+ triangle =
39
+ EquilateralTriangleConstructor.fromIdentifiers(triangleIdentifiers);
40
+ triangle.drawSidesDecoration();
41
+ break;
42
+ case 3:
43
+ default:
44
+ triangle = RightTriangleConstructor.fromIdentifiers(triangleIdentifiers);
45
+ break;
46
+ }
47
+ const ggb = new GeogebraConstructor({
48
+ commands: triangle.commands,
49
+ hideAxes: true,
50
+ hideGrid: true,
51
+ });
52
+ return ggb.getOptions({
53
+ coords: triangle.generateCoords(),
54
+ });
55
+ };
56
+ const getKeys = (identifiers) => {
57
+ return [];
58
+ };
59
+ const isAnswerValid = (ans, { answer }) => {
60
+ throw Error("VEA not implemented");
61
+ };
62
+ const getTriangleNatureQuestion = (opts) => {
63
+ // const type = random(["scalène","isocèle","équilatéral", "rectangle", "rectangle et isocèle"]);
64
+ const type = randint(0, 4);
65
+ let triangle;
66
+ switch (type) {
67
+ case 0:
68
+ triangle = TriangleConstructor.randomNiceSides({
69
+ randomName: true,
70
+ });
71
+ break;
72
+ case 1:
73
+ triangle = IsoceleTriangleConstructor.randomNiceSides({
74
+ randomName: true,
75
+ });
76
+ break;
77
+ case 2:
78
+ triangle = EquilateralTriangleConstructor.randomNiceSides({
79
+ randomName: true,
80
+ });
81
+ break;
82
+ case 3:
83
+ default:
84
+ triangle = RightTriangleConstructor.randomNiceSides({
85
+ randomName: true,
86
+ });
87
+ }
88
+ const identifiers = {
89
+ triangleIdentifiers: triangle.toIdentifiers(),
90
+ type,
91
+ };
92
+ const question = {
93
+ answer: getAnswer(identifiers),
94
+ instruction: getInstruction(identifiers),
95
+ keys: getKeys(identifiers),
96
+ answerFormat: "tex",
97
+ identifiers,
98
+ // hint: getHint(identifiers),
99
+ // correction: getCorrection(identifiers),
100
+ ggbOptions: getGGBOptions(identifiers),
101
+ };
102
+ return question;
103
+ };
104
+ export const triangleNature = {
105
+ id: "triangleNature",
106
+ label: "Déterminer la nature d'un triangle",
107
+ isSingleStep: true,
108
+ generator: (nb, opts) => getDistinctQuestions(() => getTriangleNatureQuestion(opts), nb),
109
+ qcmTimer: 60,
110
+ freeTimer: 60,
111
+ getPropositions,
112
+ isAnswerValid,
113
+ subject: "Mathématiques",
114
+ // getHint,
115
+ // getCorrection,
116
+ getInstruction,
117
+ getAnswer,
118
+ getGGBOptions,
119
+ hasGeogebra: true,
120
+ answerType: "QCM",
121
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { TriangleIdentifiers } from "../../../../math/geometry/triangles/triangle.js";
3
+ type Identifiers = {
4
+ triangleIdentifiers: TriangleIdentifiers;
5
+ angleAsked: number;
6
+ };
7
+ export declare const triangleThirdAngleValue: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=triangleThirdAngleValue.d.ts.map