math-exercises 3.0.124 → 3.0.126

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 (351) hide show
  1. package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts +1 -1
  2. package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +20 -14
  4. package/lib/exercises/math/calcul/fractions/fractionsMix.js +1 -1
  5. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +61 -1
  7. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +1 -0
  8. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/mentalCaluls/index.js +1 -0
  10. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +15 -0
  11. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -0
  12. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +217 -0
  13. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts +16 -0
  14. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -0
  15. package/lib/exercises/math/calcul/ordering/compareA10N.js +327 -0
  16. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts +8 -0
  17. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -0
  18. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +221 -0
  19. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +9 -0
  20. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -0
  21. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +135 -0
  22. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +29 -0
  23. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -0
  24. package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +367 -0
  25. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts +12 -0
  26. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts.map +1 -0
  27. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.js +164 -0
  28. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts +9 -0
  29. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -0
  30. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +140 -0
  31. package/lib/exercises/math/calcul/ordering/index.d.ts +6 -0
  32. package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/ordering/index.js +6 -0
  34. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts +9 -0
  35. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -0
  36. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +84 -0
  37. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts +8 -0
  38. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -0
  39. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +90 -0
  40. package/lib/exercises/math/calcul/rounding/index.d.ts +2 -0
  41. package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
  42. package/lib/exercises/math/calcul/rounding/index.js +2 -0
  43. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts +13 -0
  44. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -0
  45. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +414 -0
  46. package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
  47. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  48. package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
  49. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts +10 -0
  50. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts.map +1 -0
  51. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.js +70 -0
  52. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
  53. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  54. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
  55. package/lib/exercises/math/calculLitteral/index.d.ts +2 -0
  56. package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
  57. package/lib/exercises/math/calculLitteral/index.js +2 -0
  58. package/lib/exercises/math/calculLitteral/isolate/index.d.ts +2 -1
  59. package/lib/exercises/math/calculLitteral/isolate/index.d.ts.map +1 -1
  60. package/lib/exercises/math/calculLitteral/isolate/index.js +2 -1
  61. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts +8 -0
  62. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
  63. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +107 -0
  64. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts +7 -0
  65. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
  66. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.js +80 -0
  67. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts +10 -0
  68. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -0
  69. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +182 -0
  70. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts +9 -0
  71. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -0
  72. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +144 -0
  73. package/lib/exercises/math/calculLitteral/ordering/index.d.ts +3 -0
  74. package/lib/exercises/math/calculLitteral/ordering/index.d.ts.map +1 -0
  75. package/lib/exercises/math/calculLitteral/ordering/index.js +2 -0
  76. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts +11 -0
  77. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -0
  78. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +120 -0
  79. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts +8 -0
  80. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts.map +1 -0
  81. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.js +67 -0
  82. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts +11 -0
  83. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts.map +1 -0
  84. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.js +114 -0
  85. package/lib/exercises/math/calculLitteral/simplifying/index.d.ts +5 -0
  86. package/lib/exercises/math/calculLitteral/simplifying/index.d.ts.map +1 -1
  87. package/lib/exercises/math/calculLitteral/simplifying/index.js +5 -0
  88. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts +13 -0
  89. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts.map +1 -0
  90. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.js +125 -0
  91. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts +14 -0
  92. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts.map +1 -0
  93. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.js +148 -0
  94. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +5 -27
  95. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
  96. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +178 -241
  97. package/lib/exercises/math/conversion/index.d.ts +4 -0
  98. package/lib/exercises/math/conversion/index.d.ts.map +1 -1
  99. package/lib/exercises/math/conversion/index.js +4 -0
  100. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +8 -0
  101. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -0
  102. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +98 -0
  103. package/lib/exercises/math/conversion/minutesToHours.d.ts +10 -0
  104. package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -0
  105. package/lib/exercises/math/conversion/minutesToHours.js +150 -0
  106. package/lib/exercises/math/conversion/prefixToNumber.d.ts +15 -0
  107. package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -0
  108. package/lib/exercises/math/conversion/prefixToNumber.js +233 -0
  109. package/lib/exercises/math/conversion/secondsToHours.d.ts +10 -0
  110. package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -0
  111. package/lib/exercises/math/conversion/secondsToHours.js +150 -0
  112. package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
  113. package/lib/exercises/math/conversion/volumeConversion.js +7 -1
  114. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +50 -0
  115. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -0
  116. package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +517 -0
  117. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts +7 -0
  118. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts.map +1 -0
  119. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.js +223 -0
  120. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts +10 -0
  121. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -0
  122. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +139 -0
  123. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts +8 -0
  124. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -0
  125. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +133 -0
  126. package/lib/exercises/math/dataRepresentations/graphReading.d.ts +8 -0
  127. package/lib/exercises/math/dataRepresentations/graphReading.d.ts.map +1 -0
  128. package/lib/exercises/math/dataRepresentations/graphReading.js +136 -0
  129. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts +18 -0
  130. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -0
  131. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +228 -0
  132. package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts +8 -0
  133. package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts.map +1 -0
  134. package/lib/exercises/math/dataRepresentations/halfPieChartReading.js +213 -0
  135. package/lib/exercises/math/dataRepresentations/histogramReading.d.ts +9 -0
  136. package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -0
  137. package/lib/exercises/math/dataRepresentations/histogramReading.js +163 -0
  138. package/lib/exercises/math/dataRepresentations/index.d.ts +10 -0
  139. package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
  140. package/lib/exercises/math/dataRepresentations/index.js +10 -0
  141. package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts +9 -0
  142. package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -0
  143. package/lib/exercises/math/dataRepresentations/plausibleGraph.js +145 -0
  144. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts +9 -0
  145. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts.map +1 -0
  146. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.js +308 -0
  147. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
  148. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +10 -5
  149. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts +8 -0
  150. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -0
  151. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +103 -0
  152. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts +8 -0
  153. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -0
  154. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +100 -0
  155. package/lib/exercises/math/functions/affines/drawAffineFromLitExp.js +5 -5
  156. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts +16 -0
  157. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -0
  158. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +215 -0
  159. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts +13 -0
  160. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -0
  161. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +206 -0
  162. package/lib/exercises/math/functions/affines/index.d.ts +7 -0
  163. package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
  164. package/lib/exercises/math/functions/affines/index.js +7 -0
  165. package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts +20 -0
  166. package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts.map +1 -0
  167. package/lib/exercises/math/functions/affines/recognizeExprAffine.js +284 -0
  168. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +13 -0
  169. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -0
  170. package/lib/exercises/math/functions/affines/representationOfAffine.js +184 -0
  171. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts +14 -0
  172. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -0
  173. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +216 -0
  174. package/lib/exercises/math/functions/basics/findZeroesProductQuotient.d.ts.map +1 -1
  175. package/lib/exercises/math/functions/basics/findZeroesProductQuotient.js +29 -2
  176. package/lib/exercises/math/functions/basics/index.d.ts +1 -0
  177. package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
  178. package/lib/exercises/math/functions/basics/index.js +1 -0
  179. package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
  180. package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +72 -61
  181. package/lib/exercises/math/functions/composition/functionComposition.d.ts +8 -0
  182. package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -0
  183. package/lib/exercises/math/functions/composition/functionComposition.js +238 -0
  184. package/lib/exercises/math/functions/composition/index.d.ts +2 -0
  185. package/lib/exercises/math/functions/composition/index.d.ts.map +1 -0
  186. package/lib/exercises/math/functions/composition/index.js +1 -0
  187. package/lib/exercises/math/functions/index.d.ts +1 -0
  188. package/lib/exercises/math/functions/index.d.ts.map +1 -1
  189. package/lib/exercises/math/functions/index.js +1 -0
  190. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
  191. package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +41 -16
  192. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
  193. package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +3 -2
  194. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts +1 -0
  195. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -1
  196. package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +21 -13
  197. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts +23 -0
  198. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -0
  199. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +448 -0
  200. package/lib/exercises/math/geometry/angles/index.js +2 -0
  201. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts +23 -0
  202. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts.map +1 -0
  203. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.js +402 -0
  204. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +9 -6
  205. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
  206. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +140 -60
  207. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +1 -1
  208. package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
  209. package/lib/exercises/math/geometry/perimeters/circleCircumference.js +15 -7
  210. package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
  211. package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +5 -3
  212. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
  213. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +121 -104
  214. package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -1
  215. package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +3 -2
  216. package/lib/exercises/math/percent/evolutions/evolutionToCM.js +2 -2
  217. package/lib/exercises/math/percent/findProportion.d.ts +6 -1
  218. package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
  219. package/lib/exercises/math/percent/findProportion.js +162 -45
  220. package/lib/exercises/math/powers/calculateNegativePower.d.ts +5 -1
  221. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  222. package/lib/exercises/math/powers/calculateNegativePower.js +93 -29
  223. package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
  224. package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
  225. package/lib/exercises/math/probaStat/basicProbas/index.js +1 -0
  226. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts +0 -1
  227. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
  228. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +42 -80
  229. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts +9 -0
  230. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -0
  231. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +217 -0
  232. package/lib/exercises/math/probaStat/index.d.ts +2 -0
  233. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  234. package/lib/exercises/math/probaStat/index.js +2 -0
  235. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +30 -0
  236. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -0
  237. package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +548 -0
  238. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  239. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +10 -2
  240. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  241. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +2 -1
  242. package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
  243. package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
  244. package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
  245. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts +9 -0
  246. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -0
  247. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +90 -0
  248. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts +10 -0
  249. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -0
  250. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +151 -0
  251. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts +4 -1
  252. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  253. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +46 -27
  254. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
  255. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +14 -2
  256. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts +1 -0
  257. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
  258. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +43 -19
  259. package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -1
  260. package/lib/exercises/math/sequences/sequenceEvaluation.js +18 -1
  261. package/lib/exercises/pc/chemicalReactions/chemicalEquations.d.ts.map +1 -1
  262. package/lib/exercises/pc/chemicalReactions/chemicalEquations.js +17 -2
  263. package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts +7 -0
  264. package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts.map +1 -0
  265. package/lib/exercises/pc/electricity/calculateUEqualsRI.js +73 -0
  266. package/lib/exercises/pc/electricity/index.d.ts +1 -0
  267. package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
  268. package/lib/exercises/pc/electricity/index.js +1 -0
  269. package/lib/exercises/pc/index.d.ts +1 -0
  270. package/lib/exercises/pc/index.d.ts.map +1 -1
  271. package/lib/exercises/pc/index.js +1 -0
  272. package/lib/exercises/pc/mole/molarMass.d.ts.map +1 -1
  273. package/lib/exercises/pc/mole/molarMass.js +7 -1
  274. package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
  275. package/lib/exercises/pc/moleculeFormula.js +4 -3
  276. package/lib/exercises/pc/motion/averageSpeed.d.ts +9 -4
  277. package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
  278. package/lib/exercises/pc/motion/averageSpeed.js +132 -61
  279. package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -1
  280. package/lib/exercises/pc/motion/averageSpeedCalculation.js +10 -4
  281. package/lib/exercises/pc/optics/index.d.ts +2 -0
  282. package/lib/exercises/pc/optics/index.d.ts.map +1 -0
  283. package/lib/exercises/pc/optics/index.js +1 -0
  284. package/lib/exercises/pc/optics/lensFormula.d.ts +21 -0
  285. package/lib/exercises/pc/optics/lensFormula.d.ts.map +1 -0
  286. package/lib/exercises/pc/optics/lensFormula.js +415 -0
  287. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +2 -2
  288. package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +15 -15
  289. package/lib/exercises/pc/weight/calculateWeight.d.ts +8 -1
  290. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
  291. package/lib/exercises/pc/weight/calculateWeight.js +113 -38
  292. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
  293. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  294. package/lib/exercises/utils/geogebra/toolBarConstructor.js +3 -1
  295. package/lib/geogebra/parsers/geogebraParser.d.ts +4 -0
  296. package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
  297. package/lib/geogebra/parsers/geogebraParser.js +17 -0
  298. package/lib/index.d.ts +392 -23
  299. package/lib/index.d.ts.map +1 -1
  300. package/lib/latexTester.d.ts.map +1 -1
  301. package/lib/latexTester.js +1 -0
  302. package/lib/math/geometry/CloudPoints.d.ts +10 -0
  303. package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
  304. package/lib/math/geometry/CloudPoints.js +119 -0
  305. package/lib/math/geometry/line.d.ts +1 -0
  306. package/lib/math/geometry/line.d.ts.map +1 -1
  307. package/lib/math/geometry/line.js +10 -2
  308. package/lib/math/geometry/vector.d.ts +1 -0
  309. package/lib/math/geometry/vector.d.ts.map +1 -1
  310. package/lib/math/geometry/vector.js +12 -0
  311. package/lib/math/progCalc/progCalc.d.ts +46 -0
  312. package/lib/math/progCalc/progCalc.d.ts.map +1 -0
  313. package/lib/math/progCalc/progCalc.js +239 -0
  314. package/lib/math/utils/latex/realize.d.ts +12 -0
  315. package/lib/math/utils/latex/realize.d.ts.map +1 -0
  316. package/lib/math/utils/latex/realize.js +43 -0
  317. package/lib/pc/constants/molecularChemistry/molecule.d.ts +2 -0
  318. package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -1
  319. package/lib/pc/constants/molecularChemistry/molecule.js +52 -0
  320. package/lib/pc/units/timeUnits.d.ts +5 -3
  321. package/lib/pc/units/timeUnits.d.ts.map +1 -1
  322. package/lib/pc/units/timeUnits.js +25 -19
  323. package/lib/tests/questionTest.d.ts.map +1 -1
  324. package/lib/tests/questionTest.js +1 -1
  325. package/lib/tests/singleExo.test.js +3 -3
  326. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  327. package/lib/tree/nodes/operators/addNode.d.ts +4 -2
  328. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  329. package/lib/tree/nodes/operators/addNode.js +8 -17
  330. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  331. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  332. package/lib/tree/nodes/operators/fractionNode.js +5 -1
  333. package/lib/tree/nodes/operators/multiplyNode.d.ts +4 -2
  334. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  335. package/lib/tree/nodes/operators/multiplyNode.js +8 -17
  336. package/lib/tree/nodes/operators/operatorNode.d.ts +3 -3
  337. package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
  338. package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
  339. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  340. package/lib/tree/utilities/nodeShuffler.d.ts +12 -0
  341. package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -0
  342. package/lib/tree/utilities/nodeShuffler.js +123 -0
  343. package/lib/utils/arrays/getAllPicks.d.ts +2 -0
  344. package/lib/utils/arrays/getAllPicks.d.ts.map +1 -0
  345. package/lib/utils/arrays/getAllPicks.js +17 -0
  346. package/lib/utils/errors/handleVEAError.d.ts +1 -1
  347. package/lib/utils/errors/handleVEAError.d.ts.map +1 -1
  348. package/lib/utils/strings/decapitalize.d.ts +2 -0
  349. package/lib/utils/strings/decapitalize.d.ts.map +1 -0
  350. package/lib/utils/strings/decapitalize.js +3 -0
  351. package/package.json +1 -1
@@ -0,0 +1,448 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
+ import { Angle } from "../../../../math/geometry/angle.js";
5
+ import { Line, LineConstructor, } from "../../../../math/geometry/line.js";
6
+ import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
7
+ import { Vector } from "../../../../math/geometry/vector.js";
8
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
9
+ import { round } from "../../../../math/utils/round.js";
10
+ import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
11
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
12
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
13
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
14
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
15
+ import { random } from "../../../../utils/alea/random.js";
16
+ const createVector = (from, to, name, precision = 5) => {
17
+ return new Vector(name, round(substract(to.x, from.x).evaluate(), precision).toTree(), round(substract(to.y, from.y).evaluate(), precision).toTree());
18
+ };
19
+ const createPoint = (x, y, name, precision = 5) => {
20
+ return new Point(name, round(x, precision), round(y, precision));
21
+ };
22
+ const midPoint = (pointA, pointB, name, precision = 2) => {
23
+ return createPoint(multiply(add(pointA.x, pointB.x), 0.5).evaluate(), multiply(add(pointA.y, pointB.y), 0.5).evaluate(), name, precision);
24
+ };
25
+ const degreesToRadians = (angleInDegrees, precision) => {
26
+ const oneOver180 = 0.00555555555555555;
27
+ return round(multiply(multiply(angleInDegrees, PiNode), oneOver180).evaluate(), precision);
28
+ };
29
+ const rotatePoint = (target, angle, center, name, precision = 2) => {
30
+ const vSrc = createVector(center, target, "vSrc", precision);
31
+ const vRotated = vSrc.rotate(angle, "vRotated");
32
+ return createPoint(add(center.x, vRotated.x).evaluate(), add(center.y, vRotated.y).evaluate(), name, precision);
33
+ };
34
+ const buildLines = (cAngleInDegreesTop, cAngleInDegreesBottom) => {
35
+ //we build the quasiparallels using corresponding angles
36
+ /*
37
+ cAngleTop/
38
+ topLine------------------------
39
+ /
40
+ /
41
+ cAngleBottom/
42
+ bottomLine----------------------
43
+ /
44
+ */
45
+ const precision = 5;
46
+ const [cAngleTop, cAngleBottom] = [
47
+ cAngleInDegreesTop,
48
+ cAngleInDegreesBottom,
49
+ ].map((angleInDegrees) => degreesToRadians(angleInDegrees, precision));
50
+ //build top line
51
+ const heightAvgTopLine = 2;
52
+ const lineTop = new Line(new Point("A", (-4 + randfloat(-1, 1, 1)).toTree(), (heightAvgTopLine + randfloat(-1, 1, 1)).toTree()), new Point("B", (4 + randfloat(-1, 1, 1)).toTree(), (heightAvgTopLine + randfloat(-1, 1, 1)).toTree()), "d_1");
53
+ //build secant line
54
+ const pointSTop = midPoint(lineTop.pointA, lineTop.pointB, "C", 5);
55
+ const lineSecant = new Line(pointSTop, rotatePoint(lineTop.pointA, PiNode.value - cAngleTop, pointSTop, "D", 5), "s");
56
+ //build bottom line
57
+ const lineBottom = new Line(lineSecant.pointB, rotatePoint(lineSecant.pointA, cAngleBottom, lineSecant.pointB, "E", 5), "d_2");
58
+ return {
59
+ lineTop,
60
+ lineSecant,
61
+ lineBottom,
62
+ };
63
+ };
64
+ class IntersectionConstructor {
65
+ static fromBaselines(pointName, lineHBase, lineVBase) {
66
+ const center = lineHBase.intersect(lineVBase, pointName);
67
+ const lineH = Intersection.createLineBothSideOfPoint(lineHBase, center, lineVBase, "x");
68
+ const lineV = Intersection.createLineBothSideOfPoint(lineVBase, center, lineHBase, "y");
69
+ return new Intersection(center, lineH, lineV);
70
+ }
71
+ static fromIdentifiers(intersectionIds) {
72
+ const center = PointConstructor.fromIdentifiers(intersectionIds.center);
73
+ const lineH = LineConstructor.fromIdentifiers(intersectionIds.lineH);
74
+ const lineV = LineConstructor.fromIdentifiers(intersectionIds.lineV);
75
+ return new Intersection(center, lineH, lineV);
76
+ }
77
+ static byRotatingIntersection(intersectionSrc, rotationCenter, rotationAngle, precision = 5) {
78
+ const arrPointSrc = [
79
+ intersectionSrc.center,
80
+ intersectionSrc.lineH.pointA,
81
+ intersectionSrc.lineH.pointB,
82
+ intersectionSrc.lineV.pointA,
83
+ intersectionSrc.lineV.pointB,
84
+ ];
85
+ const arrPointRotated = arrPointSrc.map((p) => {
86
+ return rotatePoint(p, rotationAngle, rotationCenter, p.name, precision);
87
+ });
88
+ return new Intersection(arrPointRotated[0], new Line(arrPointRotated[1], arrPointRotated[2], intersectionSrc.lineH.name), new Line(arrPointRotated[3], arrPointRotated[4], intersectionSrc.lineV.name));
89
+ }
90
+ }
91
+ class Intersection {
92
+ center;
93
+ lineH;
94
+ lineV;
95
+ constructor(center, lineH, lineV) {
96
+ this.center = center;
97
+ this.lineH = lineH;
98
+ this.lineV = lineV;
99
+ }
100
+ static createLineBothSideOfPoint(lineBase, pointCenter, lineIntersector, wrtAxis) {
101
+ switch (wrtAxis) {
102
+ case "x":
103
+ return new Line(lineBase.intersect(lineIntersector.translate(-1, 0), pointCenter.name + "_xm"), lineBase.intersect(lineIntersector.translate(+1, 0), pointCenter.name + "_xM"), lineBase.name);
104
+ case "y":
105
+ return new Line(lineBase.intersect(lineIntersector.translate(0, -1), pointCenter.name + "_ym"), lineBase.intersect(lineIntersector.translate(0, +1), pointCenter.name + "_yM"), lineBase.name);
106
+ }
107
+ }
108
+ getAngle(angleIndex) {
109
+ /*
110
+ lineV.pointB
111
+ 0 | 1
112
+ lineH.pointA--center--lineH.pointB
113
+ 3 | 2
114
+ lineV.pointA
115
+ */
116
+ switch ((angleIndex % 4)) {
117
+ case 0:
118
+ return new Angle([this.lineH.pointA, this.center, this.lineV.pointB]);
119
+ case 1:
120
+ return new Angle([this.lineV.pointB, this.center, this.lineH.pointB]);
121
+ case 2:
122
+ return new Angle([this.lineH.pointB, this.center, this.lineV.pointA]);
123
+ case 3:
124
+ return new Angle([this.lineV.pointA, this.center, this.lineH.pointA]);
125
+ }
126
+ }
127
+ toIdentifiers() {
128
+ return {
129
+ center: this.center.toIdentifiers(),
130
+ lineH: this.lineH.toIdentifiers(),
131
+ lineV: this.lineV.toIdentifiers(),
132
+ };
133
+ }
134
+ }
135
+ const getUsedAngles = (identifiers) => {
136
+ const { arrAngleForLabel } = identifiers;
137
+ const arrNodeFakeDisplay = arrAngleForLabel?.map((value) => value.toTree());
138
+ return arrNodeFakeDisplay ?? getGeomAngles(identifiers);
139
+ };
140
+ const getGeomAngles = (identifiers) => {
141
+ const { arrAngleIndex, arrIntersectionIds } = identifiers;
142
+ return arrIntersectionIds
143
+ .map(IntersectionConstructor.fromIdentifiers)
144
+ .map((inter, i) => inter.getAngle(arrAngleIndex[i]).getValueNode(true));
145
+ };
146
+ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
147
+ const opts = optsIn ?? optsDefault;
148
+ const propositions = [];
149
+ addValidProp(propositions, answer, "tex");
150
+ const arrAngleUsed = getUsedAngles(identifiers);
151
+ tryToAddWrongProp(propositions, arrAngleUsed[0].toTex(), "tex");
152
+ tryToAddWrongProp(propositions, substract(180, arrAngleUsed[0]).toTex(), "tex");
153
+ const arrAngleGeom = getGeomAngles(identifiers);
154
+ //l'élève fait une mesure sur la figure
155
+ tryToAddWrongProp(propositions, round(arrAngleGeom[1].evaluate(), opts.nbDigits).frenchify(), "tex");
156
+ tryToAddWrongProp(propositions, "\\text{On ne peut pas savoir.}", "tex");
157
+ return shuffleProps(propositions, n);
158
+ };
159
+ const getAnswer = (identifiers) => {
160
+ return !identifiers.isParallel
161
+ ? "\\text{On ne peut pas savoir.}"
162
+ : getUsedAngles(identifiers)[1].toTex();
163
+ };
164
+ const getInstruction = (identifiers) => {
165
+ const { isParallel } = identifiers;
166
+ return `Les droites $d_{1}$ et $d_{2}$ ${isParallel ? "sont" : "ne sont pas"} parallèles.
167
+ Déterminer, si c'est possible, la mesure de l’angle cherché.`;
168
+ };
169
+ const getHint = () => {
170
+ return `Trouve la relation entre les deux angles et déduis-en, si c'est possible, la mesure de l'angle cherché.`;
171
+ };
172
+ const getCorrection = (identifiers) => {
173
+ const { isParallel, angleType } = identifiers;
174
+ return `Les deux angles sont ${(() => {
175
+ switch (angleType) {
176
+ case "alternes-internes":
177
+ return `alternes-internes`;
178
+ case "correspondants":
179
+ return `correspondants`;
180
+ break;
181
+ case "alternes-externes":
182
+ return `alternes-externes`;
183
+ case "autres":
184
+ return "tels que l'un repose sur l'intersection de la sécante avec $d_1$ et l'autre repose sur l'intersection de la sécante avec $d_2$";
185
+ }
186
+ })()}.
187
+ ${(() => {
188
+ if (!isParallel) {
189
+ return `Malheureusement, les droites $d_{1}$ et $d_{2}$ ne sont pas parallèles. On ne peut donc rien conclure.`;
190
+ }
191
+ else if (angleType !== "autres") {
192
+ return `Puisque les droites $d_{1}$ et $d_{2}$ sont parallèles,
193
+ ils ont la même mesure donc la mesure de l'angle cherché est $${getUsedAngles(identifiers)[1].toTex()}$°.`;
194
+ }
195
+ else {
196
+ return `Puisque les droites $d_{1}$ et $d_{2}$ sont parallèles,
197
+ on peut retrouver toutes les mesures des angles des deux intersections.
198
+ La mesure de l'angle cherché est $${getUsedAngles(identifiers)[1].toTex()}$°.`;
199
+ }
200
+ })()}`;
201
+ };
202
+ const getGGBOptions = (identifiers, opts) => {
203
+ const { isParallel, arrIntersectionIds, arrAngleIndex, arrAngleForLabel } = identifiers;
204
+ const nbDigits = opts?.nbDigits ?? 1;
205
+ const arrIntersection = arrIntersectionIds.map(IntersectionConstructor.fromIdentifiers);
206
+ const arrAngle = arrAngleIndex.map((angleIndex, i) => arrIntersection[i].getAngle(angleIndex));
207
+ const arrCommandPoints = arrAngle
208
+ .flatMap((a) => a.points)
209
+ .flatMap((p) => [
210
+ ...p.toGGBCommand({
211
+ isFixed: true,
212
+ showLabel: false,
213
+ showUnderlyingPoints: false,
214
+ showUnderlyingPointsLabel: false,
215
+ }),
216
+ //hide points
217
+ `SetVisibleInView(${p.name}, 1, false)`,
218
+ ]);
219
+ const arrCommandLines = [
220
+ arrIntersectionIds[0].lineH, //top
221
+ arrIntersectionIds[1].lineH, //bottom
222
+ arrIntersectionIds[0].lineV, //secant
223
+ ]
224
+ .map((lIds) => LineConstructor.fromIdentifiers(lIds))
225
+ .flatMap((l, i) => l.toGGBCommands(false, {
226
+ color: "black",
227
+ showLabel: i < 2,
228
+ }));
229
+ const arrCommandAngles = arrAngle
230
+ .map((angle, i) => {
231
+ angle.name = `angle_${i}`;
232
+ return angle;
233
+ })
234
+ .flatMap((a, i) => [
235
+ ...a.toCommands({
236
+ pointsAreNotBuilt: false,
237
+ color: ["red", "blue"][i],
238
+ showValue: false,
239
+ }),
240
+ //fake or real label
241
+ `ShowLabel(${a.name}, false)`,
242
+ ...a.getFitCaptionCommands({
243
+ text: [
244
+ round(arrAngleForLabel ? arrAngleForLabel[i] : a.evaluate(), nbDigits).frenchify(),
245
+ "?",
246
+ ][i],
247
+ size: "small",
248
+ color: ["red", "blue"][i],
249
+ }),
250
+ ]);
251
+ const arrCommandOther = [
252
+ `lb_parallel = Text("\\tex$d_1$${isParallel ? "∥" : "∦"}$d_2$", (${-4.5},${-3.1}), false, true, -1, -1)`,
253
+ ];
254
+ const ggb = new GeogebraConstructor({
255
+ commands: [
256
+ ...arrCommandPoints,
257
+ ...arrCommandLines,
258
+ ...arrCommandAngles,
259
+ ...arrCommandOther,
260
+ ],
261
+ hideAxes: true,
262
+ hideGrid: true,
263
+ forbidShiftDragZoom: true,
264
+ });
265
+ return ggb.getOptions({
266
+ coords: [-5, 5, -5, 5],
267
+ });
268
+ };
269
+ const getKeys = () => {
270
+ return [
271
+ {
272
+ id: "custom",
273
+ label: "On ne peut pas savoir.",
274
+ labelType: "raw",
275
+ mathfieldInstructions: {
276
+ method: "write",
277
+ content: "\\text{On ne peut pas savoir.}",
278
+ },
279
+ },
280
+ ];
281
+ };
282
+ const isAnswerValid = (ans, { answer }) => {
283
+ return ans === answer;
284
+ };
285
+ const optsDefault = {
286
+ angleTypes: ["alternes-internes"],
287
+ isFakeDisplay: true,
288
+ nbDigits: 0,
289
+ };
290
+ const options = [
291
+ {
292
+ id: "angleTypes",
293
+ label: "Type d'angles",
294
+ target: GeneratorOptionTarget.generation,
295
+ type: GeneratorOptionType.multiselect,
296
+ values: [
297
+ "alternes-internes",
298
+ "correspondants",
299
+ "alternes-externes",
300
+ "autres",
301
+ ],
302
+ defaultValue: optsDefault.angleTypes,
303
+ },
304
+ {
305
+ id: "isFakeDisplay",
306
+ label: "Affichage trompeur",
307
+ target: GeneratorOptionTarget.generation,
308
+ type: GeneratorOptionType.checkbox,
309
+ defaultValue: optsDefault.isFakeDisplay,
310
+ },
311
+ {
312
+ id: "nbDigits",
313
+ label: "Nombre de décimales",
314
+ target: GeneratorOptionTarget.generation,
315
+ type: GeneratorOptionType.select,
316
+ values: [0, 1, 2],
317
+ defaultValue: optsDefault.nbDigits,
318
+ },
319
+ ];
320
+ const getAnglesUsingIsParallelQuestion = (optsIn) => {
321
+ const isParallel = coinFlip();
322
+ const opts = optsIn ?? optsDefault;
323
+ //---create intersections---
324
+ //this config will be used to create ggb lines
325
+ function createConfigGeom(isParallelInGeom, isLookingParallel) {
326
+ const deviation = isLookingParallel ? 1 : 5;
327
+ const cAngleInDegreesMin = 30;
328
+ const cAngleInDegreesTop = randfloat(cAngleInDegreesMin, 180 - cAngleInDegreesMin, opts.nbDigits);
329
+ const cAngleInDegreesBottom = isParallelInGeom
330
+ ? cAngleInDegreesTop
331
+ : cAngleInDegreesTop +
332
+ randfloat(-deviation, deviation, opts.nbDigits, [0]);
333
+ return {
334
+ cAngleInDegreesTop,
335
+ cAngleInDegreesBottom,
336
+ };
337
+ }
338
+ const configGeom = createConfigGeom(opts.isFakeDisplay ? coinFlip() : isParallel, opts.isFakeDisplay ? coinFlip() : isParallel);
339
+ const dictLine = buildLines(configGeom.cAngleInDegreesTop, configGeom.cAngleInDegreesBottom);
340
+ const arrIntersectionRaw = [
341
+ //intersection: top
342
+ IntersectionConstructor.fromBaselines("I", dictLine.lineTop, dictLine.lineSecant),
343
+ //intersection: bottom
344
+ IntersectionConstructor.fromBaselines("J", dictLine.lineBottom, dictLine.lineSecant),
345
+ ];
346
+ //rotate randomly around center
347
+ const rotationCenter = midPoint(arrIntersectionRaw[0].center, arrIntersectionRaw[1].center, "K", 5);
348
+ const rotationAngle = randfloat(-PiNode.value, PiNode.value);
349
+ const arrIntersection = arrIntersectionRaw.map((intersection) => IntersectionConstructor.byRotatingIntersection(intersection, rotationCenter, rotationAngle));
350
+ //---create angles---
351
+ const angleType = random(opts.angleTypes);
352
+ function randomArrAngleIndex(angleType) {
353
+ /*
354
+ 0 | 1
355
+ -----
356
+ 3 | 2
357
+ |
358
+ 0 | 1
359
+ -----
360
+ 3 | 2
361
+ */
362
+ switch (angleType) {
363
+ case "alternes-internes":
364
+ return random([
365
+ [2, 0],
366
+ [3, 1],
367
+ ]);
368
+ case "correspondants":
369
+ return random([
370
+ [0, 0],
371
+ [1, 1],
372
+ [2, 2],
373
+ [3, 3],
374
+ ]);
375
+ case "alternes-externes":
376
+ return random([
377
+ [0, 2],
378
+ [1, 3],
379
+ ]);
380
+ case "autres":
381
+ return random([
382
+ [0, 1],
383
+ [0, 3],
384
+ [1, 2],
385
+ [1, 0],
386
+ [2, 1],
387
+ [2, 3],
388
+ [3, 0],
389
+ [3, 2],
390
+ ]);
391
+ }
392
+ }
393
+ const arrAngleIndex = randomArrAngleIndex(angleType);
394
+ //this is the fake display part:
395
+ let arrAngleForLabel;
396
+ if (opts.isFakeDisplay) {
397
+ const angleInDegreesMin = 25;
398
+ const cAngleInDegreesTop = round(randfloat(angleInDegreesMin, 180 - angleInDegreesMin, opts.nbDigits), opts.nbDigits);
399
+ const cAngleInDegreesBottom = isParallel
400
+ ? cAngleInDegreesTop
401
+ : round(cAngleInDegreesTop + randfloat(-25, 50, opts.nbDigits, [0]), opts.nbDigits);
402
+ //angles at angleIndexes 0 and 2 have same value. Same for angleIndexes 1 and 3.
403
+ arrAngleForLabel = [cAngleInDegreesTop, cAngleInDegreesBottom].map((angle, i) => {
404
+ return arrAngleIndex[i] % 2 == 0
405
+ ? angle
406
+ : round(180 - angle, opts.nbDigits);
407
+ });
408
+ }
409
+ const identifiers = {
410
+ isParallel,
411
+ arrIntersectionIds: arrIntersection.map((intersection) => intersection.toIdentifiers()),
412
+ angleType,
413
+ arrAngleIndex,
414
+ arrAngleForLabel,
415
+ };
416
+ return getQuestionFromIdentifiers(identifiers, opts);
417
+ };
418
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
419
+ const question = {
420
+ answer: getAnswer(identifiers),
421
+ instruction: getInstruction(identifiers),
422
+ keys: getKeys(identifiers),
423
+ answerFormat: "tex",
424
+ identifiers,
425
+ hint: getHint(identifiers),
426
+ correction: getCorrection(identifiers),
427
+ ggbOptions: getGGBOptions(identifiers, opts),
428
+ };
429
+ return question;
430
+ };
431
+ export const anglesUsingIsParallel = {
432
+ id: "anglesUsingIsParallel",
433
+ label: "Déterminer un angle issu d'une sécante en utilisant le parallélisme",
434
+ isSingleStep: true,
435
+ generator: (nb, opts) => getDistinctQuestions(() => getAnglesUsingIsParallelQuestion(opts), nb),
436
+ options,
437
+ qcmTimer: 60,
438
+ freeTimer: 60,
439
+ getPropositions,
440
+ isAnswerValid,
441
+ subject: "Mathématiques",
442
+ getHint,
443
+ getCorrection,
444
+ hasHintAndCorrection: true,
445
+ answerType: "QCU",
446
+ getQuestionFromIdentifiers,
447
+ hasGeogebra: true,
448
+ };
@@ -1,2 +1,4 @@
1
1
  export * from "./recognizeAngleType.js";
2
2
  export * from "./parallelogramFourthAngle.js";
3
+ //export * from "./isParallelUsingAngles.js";
4
+ // export * from "./anglesUsingIsParallel.js";
@@ -0,0 +1,23 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { LineIdentifiers } from "../../../../math/geometry/line.js";
3
+ import { PointIdentifiers } from "../../../../math/geometry/point.js";
4
+ type IntersectionIds = {
5
+ center: PointIdentifiers;
6
+ lineH: LineIdentifiers;
7
+ lineV: LineIdentifiers;
8
+ };
9
+ type Identifiers = {
10
+ isParralel: boolean;
11
+ angleType: "alternes-internes" | "correspondants" | "alternes-externes" | "autres";
12
+ arrIntersectionIds: IntersectionIds[];
13
+ arrAngleIndex: number[];
14
+ arrAngleForLabel: number[] | undefined;
15
+ };
16
+ type Options = {
17
+ angleTypes: ("alternes-internes" | "correspondants" | "alternes-externes" | "autres")[];
18
+ isFakeDisplay: boolean;
19
+ nbDigits: 0 | 1 | 2;
20
+ };
21
+ export declare const isParallelUsingAngles: Exercise<Identifiers, Options>;
22
+ export {};
23
+ //# sourceMappingURL=isParallelUsingAngles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isParallelUsingAngles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/isParallelUsingAngles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAuItC,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AA6HF,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EACL,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CAAC;IAGb,kBAAkB,EAAE,eAAe,EAAE,CAAC;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IAGxB,gBAAgB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACxC,CAAC;AAuIF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,CACR,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CACX,EAAE,CAAC;IACJ,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACrB,CAAC;AAuNF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBhE,CAAC"}