math-exercises 3.0.126 → 3.0.128

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 (221) hide show
  1. package/lib/exercises/math/calcul/arithmetics/isMultipleOrDivisor.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/arithmetics/isMultipleOrDivisor.js +0 -10
  3. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +1 -1
  4. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +66 -42
  6. package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
  7. package/lib/exercises/math/calcul/operations/expressionNature.js +0 -4
  8. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -1
  9. package/lib/exercises/math/calcul/ordering/compareA10N.js +0 -1
  10. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -1
  11. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +6 -105
  12. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -1
  13. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +22 -9
  14. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -1
  15. package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +7 -7
  16. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -1
  17. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +23 -14
  18. package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -1
  19. package/lib/exercises/math/calcul/ordering/decimalOrdering.js +0 -4
  20. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.d.ts.map +1 -1
  21. package/lib/exercises/math/calcul/ordering/decimalOrderingNoRelatives.js +0 -4
  22. package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -1
  23. package/lib/exercises/math/calcul/ordering/integerOrdering.js +0 -4
  24. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
  25. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +0 -1
  26. package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -1
  27. package/lib/exercises/math/calcul/proportionality/isTableProportional.js +0 -4
  28. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
  29. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +0 -4
  30. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -1
  31. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +0 -1
  32. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +0 -1
  34. package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.d.ts.map +1 -1
  35. package/lib/exercises/math/calcul/rounding/getPhysicalOrderOfMagnitude.js +28 -14
  36. package/lib/exercises/math/calcul/sign/signFromAx.d.ts.map +1 -1
  37. package/lib/exercises/math/calcul/sign/signFromAx.js +0 -10
  38. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -1
  39. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +63 -24
  40. package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.d.ts.map +1 -1
  41. package/lib/exercises/math/calculLitteral/inequations/isInequalityTrue.js +0 -10
  42. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -1
  43. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +6 -27
  44. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -1
  45. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +41 -39
  46. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -1
  47. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +1 -2
  48. package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.d.ts.map +1 -1
  49. package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.js +0 -10
  50. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
  51. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +68 -23
  52. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +4 -1
  53. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -1
  54. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +52 -35
  55. package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -1
  56. package/lib/exercises/math/conversion/minutesToHours.js +0 -1
  57. package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -1
  58. package/lib/exercises/math/conversion/prefixToNumber.js +14 -4
  59. package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -1
  60. package/lib/exercises/math/conversion/secondsToHours.js +1 -2
  61. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +5 -2
  62. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -1
  63. package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +47 -31
  64. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -1
  65. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +5 -4
  66. package/lib/exercises/math/dataRepresentations/compareBoxPlot.d.ts.map +1 -1
  67. package/lib/exercises/math/dataRepresentations/compareBoxPlot.js +0 -1
  68. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +4 -4
  69. package/lib/exercises/math/dataRepresentations/graphReading.js +13 -13
  70. package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -1
  71. package/lib/exercises/math/dataRepresentations/histogramReading.js +32 -32
  72. package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -1
  73. package/lib/exercises/math/dataRepresentations/plausibleGraph.js +53 -4
  74. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -1
  75. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +0 -1
  76. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  77. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +0 -4
  78. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
  79. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +0 -1
  80. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -1
  81. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +17 -4
  82. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -1
  83. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +27 -10
  84. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -1
  85. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +33 -16
  86. package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts.map +1 -1
  87. package/lib/exercises/math/functions/affines/recognizeAffineGraph.js +0 -4
  88. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +3 -0
  89. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -1
  90. package/lib/exercises/math/functions/affines/representationOfAffine.js +121 -30
  91. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -1
  92. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +29 -11
  93. package/lib/exercises/math/functions/basics/isPointOnFunction.d.ts.map +1 -1
  94. package/lib/exercises/math/functions/basics/isPointOnFunction.js +0 -10
  95. package/lib/exercises/math/functions/basics/signOfFunction.d.ts.map +1 -1
  96. package/lib/exercises/math/functions/basics/signOfFunction.js +0 -10
  97. package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -1
  98. package/lib/exercises/math/functions/composition/functionComposition.js +2 -2
  99. package/lib/exercises/math/functions/cube/isPointOnCubicFunction.d.ts.map +1 -1
  100. package/lib/exercises/math/functions/cube/isPointOnCubicFunction.js +0 -10
  101. package/lib/exercises/math/functions/exponentials/exponentialsVariations.d.ts.map +1 -1
  102. package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +0 -4
  103. package/lib/exercises/math/functions/inverse/compareInverseValues.d.ts.map +1 -1
  104. package/lib/exercises/math/functions/inverse/compareInverseValues.js +0 -1
  105. package/lib/exercises/math/functions/inverse/isPointOnReciprocalFunction.d.ts.map +1 -1
  106. package/lib/exercises/math/functions/inverse/isPointOnReciprocalFunction.js +0 -10
  107. package/lib/exercises/math/functions/parity/parityFromAlgebra.d.ts.map +1 -1
  108. package/lib/exercises/math/functions/parity/parityFromAlgebra.js +0 -4
  109. package/lib/exercises/math/functions/square/compareSquaredValues.d.ts.map +1 -1
  110. package/lib/exercises/math/functions/square/compareSquaredValues.js +0 -10
  111. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.d.ts.map +1 -1
  112. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +0 -4
  113. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
  114. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +0 -4
  115. package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.d.ts.map +1 -1
  116. package/lib/exercises/math/geometry/lines/isPointOnCartesianLine.js +0 -4
  117. package/lib/exercises/math/geometry/lines/isPointOnLine.d.ts.map +1 -1
  118. package/lib/exercises/math/geometry/lines/isPointOnLine.js +0 -4
  119. package/lib/exercises/math/geometry/lines/linesRelativePositions.d.ts.map +1 -1
  120. package/lib/exercises/math/geometry/lines/linesRelativePositions.js +0 -4
  121. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -1
  122. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +0 -4
  123. package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
  124. package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +0 -4
  125. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.d.ts.map +1 -1
  126. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRectangle.js +0 -4
  127. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.d.ts.map +1 -1
  128. package/lib/exercises/math/geometry/quadrilaterals/parallelogramRhombus.js +0 -4
  129. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.d.ts.map +1 -1
  130. package/lib/exercises/math/geometry/quadrilaterals/quadrilateralRecognition.js +0 -4
  131. package/lib/exercises/math/geometry/shapes/basicShapesRecognition.d.ts.map +1 -1
  132. package/lib/exercises/math/geometry/shapes/basicShapesRecognition.js +6 -7
  133. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromBasis.d.ts.map +1 -1
  134. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromBasis.js +0 -10
  135. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
  136. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +0 -10
  137. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
  138. package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +0 -4
  139. package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.d.ts.map +1 -1
  140. package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.js +0 -4
  141. package/lib/exercises/math/probaStat/basicProbas/mostLeastProbable.d.ts.map +1 -1
  142. package/lib/exercises/math/probaStat/basicProbas/mostLeastProbable.js +0 -10
  143. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
  144. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +24 -9
  145. package/lib/exercises/math/probaStat/checkEquiprobability.d.ts.map +1 -1
  146. package/lib/exercises/math/probaStat/checkEquiprobability.js +0 -10
  147. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -1
  148. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +9 -6
  149. package/lib/exercises/math/probaStat/events/describeEvent.d.ts.map +1 -1
  150. package/lib/exercises/math/probaStat/events/describeEvent.js +0 -10
  151. package/lib/exercises/math/probaStat/events/eventNotation.d.ts.map +1 -1
  152. package/lib/exercises/math/probaStat/events/eventNotation.js +0 -10
  153. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +0 -1
  154. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -1
  155. package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +13 -14
  156. package/lib/exercises/math/probaStat/stats1var/compareSeriesDispersion.d.ts.map +1 -1
  157. package/lib/exercises/math/probaStat/stats1var/compareSeriesDispersion.js +0 -4
  158. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts.map +1 -1
  159. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.js +0 -10
  160. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -1
  161. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +2 -3
  162. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -1
  163. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +26 -25
  164. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  165. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +0 -4
  166. package/lib/exercises/math/python/pythonForLoopInstructionCompletion.d.ts.map +1 -1
  167. package/lib/exercises/math/python/pythonForLoopInstructionCompletion.js +0 -10
  168. package/lib/exercises/math/python/pythonIfStatementCompletion.d.ts.map +1 -1
  169. package/lib/exercises/math/python/pythonIfStatementCompletion.js +7 -8
  170. package/lib/exercises/math/python/pythonSimpleFunctionInstructionCompletion.d.ts.map +1 -1
  171. package/lib/exercises/math/python/pythonSimpleFunctionInstructionCompletion.js +0 -10
  172. package/lib/exercises/math/python/pythonWhileStatementCompletion.d.ts.map +1 -1
  173. package/lib/exercises/math/python/pythonWhileStatementCompletion.js +5 -6
  174. package/lib/exercises/math/python/pythonWhileStatementOperationCompletion.d.ts.map +1 -1
  175. package/lib/exercises/math/python/pythonWhileStatementOperationCompletion.js +5 -6
  176. package/lib/exercises/math/python/variableType.d.ts.map +1 -1
  177. package/lib/exercises/math/python/variableType.js +0 -10
  178. package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts.map +1 -1
  179. package/lib/exercises/math/sampling/isSamplingRepresentative.js +0 -4
  180. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -1
  181. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +0 -4
  182. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
  183. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +0 -4
  184. package/lib/exercises/math/sequences/geometric/geometricVariations.d.ts.map +1 -1
  185. package/lib/exercises/math/sequences/geometric/geometricVariations.js +0 -4
  186. package/lib/exercises/math/sets/intervals/isNumberInInterval.d.ts.map +1 -1
  187. package/lib/exercises/math/sets/intervals/isNumberInInterval.js +0 -10
  188. package/lib/exercises/math/sets/isNumberDecimal.d.ts.map +1 -1
  189. package/lib/exercises/math/sets/isNumberDecimal.js +0 -10
  190. package/lib/exercises/math/sets/nameOfNumberSets.d.ts.map +1 -1
  191. package/lib/exercises/math/sets/nameOfNumberSets.js +0 -10
  192. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.d.ts.map +1 -1
  193. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +0 -1
  194. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.d.ts.map +1 -1
  195. package/lib/exercises/pc/chemicalElements/identifyRightElectronicConfiguration.js +0 -4
  196. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.d.ts.map +1 -1
  197. package/lib/exercises/pc/chemicalReactions/identifyLimitingReagent.js +0 -4
  198. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.d.ts.map +1 -1
  199. package/lib/exercises/pc/chemicalReactions/identifyStoichiometricMixture.js +0 -4
  200. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.d.ts.map +1 -1
  201. package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +0 -4
  202. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.d.ts.map +1 -1
  203. package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +0 -4
  204. package/lib/exercises/pc/moleculeNomenclature.d.ts.map +1 -1
  205. package/lib/exercises/pc/moleculeNomenclature.js +0 -4
  206. package/lib/exercises/pc/motion/motionReference.d.ts.map +1 -1
  207. package/lib/exercises/pc/motion/motionReference.js +0 -4
  208. package/lib/exercises/pc/motion/typeOfAcceleration.d.ts.map +1 -1
  209. package/lib/exercises/pc/motion/typeOfAcceleration.js +0 -4
  210. package/lib/exercises/pc/sound/frequencyComparison.d.ts.map +1 -1
  211. package/lib/exercises/pc/sound/frequencyComparison.js +0 -4
  212. package/lib/index.d.ts +10 -5
  213. package/lib/index.d.ts.map +1 -1
  214. package/lib/math/progCalc/progCalc.d.ts +3 -3
  215. package/lib/math/progCalc/progCalc.d.ts.map +1 -1
  216. package/lib/math/progCalc/progCalc.js +13 -3
  217. package/lib/tests/exoTest.d.ts.map +1 -1
  218. package/lib/tests/exoTest.js +7 -0
  219. package/lib/tests/questionTest.d.ts.map +1 -1
  220. package/lib/tests/questionTest.js +3 -2
  221. package/package.json +1 -1
@@ -106,9 +106,6 @@ const getPropositions = (n, { answer }) => {
106
106
  tryToAddWrongProp(propositions, "On ne peut pas savoir", "raw");
107
107
  return shuffleProps(propositions, n);
108
108
  };
109
- const isAnswerValid = (ans, { answer }) => {
110
- return ans === answer;
111
- };
112
109
  export const equaDiffCheckSolutionFirstOrder = {
113
110
  id: "equaDiffCheckSolutionFirstOrder",
114
111
  label: "Vérifier si une fonction est solution d'une équation différentielle du premier ordre",
@@ -117,7 +114,6 @@ export const equaDiffCheckSolutionFirstOrder = {
117
114
  qcmTimer: 60,
118
115
  freeTimer: 60,
119
116
  getPropositions,
120
- isAnswerValid,
121
117
  answerType: "QCU",
122
118
  subject: "Mathématiques",
123
119
  getQuestionFromIdentifiers,
@@ -1 +1 @@
1
- {"version":3,"file":"affineAdjustmentComplete.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustmentComplete.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA0JF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAclE,CAAC"}
1
+ {"version":3,"file":"affineAdjustmentComplete.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustmentComplete.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA0JF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAalE,CAAC"}
@@ -96,7 +96,6 @@ export const affineAdjustmentCompleteExercise = {
96
96
  label: "Déterminer l'équation de la droite d'ajustement et le coefficient de détermination",
97
97
  isSingleStep: true,
98
98
  generator: (nb) => getDistinctQuestions(getAffineAdjustmentCompleteQuestion, nb),
99
- answerType: "QCU",
100
99
  qcmTimer: 60,
101
100
  freeTimer: 60,
102
101
  getPropositions,
@@ -1 +1 @@
1
- {"version":3,"file":"coordsOfPointOnAffineFindX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/coordsOfPointOnAffineFindX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAuHF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAc5D,CAAC"}
1
+ {"version":3,"file":"coordsOfPointOnAffineFindX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/coordsOfPointOnAffineFindX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAqIF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAc5D,CAAC"}
@@ -6,6 +6,8 @@ import { randint } from "../../../../math/utils/random/randint.js";
6
6
  import { equationResolutionTex } from "../../../../tree/nodes/equations/equalNode.js";
7
7
  import { add } from "../../../../tree/nodes/operators/addNode.js";
8
8
  import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
9
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
10
+ import { pointParser } from "../../../../tree/parsers/pointParser.js";
9
11
  const getInstruction = (identifiers) => {
10
12
  const { yValue, coeffs } = identifiers;
11
13
  const affine = AffineConstructor.fromCoeffs(coeffs);
@@ -69,6 +71,17 @@ const getPropositions = (n, { answer, coeffs, yValue }) => {
69
71
  tryToAddWrongProp(propositions, `(${frac(add(yValue, p), m).simplify().toTex()}, ${yValue.frenchify()})`);
70
72
  return shuffleProps(propositions, n);
71
73
  };
74
+ const isAnswerValid = (ans, { answer }) => {
75
+ const pointAns = pointParser(ans);
76
+ if (!pointAns) {
77
+ return false;
78
+ }
79
+ const pointAnswer = pointParser(answer);
80
+ return [
81
+ [pointAns.x, pointAnswer.x],
82
+ [pointAns.y, pointAnswer.y],
83
+ ].every(([nodeAns, nodeAnswer]) => substract(nodeAns, nodeAnswer).evaluate() === 0);
84
+ };
72
85
  const getCoordsOfPointOnAffineFindXQuestion = () => {
73
86
  const polynome1 = new Polynomial([randint(-9, 10), randint(-5, 6, [0])]);
74
87
  const xValue = randint(-9, 10);
@@ -80,7 +93,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
80
93
  const question = {
81
94
  instruction: getInstruction(identifiers),
82
95
  answer: getAnswer(identifiers),
83
- keys: [],
96
+ keys: ["semicolon"],
84
97
  answerFormat: "tex",
85
98
  identifiers,
86
99
  hint: getHint(identifiers),
@@ -90,8 +103,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
90
103
  };
91
104
  export const coordsOfPointOnAffineFindX = {
92
105
  id: "coordsOfPointOnAffineFindX",
93
- getPropositions,
94
- label: "Déterminer les coordonnées d'un point appartenant à une courbe et dont on connaît l'ordonnée",
106
+ label: "Déterminer les coordonnées d'un point appartenant à une droite et dont on connaît l'ordonnée",
95
107
  isSingleStep: true,
96
108
  generator: (nb) => getDistinctQuestions(getCoordsOfPointOnAffineFindXQuestion, nb),
97
109
  qcmTimer: 60,
@@ -99,5 +111,6 @@ export const coordsOfPointOnAffineFindX = {
99
111
  subject: "Mathématiques",
100
112
  getQuestionFromIdentifiers,
101
113
  hasHintAndCorrection: true,
102
- answerType: "QCU",
114
+ getPropositions,
115
+ isAnswerValid,
103
116
  };
@@ -1 +1 @@
1
- {"version":3,"file":"coordsOfPointOnAffineFindY.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/coordsOfPointOnAffineFindY.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6GF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAc5D,CAAC"}
1
+ {"version":3,"file":"coordsOfPointOnAffineFindY.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/coordsOfPointOnAffineFindY.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA+HF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAc5D,CAAC"}
@@ -1,9 +1,12 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Point } from "../../../../math/geometry/point.js";
3
4
  import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
4
5
  import { Polynomial } from "../../../../math/polynomials/polynomial.js";
5
6
  import { randint } from "../../../../math/utils/random/randint.js";
6
7
  import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
9
+ import { pointParser } from "../../../../tree/parsers/pointParser.js";
7
10
  const getInstruction = (identifiers) => {
8
11
  const { xValue, coeffs } = identifiers;
9
12
  const affine = AffineConstructor.fromCoeffs(coeffs);
@@ -15,11 +18,15 @@ $$
15
18
 
16
19
  Quelles sont les coordonnées de $M$ ?`;
17
20
  };
18
- const getAnswer = (identifiers) => {
21
+ const getAnswerPoint = (identifiers) => {
19
22
  const { xValue, coeffs } = identifiers;
20
23
  const polynome = AffineConstructor.fromCoeffs(coeffs);
21
24
  const yValue = polynome.calculate(xValue);
22
- const answer = `(${xValue.frenchify()};${yValue.frenchify()})`;
25
+ return new Point("A", xValue, yValue);
26
+ };
27
+ const getAnswer = (identifiers) => {
28
+ const answerPoint = getAnswerPoint(identifiers);
29
+ const answer = `(${answerPoint.x.toTex()};${answerPoint.y.toTex()})`;
23
30
  return answer;
24
31
  };
25
32
  const getHint = (identifiers) => {
@@ -61,12 +68,22 @@ const getPropositions = (n, { answer, coeffs, xValue }) => {
61
68
  const propositions = [];
62
69
  addValidProp(propositions, answer);
63
70
  const poly = AffineConstructor.fromCoeffs(coeffs);
64
- tryToAddWrongProp(propositions, `(${m.frenchify()}, ${p.frenchify()})`);
65
- tryToAddWrongProp(propositions, `(${p.frenchify()}, ${m.frenchify()})`);
66
- tryToAddWrongProp(propositions, `(${xValue.frenchify()}, ${multiply(m, xValue).simplify().toTex()})`);
67
- tryToAddWrongProp(propositions, `(${xValue.frenchify()}, ${poly.calculate(1).frenchify()})`);
71
+ tryToAddWrongProp(propositions, `(${m.frenchify()};${p.frenchify()})`);
72
+ tryToAddWrongProp(propositions, `(${p.frenchify()};${m.frenchify()})`);
73
+ tryToAddWrongProp(propositions, `(${xValue.frenchify()};${multiply(m, xValue).simplify().toTex()})`);
74
+ tryToAddWrongProp(propositions, `(${xValue.frenchify()};${poly.calculate(1).frenchify()})`);
68
75
  return shuffleProps(propositions, n);
69
76
  };
77
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
78
+ const pointAns = pointParser(ans);
79
+ if (!pointAns)
80
+ return false;
81
+ const pointAnswer = getAnswerPoint(identifiers);
82
+ return [
83
+ [pointAns.x, pointAnswer.x],
84
+ [pointAns.y, pointAnswer.y],
85
+ ].every(([ansNode, answerNode]) => substract(ansNode, answerNode).simplify().evaluate() === 0);
86
+ };
70
87
  const getCoordsOfPointOnAffineFindYQuestion = () => {
71
88
  const polynome1 = new Polynomial([randint(-9, 10), randint(-5, 6, [0])]);
72
89
  const xValue = randint(-9, 10);
@@ -77,7 +94,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
77
94
  const question = {
78
95
  instruction: getInstruction(identifiers),
79
96
  answer: getAnswer(identifiers),
80
- keys: [],
97
+ keys: ["semicolon"],
81
98
  answerFormat: "tex",
82
99
  identifiers,
83
100
  hint: getHint(identifiers),
@@ -87,14 +104,14 @@ const getQuestionFromIdentifiers = (identifiers) => {
87
104
  };
88
105
  export const coordsOfPointOnAffineFindY = {
89
106
  id: "coordsOfPointOnAffineFindY",
90
- getPropositions,
91
- label: "Déterminer les coordonnées d'un point appartenant à une courbe et dont on connaît l'abscisse",
107
+ label: "Déterminer les coordonnées d'un point appartenant à une droite et dont on connaît l'abscisse",
92
108
  isSingleStep: true,
93
109
  generator: (nb) => getDistinctQuestions(getCoordsOfPointOnAffineFindYQuestion, nb),
110
+ getPropositions,
111
+ isAnswerValid,
94
112
  qcmTimer: 60,
95
113
  freeTimer: 60,
96
114
  subject: "Mathématiques",
97
115
  getQuestionFromIdentifiers,
98
116
  hasHintAndCorrection: true,
99
- answerType: "QCU",
100
117
  };
@@ -1 +1 @@
1
- {"version":3,"file":"drawAffineFromProgCalc.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromProgCalc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,mBAAmB,EAEpB,MAAM,iCAAiC,CAAC;AAMzC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAgNF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAwBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBjE,CAAC"}
1
+ {"version":3,"file":"drawAffineFromProgCalc.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/drawAffineFromProgCalc.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,mBAAmB,EAEpB,MAAM,iCAAiC,CAAC;AAOzC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAkOF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAwBF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBjE,CAAC"}
@@ -17,9 +17,8 @@ const getInstruction = (identifiers) => {
17
17
  const progCalc = ProgCalcConstructor.fromIdentifiers(progCalcIds);
18
18
  return `La fonction $ ${funcName} $ est définie par le programme de calcul suivant :
19
19
 
20
- ${progCalc.getArrOfFrenchStrings().map((str) => `
21
-
22
- ${str}
20
+ ${progCalc.getArrOfFrenchStrings().map((str) => `> ${str}`).join(`
21
+
23
22
  `)}
24
23
 
25
24
  Dans le repère, tracer la représentation de la fonction $ ${funcName} $.`;
@@ -35,23 +34,41 @@ Le point de coordonnées $ (x;${funcName}(x)) $ appartient à la droite qu'il fa
35
34
  `;
36
35
  };
37
36
  const getCorrection = (identifiers) => {
38
- const { progCalcIds, funcName } = identifiers;
37
+ const { funcName, progCalcIds } = identifiers;
39
38
  const progCalc = ProgCalcConstructor.fromIdentifiers(progCalcIds);
40
- const xA = 0;
41
- const yA = progCalc.apply(xA.toTree()).evaluate();
42
- const xB = 1;
43
- const yB = progCalc.apply(xB.toTree()).evaluate();
44
- return `
45
- Toutes les fonctions dans le programme de calcul sont des fonctions affines,
46
- la fonction $ ${funcName} $ est donc une fonction affine. On va donc tracer une droite.
39
+ const nodeProgCalc = progCalc.toTree("x".toTree());
40
+ const nodeXA = (0).toTree();
41
+ const nodeYA = progCalc.apply(nodeXA).simplify();
42
+ const nodeXB = (1).toTree();
43
+ const nodeYB = progCalc.apply(nodeXB).simplify();
44
+ return `Si on exécute le programme de calcul avec $x$, on obtient:
45
+
46
+ $$
47
+ ${funcName}(x) =
48
+ ${nodeProgCalc.toTex({
49
+ allowMinusAnywhereInFraction: true,
50
+ allowDoubleMinus: true,
51
+ forceTimesSign: true,
52
+ forceParenthesis: true,
53
+ })} = ${nodeProgCalc
54
+ .simplify({
55
+ forbidFactorize: true,
56
+ towardsDistribute: true,
57
+ forceDistributeFractions: true,
58
+ })
59
+ .toTex()}
60
+ $$
61
+
62
+ On reconnaît l'expression d'une fonction affine.
63
+ On va donc tracer une droite.
47
64
 
48
- Si on exécute le programme de calcul avec la valeur $ ${xA} $, on obtient $ ${yA} $.
49
- La droite passe donc par le point de coordonnées $(${xA};${yA})$.
65
+ Si on exécute le programme de calcul avec la valeur $ ${nodeXA.toTex()} $, on obtient $ ${nodeYA.toTex()} $.
66
+ La droite passe donc par le point de coordonnées $(${nodeXA.toTex()};${nodeYA.toTex()})$.
50
67
 
51
- Si on exécute le programme de calcul avec la valeur $ ${xB} $, on obtient $ ${yB} $.
52
- La droite passe donc par le point de coordonnées $(${xB};${yB})$.
68
+ Si on exécute le programme de calcul avec la valeur $ ${nodeXB.toTex()} $, on obtient $ ${nodeYB.toTex()} $.
69
+ La droite passe donc par le point de coordonnées $(${nodeXB.toTex()};${nodeYB.toTex()})$.
53
70
 
54
- On place donc les deux points de coordonnées $(${xA};${yA})$ et $(${xB};${yB})$,
71
+ On place donc les deux points de coordonnées $(${nodeXA.toTex()};${nodeYA.toTex()})$ et $(${nodeXB.toTex()};${nodeYB.toTex()})$,
55
72
  puis on trace la droite passant par ces deux points.
56
73
  `;
57
74
  };
@@ -1 +1 @@
1
- {"version":3,"file":"recognizeAffineGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/recognizeAffineGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,UAAU,GAAG;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAmBF,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAgKF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAgBtD,CAAC"}
1
+ {"version":3,"file":"recognizeAffineGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/recognizeAffineGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,UAAU,GAAG;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAmBF,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AA6JF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
@@ -141,9 +141,6 @@ const getPropositions = (_, { answer, ...idenfitiers }) => {
141
141
  });
142
142
  return propositions;
143
143
  };
144
- const isAnswerValid = (ans, { answer }) => {
145
- return ans === answer;
146
- };
147
144
  export const recognizeAffineGraph = {
148
145
  id: "recognizeAffineGraph",
149
146
  label: "Reconnaître la représentation graphique d'une fonction linéaire ou d'une fonction affine",
@@ -152,7 +149,6 @@ export const recognizeAffineGraph = {
152
149
  qcmTimer: 60,
153
150
  freeTimer: 60,
154
151
  getPropositions,
155
- isAnswerValid,
156
152
  hasGeogebra: true,
157
153
  subject: "Mathématiques",
158
154
  getQuestionFromIdentifiers,
@@ -1,7 +1,10 @@
1
1
  import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { PointIdentifiers } from "../../../../math/geometry/point.js";
2
3
  type Item = {
3
4
  tex: string;
4
5
  isValid: boolean;
6
+ point?: PointIdentifiers | undefined;
7
+ isPointValid?: boolean;
5
8
  };
6
9
  type Identifiers = {
7
10
  fName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"representationOfAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/representationOfAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAwOF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
1
+ {"version":3,"file":"representationOfAffine.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/representationOfAffine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAWtC,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAmWF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
3
4
  import { AffineConstructor } from "../../../../math/polynomials/affine.js";
4
5
  import { randint } from "../../../../math/utils/random/randint.js";
5
6
  import { add } from "../../../../tree/nodes/operators/addNode.js";
6
7
  import { substract } from "../../../../tree/nodes/operators/substractNode.js";
8
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
7
9
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
8
10
  import { random } from "../../../../utils/alea/random.js";
9
11
  import { shuffle } from "../../../../utils/alea/shuffle.js";
@@ -18,36 +20,83 @@ const primordialRightsAndWrongs = {
18
20
  `une fonction affine`,
19
21
  ],
20
22
  };
21
- const createRightsAndWrongs = (validSuffixFunc, invalidSuffixFuncs) => {
23
+ const createRightsAndWrongs = (validSuffixObj, invalidSuffixObjs) => {
22
24
  return {
23
- rights: primordialRightsAndWrongs.rights.map((rightStr) => (pointName) => validSuffixFunc(rightStr, pointName)),
25
+ rights: primordialRightsAndWrongs.rights.map((rightStr) => (pointName) => {
26
+ const point = validSuffixObj.nodeX &&
27
+ validSuffixObj.nodeY &&
28
+ new Point(pointName, validSuffixObj.nodeX, validSuffixObj.nodeY);
29
+ return {
30
+ str: validSuffixObj.suffixFunc(rightStr, pointName),
31
+ point,
32
+ isPointValid: point ? true : undefined,
33
+ };
34
+ }),
24
35
  wrongs: [
25
- ...primordialRightsAndWrongs.wrongs.map((wrongStr) => (pointName) => validSuffixFunc(wrongStr, pointName)),
26
- ...invalidSuffixFuncs.flatMap((invalidSuffixFunc) => primordialRightsAndWrongs.rights.map((rightStr) => (pointName) => invalidSuffixFunc(rightStr, pointName))),
36
+ ...primordialRightsAndWrongs.wrongs.map((wrongStr) => (pointName) => {
37
+ const point = validSuffixObj.nodeX &&
38
+ validSuffixObj.nodeY &&
39
+ new Point(pointName, validSuffixObj.nodeX, validSuffixObj.nodeY);
40
+ return {
41
+ str: validSuffixObj.suffixFunc(wrongStr, pointName),
42
+ point,
43
+ isPointValid: point ? true : undefined,
44
+ };
45
+ }),
46
+ ...invalidSuffixObjs.flatMap((invalidSuffixObj) => primordialRightsAndWrongs.rights.map((rightStr) => (pointName) => {
47
+ const point = invalidSuffixObj.nodeX &&
48
+ invalidSuffixObj.nodeY &&
49
+ new Point(pointName, invalidSuffixObj.nodeX, invalidSuffixObj.nodeY);
50
+ return {
51
+ str: invalidSuffixObj.suffixFunc(rightStr, pointName),
52
+ point,
53
+ isPointValid: point ? false : undefined,
54
+ };
55
+ })),
27
56
  ],
28
57
  };
29
58
  };
59
+ const nodeBySubstitutingX = (node, strVar) => {
60
+ return parseAlgebraic(node.toTex().replaceAll("x", `({${strVar}})`));
61
+ };
62
+ const calculateWithNode = (f, nodeX) => {
63
+ return nodeBySubstitutingX(f.toTree(), nodeX.toTex()).simplify();
64
+ };
30
65
  const createArrayOfRightsAndWrongs = (f) => {
31
- function createRightAndWrongsCoords(f, x) {
32
- const yR = f.calculate(x);
33
- const yWs = [
34
- f.a,
35
- f.b,
36
- add(f.a, f.b).evaluate(),
37
- substract(f.a, f.b).evaluate(),
38
- ].filter((yW) => yW !== yR);
66
+ function createRightAndWrongsCoords(f, nodeX) {
67
+ const nodeYR = calculateWithNode(f, nodeX);
68
+ const nodeYWs = [
69
+ f.a.toTree(),
70
+ f.b.toTree(),
71
+ add(f.a, f.b),
72
+ substract(f.a, f.b),
73
+ ].filter((yW) => substract(yW, nodeYR).evaluate() !== 0);
39
74
  return {
40
- right: [x, yR],
41
- wrongs: yWs.map((yW) => [x, yW]),
75
+ right: [nodeX, nodeYR],
76
+ wrongs: nodeYWs.map((nodeYW) => [nodeX, nodeYW]),
42
77
  };
43
78
  }
44
- const coordObjects = [-1, 0, 1].map((x) => createRightAndWrongsCoords(f, x));
45
- const strFunc = (str, pointName, x, y) => `${str} qui passe par $${pointName}(${x.frenchify()};${y.frenchify()})$`;
79
+ const coordObjects = [-1, 0, 1]
80
+ .map((x) => x.toTree())
81
+ .map((nodeX) => createRightAndWrongsCoords(f, nodeX));
82
+ const strFunc = (str, pointName, nodeX, nodeY) => `${str} qui passe par $${pointName}(${nodeX.simplify().toTex()};${nodeY
83
+ .simplify()
84
+ .toTex()})$`;
46
85
  return [
47
- createRightsAndWrongs((str) => `${str}`, []),
48
- ...coordObjects.flatMap((coordObject) => {
49
- return createRightsAndWrongs((str, pointName) => strFunc(str, pointName, coordObject.right[0], coordObject.right[1]), coordObject.wrongs.map(([x, y]) => (str, pointName) => strFunc(str, pointName, x, y)));
50
- }),
86
+ createRightsAndWrongs({
87
+ suffixFunc: (str) => `${str}`,
88
+ }, []),
89
+ ...coordObjects.flatMap((coordObject) => createRightsAndWrongs({
90
+ suffixFunc: (str, pointName) => strFunc(str, pointName, coordObject.right[0], coordObject.right[1]),
91
+ nodeX: coordObject.right[0],
92
+ nodeY: coordObject.right[1],
93
+ }, coordObject.wrongs.map(([nodeX, nodeY]) => {
94
+ return {
95
+ suffixFunc: (str, pointName) => strFunc(str, pointName, nodeX, nodeY),
96
+ nodeX,
97
+ nodeY,
98
+ };
99
+ }))),
51
100
  ];
52
101
  };
53
102
  const getInstruction = (identifiers) => {
@@ -65,20 +114,60 @@ const getHint = () => {
65
114
  return `Les fonctions affines et linéaires sont représentées par des droites.`;
66
115
  };
67
116
  const getCorrection = (identifiers) => {
68
- const { fName } = identifiers;
117
+ const { fName, items, coeffs } = identifiers;
118
+ const affine = AffineConstructor.fromCoeffs(coeffs);
69
119
  const abstractFName = ["f", "g", "h"].find((letter) => letter !== fName);
70
- return `Une fonction affine $${abstractFName}$ est de la forme
71
-
120
+ return `Une fonction affine $${abstractFName}$ est de la forme
121
+
72
122
  $$
73
123
  ${abstractFName}(x)=mx+p
74
124
  $$
75
125
 
76
- Sa représentation graphique est donc une droite qui passe, entre autres, par le point de coordonnées $(1;m+p)$ car
126
+ Sa représentation graphique est une droite.
127
+
128
+ $\\ $
129
+
130
+ ${items
131
+ .filter((item) => item.isValid && item.point && item.isPointValid)
132
+ .map((item) => {
133
+ const point = PointConstructor.fromIdentifiers(item.point);
134
+ const applyNode = nodeBySubstitutingX(affine.toTree(), point.x.toTex());
135
+ const texRaw = applyNode.toTex();
136
+ const texSimplified = applyNode.simplify().toTex();
137
+ return `On a :
138
+
139
+ $$
140
+ ${fName}(${point.x.toTex()}) = ${texRaw} = ${texSimplified}
141
+ $$
142
+
143
+ Donc elle passe par le point $${point.name}(${point.x.toTex()},${point.y.toTex()})$.`;
144
+ }).join(`
145
+
146
+ $\\ $
147
+
148
+ `)}
149
+
150
+ $\\ $
151
+
152
+ ${items
153
+ .filter((item) => !item.isValid && item.point && !item.isPointValid)
154
+ .map((item) => {
155
+ const point = PointConstructor.fromIdentifiers(item.point);
156
+ const applyNode = nodeBySubstitutingX(affine.toTree(), point.x.toTex());
157
+ const texRaw = applyNode.toTex();
158
+ const texSimplified = applyNode.simplify().toTex();
159
+ return `On a :
77
160
 
78
161
  $$
79
- ${abstractFName}(1)=m+p
162
+ ${fName}(${point.x.toTex()}) = ${texRaw} = ${texSimplified} \\neq ${point.y.toTex()}
80
163
  $$
81
- `;
164
+
165
+ Donc le point $${point.name}(${point.x.toTex()},${point.y.toTex()})$ n'appartient pas à la droite représentant $${fName}$.`;
166
+ }).join(`
167
+
168
+ $\\ $
169
+
170
+ `)}`;
82
171
  };
83
172
  const getPropositions = (_, { answer, ...idenfitiers }) => {
84
173
  const { items } = idenfitiers;
@@ -112,7 +201,7 @@ const getRepresentationOfAffineQuestion = () => {
112
201
  const index = random(allIndexes.filter((index) => !previouslyPickedIndexes.includes(index)));
113
202
  if (rightsAndWrongs[index].rights.length > 0) {
114
203
  return {
115
- texFunc: random(rightsAndWrongs[index].rights),
204
+ objFunc: random(rightsAndWrongs[index].rights),
116
205
  index,
117
206
  };
118
207
  }
@@ -129,7 +218,7 @@ const getRepresentationOfAffineQuestion = () => {
129
218
  const index = random(indexArray);
130
219
  if (rightsAndWrongs[index].wrongs.length > 0) {
131
220
  return {
132
- texFunc: random(rightsAndWrongs[index].wrongs),
221
+ objFunc: random(rightsAndWrongs[index].wrongs),
133
222
  index,
134
223
  };
135
224
  }
@@ -146,11 +235,13 @@ const getRepresentationOfAffineQuestion = () => {
146
235
  ? getRightTexFunc(previouslyPickedIndexes)
147
236
  : getWrongTexFunc(previouslyPickedIndexes);
148
237
  } while (!pick);
149
- const tex = pick.texFunc(pointName);
238
+ const obj = pick.objFunc(pointName);
150
239
  previouslyPickedIndexes.push(pick.index);
151
240
  const item = {
152
- tex,
241
+ tex: obj.str,
153
242
  isValid,
243
+ point: obj.point?.toIdentifiers(),
244
+ isPointValid: obj.isPointValid,
154
245
  };
155
246
  return item;
156
247
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"coordsOfPointOnCurveFindY.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/coordsOfPointOnCurveFindY.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,gBAAgB,GACjB,QAAQ,GACR,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,WAAW,GACX,iBAAiB,CAAC;AAEtB,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAsRF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
1
+ {"version":3,"file":"coordsOfPointOnCurveFindY.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/coordsOfPointOnCurveFindY.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAe7C,KAAK,gBAAgB,GACjB,QAAQ,GACR,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,WAAW,GACX,iBAAiB,CAAC;AAEtB,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA0SF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAc3D,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Point } from "../../../../math/geometry/point.js";
3
4
  import { Polynomial } from "../../../../math/polynomials/polynomial.js";
4
5
  import { randint } from "../../../../math/utils/random/randint.js";
5
6
  import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
@@ -10,6 +11,7 @@ import { isOperatorNode, OperatorIds, } from "../../../../tree/nodes/operators/o
10
11
  import { power } from "../../../../tree/nodes/operators/powerNode.js";
11
12
  import { substract } from "../../../../tree/nodes/operators/substractNode.js";
12
13
  import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
14
+ import { pointParser } from "../../../../tree/parsers/pointParser.js";
13
15
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
14
16
  import { random } from "../../../../utils/alea/random.js";
15
17
  const nodeByReplacingOperations = (node, replacementDict) => {
@@ -50,13 +52,15 @@ $$
50
52
 
51
53
  Quelles sont les coordonnées de $M$ ?`;
52
54
  };
53
- const getAnswer = (identifiers) => {
55
+ const getAnswerPoint = (identifiers) => {
54
56
  const { xValue, questionFunc } = identifiers;
55
57
  const node = NodeConstructor.fromIdentifiers(questionFunc.nodeIds);
56
58
  const nodeWithXValue = nodeBySubstitutingX(node, `(${xValue})`);
57
- const answer = `(${xValue.frenchify()};${nodeWithXValue
58
- .simplify({ calculatePowers: true })
59
- .toTex()})`;
59
+ return new Point("A", xValue.toTree(), nodeWithXValue.simplify({ calculatePowers: true }));
60
+ };
61
+ const getAnswer = (identifiers) => {
62
+ const answerPoint = getAnswerPoint(identifiers);
63
+ const answer = `(${answerPoint.x.toTex()};${answerPoint.y.toTex()})`;
60
64
  return answer;
61
65
  };
62
66
  const getHint = (identifiers) => {
@@ -138,6 +142,16 @@ const getPropositions = (n, { answer, questionFunc, xValue }) => {
138
142
  }
139
143
  return shuffleProps(propositions, n);
140
144
  };
145
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
146
+ const pointAns = pointParser(ans);
147
+ if (!pointAns)
148
+ return false;
149
+ const pointAnswer = getAnswerPoint(identifiers);
150
+ return [
151
+ [pointAns.x, pointAnswer.x],
152
+ [pointAns.y, pointAnswer.y],
153
+ ].every(([ansNode, answerNode]) => substract(ansNode, answerNode).simplify().evaluate() === 0);
154
+ };
141
155
  const getCoordsOfPointOnAffineFindYQuestion = () => {
142
156
  const xValue = randint(-9, 10);
143
157
  const questionFunc = random([
@@ -164,15 +178,15 @@ const getCoordsOfPointOnAffineFindYQuestion = () => {
164
178
  },
165
179
  {
166
180
  type: "(x-...)(x-...)",
167
- nodeIds: multiply(substract("x", randint(-3, 4, [xValue])), substract("x", randint(-3, 4, [0, xValue]))).toIdentifiers(),
181
+ nodeIds: multiply(substract("x", randint(-3, 4, [0, xValue])), substract("x", randint(-3, 4, [0, xValue]))).toIdentifiers(),
168
182
  },
169
183
  {
170
184
  type: "(x+...)(x-...)",
171
- nodeIds: multiply(add("x", randint(-3, 4, [-xValue])), substract("x", randint(-3, 4, [0, xValue]))).toIdentifiers(),
185
+ nodeIds: multiply(add("x", randint(-3, 4, [0, -xValue])), substract("x", randint(-3, 4, [0, xValue]))).toIdentifiers(),
172
186
  },
173
187
  {
174
188
  type: "(x+...)(x+...)",
175
- nodeIds: multiply(add("x", randint(-3, 4, [-xValue])), add("x", randint(-3, 4, [0, -xValue]))).toIdentifiers(),
189
+ nodeIds: multiply(add("x", randint(-3, 4, [0, -xValue])), add("x", randint(-3, 4, [0, -xValue]))).toIdentifiers(),
176
190
  },
177
191
  {
178
192
  type: "a/(x+...)",
@@ -180,7 +194,11 @@ const getCoordsOfPointOnAffineFindYQuestion = () => {
180
194
  },
181
195
  {
182
196
  type: "(x+...)/(x+...)",
183
- nodeIds: frac(add("x", randint(-3, 4)), add("x", randint(-3, 4, [0, -xValue]))).toIdentifiers(),
197
+ nodeIds: (() => {
198
+ const a = randint(-3, 4, [0]);
199
+ const b = randint(-3, 4, [0, -xValue, a]);
200
+ return frac(add("x", a), add("x", b)).toIdentifiers();
201
+ })(),
184
202
  },
185
203
  ]);
186
204
  const identifiers = {
@@ -193,7 +211,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
193
211
  const question = {
194
212
  instruction: getInstruction(identifiers),
195
213
  answer: getAnswer(identifiers),
196
- keys: [],
214
+ keys: ["semicolon"],
197
215
  answerFormat: "tex",
198
216
  identifiers,
199
217
  hint: getHint(identifiers),
@@ -203,14 +221,14 @@ const getQuestionFromIdentifiers = (identifiers) => {
203
221
  };
204
222
  export const coordsOfPointOnCurveFindY = {
205
223
  id: "coordsOfPointOnCurveFindY",
206
- getPropositions,
207
224
  label: "Déterminer les coordonnées d'un point appartenant à une courbe et dont on connaît l'abscisse",
208
225
  isSingleStep: true,
209
226
  generator: (nb) => getDistinctQuestions(getCoordsOfPointOnAffineFindYQuestion, nb),
227
+ getPropositions,
228
+ isAnswerValid,
210
229
  qcmTimer: 60,
211
230
  freeTimer: 60,
212
231
  subject: "Mathématiques",
213
232
  getQuestionFromIdentifiers,
214
233
  hasHintAndCorrection: true,
215
- answerType: "QCU",
216
234
  };
@@ -1 +1 @@
1
- {"version":3,"file":"isPointOnFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/isPointOnFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAI7C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AA0HF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAmBnD,CAAC"}
1
+ {"version":3,"file":"isPointOnFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/isPointOnFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAG7C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAmHF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAkBnD,CAAC"}