math-exercises 3.0.214 → 3.0.216

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 (371) hide show
  1. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts +9 -0
  2. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts.map +1 -0
  3. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.js +194 -0
  4. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts +8 -0
  5. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts.map +1 -0
  6. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.js +121 -0
  7. package/lib/exercises/math/arithmetic/index.d.ts +7 -0
  8. package/lib/exercises/math/arithmetic/index.d.ts.map +1 -1
  9. package/lib/exercises/math/arithmetic/index.js +7 -0
  10. package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts +7 -0
  11. package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts.map +1 -0
  12. package/lib/exercises/math/arithmetic/isBigNumberPrime.js +107 -0
  13. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts +8 -0
  14. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts.map +1 -0
  15. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.js +139 -0
  16. package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts +8 -0
  17. package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts.map +1 -0
  18. package/lib/exercises/math/arithmetic/pgcdFromEuclid.js +123 -0
  19. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts +7 -0
  20. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts.map +1 -0
  21. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.js +117 -0
  22. package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts +8 -0
  23. package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts.map +1 -0
  24. package/lib/exercises/math/arithmetic/whichDayInXDays.js +82 -0
  25. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts +15 -0
  26. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts.map +1 -0
  27. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.js +256 -0
  28. package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
  29. package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
  30. package/lib/exercises/math/calcul/fractions/index.js +1 -0
  31. package/lib/exercises/math/calcul/index.d.ts +1 -0
  32. package/lib/exercises/math/calcul/index.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/index.js +1 -0
  34. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +3 -0
  35. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
  36. package/lib/exercises/math/calcul/mentalCaluls/index.js +3 -0
  37. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts +10 -0
  38. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts.map +1 -0
  39. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.js +264 -0
  40. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts +10 -0
  41. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts.map +1 -0
  42. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.js +264 -0
  43. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts +11 -0
  44. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts.map +1 -0
  45. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.js +141 -0
  46. package/lib/exercises/math/calcul/ratio/index.d.ts +1 -0
  47. package/lib/exercises/math/calcul/ratio/index.d.ts.map +1 -1
  48. package/lib/exercises/math/calcul/ratio/index.js +1 -0
  49. package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts +13 -0
  50. package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts.map +1 -0
  51. package/lib/exercises/math/calcul/ratio/partsUsingRatio.js +237 -0
  52. package/lib/exercises/math/calcul/relatives/index.d.ts +2 -0
  53. package/lib/exercises/math/calcul/relatives/index.d.ts.map +1 -0
  54. package/lib/exercises/math/calcul/relatives/index.js +1 -0
  55. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts +17 -0
  56. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts.map +1 -0
  57. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.js +448 -0
  58. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts +10 -0
  59. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts.map +1 -0
  60. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.js +190 -0
  61. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
  62. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  63. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
  64. package/lib/exercises/math/complex/algebraic/addComplex.d.ts +10 -0
  65. package/lib/exercises/math/complex/algebraic/addComplex.d.ts.map +1 -0
  66. package/lib/exercises/math/complex/algebraic/addComplex.js +125 -0
  67. package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts +8 -0
  68. package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts.map +1 -0
  69. package/lib/exercises/math/complex/algebraic/conjugateComplex.js +105 -0
  70. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts +8 -0
  71. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts.map +1 -0
  72. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.js +137 -0
  73. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts +8 -0
  74. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts.map +1 -0
  75. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.js +116 -0
  76. package/lib/exercises/math/complex/algebraic/divideComplex.d.ts +8 -0
  77. package/lib/exercises/math/complex/algebraic/divideComplex.d.ts.map +1 -0
  78. package/lib/exercises/math/complex/algebraic/divideComplex.js +128 -0
  79. package/lib/exercises/math/complex/algebraic/index.d.ts +11 -0
  80. package/lib/exercises/math/complex/algebraic/index.d.ts.map +1 -0
  81. package/lib/exercises/math/complex/algebraic/index.js +10 -0
  82. package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts +8 -0
  83. package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts.map +1 -0
  84. package/lib/exercises/math/complex/algebraic/inverseComplex.js +95 -0
  85. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts +10 -0
  86. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts.map +1 -0
  87. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.js +105 -0
  88. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts +8 -0
  89. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts.map +1 -0
  90. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.js +93 -0
  91. package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts +8 -0
  92. package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts.map +1 -0
  93. package/lib/exercises/math/complex/algebraic/mutiplyComplex.js +106 -0
  94. package/lib/exercises/math/complex/algebraic/reAndIm.d.ts +9 -0
  95. package/lib/exercises/math/complex/algebraic/reAndIm.d.ts.map +1 -0
  96. package/lib/exercises/math/complex/algebraic/reAndIm.js +92 -0
  97. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts +9 -0
  98. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts.map +1 -0
  99. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.js +151 -0
  100. package/lib/exercises/math/complex/geometric/complexDistance.d.ts +11 -0
  101. package/lib/exercises/math/complex/geometric/complexDistance.d.ts.map +1 -0
  102. package/lib/exercises/math/complex/geometric/complexDistance.js +125 -0
  103. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts +9 -0
  104. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts.map +1 -0
  105. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.js +326 -0
  106. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts +10 -0
  107. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts.map +1 -0
  108. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.js +459 -0
  109. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts +14 -0
  110. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts.map +1 -0
  111. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.js +539 -0
  112. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts +13 -0
  113. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts.map +1 -0
  114. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.js +485 -0
  115. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts +12 -0
  116. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts.map +1 -0
  117. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.js +224 -0
  118. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts +11 -0
  119. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts.map +1 -0
  120. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.js +448 -0
  121. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts +11 -0
  122. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts.map +1 -0
  123. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.js +223 -0
  124. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts +11 -0
  125. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts.map +1 -0
  126. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.js +348 -0
  127. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts +8 -0
  128. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts.map +1 -0
  129. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.js +86 -0
  130. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts +11 -0
  131. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts.map +1 -0
  132. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.js +311 -0
  133. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts +11 -0
  134. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts.map +1 -0
  135. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.js +345 -0
  136. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts +16 -0
  137. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts.map +1 -0
  138. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.js +729 -0
  139. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts +11 -0
  140. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts.map +1 -0
  141. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.js +253 -0
  142. package/lib/exercises/math/complex/geometric/index.d.ts +12 -0
  143. package/lib/exercises/math/complex/geometric/index.d.ts.map +1 -0
  144. package/lib/exercises/math/complex/geometric/index.js +19 -0
  145. package/lib/exercises/math/complex/index.d.ts +4 -10
  146. package/lib/exercises/math/complex/index.d.ts.map +1 -1
  147. package/lib/exercises/math/complex/index.js +4 -11
  148. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts +10 -0
  149. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts.map +1 -0
  150. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.js +176 -0
  151. package/lib/exercises/math/complex/polynomials/index.d.ts +4 -0
  152. package/lib/exercises/math/complex/polynomials/index.d.ts.map +1 -0
  153. package/lib/exercises/math/complex/polynomials/index.js +3 -0
  154. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts +10 -0
  155. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts.map +1 -0
  156. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.js +190 -0
  157. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts +11 -0
  158. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts.map +1 -0
  159. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.js +158 -0
  160. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts +7 -0
  161. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts.map +1 -0
  162. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.js +122 -0
  163. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts +8 -0
  164. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts.map +1 -0
  165. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.js +138 -0
  166. package/lib/exercises/math/complex/unitRoots/index.d.ts +3 -0
  167. package/lib/exercises/math/complex/unitRoots/index.d.ts.map +1 -0
  168. package/lib/exercises/math/complex/unitRoots/index.js +2 -0
  169. package/lib/exercises/math/conversion/clock/clockReading.d.ts +12 -0
  170. package/lib/exercises/math/conversion/clock/clockReading.d.ts.map +1 -0
  171. package/lib/exercises/math/conversion/clock/clockReading.js +385 -0
  172. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts +2 -0
  173. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts.map +1 -0
  174. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.js +521 -0
  175. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts +2 -0
  176. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts.map +1 -0
  177. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.js +359 -0
  178. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts +16 -0
  179. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts.map +1 -0
  180. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.js +319 -0
  181. package/lib/exercises/math/conversion/clock/index.d.ts +2 -0
  182. package/lib/exercises/math/conversion/clock/index.d.ts.map +1 -0
  183. package/lib/exercises/math/conversion/clock/index.js +4 -0
  184. package/lib/exercises/math/conversion/index.d.ts +1 -0
  185. package/lib/exercises/math/conversion/index.d.ts.map +1 -1
  186. package/lib/exercises/math/conversion/index.js +1 -0
  187. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts +11 -0
  188. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts.map +1 -0
  189. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.js +233 -0
  190. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts +10 -0
  191. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts.map +1 -0
  192. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.js +137 -0
  193. package/lib/exercises/math/geometry/angles/index.d.ts +2 -0
  194. package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
  195. package/lib/exercises/math/geometry/angles/index.js +2 -0
  196. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts +9 -0
  197. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts.map +1 -0
  198. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.js +187 -0
  199. package/lib/exercises/math/geometry/circles/index.d.ts +1 -0
  200. package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -1
  201. package/lib/exercises/math/geometry/circles/index.js +1 -0
  202. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts +11 -0
  203. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts.map +1 -0
  204. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.js +154 -0
  205. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts +11 -0
  206. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts.map +1 -0
  207. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.js +157 -0
  208. package/lib/exercises/math/geometry/lines/index.d.ts +2 -0
  209. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  210. package/lib/exercises/math/geometry/lines/index.js +2 -0
  211. package/lib/exercises/math/geometry/triangles/index.d.ts +2 -0
  212. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
  213. package/lib/exercises/math/geometry/triangles/index.js +2 -1
  214. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts +13 -0
  215. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts.map +1 -0
  216. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.js +271 -0
  217. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts +8 -0
  218. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts.map +1 -1
  219. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.js +284 -53
  220. package/lib/exercises/math/geometry/vectors/constructions/index.d.ts +1 -0
  221. package/lib/exercises/math/geometry/vectors/constructions/index.d.ts.map +1 -1
  222. package/lib/exercises/math/geometry/vectors/constructions/index.js +1 -0
  223. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts +8 -0
  224. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts.map +1 -0
  225. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.js +165 -0
  226. package/lib/exercises/math/geometry/volumes/index.d.ts +1 -0
  227. package/lib/exercises/math/geometry/volumes/index.d.ts.map +1 -1
  228. package/lib/exercises/math/geometry/volumes/index.js +1 -0
  229. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts +8 -0
  230. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts.map +1 -0
  231. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.js +157 -0
  232. package/lib/exercises/math/graphs/adjacentMatrixPath.d.ts +10 -0
  233. package/lib/exercises/math/graphs/adjacentMatrixPath.d.ts.map +1 -0
  234. package/lib/exercises/math/graphs/adjacentMatrixPath.js +89 -0
  235. package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.d.ts +7 -0
  236. package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.d.ts.map +1 -0
  237. package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.js +98 -0
  238. package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.d.ts +8 -0
  239. package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.d.ts.map +1 -0
  240. package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.js +96 -0
  241. package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts +15 -0
  242. package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts.map +1 -0
  243. package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.js +262 -0
  244. package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.d.ts +11 -0
  245. package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.d.ts.map +1 -0
  246. package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.js +178 -0
  247. package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts +19 -0
  248. package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts.map +1 -0
  249. package/lib/exercises/math/graphs/graphsCheckIsSameGraph.js +301 -0
  250. package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts +16 -0
  251. package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts.map +1 -0
  252. package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.js +207 -0
  253. package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts +15 -0
  254. package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts.map +1 -0
  255. package/lib/exercises/math/graphs/graphsDegreeOfVertex.js +232 -0
  256. package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts +14 -0
  257. package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts.map +1 -0
  258. package/lib/exercises/math/graphs/graphsOrderOfGraph.js +222 -0
  259. package/lib/exercises/math/graphs/index.d.ts +10 -0
  260. package/lib/exercises/math/graphs/index.d.ts.map +1 -0
  261. package/lib/exercises/math/graphs/index.js +9 -0
  262. package/lib/exercises/math/index.d.ts +1 -0
  263. package/lib/exercises/math/index.d.ts.map +1 -1
  264. package/lib/exercises/math/index.js +1 -0
  265. package/lib/exercises/math/matrices/areMatricesInverse.d.ts +9 -0
  266. package/lib/exercises/math/matrices/areMatricesInverse.d.ts.map +1 -0
  267. package/lib/exercises/math/matrices/areMatricesInverse.js +106 -0
  268. package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.d.ts +9 -0
  269. package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.d.ts.map +1 -0
  270. package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.js +144 -0
  271. package/lib/exercises/math/matrices/findInversedMatrixFromSystem.d.ts +8 -0
  272. package/lib/exercises/math/matrices/findInversedMatrixFromSystem.d.ts.map +1 -0
  273. package/lib/exercises/math/matrices/findInversedMatrixFromSystem.js +148 -0
  274. package/lib/exercises/math/matrices/index.d.ts +12 -0
  275. package/lib/exercises/math/matrices/index.d.ts.map +1 -1
  276. package/lib/exercises/math/matrices/index.js +12 -0
  277. package/lib/exercises/math/matrices/isMatrixTransitionMatrix.d.ts +8 -0
  278. package/lib/exercises/math/matrices/isMatrixTransitionMatrix.d.ts.map +1 -0
  279. package/lib/exercises/math/matrices/isMatrixTransitionMatrix.js +132 -0
  280. package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.d.ts +8 -0
  281. package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.d.ts.map +1 -0
  282. package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.js +152 -0
  283. package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.d.ts +8 -0
  284. package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.d.ts.map +1 -0
  285. package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.js +155 -0
  286. package/lib/exercises/math/matrices/matrixComputeDetOfMat2.d.ts +8 -0
  287. package/lib/exercises/math/matrices/matrixComputeDetOfMat2.d.ts.map +1 -0
  288. package/lib/exercises/math/matrices/matrixComputeDetOfMat2.js +142 -0
  289. package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.d.ts +8 -0
  290. package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.d.ts.map +1 -0
  291. package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.js +237 -0
  292. package/lib/exercises/math/matrices/matrixComputeLinearCombination.d.ts +15 -0
  293. package/lib/exercises/math/matrices/matrixComputeLinearCombination.d.ts.map +1 -0
  294. package/lib/exercises/math/matrices/matrixComputeLinearCombination.js +232 -0
  295. package/lib/exercises/math/matrices/matrixComputePower.d.ts +12 -0
  296. package/lib/exercises/math/matrices/matrixComputePower.d.ts.map +1 -0
  297. package/lib/exercises/math/matrices/matrixComputePower.js +230 -0
  298. package/lib/exercises/math/matrices/matrixComputeProduct.d.ts +9 -0
  299. package/lib/exercises/math/matrices/matrixComputeProduct.d.ts.map +1 -0
  300. package/lib/exercises/math/matrices/matrixComputeProduct.js +178 -0
  301. package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.d.ts +8 -0
  302. package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.d.ts.map +1 -0
  303. package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.js +105 -0
  304. package/lib/exercises/math/spaceGeometry/basis/index.d.ts +1 -0
  305. package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -1
  306. package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
  307. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts +18 -0
  308. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts.map +1 -0
  309. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.js +538 -0
  310. package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.d.ts.map +1 -1
  311. package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.js +6 -5
  312. package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.js +1 -1
  313. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
  314. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  315. package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -0
  316. package/lib/exercises/vea/matrixVEA.d.ts +2 -0
  317. package/lib/exercises/vea/matrixVEA.d.ts.map +1 -0
  318. package/lib/exercises/vea/matrixVEA.js +1 -0
  319. package/lib/geogebra/parsers/geogebraParser.d.ts +3 -0
  320. package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
  321. package/lib/geogebra/parsers/geogebraParser.js +27 -0
  322. package/lib/index.d.ts +286 -23
  323. package/lib/index.d.ts.map +1 -1
  324. package/lib/latexTester.js +2 -0
  325. package/lib/math/geometry/angle.d.ts.map +1 -1
  326. package/lib/math/geometry/angle.js +3 -0
  327. package/lib/math/geometry/point.d.ts.map +1 -1
  328. package/lib/math/geometry/point.js +3 -1
  329. package/lib/math/geometry/segment.d.ts +1 -1
  330. package/lib/math/geometry/segment.d.ts.map +1 -1
  331. package/lib/math/geometry/segment.js +5 -2
  332. package/lib/math/graphs/graph.d.ts +43 -0
  333. package/lib/math/graphs/graph.d.ts.map +1 -0
  334. package/lib/math/graphs/graph.js +391 -0
  335. package/lib/math/matrices/matrix.d.ts +42 -3
  336. package/lib/math/matrices/matrix.d.ts.map +1 -1
  337. package/lib/math/matrices/matrix.js +173 -7
  338. package/lib/math/matrices/parseMatrix.d.ts +3 -0
  339. package/lib/math/matrices/parseMatrix.d.ts.map +1 -0
  340. package/lib/math/matrices/parseMatrix.js +22 -0
  341. package/lib/math/systems/generalSystem.d.ts +2 -0
  342. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  343. package/lib/math/systems/generalSystem.js +5 -0
  344. package/lib/math/utils/geometry/angleBetweenPoints.d.ts +4 -0
  345. package/lib/math/utils/geometry/angleBetweenPoints.d.ts.map +1 -0
  346. package/lib/math/utils/geometry/angleBetweenPoints.js +58 -0
  347. package/lib/math/utils/geometry/angleNWSE.d.ts +3 -0
  348. package/lib/math/utils/geometry/angleNWSE.d.ts.map +1 -0
  349. package/lib/math/utils/geometry/angleNWSE.js +56 -0
  350. package/lib/math/utils/graphs/graphRenderer.d.ts +25 -0
  351. package/lib/math/utils/graphs/graphRenderer.d.ts.map +1 -0
  352. package/lib/math/utils/graphs/graphRenderer.js +123 -0
  353. package/lib/playground.d.ts +6 -1
  354. package/lib/playground.d.ts.map +1 -1
  355. package/lib/playground.js +6 -5
  356. package/lib/tests/singleExo.test.d.ts.map +1 -1
  357. package/lib/tests/singleExo.test.js +2 -2
  358. package/lib/tree/parsers/latexParser.d.ts +1 -1
  359. package/lib/tree/utilities/nodeSimplifier.d.ts +1 -1
  360. package/lib/types/keyIds.d.ts +2 -0
  361. package/lib/types/keyIds.d.ts.map +1 -1
  362. package/lib/utils/arrays/arrayChunks.d.ts +9 -0
  363. package/lib/utils/arrays/arrayChunks.d.ts.map +1 -0
  364. package/lib/utils/arrays/arrayChunks.js +34 -0
  365. package/lib/utils/strings/frenchDays.d.ts +2 -0
  366. package/lib/utils/strings/frenchDays.d.ts.map +1 -0
  367. package/lib/utils/strings/frenchDays.js +9 -0
  368. package/lib/utils/strings/ordinalSuffixed.d.ts +2 -0
  369. package/lib/utils/strings/ordinalSuffixed.d.ts.map +1 -0
  370. package/lib/utils/strings/ordinalSuffixed.js +5 -0
  371. package/package.json +7 -1
@@ -0,0 +1,105 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Matrix, MatrixConstructor } from "../../../math/matrices/matrix.js";
4
+ import { parseMatrix } from "../../../math/matrices/parseMatrix.js";
5
+ import { GeneralSystemConstructor, } from "../../../math/systems/generalSystem.js";
6
+ import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
7
+ const getPropositions = (n, { answer }) => {
8
+ const propositions = [];
9
+ addValidProp(propositions, answer);
10
+ propWhile(propositions, n, () => {
11
+ tryToAddWrongProp(propositions, MatrixConstructor.random(2, 2).toTex());
12
+ });
13
+ return shuffleProps(propositions, n);
14
+ };
15
+ const getAnswer = (identifiers) => {
16
+ const { systemIds } = identifiers;
17
+ const system = GeneralSystemConstructor.fromIdentifiers(systemIds);
18
+ const matrix = system.getMatrix();
19
+ return matrix.toTex();
20
+ };
21
+ const getInstruction = (identifiers) => {
22
+ const { systemIds } = identifiers;
23
+ const system = GeneralSystemConstructor.fromIdentifiers(systemIds);
24
+ return `On considère le système $(S)$ suivant :
25
+
26
+ $$
27
+ ${system.toTex()}
28
+ $$
29
+
30
+ On cherche à écrire ce système sous forme matricielle :
31
+
32
+ $$
33
+ AX = B
34
+ $$
35
+
36
+ avec $X = \\begin{pmatrix}x\\\\ y\\end{pmatrix}$ et $B = \\begin{pmatrix}${system.coeffs[0][2].toTex()}\\\\ ${system.coeffs[1][2].toTex()}\\end{pmatrix}$.
37
+
38
+
39
+ Écrire $A$.`;
40
+ };
41
+ const getHint = () => {
42
+ return `En faisant le produit de $A$ par $X$, on doit obtenir la partie gauche du système.`;
43
+ };
44
+ const getCorrection = (identifiers) => {
45
+ const { systemIds } = identifiers;
46
+ const system = GeneralSystemConstructor.fromIdentifiers(systemIds);
47
+ const coeffs = system.coeffs.map((row) => row.slice(0, 2));
48
+ const matrix = new Matrix(coeffs).toTex();
49
+ return `En posant $X = \\begin{pmatrix}x\\\\ y\\end{pmatrix}$, $B = \\begin{pmatrix}${system.coeffs[0][2].toTex()}\\\\ ${system.coeffs[1][2].toTex()}\\end{pmatrix}$ et :
50
+
51
+ $$
52
+ A = ${matrix}
53
+ $$
54
+
55
+ on obtient bien $(S)\\iff AX=B$.`;
56
+ };
57
+ const getKeys = () => {
58
+ return ["mat-2-2"];
59
+ };
60
+ const isAnswerValid = (ans, { answer }) => {
61
+ try {
62
+ const matAns = parseMatrix(ans);
63
+ const matAnswer = parseMatrix(answer);
64
+ return matAns.equals(matAnswer);
65
+ }
66
+ catch (err) {
67
+ return handleVEAError(err);
68
+ }
69
+ };
70
+ const getWriteMatrixAssociatedToSystemQuestion = () => {
71
+ const sys = GeneralSystemConstructor.random();
72
+ const identifiers = {
73
+ systemIds: sys.toIdentifiers(),
74
+ };
75
+ return getQuestionFromIdentifiers(identifiers);
76
+ };
77
+ const getQuestionFromIdentifiers = (identifiers) => {
78
+ return {
79
+ answer: getAnswer(identifiers),
80
+ instruction: getInstruction(identifiers),
81
+ keys: getKeys(identifiers),
82
+ answerFormat: "tex",
83
+ identifiers,
84
+ hint: getHint(identifiers),
85
+ correction: getCorrection(identifiers),
86
+ };
87
+ };
88
+ export const writeMatrixAssociatedToSystem = {
89
+ id: "writeMatrixAssociatedToSystem",
90
+ connector: "=",
91
+ label: "Écrire la matrice associée à un système d'équations linéaires",
92
+ isSingleStep: true,
93
+ generator: (nb, opts) => getDistinctQuestions(() => getWriteMatrixAssociatedToSystemQuestion(opts), nb),
94
+ qcmTimer: 60,
95
+ freeTimer: 60,
96
+ getPropositions,
97
+ isAnswerValid,
98
+ subject: "Mathématiques",
99
+ getInstruction,
100
+ getHint,
101
+ getCorrection,
102
+ getAnswer,
103
+ getQuestionFromIdentifiers,
104
+ hasHintAndCorrection: true,
105
+ };
@@ -6,4 +6,5 @@ export * from "./spaceCoordinatesOfPointInCubeCoordSystemFromVecPath.js";
6
6
  export * from "./spaceVectorLinearCombinationFromCoords.js";
7
7
  export * from "./lineLineRelativePositionsFromCubeOuterPoints.js";
8
8
  export * from "./linePlaneRelativePositionsFromCubeOuterPoints.js";
9
+ export * from "./spaceSegmentLengthInRectangularPrism.js";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0DAA0D,CAAC;AACzE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;AAClE,cAAc,oDAAoD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,0DAA0D,CAAC;AACzE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mDAAmD,CAAC;AAClE,cAAc,oDAAoD,CAAC;AACnE,cAAc,2CAA2C,CAAC"}
@@ -6,3 +6,4 @@ export * from "./spaceCoordinatesOfPointInCubeCoordSystemFromVecPath.js";
6
6
  export * from "./spaceVectorLinearCombinationFromCoords.js";
7
7
  export * from "./lineLineRelativePositionsFromCubeOuterPoints.js";
8
8
  export * from "./linePlaneRelativePositionsFromCubeOuterPoints.js";
9
+ export * from "./spaceSegmentLengthInRectangularPrism.js";
@@ -0,0 +1,18 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { SpacePointIdentifiers } from "../../../../math/geometry/spacePoint.js";
3
+ /**********/
4
+ type Identifiers = {
5
+ rectangularPrismOrigin: SpacePointIdentifiers;
6
+ L: number;
7
+ l: number;
8
+ h: number;
9
+ arrSegmentSpacePointIds: SpacePointIdentifiers[];
10
+ acceptedInputType: string;
11
+ };
12
+ type Options = {
13
+ acceptedInputType: string;
14
+ nbComponents: string;
15
+ };
16
+ export declare const spaceSegmentLengthInRectangularPrism: Exercise<Identifiers, Options>;
17
+ export {};
18
+ //# sourceMappingURL=spaceSegmentLengthInRectangularPrism.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spaceSegmentLengthInRectangularPrism.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAGL,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AA2N3C,YAAY;AAEZ,KAAK,WAAW,GAAG;IAEjB,sBAAsB,EAAE,qBAAqB,CAAC;IAC9C,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IAEV,uBAAuB,EAAE,qBAAqB,EAAE,CAAC;IACjD,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAojBF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAmCF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CACzD,WAAW,EACX,OAAO,CAsBR,CAAC"}
@@ -0,0 +1,538 @@
1
+ import { addValidProp, tryToAddWrongProp, shuffleProps, GeneratorOptionTarget, GeneratorOptionType, propWhile, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { defaultArrayedOptsWhereNeeded } from "../../../../exercises/utils/options/arrayedOptions.js";
4
+ import { blueMain, colorWithOpacity, greenMain, } from "../../../../geogebra/colors.js";
5
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
6
+ import { SpacePointConstructor, } from "../../../../math/geometry/spacePoint.js";
7
+ import { SpaceVectorConstructor, } from "../../../../math/geometry/spaceVector.js";
8
+ import { randint } from "../../../../math/utils/random/randint.js";
9
+ import { round } from "../../../../math/utils/round.js";
10
+ import { abs } from "../../../../tree/nodes/functions/absNode.js";
11
+ import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
12
+ import { add, AddNode } from "../../../../tree/nodes/operators/addNode.js";
13
+ import { square } from "../../../../tree/nodes/operators/powerNode.js";
14
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
15
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
16
+ import { NodeComparator } from "../../../../tree/utilities/nodeComparator.js";
17
+ import { operatorComposition } from "../../../../tree/utilities/operatorComposition.js";
18
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
19
+ import { random, randomMany } from "../../../../utils/alea/random.js";
20
+ import { zip } from "../../../../utils/arrays/arrayZip.js";
21
+ import { getCartesiansProducts } from "../../../../utils/arrays/cartesianProducts.js";
22
+ import { transpose } from "../../../../utils/arrays/transpose.js";
23
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
24
+ const getCoordsForFrame = (spacePointStart, spacePointEnd) => {
25
+ const [arrAxisMin, arrAxisMax] = [Math.min, Math.max].map((funcMinMax) => {
26
+ return ["x", "y", "z"].map((axis) => {
27
+ const [vAxisStart, vAxisEnd] = [spacePointStart, spacePointEnd]
28
+ .map((spacePoint) => spacePoint[axis])
29
+ .map((node) => node.evaluate());
30
+ return funcMinMax(vAxisStart, vAxisEnd);
31
+ });
32
+ });
33
+ const [xMin, yMin, zMin] = arrAxisMin;
34
+ const [xMax, yMax, zMax] = arrAxisMax;
35
+ return [xMin, xMax, yMin, yMax, zMin, zMax];
36
+ };
37
+ const createArrSpacePointBoundingBox = (spacePointStart, spacePointEnd) => {
38
+ const [xMin, xMax, yMin, yMax, zMin, zMax] = getCoordsForFrame(spacePointStart, spacePointEnd);
39
+ const arrSpacePoint = getCartesiansProducts([
40
+ [xMin, xMax],
41
+ [yMin, yMax],
42
+ [zMin, zMax],
43
+ ]).map(([x, y, z], i) => {
44
+ return SpacePointConstructor.fromScalars([x, y, z], `PBB${i}`);
45
+ });
46
+ return arrSpacePoint;
47
+ };
48
+ const getAcceptedInputTypesSentence = (acceptedInputType) => {
49
+ return `Donner le résultat
50
+ ${(() => {
51
+ switch (acceptedInputType) {
52
+ case "exact":
53
+ return "sous forme exacte";
54
+ default:
55
+ case "arrondi au centième":
56
+ return "arrondie au centième";
57
+ }
58
+ })()}.`;
59
+ };
60
+ const getFormattedNode = (node, acceptedInputType) => {
61
+ switch (acceptedInputType) {
62
+ case "exact":
63
+ return node;
64
+ default:
65
+ case "arrondi au centième":
66
+ return round(node.evaluate(), 2).toTree();
67
+ }
68
+ };
69
+ /**********/
70
+ function* genFuncNamePretty() {
71
+ const arrLetter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");
72
+ yield* arrLetter;
73
+ return "Done";
74
+ }
75
+ const getRectangularPrismPoints = (rectangularPrismOriginSpacePoint, L, l, h) => {
76
+ const [x1, y1, z1] = [
77
+ rectangularPrismOriginSpacePoint.x,
78
+ rectangularPrismOriginSpacePoint.y,
79
+ rectangularPrismOriginSpacePoint.z,
80
+ ].map((node) => node.evaluate());
81
+ const [x2, y2, z2] = [x1, y1, z1].map((t, i) => add(t, [L, l, h][i]).evaluate());
82
+ return [
83
+ //bottom
84
+ SpacePointConstructor.fromScalars([x1, y1, z1]),
85
+ SpacePointConstructor.fromScalars([x1, y2, z1]),
86
+ SpacePointConstructor.fromScalars([x2, y2, z1]),
87
+ SpacePointConstructor.fromScalars([x2, y1, z1]),
88
+ //top
89
+ SpacePointConstructor.fromScalars([x1, y1, z2]),
90
+ SpacePointConstructor.fromScalars([x1, y2, z2]),
91
+ SpacePointConstructor.fromScalars([x2, y2, z2]),
92
+ SpacePointConstructor.fromScalars([x2, y1, z2]),
93
+ ];
94
+ };
95
+ const createPointMeshForSide = (spacePointOrigin, u, v, nbH, nbW) => {
96
+ return [...Array(nbH + 1).keys()].map((i) => [...Array(nbW + 1).keys()].map((j) => {
97
+ const spaceVec = u.times(i.toTree()).add(v.times(j.toTree()));
98
+ const spacePointIJ = spaceVec.getEndPoint(spacePointOrigin);
99
+ return spacePointIJ;
100
+ }));
101
+ };
102
+ const createSegmentMeshForPointMesh = (pointMesh) => {
103
+ //horiz
104
+ const arrSegmentHoriz = pointMesh.map((rowOfPoints) => {
105
+ return [rowOfPoints[0], rowOfPoints[rowOfPoints.length - 1]];
106
+ });
107
+ //vert
108
+ const arrSegmentVert = transpose(pointMesh).map((columnOfPoints) => {
109
+ return [columnOfPoints[0], columnOfPoints[columnOfPoints.length - 1]];
110
+ });
111
+ return [...arrSegmentHoriz, ...arrSegmentVert];
112
+ };
113
+ const getAllPointMeshes = (rectangularPrismOriginSpacePoint, L, l, h) => {
114
+ return [
115
+ //z-
116
+ createPointMeshForSide(rectangularPrismOriginSpacePoint, SpaceVectorConstructor.fromScalars([1, 0, 0]), SpaceVectorConstructor.fromScalars([0, 1, 0]), L, l),
117
+ //z+
118
+ createPointMeshForSide(SpaceVectorConstructor.fromScalars([0, 0, h]).getEndPoint(rectangularPrismOriginSpacePoint, "NoName"), SpaceVectorConstructor.fromScalars([1, 0, 0]), SpaceVectorConstructor.fromScalars([0, 1, 0]), L, l),
119
+ //y-
120
+ createPointMeshForSide(rectangularPrismOriginSpacePoint, SpaceVectorConstructor.fromScalars([1, 0, 0]), SpaceVectorConstructor.fromScalars([0, 0, 1]), L, h),
121
+ //y+
122
+ createPointMeshForSide(SpaceVectorConstructor.fromScalars([0, l, 0]).getEndPoint(rectangularPrismOriginSpacePoint, "NoName"), SpaceVectorConstructor.fromScalars([1, 0, 0]), SpaceVectorConstructor.fromScalars([0, 0, 1]), L, h),
123
+ //x-
124
+ createPointMeshForSide(rectangularPrismOriginSpacePoint, SpaceVectorConstructor.fromScalars([0, 1, 0]), SpaceVectorConstructor.fromScalars([0, 0, 1]), l, h),
125
+ //x+
126
+ createPointMeshForSide(SpaceVectorConstructor.fromScalars([L, 0, 0]).getEndPoint(rectangularPrismOriginSpacePoint, "NoName"), SpaceVectorConstructor.fromScalars([0, 1, 0]), SpaceVectorConstructor.fromScalars([0, 0, 1]), l, h),
127
+ ];
128
+ };
129
+ const getInstruction = (identifiers) => {
130
+ const { L, l, h, arrSegmentSpacePointIds, acceptedInputType } = identifiers;
131
+ const arrSegmentSpacePoint = arrSegmentSpacePointIds.map((spacePointIds) => SpacePointConstructor.fromIdentifiers(spacePointIds));
132
+ const [spacePointStart, spacePointEnd] = arrSegmentSpacePoint;
133
+ const texSegment = `[${spacePointStart.name}${spacePointEnd.name}]`;
134
+ return `Le pavé droit affiché a les dimensions suivantes :
135
+ - longueur : $${L.frenchify()}$
136
+ - largeur : $${l.frenchify()}$
137
+ - hauteur : $${h.frenchify()}$
138
+
139
+ Quelle est la longueur du segment $${texSegment}$ ?
140
+ ${getAcceptedInputTypesSentence(acceptedInputType)}
141
+
142
+ *On pourra tourner la fenêtre graphique.*`;
143
+ };
144
+ const createNodeSumOfSquares = (identifiers, isShouldFilterOutZeros = true) => {
145
+ const { arrSegmentSpacePointIds } = identifiers;
146
+ const [spacePointStart, spacePointEnd] = arrSegmentSpacePointIds.map((spacePointIds) => SpacePointConstructor.fromIdentifiers(spacePointIds));
147
+ const arrSubNode = ["x", "y", "z"]
148
+ .map((axis) => square(abs(substract(spacePointEnd[axis], spacePointStart[axis])).simplify({ towardsDistribute: true })))
149
+ .filter((node) => isShouldFilterOutZeros
150
+ ? !NodeComparator.isEqualViaSub(node, (0).toTree())
151
+ : true);
152
+ const nodeSumOfSquares = operatorComposition(AddNode, arrSubNode);
153
+ return nodeSumOfSquares;
154
+ };
155
+ const getAnswerNode = (identifiers, isShouldFilterOutZeros = true) => {
156
+ const nodeSumOfSquares = createNodeSumOfSquares(identifiers, isShouldFilterOutZeros);
157
+ const nodeAnswerRaw = sqrt(nodeSumOfSquares);
158
+ return nodeAnswerRaw;
159
+ };
160
+ const getAnswer = (identifiers) => {
161
+ const { acceptedInputType } = identifiers;
162
+ return getFormattedNode(getAnswerNode(identifiers), acceptedInputType)
163
+ .simplify({ towardsDistribute: true })
164
+ .toTex();
165
+ };
166
+ const getHint = (identifiers) => {
167
+ const { arrSegmentSpacePointIds } = identifiers;
168
+ const [spacePointStart, spacePointEnd] = arrSegmentSpacePointIds.map((spacePointIds) => SpacePointConstructor.fromIdentifiers(spacePointIds));
169
+ const texSegment = `[${spacePointStart.name}${spacePointEnd.name}]`;
170
+ const texVec = `\\overrightarrow{${spacePointStart.name}${spacePointEnd.name}}`;
171
+ return `La longueur du segment $${texSegment}$ est la norme du vecteur $\\overrightarrow{v} = ${texVec}$.
172
+ Détermine les $3$ composantes $v_x$, $v_y$, $v_z$
173
+ et utilise la formule (qui découle d'une double application du théorème de Pythagore) :
174
+
175
+ $$
176
+ \\lVert \\overrightarrow v \\rVert = \\sqrt{ {v_x}^2 + {v_y}^2 + {v_z}^2 }
177
+ $$
178
+
179
+ `;
180
+ };
181
+ const getCorrection = (identifiers) => {
182
+ const { arrSegmentSpacePointIds, acceptedInputType } = identifiers;
183
+ const [spacePointStart, spacePointEnd] = arrSegmentSpacePointIds.map((spacePointIds) => SpacePointConstructor.fromIdentifiers(spacePointIds));
184
+ const texLength = `${spacePointStart.name}${spacePointEnd.name}`;
185
+ const texSegment = `[${spacePointStart.name}${spacePointEnd.name}]`;
186
+ const texVec = `\\overrightarrow{${spacePointStart.name}${spacePointEnd.name}}`;
187
+ const nodeAnswer = getAnswerNode(identifiers, false);
188
+ return `La longueur du segment $${texSegment}$ est la norme du vecteur $${texVec}$.
189
+ On détermine les $3$ composantes $v_x$, $v_y$, $v_z$ :
190
+ et utilise la formule (qui découle d'une double application du théorème de Pythagore) :
191
+
192
+ ${alignTex([
193
+ [texLength, "=", `\\lVert ${texVec} \\rVert`],
194
+ ["", "=", nodeAnswer.toTex()],
195
+ ["", "=", nodeAnswer.simplify({ towardsDistribute: true }).toTex()],
196
+ ...(acceptedInputType === "arrondi au centième"
197
+ ? [
198
+ [
199
+ "",
200
+ "\\approx",
201
+ getFormattedNode(nodeAnswer, acceptedInputType).toTex(),
202
+ ],
203
+ ]
204
+ : [[]]),
205
+ ])}
206
+
207
+ `;
208
+ };
209
+ const getCorrectionGGBOptions = (identifiers) => {
210
+ const { rectangularPrismOrigin, L, l, h, arrSegmentSpacePointIds } = identifiers;
211
+ const spacePointRectangularPrismOrigin = SpacePointConstructor.fromIdentifiers(rectangularPrismOrigin);
212
+ const rectangularPrismSpacePoints = getRectangularPrismPoints(spacePointRectangularPrismOrigin, L, l, h);
213
+ const arrSegmentSpacePoint = [...arrSegmentSpacePointIds].map((spacePointIds) => SpacePointConstructor.fromIdentifiers(spacePointIds));
214
+ const arrSpacePoint = [
215
+ // spacePointRectangularPrismOrigin,
216
+ ...arrSegmentSpacePoint,
217
+ ];
218
+ const [spacePointStart, spacePointEnd] = arrSegmentSpacePoint;
219
+ const arrSpacePointBoundingBox = createArrSpacePointBoundingBox(spacePointStart, spacePointEnd);
220
+ const arrSide = getAllPointMeshes(rectangularPrismSpacePoints[0], L, l, h);
221
+ const arrSegment = arrSide.flatMap(createSegmentMeshForPointMesh);
222
+ const commands = [
223
+ //hide xOyPlane
224
+ `SetFilling(xOyPlane, 0.1)`,
225
+ //pretty names
226
+ ...[
227
+ //points
228
+ ...arrSpacePoint.flatMap((spacePoint) => spacePoint.toGGBCommand({
229
+ isFixed: true,
230
+ showLabel: true,
231
+ })),
232
+ ],
233
+ //no names
234
+ ...[
235
+ //prism
236
+ `Pri = Prism(${rectangularPrismSpacePoints
237
+ .slice(0, 5)
238
+ .map((p) => p.toMathString())
239
+ .join(",")})`,
240
+ `SetColor(Pri, "${colorWithOpacity("#000000", 14)}")`,
241
+ `SetLineThickness(Pri, 1)`,
242
+ //segment meshes
243
+ ...arrSegment.flatMap(([spacePointStart, spacePointEnd], i) => {
244
+ return [
245
+ `S_${i} = Segment(${spacePointStart.toMathString()}, ${spacePointEnd.toMathString()})`,
246
+ `SetColor(S_${i}, "${colorWithOpacity("#BBBBBB", 37)}")`, //opacity is ignored
247
+ `SetLineThickness(S_${i}, 1)`,
248
+ ];
249
+ }),
250
+ ],
251
+ //segment
252
+ `segInstruction = Segment(${spacePointStart.toMathString()}, ${spacePointEnd.toMathString()})`,
253
+ `SetLineThickness(segInstruction, 4)`,
254
+ `SetColor(segInstruction, "${blueMain}")`,
255
+ //boundingBox of segment
256
+ `polyBoundinBox = Polygon(${[
257
+ arrSpacePointBoundingBox[0],
258
+ arrSpacePointBoundingBox[1],
259
+ arrSpacePointBoundingBox[3],
260
+ arrSpacePointBoundingBox[2],
261
+ ]
262
+ .map((p) => p.toMathString())
263
+ .join(",")})`,
264
+ `priBoundingBox = Prism(polyBoundinBox, ${arrSpacePointBoundingBox[4].toMathString()})`,
265
+ `SetColor(priBoundingBox, "${colorWithOpacity(`${greenMain}`, 69)}")`,
266
+ `SetLineThickness(priBoundingBox, 2)`,
267
+ // `RunUpdateScript()`,
268
+ ];
269
+ const ggb = new GeogebraConstructor({
270
+ commands,
271
+ is3D: true,
272
+ hideAxes: true,
273
+ viewDirectionVector: [-0.5, -1, -1],
274
+ });
275
+ const [xMin, xMax, yMin, yMax, zMin, zMax] = getCoordsForFrame(spacePointStart, spacePointEnd);
276
+ return ggb.getOptions({
277
+ coords: [xMin - 2, xMax + 2, yMin - 2, yMax + 2, zMin - 2, zMax + 2],
278
+ });
279
+ };
280
+ const getGGBOptions = (identifiers) => {
281
+ const { rectangularPrismOrigin, L, l, h, arrSegmentSpacePointIds } = identifiers;
282
+ const spacePointRectangularPrismOrigin = SpacePointConstructor.fromIdentifiers(rectangularPrismOrigin);
283
+ const rectangularPrismSpacePoints = getRectangularPrismPoints(spacePointRectangularPrismOrigin, L, l, h);
284
+ const arrSegmentSpacePoint = [...arrSegmentSpacePointIds].map((spacePointIds) => SpacePointConstructor.fromIdentifiers(spacePointIds));
285
+ const arrSpacePoint = [
286
+ // spacePointRectangularPrismOrigin,
287
+ ...arrSegmentSpacePoint,
288
+ ];
289
+ const [spacePointStart, spacePointEnd] = arrSegmentSpacePoint;
290
+ const arrSide = getAllPointMeshes(rectangularPrismSpacePoints[0], L, l, h);
291
+ const arrSegment = arrSide.flatMap(createSegmentMeshForPointMesh);
292
+ const commands = [
293
+ //hide xOyPlane
294
+ `SetFilling(xOyPlane, 0.1)`,
295
+ //pretty names
296
+ ...[
297
+ //points
298
+ ...arrSpacePoint.flatMap((spacePoint) => spacePoint.toGGBCommand({
299
+ isFixed: true,
300
+ showLabel: true,
301
+ })),
302
+ ],
303
+ //no names
304
+ ...[
305
+ //prism
306
+ `Pri = Prism(${rectangularPrismSpacePoints
307
+ .slice(0, 5)
308
+ .map((p) => p.toMathString())
309
+ .join(",")})`,
310
+ `SetColor(Pri, "${colorWithOpacity("#000000", 14)}")`,
311
+ `SetLineThickness(Pri, 1)`,
312
+ //segment meshes
313
+ ...arrSegment.flatMap(([spacePointStart, spacePointEnd], i) => {
314
+ return [
315
+ `S_${i} = Segment(${spacePointStart.toMathString()}, ${spacePointEnd.toMathString()})`,
316
+ `SetColor(S_${i}, "${colorWithOpacity("#BBBBBB", 37)}")`, //opacity is ignored
317
+ `SetLineThickness(S_${i}, 1)`,
318
+ ];
319
+ }),
320
+ ],
321
+ //segment
322
+ `segInstruction = Segment(${spacePointStart.toMathString()}, ${spacePointEnd.toMathString()})`,
323
+ `SetLineThickness(segInstruction, 4)`,
324
+ `SetColor(segInstruction, "${blueMain}")`,
325
+ // `RunUpdateScript()`,
326
+ ];
327
+ const ggb = new GeogebraConstructor({
328
+ commands,
329
+ is3D: true,
330
+ hideAxes: true,
331
+ viewDirectionVector: [-0.5, -1, -1],
332
+ });
333
+ const [xMin, xMax, yMin, yMax, zMin, zMax] = getCoordsForFrame(spacePointStart, spacePointEnd);
334
+ return ggb.getOptions({
335
+ coords: [xMin - 2, xMax + 2, yMin - 2, yMax + 2, zMin - 2, zMax + 2],
336
+ });
337
+ };
338
+ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
339
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
340
+ const opts = {
341
+ ...(optsIn ?? optsDefault),
342
+ nbComponents: random(arrayedOpts.nbComponents),
343
+ };
344
+ const propositions = [];
345
+ addValidProp(propositions, answer);
346
+ const { acceptedInputType } = identifiers;
347
+ const createNodeSum = (identifiers, isShouldFilterOutZeros = true) => {
348
+ const { arrSegmentSpacePointIds } = identifiers;
349
+ const [spacePointStart, spacePointEnd] = arrSegmentSpacePointIds.map((spacePointIds) => SpacePointConstructor.fromIdentifiers(spacePointIds));
350
+ const arrSubNode = ["x", "y", "z"]
351
+ .map((axis) => abs(substract(spacePointEnd[axis], spacePointStart[axis])).simplify({ towardsDistribute: true }))
352
+ .filter((node) => isShouldFilterOutZeros
353
+ ? !NodeComparator.isEqualViaSub(node, (0).toTree())
354
+ : true);
355
+ const nodeSumOfSquares = operatorComposition(AddNode, arrSubNode);
356
+ return nodeSumOfSquares;
357
+ };
358
+ //student: forgets squares
359
+ {
360
+ const nodeWrong = getFormattedNode(sqrt(createNodeSum(identifiers, true)).simplify({
361
+ towardsDistribute: true,
362
+ }), acceptedInputType);
363
+ tryToAddWrongProp(propositions, nodeWrong.toTex());
364
+ }
365
+ if (coinFlip()) {
366
+ //student: forgets sqrt
367
+ {
368
+ const nodeWrong = getFormattedNode(createNodeSumOfSquares(identifiers, true).simplify({
369
+ towardsDistribute: true,
370
+ }), acceptedInputType);
371
+ tryToAddWrongProp(propositions, nodeWrong.toTex());
372
+ }
373
+ }
374
+ else {
375
+ //student: forgets sqrt and squares
376
+ {
377
+ const nodeWrong = getFormattedNode(createNodeSum(identifiers, true).simplify({
378
+ towardsDistribute: true,
379
+ }), acceptedInputType);
380
+ tryToAddWrongProp(propositions, nodeWrong.toTex());
381
+ }
382
+ }
383
+ //student: l'âge du capitaine
384
+ {
385
+ const { L, l, h } = identifiers;
386
+ const nodeWrong = getFormattedNode(sqrt(operatorComposition(AddNode, [L, l, h].map((v) => square(v)))), acceptedInputType).simplify({
387
+ towardsDistribute: true,
388
+ });
389
+ tryToAddWrongProp(propositions, nodeWrong.toTex());
390
+ }
391
+ propWhile(propositions, n, () => {
392
+ const identifiersWrong = createRandomIdentifiers(opts);
393
+ tryToAddWrongProp(propositions, getAnswer(identifiersWrong, opts));
394
+ });
395
+ return shuffleProps(propositions, n);
396
+ };
397
+ const getKeys = () => {
398
+ return [];
399
+ };
400
+ const isAnswerValid = (ans, { answer, ..._identifiers }, _optsIn) => {
401
+ try {
402
+ const nodeAns = parseAlgebraic(ans);
403
+ const nodeAnswer = parseAlgebraic(answer);
404
+ return (substract(nodeAns.simplify(), nodeAnswer.simplify())
405
+ .simplify()
406
+ .evaluate() === 0);
407
+ }
408
+ catch (_) {
409
+ return false;
410
+ }
411
+ };
412
+ const createRandomIdentifiers = (opts) => {
413
+ const L = randint(3, 7);
414
+ const l = randint(3, 7);
415
+ const h = randint(3, 7);
416
+ const genNamePretty = genFuncNamePretty();
417
+ const rectangularPrismOriginSpacePoint = SpacePointConstructor.fromScalars([0, 0, 0], genNamePretty.next().value);
418
+ function createSpacePointWithPrettyName(spacePoint) {
419
+ const namePretty = genNamePretty.next().value;
420
+ const spacePointWithPrettyName = SpacePointConstructor.fromIdentifiers(Object.assign({}, spacePoint.toIdentifiers(), {
421
+ name: namePretty,
422
+ }));
423
+ return spacePointWithPrettyName;
424
+ }
425
+ const arrSide = getAllPointMeshes(rectangularPrismOriginSpacePoint, L, l, h).map((arrArrSpacePoint) => arrArrSpacePoint.flat());
426
+ function getNbShared(spacePoint1, spacePoint2) {
427
+ return zip([spacePoint1.x, spacePoint1.y, spacePoint1.z], [spacePoint2.x, spacePoint2.y, spacePoint2.z]).reduce((acc, [nodeSpacePoint1Axis, nodeSpacePoint2Axis]) => {
428
+ return (acc +
429
+ (NodeComparator.isEqualViaSub(nodeSpacePoint1Axis, nodeSpacePoint2Axis)
430
+ ? 1
431
+ : 0));
432
+ }, 0);
433
+ }
434
+ function getSpacePoint2(arrSpacePoint, spacePoint1Raw, nbDifferent) {
435
+ const arrSpacePointCandidate = arrSpacePoint.filter((spacePoint2Raw) => {
436
+ const nbShared = getNbShared(spacePoint2Raw, spacePoint1Raw);
437
+ return nbShared === 3 - nbDifferent;
438
+ });
439
+ return random(arrSpacePointCandidate);
440
+ }
441
+ const arrSegmentSpacePoint = (() => {
442
+ switch (opts.nbComponents) {
443
+ case "2": {
444
+ const arrSpacePoint = random(arrSide);
445
+ const spacePoint1Raw = random(arrSpacePoint);
446
+ const spacePoint2Raw = getSpacePoint2(arrSpacePoint, spacePoint1Raw, 2);
447
+ return [spacePoint1Raw, spacePoint2Raw].map(createSpacePointWithPrettyName);
448
+ }
449
+ case "3": {
450
+ const [arrSpacePoint1, arrSpacePoint2] = randomMany(arrSide, 2);
451
+ let isFound = false;
452
+ let spacePoint1Raw;
453
+ let spacePoint2Raw;
454
+ while (!isFound) {
455
+ spacePoint1Raw = random(arrSpacePoint1);
456
+ spacePoint2Raw = getSpacePoint2(arrSpacePoint2, spacePoint1Raw, 3);
457
+ isFound = spacePoint2Raw !== undefined;
458
+ }
459
+ return [spacePoint1Raw, spacePoint2Raw].map(createSpacePointWithPrettyName);
460
+ }
461
+ default:
462
+ throw new Error("Unsupported opts.nbComponents: " + opts.nbComponents);
463
+ }
464
+ })();
465
+ const identifiers = {
466
+ rectangularPrismOrigin: rectangularPrismOriginSpacePoint.toIdentifiers(),
467
+ L,
468
+ l,
469
+ h,
470
+ arrSegmentSpacePointIds: arrSegmentSpacePoint.map((spacePoint) => spacePoint.toIdentifiers()),
471
+ acceptedInputType: opts.acceptedInputType,
472
+ };
473
+ return identifiers;
474
+ };
475
+ const getSpaceSegmentLengthInRectangularPrismQuestion = (optsIn) => {
476
+ const arrayedOpts = defaultArrayedOptsWhereNeeded(optsIn, arrayedOptsDefault);
477
+ const opts = {
478
+ ...(optsIn ?? optsDefault),
479
+ nbComponents: random(arrayedOpts.nbComponents),
480
+ };
481
+ const identifiers = createRandomIdentifiers(opts);
482
+ return getQuestionFromIdentifiers(identifiers);
483
+ };
484
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
485
+ const question = {
486
+ answer: getAnswer(identifiers, opts),
487
+ instruction: getInstruction(identifiers, opts),
488
+ identifiers,
489
+ keys: getKeys(identifiers, opts),
490
+ hint: getHint(identifiers, opts),
491
+ correction: getCorrection(identifiers, opts),
492
+ correctionGgbOptions: getCorrectionGGBOptions(identifiers, opts),
493
+ ggbOptions: getGGBOptions(identifiers, opts),
494
+ };
495
+ return question;
496
+ };
497
+ const optsDefault = {
498
+ acceptedInputType: "exact",
499
+ };
500
+ const arrayedOptsDefault = {
501
+ nbComponents: ["2", "3"],
502
+ };
503
+ const options = [
504
+ {
505
+ id: "nbComponents",
506
+ label: "Nombre de composantes",
507
+ target: GeneratorOptionTarget.generation,
508
+ type: GeneratorOptionType.multiselect,
509
+ values: ["2", "3"],
510
+ defaultValue: arrayedOptsDefault.nbComponents,
511
+ },
512
+ {
513
+ id: "acceptedInputType",
514
+ label: "Format du résultat",
515
+ target: GeneratorOptionTarget.vea,
516
+ type: GeneratorOptionType.select,
517
+ values: ["exact", "arrondi au centième"],
518
+ defaultValue: optsDefault.acceptedInputType,
519
+ },
520
+ ];
521
+ export const spaceSegmentLengthInRectangularPrism = {
522
+ id: "spaceSegmentLengthInRectangularPrism",
523
+ connector: "=",
524
+ label: "Longueur d'un segment dans un pavé droit",
525
+ isSingleStep: true,
526
+ generator: (nb, opts) => getDistinctQuestions(() => getSpaceSegmentLengthInRectangularPrismQuestion(opts), nb),
527
+ options,
528
+ qcmTimer: 60,
529
+ freeTimer: 60,
530
+ subject: "Mathématiques",
531
+ hasGeogebra: true,
532
+ getQuestionFromIdentifiers,
533
+ getHint,
534
+ getCorrection,
535
+ hasHintAndCorrection: true,
536
+ isAnswerValid,
537
+ getPropositions,
538
+ };