math-exercises 3.0.69 → 3.0.71

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 (477) hide show
  1. package/lib/exercises/exercise.d.ts +9 -1
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/addAndSub.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/addAndSub.js +4 -0
  5. package/lib/exercises/math/calcul/addAndSubWithoutRelatives.d.ts +3 -0
  6. package/lib/exercises/math/calcul/addAndSubWithoutRelatives.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/addAndSubWithoutRelatives.js +33 -20
  8. package/lib/exercises/math/calcul/digitDecimalRank.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/digitDecimalRank.js +36 -13
  10. package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts.map +1 -1
  11. package/lib/exercises/math/calcul/digitDecimalRankNumber.js +27 -12
  12. package/lib/exercises/math/calcul/digitRank.d.ts.map +1 -1
  13. package/lib/exercises/math/calcul/digitRank.js +37 -13
  14. package/lib/exercises/math/calcul/digitRankNumber.d.ts.map +1 -1
  15. package/lib/exercises/math/calcul/digitRankNumber.js +21 -12
  16. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.d.ts.map +1 -1
  17. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +33 -17
  18. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts.map +1 -1
  19. package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.js +36 -18
  20. package/lib/exercises/math/calcul/mentalCaluls/mentalDivisions.d.ts.map +1 -1
  21. package/lib/exercises/math/calcul/mentalCaluls/mentalDivisions.js +38 -30
  22. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.d.ts.map +1 -1
  23. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.js +35 -21
  24. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.d.ts.map +1 -1
  25. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.js +4 -0
  26. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.d.ts.map +1 -1
  27. package/lib/exercises/math/calcul/mentalCaluls/mentalPercentage.js +22 -9
  28. package/lib/exercises/math/calcul/operations/expressionNature.d.ts +2 -1
  29. package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
  30. package/lib/exercises/math/calcul/operations/expressionNature.js +36 -15
  31. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts +2 -1
  32. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +26 -15
  34. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts +2 -1
  35. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts.map +1 -1
  36. package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.js +26 -17
  37. package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts +1 -0
  38. package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
  39. package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.js +89 -60
  40. package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -1
  41. package/lib/exercises/math/calcul/ordering/decimalOrdering.js +30 -13
  42. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.d.ts.map +1 -1
  43. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.js +26 -13
  44. package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -1
  45. package/lib/exercises/math/calcul/ordering/framing.js +70 -59
  46. package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -1
  47. package/lib/exercises/math/calcul/ordering/integerOrdering.js +30 -11
  48. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
  49. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +4 -0
  50. package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -1
  51. package/lib/exercises/math/calcul/proportionality/isTableProportional.js +42 -24
  52. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
  53. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +4 -0
  54. package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts +1 -0
  55. package/lib/exercises/math/calcul/proportionality/scaleUsage.d.ts.map +1 -1
  56. package/lib/exercises/math/calcul/proportionality/scaleUsage.js +75 -39
  57. package/lib/exercises/math/calcul/writing/index.d.ts +1 -1
  58. package/lib/exercises/math/calcul/writing/index.d.ts.map +1 -1
  59. package/lib/exercises/math/calcul/writing/index.js +3 -1
  60. package/lib/exercises/math/calcul/writing/numberToFrenchWriting.d.ts +0 -5
  61. package/lib/exercises/math/calcul/writing/numberToFrenchWriting.d.ts.map +1 -1
  62. package/lib/exercises/math/calcul/writing/numberToFrenchWriting.js +87 -64
  63. package/lib/exercises/math/calculLitteral/distributivity/allIdentities.d.ts.map +1 -1
  64. package/lib/exercises/math/calculLitteral/distributivity/allIdentities.js +29 -5
  65. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts +2 -1
  66. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.d.ts.map +1 -1
  67. package/lib/exercises/math/calculLitteral/distributivity/idRmq1.js +3 -3
  68. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts +2 -1
  69. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.d.ts.map +1 -1
  70. package/lib/exercises/math/calculLitteral/distributivity/idRmq2.js +3 -3
  71. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts +2 -1
  72. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.d.ts.map +1 -1
  73. package/lib/exercises/math/calculLitteral/distributivity/idRmq3.js +3 -3
  74. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts.map +1 -1
  75. package/lib/exercises/math/calculLitteral/factorisation/facto1.js +3 -1
  76. package/lib/exercises/math/complex/addComplex.d.ts.map +1 -1
  77. package/lib/exercises/math/complex/addComplex.js +31 -18
  78. package/lib/exercises/math/complex/argumentFromAlgebraicComplex.d.ts.map +1 -1
  79. package/lib/exercises/math/complex/argumentFromAlgebraicComplex.js +24 -11
  80. package/lib/exercises/math/complex/conjugateComplex.d.ts.map +1 -1
  81. package/lib/exercises/math/complex/conjugateComplex.js +20 -7
  82. package/lib/exercises/math/complex/conjugateDivideComplex.d.ts.map +1 -1
  83. package/lib/exercises/math/complex/conjugateDivideComplex.js +29 -16
  84. package/lib/exercises/math/complex/conjugateMultiplyComplex.d.ts.map +1 -1
  85. package/lib/exercises/math/complex/conjugateMultiplyComplex.js +26 -13
  86. package/lib/exercises/math/complex/divideComplex.d.ts.map +1 -1
  87. package/lib/exercises/math/complex/divideComplex.js +29 -16
  88. package/lib/exercises/math/complex/inverseComplex.d.ts.map +1 -1
  89. package/lib/exercises/math/complex/inverseComplex.js +18 -7
  90. package/lib/exercises/math/complex/linearCombinaisonComplex.d.ts.map +1 -1
  91. package/lib/exercises/math/complex/linearCombinaisonComplex.js +30 -13
  92. package/lib/exercises/math/complex/moduloFromAlgebraicComplex.d.ts.map +1 -1
  93. package/lib/exercises/math/complex/moduloFromAlgebraicComplex.js +20 -8
  94. package/lib/exercises/math/complex/mutiplyComplex.d.ts.map +1 -1
  95. package/lib/exercises/math/complex/mutiplyComplex.js +26 -13
  96. package/lib/exercises/math/complex/reAndIm.d.ts.map +1 -1
  97. package/lib/exercises/math/complex/reAndIm.js +22 -9
  98. package/lib/exercises/math/conversion/volumeCapacityConversion.d.ts.map +1 -1
  99. package/lib/exercises/math/conversion/volumeCapacityConversion.js +1 -0
  100. package/lib/exercises/math/dataRepresentations/testGen.d.ts.map +1 -1
  101. package/lib/exercises/math/dataRepresentations/testGen.js +5 -1
  102. package/lib/exercises/math/dataRepresentations/testGenGGB.d.ts.map +1 -1
  103. package/lib/exercises/math/dataRepresentations/testGenGGB.js +5 -1
  104. package/lib/exercises/math/dataRepresentations/testGenStudentGGB.d.ts.map +1 -1
  105. package/lib/exercises/math/dataRepresentations/testGenStudentGGB.js +5 -1
  106. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -1
  107. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +4 -0
  108. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts.map +1 -1
  109. package/lib/exercises/math/derivation/convexity/convexityTrinomials.js +4 -0
  110. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts.map +1 -1
  111. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +4 -2
  112. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
  113. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +4 -2
  114. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -1
  115. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +4 -0
  116. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -1
  117. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +4 -0
  118. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts.map +1 -1
  119. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +4 -2
  120. package/lib/exercises/math/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
  121. package/lib/exercises/math/derivation/derivative/inverseFunctionDerivative.js +4 -0
  122. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts.map +1 -1
  123. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.js +4 -0
  124. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts +2 -1
  125. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts.map +1 -1
  126. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.js +6 -4
  127. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts +2 -1
  128. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts.map +1 -1
  129. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +4 -0
  130. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts +2 -1
  131. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts.map +1 -1
  132. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +4 -0
  133. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts.map +1 -1
  134. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.js +4 -0
  135. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts.map +1 -1
  136. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.js +4 -0
  137. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts +2 -1
  138. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts.map +1 -1
  139. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +4 -10
  140. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts.map +1 -1
  141. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.js +32 -4
  142. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts.map +1 -1
  143. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.js +4 -2
  144. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts.map +1 -1
  145. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.js +4 -0
  146. package/lib/exercises/math/derivation/derivative/productDerivative.d.ts.map +1 -1
  147. package/lib/exercises/math/derivation/derivative/productDerivative.js +4 -0
  148. package/lib/exercises/math/derivation/derivative/quotientDerivative.d.ts.map +1 -1
  149. package/lib/exercises/math/derivation/derivative/quotientDerivative.js +4 -0
  150. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts.map +1 -1
  151. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.js +4 -0
  152. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -1
  153. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +4 -0
  154. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts.map +1 -1
  155. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.js +4 -0
  156. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts.map +1 -1
  157. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.js +4 -0
  158. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts.map +1 -1
  159. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.js +4 -0
  160. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts.map +1 -1
  161. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.js +4 -0
  162. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts +4 -3
  163. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  164. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +32 -16
  165. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
  166. package/lib/exercises/math/functions/exponential/expFactorization.js +1 -0
  167. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts.map +1 -1
  168. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +73 -41
  169. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.d.ts.map +1 -1
  170. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.js +32 -16
  171. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.d.ts.map +1 -1
  172. package/lib/exercises/math/functions/trinoms/summitAndCanonical/summitReading.js +1 -2
  173. package/lib/exercises/math/geometry/areas/circleRadiusFromArea.d.ts.map +1 -1
  174. package/lib/exercises/math/geometry/areas/circleRadiusFromArea.js +1 -0
  175. package/lib/exercises/math/geometry/areas/squareSideFromArea.d.ts.map +1 -1
  176. package/lib/exercises/math/geometry/areas/squareSideFromArea.js +1 -0
  177. package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts +4 -1
  178. package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
  179. package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +97 -44
  180. package/lib/exercises/math/geometry/vectors/coordinatesReading.d.ts.map +1 -1
  181. package/lib/exercises/math/geometry/vectors/coordinatesReading.js +28 -14
  182. package/lib/exercises/math/geometry/vectors/determinant.d.ts.map +1 -1
  183. package/lib/exercises/math/geometry/vectors/determinant.js +26 -12
  184. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.d.ts.map +1 -1
  185. package/lib/exercises/math/geometry/vectors/drawAVectorInGGB.js +25 -11
  186. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts +1 -0
  187. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
  188. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +60 -33
  189. package/lib/exercises/math/geometry/vectors/fourthParallelogramPoint.d.ts.map +1 -1
  190. package/lib/exercises/math/geometry/vectors/fourthParallelogramPoint.js +34 -19
  191. package/lib/exercises/math/geometry/vectors/paralellismViaColinearity.d.ts.map +1 -1
  192. package/lib/exercises/math/geometry/vectors/paralellismViaColinearity.js +42 -20
  193. package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.d.ts.map +1 -1
  194. package/lib/exercises/math/geometry/vectors/parallelogramViaEqualVectors.js +42 -20
  195. package/lib/exercises/math/geometry/vectors/traceOppositeVector.d.ts.map +1 -1
  196. package/lib/exercises/math/geometry/vectors/traceOppositeVector.js +4 -0
  197. package/lib/exercises/math/geometry/vectors/traceVectorDifference.d.ts.map +1 -1
  198. package/lib/exercises/math/geometry/vectors/traceVectorDifference.js +4 -0
  199. package/lib/exercises/math/geometry/vectors/traceVectorMultiple.d.ts.map +1 -1
  200. package/lib/exercises/math/geometry/vectors/traceVectorMultiple.js +4 -0
  201. package/lib/exercises/math/geometry/vectors/traceVectorSum.d.ts.map +1 -1
  202. package/lib/exercises/math/geometry/vectors/traceVectorSum.js +4 -0
  203. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts +2 -0
  204. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
  205. package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +45 -25
  206. package/lib/exercises/math/geometry/vectors/vectorLinearCombination.d.ts.map +1 -1
  207. package/lib/exercises/math/geometry/vectors/vectorLinearCombination.js +33 -14
  208. package/lib/exercises/math/geometry/vectors/vectorNormCalculation.d.ts.map +1 -1
  209. package/lib/exercises/math/geometry/vectors/vectorNormCalculation.js +9 -3
  210. package/lib/exercises/math/limits/limitReading.d.ts +5 -1
  211. package/lib/exercises/math/limits/limitReading.d.ts.map +1 -1
  212. package/lib/exercises/math/limits/limitReading.js +96 -38
  213. package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
  214. package/lib/exercises/math/limits/polynomLimit.js +0 -2
  215. package/lib/exercises/math/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -1
  216. package/lib/exercises/math/limits/rationalFracForbiddenValueLimit.js +37 -20
  217. package/lib/exercises/math/limits/rationalFracLimit.d.ts.map +1 -1
  218. package/lib/exercises/math/limits/rationalFracLimit.js +34 -17
  219. package/lib/exercises/math/limits/sequenceGeometricLimit.d.ts.map +1 -1
  220. package/lib/exercises/math/limits/sequenceGeometricLimit.js +4 -0
  221. package/lib/exercises/math/limits/sequencePolynomLimit.d.ts.map +1 -1
  222. package/lib/exercises/math/limits/sequencePolynomLimit.js +23 -10
  223. package/lib/exercises/math/limits/sequencePolynomNoFILimit.d.ts.map +1 -1
  224. package/lib/exercises/math/limits/sequencePolynomNoFILimit.js +24 -11
  225. package/lib/exercises/math/limits/sequencePolynomProductLimit.d.ts.map +1 -1
  226. package/lib/exercises/math/limits/sequencePolynomProductLimit.js +31 -18
  227. package/lib/exercises/math/limits/sequenceRationalFracLimit.d.ts.map +1 -1
  228. package/lib/exercises/math/limits/sequenceRationalFracLimit.js +33 -16
  229. package/lib/exercises/math/matrices/matrixGeneralTerm.d.ts.map +1 -1
  230. package/lib/exercises/math/matrices/matrixGeneralTerm.js +21 -8
  231. package/lib/exercises/math/matrices/matrixInversibilityDomain.d.ts.map +1 -1
  232. package/lib/exercises/math/matrices/matrixInversibilityDomain.js +44 -26
  233. package/lib/exercises/math/matrices/productCell.d.ts +2 -0
  234. package/lib/exercises/math/matrices/productCell.d.ts.map +1 -1
  235. package/lib/exercises/math/matrices/productCell.js +27 -12
  236. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  237. package/lib/exercises/math/powers/decimalToScientific.js +9 -0
  238. package/lib/exercises/math/primitive/constantPrimitive.d.ts +2 -1
  239. package/lib/exercises/math/primitive/constantPrimitive.d.ts.map +1 -1
  240. package/lib/exercises/math/primitive/constantPrimitive.js +3 -3
  241. package/lib/exercises/math/primitive/exponentialPrimitive.d.ts +2 -1
  242. package/lib/exercises/math/primitive/exponentialPrimitive.d.ts.map +1 -1
  243. package/lib/exercises/math/primitive/exponentialPrimitive.js +3 -3
  244. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts +2 -1
  245. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  246. package/lib/exercises/math/primitive/polynomialPrimitive.js +3 -3
  247. package/lib/exercises/math/primitive/sinCosPrimitive.d.ts +2 -1
  248. package/lib/exercises/math/primitive/sinCosPrimitive.d.ts.map +1 -1
  249. package/lib/exercises/math/primitive/sinCosPrimitive.js +3 -3
  250. package/lib/exercises/math/primitive/usualPrimitives.d.ts.map +1 -1
  251. package/lib/exercises/math/primitive/usualPrimitives.js +33 -6
  252. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.d.ts.map +1 -1
  253. package/lib/exercises/math/probaStat/binomial/varianceOfBinomialProba.js +1 -0
  254. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  255. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +4 -1
  256. package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
  257. package/lib/exercises/math/probaStat/stats2var/averagePoint.js +1 -2
  258. package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
  259. package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +47 -23
  260. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
  261. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +4 -6
  262. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.d.ts.map +1 -1
  263. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplictFormulaFirstTermRandom.js +4 -0
  264. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.d.ts.map +1 -1
  265. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.js +30 -12
  266. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.d.ts.map +1 -1
  267. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReason.js +4 -0
  268. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.d.ts.map +1 -1
  269. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.js +23 -9
  270. package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.d.ts.map +1 -1
  271. package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.js +62 -41
  272. package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.d.ts.map +1 -1
  273. package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.js +4 -2
  274. package/lib/exercises/math/sequences/arithmetic/arithmeticReasonUsage.d.ts.map +1 -1
  275. package/lib/exercises/math/sequences/arithmetic/arithmeticReasonUsage.js +4 -0
  276. package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
  277. package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +26 -10
  278. package/lib/exercises/math/sequences/arithmetic/arithmeticThresholdFind.d.ts.map +1 -1
  279. package/lib/exercises/math/sequences/arithmetic/arithmeticThresholdFind.js +33 -14
  280. package/lib/exercises/math/sequences/arithmetic/firstIntegersSum.d.ts.map +1 -1
  281. package/lib/exercises/math/sequences/arithmetic/firstIntegersSum.js +4 -2
  282. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -1
  283. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +35 -14
  284. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
  285. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +37 -24
  286. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromFirstTerms.d.ts.map +1 -1
  287. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromFirstTerms.js +4 -0
  288. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.d.ts.map +1 -1
  289. package/lib/exercises/math/sequences/arithmetic/recognizeReasonFromGraph.js +29 -15
  290. package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
  291. package/lib/exercises/math/sequences/explicitFormulaUsage.js +27 -10
  292. package/lib/exercises/math/sequences/genericSequenceVariations.d.ts.map +1 -1
  293. package/lib/exercises/math/sequences/genericSequenceVariations.js +23 -10
  294. package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
  295. package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +9 -3
  296. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
  297. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +45 -17
  298. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts.map +1 -1
  299. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +20 -9
  300. package/lib/exercises/math/sequences/geometric/geometricFindReason.d.ts.map +1 -1
  301. package/lib/exercises/math/sequences/geometric/geometricFindReason.js +20 -9
  302. package/lib/exercises/math/sequences/geometric/geometricFindTerm.d.ts.map +1 -1
  303. package/lib/exercises/math/sequences/geometric/geometricFindTerm.js +60 -41
  304. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
  305. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.js +1 -0
  306. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
  307. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +26 -10
  308. package/lib/exercises/math/sequences/geometric/geometricRecognizeReasonFromFirstTerms.d.ts.map +1 -1
  309. package/lib/exercises/math/sequences/geometric/geometricRecognizeReasonFromFirstTerms.js +4 -0
  310. package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
  311. package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.js +27 -10
  312. package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts.map +1 -1
  313. package/lib/exercises/math/sequences/geometric/geometricVariations.js +4 -0
  314. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
  315. package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +23 -11
  316. package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -1
  317. package/lib/exercises/math/sequences/sequenceEvaluation.js +45 -21
  318. package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
  319. package/lib/exercises/math/sets/intervals/intervalsUnion.js +1 -2
  320. package/lib/exercises/pc/calibrationCurveOfSolution.d.ts.map +1 -1
  321. package/lib/exercises/pc/calibrationCurveOfSolution.js +56 -48
  322. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +3 -1
  323. package/lib/exercises/pc/chemicalElements/weightPercent.d.ts.map +1 -1
  324. package/lib/exercises/pc/chemicalElements/weightPercent.js +1 -0
  325. package/lib/exercises/pc/chemicalEquations.d.ts.map +1 -1
  326. package/lib/exercises/pc/chemicalEquations.js +0 -2
  327. package/lib/exercises/pc/chemicalReactions/chemicalEquations.d.ts +8 -0
  328. package/lib/exercises/pc/chemicalReactions/chemicalEquations.d.ts.map +1 -0
  329. package/lib/exercises/pc/chemicalReactions/chemicalEquations.js +62 -0
  330. package/lib/exercises/pc/chemicalReactions/chemicalReactionsProduct.d.ts +9 -0
  331. package/lib/exercises/pc/chemicalReactions/chemicalReactionsProduct.d.ts.map +1 -0
  332. package/lib/exercises/pc/chemicalReactions/chemicalReactionsProduct.js +70 -0
  333. package/lib/exercises/pc/chemicalReactions/index.d.ts +2 -0
  334. package/lib/exercises/pc/chemicalReactions/index.d.ts.map +1 -1
  335. package/lib/exercises/pc/chemicalReactions/index.js +2 -0
  336. package/lib/exercises/pc/delution.d.ts.map +1 -1
  337. package/lib/exercises/pc/delution.js +25 -12
  338. package/lib/exercises/pc/dosage/concentrationCalculation.d.ts.map +1 -1
  339. package/lib/exercises/pc/dosage/concentrationCalculation.js +5 -3
  340. package/lib/exercises/pc/electricity/calculateVoltage.d.ts.map +1 -1
  341. package/lib/exercises/pc/electricity/calculateVoltage.js +112 -90
  342. package/lib/exercises/pc/electricity/electricEnergyFromPower.d.ts.map +1 -1
  343. package/lib/exercises/pc/electricity/electricEnergyFromPower.js +1 -0
  344. package/lib/exercises/pc/energy/efficiencyCalculation.d.ts.map +1 -1
  345. package/lib/exercises/pc/energy/efficiencyCalculation.js +5 -3
  346. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.d.ts.map +1 -1
  347. package/lib/exercises/pc/forces/calculateNormalOrFrictionForce.js +0 -1
  348. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.d.ts.map +1 -1
  349. package/lib/exercises/pc/forces/gravitationalAttractionObjectHeight.js +87 -38
  350. package/lib/exercises/pc/forces/gravitationalAttractionValue.d.ts.map +1 -1
  351. package/lib/exercises/pc/forces/gravitationalAttractionValue.js +31 -16
  352. package/lib/exercises/pc/forces/gravitationalForcePlanets.d.ts.map +1 -1
  353. package/lib/exercises/pc/forces/gravitationalForcePlanets.js +71 -31
  354. package/lib/exercises/pc/forces/massWeight.d.ts.map +1 -1
  355. package/lib/exercises/pc/forces/massWeight.js +53 -20
  356. package/lib/exercises/pc/forces/pressingForce.d.ts.map +1 -1
  357. package/lib/exercises/pc/forces/pressingForce.js +71 -31
  358. package/lib/exercises/pc/formulaFromComposition.d.ts.map +1 -1
  359. package/lib/exercises/pc/formulaFromComposition.js +28 -8
  360. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.d.ts.map +1 -1
  361. package/lib/exercises/pc/identifyAtomicMassOrAtomicNb.js +31 -12
  362. package/lib/exercises/pc/index.d.ts +4 -6
  363. package/lib/exercises/pc/index.d.ts.map +1 -1
  364. package/lib/exercises/pc/index.js +4 -6
  365. package/lib/exercises/pc/kineticEnergy.d.ts.map +1 -1
  366. package/lib/exercises/pc/kineticEnergy.js +22 -10
  367. package/lib/exercises/pc/math/isolateVariables.d.ts.map +1 -1
  368. package/lib/exercises/pc/math/isolateVariables.js +114 -32
  369. package/lib/exercises/pc/math/proportionnalityCoeffFromLine.d.ts.map +1 -1
  370. package/lib/exercises/pc/math/proportionnalityCoeffFromLine.js +34 -16
  371. package/lib/exercises/pc/mecanicalWaves/elongationReading.d.ts.map +1 -1
  372. package/lib/exercises/pc/mecanicalWaves/elongationReading.js +35 -13
  373. package/lib/exercises/pc/molarQuantity.d.ts.map +1 -1
  374. package/lib/exercises/pc/molarQuantity.js +29 -13
  375. package/lib/exercises/pc/mole/concentrationReading.d.ts +4 -1
  376. package/lib/exercises/pc/mole/concentrationReading.d.ts.map +1 -1
  377. package/lib/exercises/pc/mole/concentrationReading.js +28 -10
  378. package/lib/exercises/pc/mole/molFromMass.d.ts.map +1 -1
  379. package/lib/exercises/pc/mole/molFromMass.js +21 -8
  380. package/lib/exercises/pc/mole/molFromMolarMass.d.ts.map +1 -1
  381. package/lib/exercises/pc/mole/molFromMolarMass.js +21 -8
  382. package/lib/exercises/pc/mole/molarMass.d.ts +3 -1
  383. package/lib/exercises/pc/mole/molarMass.d.ts.map +1 -1
  384. package/lib/exercises/pc/mole/molarMass.js +22 -9
  385. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.d.ts.map +1 -1
  386. package/lib/exercises/pc/mole/moleculeCountFromMassAndAvogadro.js +25 -11
  387. package/lib/exercises/pc/mole/moleculeCountFromMol.d.ts.map +1 -1
  388. package/lib/exercises/pc/mole/moleculeCountFromMol.js +18 -7
  389. package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
  390. package/lib/exercises/pc/moleculeFormula.js +30 -9
  391. package/lib/exercises/pc/moleculeNomenclature.d.ts.map +1 -1
  392. package/lib/exercises/pc/moleculeNomenclature.js +23 -8
  393. package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
  394. package/lib/exercises/pc/motion/averageSpeed.js +68 -55
  395. package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -1
  396. package/lib/exercises/pc/motion/averageSpeedCalculation.js +97 -39
  397. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.d.ts +4 -1
  398. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.d.ts.map +1 -1
  399. package/lib/exercises/pc/motion/characteristicsOfVelocityVector.js +51 -49
  400. package/lib/exercises/pc/motion/motionReference.d.ts +1 -0
  401. package/lib/exercises/pc/motion/motionReference.d.ts.map +1 -1
  402. package/lib/exercises/pc/motion/motionReference.js +47 -26
  403. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts +1 -1
  404. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
  405. package/lib/exercises/pc/motion/typeOfAcceleration.js +61 -62
  406. package/lib/exercises/pc/motion/typeOfMovement.d.ts +2 -1
  407. package/lib/exercises/pc/motion/typeOfMovement.d.ts.map +1 -1
  408. package/lib/exercises/pc/motion/typeOfMovement.js +58 -57
  409. package/lib/exercises/pc/orderOfMagnitude.d.ts.map +1 -1
  410. package/lib/exercises/pc/orderOfMagnitude.js +24 -23
  411. package/lib/exercises/pc/pH.d.ts.map +1 -1
  412. package/lib/exercises/pc/pH.js +37 -16
  413. package/lib/exercises/pc/perceivedFrequency.d.ts.map +1 -1
  414. package/lib/exercises/pc/perceivedFrequency.js +26 -13
  415. package/lib/exercises/pc/potentialEnergy.d.ts.map +1 -1
  416. package/lib/exercises/pc/potentialEnergy.js +23 -11
  417. package/lib/exercises/pc/power/calculatePowerOfLight.d.ts +2 -2
  418. package/lib/exercises/pc/power/calculatePowerOfLight.d.ts.map +1 -1
  419. package/lib/exercises/pc/power/calculatePowerOfLight.js +65 -39
  420. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +3 -1
  421. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts.map +1 -1
  422. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +48 -47
  423. package/lib/exercises/pc/snellDescartes.d.ts.map +1 -1
  424. package/lib/exercises/pc/snellDescartes.js +31 -13
  425. package/lib/exercises/pc/sound/findPeriodFromGraph.d.ts.map +1 -1
  426. package/lib/exercises/pc/sound/findPeriodFromGraph.js +42 -26
  427. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.d.ts +1 -0
  428. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.d.ts.map +1 -1
  429. package/lib/exercises/pc/sound/findPeriodOrFrequencyFromGraph.js +51 -32
  430. package/lib/exercises/pc/sound/findSoundFrequencyFromPeriod.d.ts.map +1 -1
  431. package/lib/exercises/pc/sound/findSoundFrequencyFromPeriod.js +20 -7
  432. package/lib/exercises/pc/sound/findSoundPeriodFromFrequency.d.ts.map +1 -1
  433. package/lib/exercises/pc/sound/findSoundPeriodFromFrequency.js +20 -7
  434. package/lib/exercises/pc/sound/frequencyComparison.d.ts.map +1 -1
  435. package/lib/exercises/pc/sound/frequencyComparison.js +25 -14
  436. package/lib/exercises/pc/spectral/spectralEnergy.d.ts +1 -3
  437. package/lib/exercises/pc/spectral/spectralEnergy.d.ts.map +1 -1
  438. package/lib/exercises/pc/spectral/spectralEnergy.js +98 -56
  439. package/lib/exercises/pc/waves/findDistanceFromEarth.d.ts.map +1 -1
  440. package/lib/exercises/pc/waves/findDistanceFromEarth.js +22 -9
  441. package/lib/exercises/pc/waves/lightDistanceConversion.d.ts.map +1 -1
  442. package/lib/exercises/pc/waves/lightDistanceConversion.js +104 -76
  443. package/lib/exercises/pc/waves/periodicWaveCelerity.d.ts +1 -0
  444. package/lib/exercises/pc/waves/periodicWaveCelerity.d.ts.map +1 -1
  445. package/lib/exercises/pc/waves/periodicWaveCelerity.js +81 -25
  446. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
  447. package/lib/exercises/pc/weight/calculateWeight.js +55 -26
  448. package/lib/exercises/pc/weight/weightOnTheMoon.d.ts.map +1 -1
  449. package/lib/exercises/pc/weight/weightOnTheMoon.js +67 -32
  450. package/lib/index.d.ts +58 -37
  451. package/lib/index.d.ts.map +1 -1
  452. package/lib/latexTester.js +7 -2
  453. package/lib/math/geometry/ray.d.ts +8 -1
  454. package/lib/math/geometry/ray.d.ts.map +1 -1
  455. package/lib/math/geometry/ray.js +11 -1
  456. package/lib/math/polynomials/trinom.d.ts +5 -0
  457. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  458. package/lib/math/polynomials/trinom.js +6 -0
  459. package/lib/pc/constants/molecularChemistry/reaction.js +1 -1
  460. package/lib/pc/measure/measure.d.ts +11 -4
  461. package/lib/pc/measure/measure.d.ts.map +1 -1
  462. package/lib/pc/measure/measure.js +10 -6
  463. package/lib/playground.d.ts.map +1 -1
  464. package/lib/playground.js +8 -1
  465. package/lib/tests/exoTest.d.ts.map +1 -1
  466. package/lib/tests/exoTest.js +13 -0
  467. package/lib/tests/mega.test.d.ts +2 -0
  468. package/lib/tests/mega.test.d.ts.map +1 -0
  469. package/lib/tests/mega.test.js +13 -0
  470. package/lib/tests/megaxl.test.d.ts +2 -0
  471. package/lib/tests/megaxl.test.d.ts.map +1 -0
  472. package/lib/tests/megaxl.test.js +10 -0
  473. package/lib/tests/singleExo.test.d.ts.map +1 -1
  474. package/lib/tests/singleExo.test.js +2 -2
  475. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  476. package/lib/tree/nodes/operators/powerNode.js +2 -1
  477. package/package.json +3 -1
@@ -1,36 +1,74 @@
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 { LineConstructor } from "../../../../math/geometry/line.js";
5
- import { RayConstructor } from "../../../../math/geometry/ray.js";
6
- import { SegmentConstructor } from "../../../../math/geometry/segment.js";
4
+ import { LineConstructor, } from "../../../../math/geometry/line.js";
5
+ import { RayConstructor, } from "../../../../math/geometry/ray.js";
6
+ import { SegmentConstructor, } from "../../../../math/geometry/segment.js";
7
7
  import { randint } from "../../../../math/utils/random/randint.js";
8
- //!!Difficile de rendre cet exo non pur QCM car taper la parenthèse ouvre un environnement left/right ce qui empeche de taper des demi droites [AB)
9
- //!solutions que je vois :
10
- //! créer une touche parenthèse qui n'ouvre pas left/right (faisable mais relou)
11
- //! créer des touches [..], (..) et [..) directement (mais il faut déplacer le curseur vers la gauche dans ce cas)
12
- const getBasicShapesNamingQuestion = () => {
13
- let answer = "";
8
+ const buildObj = (identifiers) => {
9
+ switch (identifiers.type) {
10
+ case 1: //segment
11
+ return SegmentConstructor.fromIdentifiers(identifiers.objIds);
12
+ case 2: //demi-droite
13
+ return RayConstructor.fromIdentifiers(identifiers.objIds);
14
+ case 3: //droite
15
+ default:
16
+ return LineConstructor.fromIdentifiers(identifiers.objIds);
17
+ }
18
+ };
19
+ const getInstruction = (identifiers) => {
20
+ return `Comment se nomme la figure suivante ?`;
21
+ };
22
+ const getAnswer = (identifiers) => {
23
+ const obj = buildObj(identifiers);
24
+ const { type } = identifiers;
25
+ switch (type) {
26
+ case 1: //segment
27
+ return obj.name;
28
+ break;
29
+ case 2: //demi-droite
30
+ return obj.name;
31
+ break;
32
+ case 3: //droite
33
+ default:
34
+ return obj.toTexNoLeftRight();
35
+ break;
36
+ }
37
+ };
38
+ const getHint = (identifiers) => {
39
+ return `On rappelle que :
40
+
41
+ - Une longueur se note $AB$ ;
42
+ - Un segment se note $[AB]$ ;
43
+ - Une demi-droite d'origine $A$ se note $[AB)$ ;
44
+ - Une droite se note $(AB)$.
45
+ `;
46
+ };
47
+ const getCorrection = (identifiers) => {
48
+ const { type } = identifiers;
49
+ const obj = buildObj(identifiers);
50
+ return `La figure tracée est ${type === 1
51
+ ? "un segment"
52
+ : type === 2
53
+ ? `une demi-droite d'origine $${obj.startPoint.name}$`
54
+ : "une droite"}.
55
+
56
+ Cette figure se nomme donc $${getAnswer(identifiers)}$.`;
57
+ };
58
+ const getGGBOptions = (identifiers) => {
59
+ const { type } = identifiers;
14
60
  const commands = [];
15
- const type = randint(1, 4);
16
- let startPointName = "";
61
+ const obj = buildObj(identifiers);
17
62
  switch (type) {
18
63
  case 1: //segment
19
- const segment = SegmentConstructor.random();
20
- commands.push(...segment.toGGBCommands(true));
21
- answer = segment.name;
64
+ commands.push(...obj.toGGBCommands(true));
22
65
  break;
23
66
  case 2: //demi-droite
24
- const ray = RayConstructor.random();
25
- commands.push(...ray.toGGBCommands(true));
26
- answer = ray.name;
27
- startPointName = ray.startPoint.name;
67
+ commands.push(...obj.toGGBCommands(true));
28
68
  break;
29
69
  case 3: //droite
30
70
  default:
31
- const line = LineConstructor.random();
32
- commands.push(...line.toGGBCommands(true, { color: "black" }));
33
- answer = line.toTexNoLeftRight();
71
+ commands.push(...obj.toGGBCommands(true, { color: "black" }));
34
72
  break;
35
73
  }
36
74
  const ggb = new GeogebraConstructor({
@@ -38,36 +76,52 @@ const getBasicShapesNamingQuestion = () => {
38
76
  hideAxes: true,
39
77
  hideGrid: true,
40
78
  });
79
+ return ggb.getOptions({
80
+ coords: [-15, 15, -15, 15],
81
+ });
82
+ };
83
+ const getKeys = (identifiers) => {
84
+ const answer = getAnswer(identifiers);
41
85
  const letters = answer.substring(1, answer.length - 1).split("");
86
+ return ["lbracketNoSpace", "rbracketNoSpace", ...letters];
87
+ };
88
+ const getQuestionFromIdentifiers = (identifiers) => {
42
89
  const question = {
43
- answer,
44
- instruction: `Comment se nomme la figure suivante ?`,
45
- keys: ["lbracketNoSpace", "rbracketNoSpace", ...letters],
90
+ answer: getAnswer(identifiers),
91
+ instruction: getInstruction(identifiers),
92
+ keys: getKeys(identifiers),
46
93
  answerFormat: "tex",
47
- identifiers: { type, commands },
48
- ggbOptions: ggb.getOptions({
49
- coords: [-15, 15, -15, 15],
50
- }),
94
+ identifiers,
95
+ ggbOptions: getGGBOptions(identifiers),
51
96
  keyboardOptions: {
52
97
  parenthesisShouldNotProduceLeftRight: true,
53
98
  },
54
- hint: `On rappelle que :
55
-
56
- - Une longueur se note $AB$ ;
57
- - Un segment se note $[AB]$ ;
58
- - Une demi-droite d'origine $A$ se note $[AB)$ ;
59
- - Une droite se note $(AB)$.
60
- `,
61
- correction: `La figure tracée est ${type === 1
62
- ? "un segment"
63
- : type === 2
64
- ? `une demi-droite d'origine $${startPointName}$`
65
- : "une droite"}.
66
-
67
- Cette figure se nomme donc $${answer}$.`,
99
+ hint: getHint(identifiers),
100
+ correction: getCorrection(identifiers),
68
101
  };
69
102
  return question;
70
103
  };
104
+ const getBasicShapesNamingQuestion = () => {
105
+ const type = randint(1, 4);
106
+ let objIds;
107
+ switch (type) {
108
+ case 1: //segment
109
+ const segment = SegmentConstructor.random();
110
+ objIds = segment.toIdentifiers();
111
+ break;
112
+ case 2: //demi-droite
113
+ const ray = RayConstructor.random();
114
+ objIds = ray.toIdentifiers();
115
+ break;
116
+ case 3: //droite
117
+ default:
118
+ const line = LineConstructor.random();
119
+ objIds = line.toIdentifiers();
120
+ break;
121
+ }
122
+ const identifiers = { type, objIds };
123
+ return getQuestionFromIdentifiers(identifiers);
124
+ };
71
125
  const getPropositions = (n, { answer }) => {
72
126
  const propositions = [];
73
127
  addValidProp(propositions, answer);
@@ -94,9 +148,7 @@ export const basicShapesNaming = {
94
148
  id: "basicShapesNaming",
95
149
  connector: "=",
96
150
  label: "Nommer un segment/une demi-droite/une droite",
97
- levels: [],
98
151
  isSingleStep: true,
99
- sections: [],
100
152
  generator: (nb) => getDistinctQuestions(getBasicShapesNamingQuestion, nb),
101
153
  qcmTimer: 60,
102
154
  freeTimer: 60,
@@ -105,4 +157,5 @@ export const basicShapesNaming = {
105
157
  subject: "Mathématiques",
106
158
  hasGeogebra: true,
107
159
  hasHintAndCorrection: true,
160
+ getQuestionFromIdentifiers,
108
161
  };
@@ -1 +1 @@
1
- {"version":3,"file":"coordinatesReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/coordinatesReading.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAOrC,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;AAoEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
1
+ {"version":3,"file":"coordinatesReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/coordinatesReading.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAOrC,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;AAuFF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAcpD,CAAC"}
@@ -4,15 +4,18 @@ import { randomColor } from "../../../../geogebra/colors.js";
4
4
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
5
  import { IntegerConstructor } from "../../../../math/numbers/integer/integer.js";
6
6
  import { randint } from "../../../../math/utils/random/randint.js";
7
- const getCoordinatesReadingQuestion = () => {
8
- const [xA, yA] = IntegerConstructor.randomDifferents(-5, 6, 2);
9
- let xB, yB;
10
- do {
11
- [xB, yB] = IntegerConstructor.randomDifferents(-5, 6, 2);
12
- } while (xA === xB && yA === yB);
7
+ const getInstruction = (identifiers) => {
8
+ return `Lire les coordonnées du vecteur $\\overrightarrow u$ représenté ci-dessous :`;
9
+ };
10
+ const getAnswer = (identifiers) => {
11
+ const { xA, xB, yA, yB } = identifiers;
13
12
  const xDelta = xB - xA;
14
13
  const yDelta = yB - yA;
15
14
  const answer = `\\left(${xDelta};${yDelta}\\right)`;
15
+ return answer;
16
+ };
17
+ const getGGBOptions = (identifiers) => {
18
+ const { xA, xB, yA, yB } = identifiers;
16
19
  const commands = [
17
20
  `u = Vector((${xA},${yA}), (${xB}, ${yB}))`,
18
21
  'SetCaption(u, "$\\overrightarrow u$")',
@@ -27,18 +30,30 @@ const getCoordinatesReadingQuestion = () => {
27
30
  commands,
28
31
  isGridBold: true,
29
32
  });
33
+ return ggb.getOptions({
34
+ coords: ggb.getAdaptedCoords({ xMax, xMin, yMax, yMin }),
35
+ });
36
+ };
37
+ const getQuestionFromIdentifiers = (identifiers) => {
30
38
  const question = {
31
- answer: answer,
32
- instruction: `Lire les coordonnées du vecteur $\\overrightarrow u$ représenté ci-dessous :`,
39
+ answer: getAnswer(identifiers),
40
+ instruction: getInstruction(identifiers),
33
41
  keys: ["semicolon", "vectorU"],
34
42
  answerFormat: "tex",
35
- ggbOptions: ggb.getOptions({
36
- coords: ggb.getAdaptedCoords({ xMax, xMin, yMax, yMin }),
37
- }),
38
- identifiers: { xA, xB, yA, yB },
43
+ ggbOptions: getGGBOptions(identifiers),
44
+ identifiers,
39
45
  };
40
46
  return question;
41
47
  };
48
+ const getCoordinatesReadingQuestion = () => {
49
+ const [xA, yA] = IntegerConstructor.randomDifferents(-5, 6, 2);
50
+ let xB, yB;
51
+ do {
52
+ [xB, yB] = IntegerConstructor.randomDifferents(-5, 6, 2);
53
+ } while (xA === xB && yA === yB);
54
+ const identifiers = { xA, xB, yA, yB };
55
+ return getQuestionFromIdentifiers(identifiers);
56
+ };
42
57
  const getPropositions = (n, { answer, xA, xB, yA, yB }) => {
43
58
  const propositions = [];
44
59
  addValidProp(propositions, answer);
@@ -58,9 +73,7 @@ export const coordinatesReading = {
58
73
  id: "coordinatesReading",
59
74
  connector: "=",
60
75
  label: "Lire les coordonnées d'un vecteur",
61
- levels: ["2nde", "1reESM"],
62
76
  isSingleStep: true,
63
- sections: ["Vecteurs"],
64
77
  generator: (nb) => getDistinctQuestions(getCoordinatesReadingQuestion, nb),
65
78
  qcmTimer: 60,
66
79
  freeTimer: 60,
@@ -68,4 +81,5 @@ export const coordinatesReading = {
68
81
  isAnswerValid,
69
82
  hasGeogebra: true,
70
83
  subject: "Mathématiques",
84
+ getQuestionFromIdentifiers,
71
85
  };
@@ -1 +1 @@
1
- {"version":3,"file":"determinant.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/determinant.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAoDF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAa7C,CAAC"}
1
+ {"version":3,"file":"determinant.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/determinant.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAwFF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,CAY7C,CAAC"}
@@ -4,23 +4,38 @@ import { Vector, VectorConstructor } from "../../../../math/geometry/vector.js";
4
4
  import { randint } from "../../../../math/utils/random/randint.js";
5
5
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
6
6
  import { shuffle } from "../../../../utils/alea/shuffle.js";
7
- const getDeterminantQuestion = () => {
8
- const u = VectorConstructor.random("u");
9
- const v = VectorConstructor.random("v");
7
+ const getInstruction = (identifiers) => {
8
+ const u = new Vector("u", Number(identifiers.uCoords[0]).toTree(), Number(identifiers.uCoords[1]).toTree());
9
+ const v = new Vector("v", Number(identifiers.uCoords[0]).toTree(), Number(identifiers.uCoords[1]).toTree());
10
+ return `Soient les vecteurs $${u.toTexWithCoords()}$ et $${v.toTexWithCoords()}$.
11
+
12
+ Calculer le déterminant $\\det(\\overrightarrow u;\\overrightarrow v)$.`;
13
+ };
14
+ const getAnswer = (identifiers) => {
15
+ const u = new Vector("u", Number(identifiers.uCoords[0]).toTree(), Number(identifiers.uCoords[1]).toTree());
16
+ const v = new Vector("v", Number(identifiers.uCoords[0]).toTree(), Number(identifiers.uCoords[1]).toTree());
10
17
  const answer = u.determinant(v).simplify();
11
- const answerTex = answer.toTex();
18
+ return answer.toTex();
19
+ };
20
+ const getQuestionFromIdentifiers = (identifiers) => {
12
21
  const question = {
13
- answer: answerTex,
14
- instruction: `Soient les vecteurs $${u.toTexWithCoords()}$ et $${v.toTexWithCoords()}$. Calculer le déterminant $\\det(\\overrightarrow u;\\overrightarrow v)$.`,
22
+ answer: getAnswer(identifiers),
23
+ instruction: getInstruction(identifiers),
15
24
  keys: [],
16
25
  answerFormat: "tex",
17
- identifiers: {
18
- uCoords: [u.x.toTex(), u.y.toTex()],
19
- vCoords: [v.x.toTex(), v.y.toTex()],
20
- },
26
+ identifiers,
21
27
  };
22
28
  return question;
23
29
  };
30
+ const getDeterminantQuestion = () => {
31
+ const u = VectorConstructor.random("u");
32
+ const v = VectorConstructor.random("v");
33
+ const identifiers = {
34
+ uCoords: [u.x.toTex(), u.y.toTex()],
35
+ vCoords: [v.x.toTex(), v.y.toTex()],
36
+ };
37
+ return getQuestionFromIdentifiers(identifiers);
38
+ };
24
39
  const getPropositions = (n, { answer, uCoords, vCoords }) => {
25
40
  const propositions = [];
26
41
  addValidProp(propositions, answer);
@@ -40,13 +55,12 @@ export const determinant = {
40
55
  id: "determinant",
41
56
  connector: "=",
42
57
  label: "Calculer le déterminant de deux vecteurs",
43
- levels: ["2nde", "1reESM", "1reSpé"],
44
58
  isSingleStep: true,
45
- sections: ["Vecteurs"],
46
59
  generator: (nb) => getDistinctQuestions(getDeterminantQuestion, nb),
47
60
  qcmTimer: 60,
48
61
  freeTimer: 60,
49
62
  getPropositions,
50
63
  isAnswerValid,
51
64
  subject: "Mathématiques",
65
+ getQuestionFromIdentifiers,
52
66
  };
@@ -1 +1 @@
1
- {"version":3,"file":"drawAVectorInGGB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/drawAVectorInGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAIT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAkCF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAYlD,CAAC"}
1
+ {"version":3,"file":"drawAVectorInGGB.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/drawAVectorInGGB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAyDF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAWlD,CAAC"}
@@ -5,28 +5,43 @@ import { randint } from "../../../../math/utils/random/randint.js";
5
5
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
6
6
  import { GeogebraParser } from "../../../../geogebra/parsers/geogebraParser.js";
7
7
  import { approxEqual } from "../../../../geogebra/parsers/approxEqual.js";
8
- const getDrawAVectorInGgbQuestion = () => {
9
- const x = randint(-3, 3);
10
- const y = x === 0 ? randint(-3, 3, [0]) : randint(-3, 3);
8
+ const getInstruction = (identifiers) => {
9
+ const { x, y } = identifiers;
11
10
  const vector = new Vector("u", x.toTree(), y.toTree());
11
+ return `Tracer le vecteur $${vector.toTex()}${vector.toInlineCoordsTex()}$`;
12
+ };
13
+ const getGGBAnswer = (identifiers) => {
14
+ const { x, y } = identifiers;
15
+ return [`Vector[(0, 0), (${x}, ${y})]`];
16
+ };
17
+ const getStudentGGBOptions = (identifiers) => {
12
18
  const studentGGB = new GeogebraConstructor({
13
19
  isGridSimple: true,
14
20
  customToolBar: toolBarConstructor({
15
21
  vector: true,
16
22
  }),
17
23
  });
24
+ return studentGGB.getOptions({
25
+ coords: [-5, 5, -6, 6],
26
+ });
27
+ };
28
+ const getQuestionFromIdentifiers = (identifiers) => {
18
29
  const question = {
19
- ggbAnswer: [`Vector[(0, 0), (${x}, ${y})]`],
20
- instruction: `Tracer le vecteur $${vector.toTex()}${vector.toInlineCoordsTex()}$`,
30
+ ggbAnswer: getGGBAnswer(identifiers),
31
+ instruction: getInstruction(identifiers),
21
32
  keys: [],
22
- studentGgbOptions: studentGGB.getOptions({
23
- coords: [-5, 5, -6, 6],
24
- }),
33
+ studentGgbOptions: getStudentGGBOptions(identifiers),
25
34
  answerFormat: "tex",
26
- identifiers: { x, y },
35
+ identifiers,
27
36
  };
28
37
  return question;
29
38
  };
39
+ const getDrawAVectorInGgbQuestion = () => {
40
+ const x = randint(-3, 3);
41
+ const y = x === 0 ? randint(-3, 3, [0]) : randint(-3, 3);
42
+ const identifiers = { x, y };
43
+ return getQuestionFromIdentifiers(identifiers);
44
+ };
30
45
  const isGGBAnswerValid = (ans, { ggbAnswer, x, y }) => {
31
46
  const parser = new GeogebraParser(ans);
32
47
  const vectors = parser.vectors();
@@ -38,12 +53,11 @@ const isGGBAnswerValid = (ans, { ggbAnswer, x, y }) => {
38
53
  export const drawAVectorInGGB = {
39
54
  id: "drawAVectorInGGB",
40
55
  label: "Tracer un vecteur",
41
- levels: ["2nde"],
42
56
  isSingleStep: true,
43
- sections: ["Géométrie cartésienne"],
44
57
  generator: (nb) => getDistinctQuestions(getDrawAVectorInGgbQuestion, nb),
45
58
  ggbTimer: 60,
46
59
  answerType: "GGB",
47
60
  isGGBAnswerValid,
48
61
  subject: "Mathématiques",
62
+ getQuestionFromIdentifiers,
49
63
  };
@@ -3,6 +3,7 @@ type Identifiers = {
3
3
  caracAsked: string;
4
4
  uPoints: number[][];
5
5
  vPoints: number[][];
6
+ isTrue: boolean;
6
7
  };
7
8
  export declare const equalCaracteristicFromGraph: Exercise<Identifiers>;
8
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"equalCaracteristicFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/equalCaracteristicFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;CACrB,CAAC;AAuLF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAe7D,CAAC"}
1
+ {"version":3,"file":"equalCaracteristicFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/equalCaracteristicFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAuNF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAc7D,CAAC"}
@@ -9,10 +9,65 @@ import { random } from "../../../../utils/alea/random.js";
9
9
  * Soient deux cercles C1 et C2 de rayon 3 et de centres (-4,0) et (4,0)
10
10
  * on construit u dans C1 et v dans C2
11
11
  */
12
+ const getInstruction = (identifiers) => {
13
+ let instruction = "";
14
+ const { caracAsked, uPoints, vPoints } = identifiers;
15
+ switch (caracAsked) {
16
+ case "direction":
17
+ instruction = "avoir la même direction";
18
+ break;
19
+ case "norme":
20
+ instruction = "avoir la même norme";
21
+ break;
22
+ case "sens":
23
+ instruction = "avoir le même sens";
24
+ break;
25
+ case "egaux":
26
+ instruction = "être égaux";
27
+ break;
28
+ case "opposes":
29
+ default:
30
+ instruction = "être opposés";
31
+ break;
32
+ }
33
+ return `Les vecteurs $\\overrightarrow{u}$ et $\\overrightarrow{v}$ suivants semblent-ils ${instruction} ?`;
34
+ };
35
+ const getAnswer = (identifiers) => {
36
+ const { caracAsked, uPoints, vPoints, isTrue } = identifiers;
37
+ const answer = isTrue ? "Oui" : "Non";
38
+ return answer;
39
+ };
40
+ const getGGBOptions = (identifiers) => {
41
+ const { caracAsked, uPoints, vPoints } = identifiers;
42
+ const commands = [
43
+ `u = Vector((${uPoints[0][0]},${uPoints[0][1]}), (${uPoints[1][0]},${uPoints[1][1]}))`,
44
+ `v = Vector((${vPoints[0][0]},${vPoints[0][1]}), (${vPoints[1][0]},${vPoints[1][1]}))`,
45
+ 'SetCaption(u, "$\\overrightarrow u$")',
46
+ 'SetCaption(v, "$\\overrightarrow v$")',
47
+ "ShowLabel(u, true)",
48
+ "ShowLabel(v,true)",
49
+ ];
50
+ const ggb = new GeogebraConstructor({
51
+ commands,
52
+ hideAxes: true,
53
+ });
54
+ return ggb.getOptions({
55
+ coords: [-8, 8, -4, 4],
56
+ });
57
+ };
58
+ const getQuestionFromIdentifiers = (identifiers) => {
59
+ const question = {
60
+ answer: getAnswer(identifiers),
61
+ instruction: getInstruction(identifiers),
62
+ keys: [],
63
+ ggbOptions: getGGBOptions(identifiers),
64
+ answerFormat: "raw",
65
+ identifiers,
66
+ };
67
+ return question;
68
+ };
12
69
  const getEqualCaracteristicFromGraphQuestion = () => {
13
- let points = [];
14
70
  // const caracAsked = random(["sens", "direction", "norme"]);
15
- let instruction = "";
16
71
  const caracAsked = random(["sens", "norme", "direction", "egaux", "opposes"]);
17
72
  const isTrue = coinFlip();
18
73
  let uPoints = [];
@@ -31,7 +86,6 @@ const getEqualCaracteristicFromGraphQuestion = () => {
31
86
  let rho;
32
87
  switch (caracAsked) {
33
88
  case "direction":
34
- instruction = "avoir la même direction";
35
89
  thetaPrime = isTrue
36
90
  ? theta
37
91
  : theta + randfloat(1 / 4, 1 / 3) * Math.PI * 2;
@@ -51,7 +105,6 @@ const getEqualCaracteristicFromGraphQuestion = () => {
51
105
  [uPoints, vPoints] = [vPoints, uPoints];
52
106
  break;
53
107
  case "norme":
54
- instruction = "avoir la même norme";
55
108
  sameDirection = coinFlip();
56
109
  thetaPrime = sameDirection ? theta : Math.random() * 2 * Math.PI;
57
110
  if (isTrue) {
@@ -74,7 +127,6 @@ const getEqualCaracteristicFromGraphQuestion = () => {
74
127
  [uPoints, vPoints] = [vPoints, uPoints];
75
128
  break;
76
129
  case "sens":
77
- instruction = "avoir le même sens";
78
130
  sameDirection = coinFlip();
79
131
  sameNorm = coinFlip();
80
132
  thetaPrime =
@@ -96,7 +148,6 @@ const getEqualCaracteristicFromGraphQuestion = () => {
96
148
  [uPoints, vPoints] = [vPoints, uPoints];
97
149
  break;
98
150
  case "egaux":
99
- instruction = "être égaux";
100
151
  sameDirection = isTrue || coinFlip();
101
152
  sameNorm = isTrue || coinFlip();
102
153
  sameSens = isTrue || (sameDirection && sameNorm ? false : coinFlip());
@@ -118,7 +169,6 @@ const getEqualCaracteristicFromGraphQuestion = () => {
118
169
  [uPoints, vPoints] = [vPoints, uPoints];
119
170
  break;
120
171
  case "opposes":
121
- instruction = "être opposés";
122
172
  sameDirection = isTrue || coinFlip();
123
173
  sameNorm = isTrue || coinFlip();
124
174
  sameSens = !isTrue || (sameDirection && sameNorm ? false : coinFlip());
@@ -140,30 +190,8 @@ const getEqualCaracteristicFromGraphQuestion = () => {
140
190
  [uPoints, vPoints] = [vPoints, uPoints];
141
191
  break;
142
192
  }
143
- const commands = [
144
- `u = Vector((${uPoints[0][0]},${uPoints[0][1]}), (${uPoints[1][0]},${uPoints[1][1]}))`,
145
- `v = Vector((${vPoints[0][0]},${vPoints[0][1]}), (${vPoints[1][0]},${vPoints[1][1]}))`,
146
- 'SetCaption(u, "$\\overrightarrow u$")',
147
- 'SetCaption(v, "$\\overrightarrow v$")',
148
- "ShowLabel(u, true)",
149
- "ShowLabel(v,true)",
150
- ];
151
- const ggb = new GeogebraConstructor({
152
- commands,
153
- hideAxes: true,
154
- });
155
- const answer = isTrue ? "Oui" : "Non";
156
- const question = {
157
- answer,
158
- instruction: `Les vecteurs $\\overrightarrow{u}$ et $\\overrightarrow{v}$ suivants semblent-ils ${instruction} ?`,
159
- keys: [],
160
- ggbOptions: ggb.getOptions({
161
- coords: [-8, 8, -4, 4],
162
- }),
163
- answerFormat: "raw",
164
- identifiers: { caracAsked, uPoints, vPoints },
165
- };
166
- return question;
193
+ const identifiers = { caracAsked, uPoints, vPoints, isTrue };
194
+ return getQuestionFromIdentifiers(identifiers);
167
195
  };
168
196
  const getPropositions = (n, { answer }) => {
169
197
  const propositions = [];
@@ -178,9 +206,7 @@ const isAnswerValid = (ans, { answer }) => {
178
206
  export const equalCaracteristicFromGraph = {
179
207
  id: "equalCaracteristicFromGraph",
180
208
  label: "Direction, sens, norme, égalité, opposés",
181
- levels: ["2nde"],
182
209
  isSingleStep: true,
183
- sections: ["Vecteurs"],
184
210
  generator: (nb) => getDistinctQuestions(getEqualCaracteristicFromGraphQuestion, nb),
185
211
  qcmTimer: 60,
186
212
  freeTimer: 60,
@@ -189,4 +215,5 @@ export const equalCaracteristicFromGraph = {
189
215
  answerType: "QCU",
190
216
  hasGeogebra: true,
191
217
  subject: "Mathématiques",
218
+ getQuestionFromIdentifiers,
192
219
  };
@@ -1 +1 @@
1
- {"version":3,"file":"fourthParallelogramPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/fourthParallelogramPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAwDF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAa1D,CAAC"}
1
+ {"version":3,"file":"fourthParallelogramPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/fourthParallelogramPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA4EF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAY1D,CAAC"}
@@ -6,6 +6,29 @@ import { Vector, VectorConstructor } from "../../../../math/geometry/vector.js";
6
6
  import { randint } from "../../../../math/utils/random/randint.js";
7
7
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
8
8
  import { shuffle } from "../../../../utils/alea/shuffle.js";
9
+ const getInstruction = (identifiers) => {
10
+ const A = new Point("A", identifiers.xA, identifiers.yA);
11
+ const B = new Point("B", identifiers.xB, identifiers.yB);
12
+ const C = new Point("C", identifiers.xC, identifiers.yC);
13
+ return `Soient les points $${A.toTexWithCoords()}$, $${B.toTexWithCoords()}$, et $${C.toTexWithCoords()}$.
14
+
15
+ Quelles sont les coordonnées du point $D$ tel que $ABCD$ soit un parallélogramme ?`;
16
+ };
17
+ const getAnswer = (identifiers) => {
18
+ const D = new Point("D", identifiers.xD, identifiers.yD);
19
+ const answer = D.toCoords();
20
+ return answer;
21
+ };
22
+ const getQuestionFromIdentifiers = (identifiers) => {
23
+ const question = {
24
+ answer: getAnswer(identifiers),
25
+ instruction: getInstruction(identifiers),
26
+ keys: coordinatesKeys,
27
+ answerFormat: "tex",
28
+ identifiers,
29
+ };
30
+ return question;
31
+ };
9
32
  const getFourthParallelogramPointQuestion = () => {
10
33
  const points = PointConstructor.randomDifferent(2, { names: ["A", "B"] });
11
34
  const AB = VectorConstructor.fromPoints(points[0], points[1]);
@@ -14,24 +37,17 @@ const getFourthParallelogramPointQuestion = () => {
14
37
  D = PointConstructor.random("D");
15
38
  } while (AB.isColinear(VectorConstructor.fromPoints(D, points[0])));
16
39
  const C = AB.getEndPoint(D, "C");
17
- const answer = D.toCoords();
18
- const question = {
19
- answer,
20
- instruction: `Soient les points $${points[0].toTexWithCoords()}$, $${points[1].toTexWithCoords()}$, et $${C.toTexWithCoords()}$. Quelles sont les coordonnées du point $D$ tel que $ABCD$ soit un parallélogramme ?`,
21
- keys: coordinatesKeys,
22
- answerFormat: "tex",
23
- identifiers: {
24
- xA: points[0].x.evaluate({}),
25
- xB: points[1].x.evaluate({}),
26
- xC: C.x.evaluate({}),
27
- xD: D.x.evaluate({}),
28
- yA: points[0].y.evaluate({}),
29
- yB: points[1].y.evaluate({}),
30
- yC: C.y.evaluate({}),
31
- yD: D.y.evaluate({}),
32
- },
40
+ const identifiers = {
41
+ xA: points[0].x.evaluate({}),
42
+ xB: points[1].x.evaluate({}),
43
+ xC: C.x.evaluate({}),
44
+ xD: D.x.evaluate({}),
45
+ yA: points[0].y.evaluate({}),
46
+ yB: points[1].y.evaluate({}),
47
+ yC: C.y.evaluate({}),
48
+ yD: D.y.evaluate({}),
33
49
  };
34
- return question;
50
+ return getQuestionFromIdentifiers(identifiers);
35
51
  };
36
52
  const getPropositions = (n, { answer, xA, xB, xC, yA, yB, yC, yD }) => {
37
53
  const propositions = [];
@@ -51,13 +67,12 @@ const isAnswerValid = (ans, { answer }) => {
51
67
  export const fourthParallelogramPoint = {
52
68
  id: "fourthParallelogramPoint",
53
69
  label: "Déterminer les coordonnées du quatrième point d'un parallélogramme",
54
- levels: ["2nde", "1reSpé"],
55
70
  isSingleStep: true,
56
- sections: ["Vecteurs", "Droites"],
57
71
  generator: (nb) => getDistinctQuestions(getFourthParallelogramPointQuestion, nb),
58
72
  qcmTimer: 60,
59
73
  freeTimer: 60,
60
74
  getPropositions,
61
75
  isAnswerValid,
62
76
  subject: "Mathématiques",
77
+ getQuestionFromIdentifiers,
63
78
  };