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
@@ -92,9 +92,12 @@ const getMdTable = (prefixes, indexBold = -1) => {
92
92
  function boldify(str) {
93
93
  return `**${str}**`;
94
94
  }
95
+ const isBolded = 0 <= indexBold && indexBold < prefixes.length;
95
96
  return mdTable([
96
97
  ["Préfixe", "Symbole", "Signification", "Puissance"],
97
- ...prefixes.map((prefix, i) => [
98
+ ...prefixes
99
+ .filter((_, i) => (isBolded ? i === indexBold : true))
100
+ .map((prefix, i) => [
98
101
  prefix.name,
99
102
  `$${prefix.symbol}$`,
100
103
  prefix.meaning,
@@ -107,7 +110,7 @@ const getInstruction = (identifiers) => {
107
110
  const prefix = prefixes[prefixIndex];
108
111
  return `Quelle est la valeur du préfixe ${isFromSymbol ? `$${prefix.symbol}$` : prefix.name} ?
109
112
 
110
- Ecris la réponse sous la forme ${isToPow10 ? `d'une puissance de $10$` : `d'un nombre décimal`}.`;
113
+ Ecrire la réponse sous la forme ${isToPow10 ? `d'une puissance de $10$` : `d'un nombre décimal`}.`;
111
114
  };
112
115
  const getHint = (identifiers) => {
113
116
  const { prefixIndexesPool } = identifiers;
@@ -115,7 +118,8 @@ const getHint = (identifiers) => {
115
118
  return getMdTable(prefixPool);
116
119
  };
117
120
  const getCorrection = (identifiers) => {
118
- const { prefixIndexesPool, prefixIndex } = identifiers;
121
+ const { prefixIndexesPool, prefixIndex, isToPow10 } = identifiers;
122
+ const prefix = prefixes[prefixIndex];
119
123
  const prefixPool = prefixIndexesPool.map((i) => prefixes[i]);
120
124
  const indexBold = (() => {
121
125
  for (let i = 0; i < prefixIndexesPool.length; i++) {
@@ -123,7 +127,13 @@ const getCorrection = (identifiers) => {
123
127
  return i;
124
128
  }
125
129
  })();
126
- return getMdTable(prefixPool, indexBold);
130
+ return `Voici un tableau récapitulatif :
131
+
132
+ ${getMdTable(prefixPool, indexBold)}
133
+
134
+ ${!isToPow10
135
+ ? `$${prefix.texPow10}$ correspond à l'écriture décimale $${prefix.texValue}$.`
136
+ : ``}`;
127
137
  };
128
138
  const getAnswer = (identifiers) => {
129
139
  const { prefixIndex, isToPow10 } = identifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"secondsToHours.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/secondsToHours.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,eAAe,CAAC;IAChC,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA2LF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAiBhD,CAAC"}
1
+ {"version":3,"file":"secondsToHours.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/secondsToHours.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,eAAe,CAAC;IAChC,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA2LF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAgBhD,CAAC"}
@@ -46,7 +46,7 @@ const isAnswerValid = (ans, { isSecondsToHours, nodeIdsSeconds, nodeIdsHours })
46
46
  const getHint = (identifiers) => {
47
47
  const { isSecondsToHours } = identifiers;
48
48
  if (isSecondsToHours) {
49
- return `Combien y-a-t-il d'heures dans $7200$ secondes ?`;
49
+ return `Combien d'heures font $7200$ secondes ?`;
50
50
  }
51
51
  else {
52
52
  return `Combien y-a-t-il de secondes dans une heure ?`;
@@ -146,5 +146,4 @@ export const secondsToHours = {
146
146
  getQuestionFromIdentifiers,
147
147
  hasHintAndCorrection: true,
148
148
  shouldHaveCalculator: true,
149
- answerType: "QCU",
150
149
  };
@@ -4,7 +4,7 @@ type Identifiers = {
4
4
  itemAsked: AskedItem;
5
5
  questionStr: string;
6
6
  answerStr: string;
7
- displayType: "horizMulti" | "vertStacked";
7
+ displayType: string;
8
8
  };
9
9
  type AskedItem = {
10
10
  type: "xForCategory" | "categoryForX";
@@ -45,6 +45,9 @@ type BarChart = {
45
45
  bars: Bar[];
46
46
  categories: Category[];
47
47
  };
48
- export declare const barChartInterpreting: Exercise<Identifiers>;
48
+ type Options = {
49
+ displayType: string;
50
+ };
51
+ export declare const barChartInterpreting: Exercise<Identifiers, Options>;
49
52
  export {};
50
53
  //# sourceMappingURL=barChartInterpreting.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"barChartInterpreting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/barChartInterpreting.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,QAAQ,EAET,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,YAAY,GAAG,aAAa,CAAC;CAC3C,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,cAAc,GAAG,cAAc,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,GAAG,GAAG;IACT,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAisBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
1
+ {"version":3,"file":"barChartInterpreting.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/barChartInterpreting.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,QAAQ,EAKT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,cAAc,GAAG,cAAc,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAE5C,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,GAAG,GAAG;IACT,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,UAAU,EAAE,QAAQ,EAAE,CAAC;CACxB,CAAC;AAotBF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgB/D,CAAC"}
@@ -1,20 +1,21 @@
1
- import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../exercises/exercise.js";
2
2
  import { random, randomMany } from "../../../utils/alea/random.js";
3
3
  import { randfloat } from "../../../math/utils/random/randfloat.js";
4
- import { blueMain, greenMain, orange, purpleDark, red, } from "../../../geogebra/colors.js";
4
+ import { blueMain, greenMain, orange, red } from "../../../geogebra/colors.js";
5
5
  import { coinFlip } from "../../../utils/alea/coinFlip.js";
6
6
  import { probaLawFlip } from "../../../utils/alea/probaLawFlip.js";
7
7
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
8
8
  import { randint } from "../../../math/utils/random/randint.js";
9
9
  import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
10
10
  import { capitalize } from "../../../utils/strings/capitalize.js";
11
+ import { shuffle } from "../../../utils/alea/shuffle.js";
11
12
  class BarChartConstructor {
12
13
  static stylesPools = {
13
14
  color: [
14
15
  {
15
16
  type: "color",
16
- color: red,
17
- frStr: "rouge",
17
+ color: blueMain,
18
+ frStr: "bleu",
18
19
  },
19
20
  {
20
21
  type: "color",
@@ -23,13 +24,8 @@ class BarChartConstructor {
23
24
  },
24
25
  {
25
26
  type: "color",
26
- color: purpleDark,
27
- frStr: "violet",
28
- },
29
- {
30
- type: "color",
31
- color: blueMain,
32
- frStr: "bleu",
27
+ color: red,
28
+ frStr: "rouge",
33
29
  },
34
30
  {
35
31
  type: "color",
@@ -102,7 +98,7 @@ class BarChartConstructor {
102
98
  }
103
99
  static createRandomCategories(dictIsUsingCategory, categoryPropsPool, styleType) {
104
100
  const nbCategUsed = Object.keys(dictIsUsingCategory).length;
105
- const styles = randomMany(this.stylesPools[styleType], nbCategUsed);
101
+ const styles = shuffle(this.stylesPools[styleType].slice(0, nbCategUsed));
106
102
  return categoryPropsPool
107
103
  .filter((_, i) => dictIsUsingCategory[i])
108
104
  .map((props, i) => {
@@ -117,7 +113,7 @@ class BarChartConstructor {
117
113
  const frenchOrdinals = [``, "deuxième", "troisième", "quatrième"];
118
114
  const arrayOfBarChartSkeleton = [
119
115
  {
120
- description: `Le diagramme en barres ci-contre donne la production d'électricité, en TWh (téraWatt-heure) selon son origine.`,
116
+ description: `Le diagramme en barres ci-dessous donne la production d'électricité, en TWh (téraWatt-heure) selon son origine.`,
121
117
  questionXForCategFunc(categName, isLess, ordinal) {
122
118
  return `Quelle était l'année où la production d'électricité d'origine ${categName.toLocaleLowerCase()} était
123
119
  la ${ordinal > 0 ? `${frenchOrdinals[ordinal]} la` : ``} ${isLess ? `moins` : `plus`} importante de toutes ces années ?`;
@@ -127,12 +123,10 @@ la ${ordinal > 0 ? `${frenchOrdinals[ordinal]} la` : ``} ${isLess ? `moins` : `
127
123
  la ${ordinal > 0 ? `${frenchOrdinals[ordinal]} la` : ``} ${isLess ? `moins` : `plus`} importante de toutes ces années`;
128
124
  },
129
125
  questionCategForXFunc(barLabel, isLess, ordinal) {
130
- return `Quelle était l'origine de production d'électricité
131
- la ${ordinal > 0 ? `${frenchOrdinals[ordinal]} la` : ``} ${isLess ? `moins` : `plus`} importante pour l'année $${barLabel}$ ?`;
126
+ return `Quelle était la ${ordinal > 0 ? `${frenchOrdinals[ordinal]}` : ``} ${isLess ? `moins` : `plus`} importante origine de production d'électricité pour l'année $${barLabel}$ ?`;
132
127
  },
133
128
  answerCategForXFunc(barLabel, isLess, ordinal) {
134
- return `la production d'électricité
135
- la ${ordinal > 0 ? `${frenchOrdinals[ordinal]} la` : ``} ${isLess ? `moins` : `plus`} importante pour l'année $${barLabel}$`;
129
+ return `la ${ordinal > 0 ? `${frenchOrdinals[ordinal]} la` : ``} ${isLess ? `moins` : `plus`} importante origine de production d'électricité pour l'année $${barLabel}$`;
136
130
  },
137
131
  axisLabels: ["Année", "Production d'électricité (en TWh)"],
138
132
  categoryProps: (() => {
@@ -411,30 +405,37 @@ const getGGBOptionsVertStacked = (identifiers) => {
411
405
  }),
412
406
  });
413
407
  };
414
- const getGGBOptions = (identifiers) => {
408
+ const getGGBOptions = (identifiers, opts) => {
415
409
  const { displayType } = identifiers;
416
410
  switch (displayType) {
417
- case "horizMulti":
418
- return getGGBOptionsHorizMulti(identifiers);
419
- case "vertStacked":
420
- return getGGBOptionsVertStacked(identifiers);
411
+ case "empilements":
412
+ return getGGBOptionsVertStacked(identifiers, opts);
413
+ default:
414
+ case "faisceaux":
415
+ return getGGBOptionsHorizMulti(identifiers, opts);
421
416
  }
422
417
  };
423
- const getBarChartInterpretingQuestion = () => {
424
- const styleType = coinFlip() ? "color" : "fill";
425
- const displayType = coinFlip() ? "horizMulti" : "vertStacked";
418
+ const getBarChartInterpretingQuestion = (optsIn) => {
419
+ console.log("optsIn", optsIn);
420
+ const arrayedOptions = optsIn ?? optsDefault;
421
+ const opts = {
422
+ displayType: random(arrayedOptions.displayType),
423
+ };
424
+ const styleType = "color";
425
+ const displayType = opts.displayType;
426
426
  let nbBars;
427
427
  let nbCateg;
428
428
  switch (displayType) {
429
- case "horizMulti":
429
+ case "empilements":
430
430
  {
431
- nbBars = 3;
431
+ nbBars = 5;
432
432
  nbCateg = 3;
433
433
  }
434
434
  break;
435
- case "vertStacked":
435
+ default:
436
+ case "faisceaux":
436
437
  {
437
- nbBars = 5;
438
+ nbBars = 3;
438
439
  nbCateg = 3;
439
440
  }
440
441
  break;
@@ -485,9 +486,9 @@ const getBarChartInterpretingQuestion = () => {
485
486
  questionStr,
486
487
  answerStr,
487
488
  displayType,
488
- });
489
+ }, opts);
489
490
  };
490
- const getQuestionFromIdentifiers = (identifiers) => {
491
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
491
492
  const question = {
492
493
  answer: getAnswer(identifiers),
493
494
  instruction: getInstruction(identifiers),
@@ -497,14 +498,29 @@ const getQuestionFromIdentifiers = (identifiers) => {
497
498
  hint: getHint(identifiers),
498
499
  correction: getCorrection(identifiers),
499
500
  ggbOptions: getGGBOptions(identifiers),
501
+ options: opts,
500
502
  };
501
503
  return question;
502
504
  };
505
+ const optsDefault = {
506
+ displayType: ["faisceaux", "empilements"],
507
+ };
508
+ const options = [
509
+ {
510
+ id: "displayType",
511
+ label: "Type de diagramme",
512
+ target: GeneratorOptionTarget.generation,
513
+ type: GeneratorOptionType.multiselect,
514
+ values: ["faisceaux", "empilements"],
515
+ defaultValue: optsDefault.displayType,
516
+ },
517
+ ];
503
518
  export const barChartInterpreting = {
504
519
  id: "barChartInterpreting",
505
520
  label: "Interpréter un diagramme en bâtons",
506
521
  isSingleStep: true,
507
522
  generator: (nb, opts) => getDistinctQuestions(() => getBarChartInterpretingQuestion(opts), nb),
523
+ options,
508
524
  qcmTimer: 60,
509
525
  freeTimer: 60,
510
526
  getPropositions,
@@ -1 +1 @@
1
- {"version":3,"file":"cartesianGraphExtremaReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/cartesianGraphExtremaReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAuJF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAsB9D,CAAC"}
1
+ {"version":3,"file":"cartesianGraphExtremaReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/cartesianGraphExtremaReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AA6JF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAsB9D,CAAC"}
@@ -35,13 +35,14 @@ Durant cette période, en quelle année y a-t-il eu le ${isLess ? `moins` : `plu
35
35
  };
36
36
  const getHint = (identifiers) => {
37
37
  const { isLess } = identifiers;
38
- return `Observe quand la courbe est la plus ${isLess ? `basse` : `haute`}.`;
38
+ return `Observe quand la courbe atteint son ${isLess ? `minimum` : `maximum`}.`;
39
39
  };
40
40
  const getCorrection = (identifiers) => {
41
- const { isLess } = identifiers;
41
+ const { isLess, answerIndex, yValues } = identifiers;
42
+ const yAnswer = yValues[answerIndex];
42
43
  const answer = getAnswer(identifiers);
43
- return `La courbe est la plus ${isLess ? `basse` : `haute`} en $${answer}$.
44
- Donc c'est en $${answer}$ qu'il y a eu le ${isLess ? `moins` : `plus`} de naissances en France.
44
+ return `La courbe atteint son ${isLess ? `minimum` : `maximum`} en $${answer}$.
45
+ Donc c'est en $${answer}$ qu'il y a eu le ${isLess ? `moins` : `plus`} de naissances (il y en a eu $${(yAnswer * 1000).frenchify()}$).
45
46
  `;
46
47
  };
47
48
  const getGGBOptions = (identifiers) => {
@@ -1 +1 @@
1
- {"version":3,"file":"compareBoxPlot.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/compareBoxPlot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,EAAE,CAAC;CACvB,CAAC;AAKF,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAmQF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAoBhD,CAAC"}
1
+ {"version":3,"file":"compareBoxPlot.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/compareBoxPlot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,EAAE,CAAC;CACvB,CAAC;AAKF,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAmQF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAmBhD,CAAC"}
@@ -193,5 +193,4 @@ export const compareBoxPlot = {
193
193
  hasGeogebra: true,
194
194
  getQuestionFromIdentifiers,
195
195
  hasHintAndCorrection: true,
196
- answerType: "QCU",
197
196
  };
@@ -11,7 +11,7 @@ et les autres ont plus de $65$ ans.`,
11
11
  answer: "a",
12
12
  hint: (n) => `$${n}$ est le tiers de $${n * 3}$.`,
13
13
  correction: (n) => `Comme $${n}$ est le tiers de $${n * 3}$
14
- alors seul le graphiques $a$ convient, car c'est le seul à contenir un tiers de disque.`,
14
+ alors seul le graphique $a$ convient, car c'est le seul à contenir un tiers de disque.`,
15
15
  },
16
16
  {
17
17
  description: (n) => `Sur $${n * 5}$ personnes :
@@ -33,7 +33,7 @@ et les autres ont plus de $65$ ans.`,
33
33
  answer: "c",
34
34
  hint: (n) => `$${n}$ est le dixième de $${n * 10}$.`,
35
35
  correction: (n) => `Comme $${n}$ est le dixième de $${n * 10}$
36
- alors seuls le graphique $c$ convient.`,
36
+ alors seul le graphique $c$ convient.`,
37
37
  },
38
38
  {
39
39
  description: (n) => `Sur $${n * 5}$ personnes :
@@ -44,8 +44,8 @@ et les autres ont plus de $65$ ans.`,
44
44
  hint: (n) => `$${n * 2.5}$ est la moitié de $${n * 5}$.`,
45
45
  correction: (n) => `Comme $${n * 2.5}$ est la moitié de $${n * 5}$
46
46
  alors seuls les graphiques $b$ et $d$ conviennent.
47
- De plus comme le quart de $${n * 5}$ vaut $${(n * 5) / 4}$
48
- et que $${n}<${(n * 5) / 4}$ alors seul le graphique $d$ convient.`,
47
+ De plus $${(n * 5) / 4}$ est le quart de $${n * 5}$
48
+ et seul le graphique D contient un secteur représentant le quart du cercle.`,
49
49
  },
50
50
  ];
51
51
  const getInstruction = (identifiers) => {
@@ -14,43 +14,43 @@ const situations = [
14
14
  interval: { min: 2003, max: 2006 },
15
15
  maxValue: 830_000,
16
16
  answerIndexes: [0],
17
- hint: `Observe les variations du graphiques entre $2003$ et $2006$. Monotone signifie "que croissant" ou "que décroissant".`,
18
- correction: `Comme la courbe monte entre $2003$ et $2006$ alors le nombre de naissances n'a pas cessé de croitre entre $2003$ et $2006$.`,
17
+ hint: `Observe les variations du graphique entre $2003$ et $2006$. Monotone signifie "que croissant" ou "que décroissant".`,
18
+ correction: `Comme la courbe est croissante entre $2003$ et $2006$ alors le nombre de naissances n'a pas cessé de croitre entre $2003$ et $2006$.`,
19
19
  },
20
20
  {
21
21
  interval: { min: 2003, max: 2007 },
22
22
  maxValue: 830_000,
23
23
  answerIndexes: [1, 2],
24
- hint: `Observe les variations du graphiques entre $2003$ et $2007$. Monotone signifie "que croissant" ou "que décroissant".`,
25
- correction: `Comme la courbe monte entre $2003$ et $2006$, puis descend entre $2006$ et $2007$ alors le nombre de naissances a augmenté puis diminué entre $2003$ et $2007$.`,
24
+ hint: `Observe les variations du graphique entre $2003$ et $2007$. Monotone signifie "uniquement croissant" ou "uniquement décroissant".`,
25
+ correction: `Comme la courbe est croissante entre $2003$ et $2006$, puis est décroissante entre $2006$ et $2007$ alors le nombre de naissances a augmenté puis diminué entre $2003$ et $2007$.`,
26
26
  },
27
27
  {
28
28
  interval: { min: 2007, max: 2008 },
29
29
  maxValue: 828_000,
30
30
  answerIndexes: [0],
31
- hint: `Observe les variations du graphiques entre $2007$ et $2008$. Monotone signifie "que croissant" ou "que décroissant".`,
32
- correction: `Comme la courbe monte entre $2007$ et $2008$ alors le nombre de naissances n'a pas cessé de croitre entre $2007$ et $2008$.`,
31
+ hint: `Observe les variations du graphique entre $2007$ et $2008$. Monotone signifie "uniquement croissant" ou "uniquement décroissant".`,
32
+ correction: `Comme la courbe est croissante entre $2007$ et $2008$ alors le nombre de naissances n'a pas cessé de croitre entre $2007$ et $2008$.`,
33
33
  },
34
34
  {
35
35
  interval: { min: 2006, max: 2008 },
36
36
  maxValue: 830_000,
37
37
  answerIndexes: [1],
38
- hint: `Observe les variations du graphiques entre $2006$ et $2008$. Monotone signifie "que croissant" ou "que décroissant".`,
39
- correction: `Comme la courbe descend entre $2006$ et $2007$ puis monte entre $2007$ et $2008$ alors le nombre de naissances a augmenté puis diminué entre $2006$ et $2008$.`,
38
+ hint: `Observe les variations du graphique entre $2006$ et $2008$. Monotone signifie "uniquement croissant" ou "uniquement décroissant".`,
39
+ correction: `Comme la courbe est décroissante entre $2006$ et $2007$ puis est croissante entre $2007$ et $2008$ alors le nombre de naissances a diminué puis augmenté entre $2006$ et $2008$.`,
40
40
  },
41
41
  {
42
42
  interval: { min: 2008, max: 2009 },
43
43
  maxValue: 828_000,
44
44
  answerIndexes: [],
45
- hint: `Observe les variations du graphiques entre $2008$ et $2009$. Monotone signifie "que croissant" ou "que décroissant".`,
46
- correction: `Comme la courbe monte descend entre $2008$ et $2009$ alors le nombre de naissances a diminué entre $2008$ et $2009$.`,
45
+ hint: `Observe les variations du graphique entre $2008$ et $2009$. Monotone signifie "uniquement croissant" ou "uniquement décroissant".`,
46
+ correction: `Comme la courbe est décroissante entre $2008$ et $2009$ alors le nombre de naissances a diminué entre $2008$ et $2009$.`,
47
47
  },
48
48
  {
49
49
  interval: { min: 2009, max: 2011 },
50
50
  maxValue: 833_000,
51
51
  answerIndexes: [1, 2],
52
- hint: `Observe les variations du graphiques entre $2009$ et $2011$. Monotone signifie "que croissant" ou "que décroissant".`,
53
- correction: `Comme la courbe monte entre $2009$ et $2010$, puis descend entre $2010$ et $2011$ alors le nombre de naissances a augmenté puis diminué entre $2009$ et $2011$.`,
52
+ hint: `Observe les variations du graphique entre $2009$ et $2011$. Monotone signifie "uniquement croissant" ou "uniquement décroissant".`,
53
+ correction: `Comme la courbe est croissante entre $2009$ et $2010$, puis est décroissante entre $2010$ et $2011$ alors le nombre de naissances a augmenté puis diminué entre $2009$ et $2011$.`,
54
54
  },
55
55
  ];
56
56
  const getInstruction = (identifiers) => {
@@ -122,7 +122,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
122
122
  };
123
123
  export const graphReading = {
124
124
  id: "graphReading",
125
- label: "Lire un graphique",
125
+ label: "Lire et interpréter la courbe d’une fonction ($2$)",
126
126
  isSingleStep: true,
127
127
  generator: (nb, opts) => getDistinctQuestions(() => getGraphReadingQuestion(opts), nb),
128
128
  qcmTimer: 60,
@@ -1 +1 @@
1
- {"version":3,"file":"histogramReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/histogramReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoLF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAmBlD,CAAC"}
1
+ {"version":3,"file":"histogramReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/histogramReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAsMF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAmBlD,CAAC"}
@@ -4,17 +4,27 @@ import { numberVEA } from "../../../exercises/vea/numberVEA.js";
4
4
  import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
5
5
  import { frenchify } from "../../../math/utils/latex/frenchify.js";
6
6
  import { randint } from "../../../math/utils/random/randint.js";
7
+ import { round } from "../../../math/utils/round.js";
7
8
  import { frac } from "../../../tree/nodes/operators/fractionNode.js";
9
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
8
10
  import { substract } from "../../../tree/nodes/operators/substractNode.js";
9
11
  import { random } from "../../../utils/alea/random.js";
12
+ import { shuffle } from "../../../utils/alea/shuffle.js";
10
13
  import { alignTex } from "../../../utils/latex/alignTex.js";
11
14
  const getPropositions = (n, { answer, ...identifiers }) => {
12
15
  const propositions = [];
13
- const { data } = identifiers;
16
+ const { data, bounds } = identifiers;
14
17
  addValidProp(propositions, answer);
15
- while (propositions.length < n) {
16
- tryToAddWrongProp(propositions, random(data).frenchify());
17
- }
18
+ const nodeWidths = [...Array(bounds.length - 1).keys()].map((i) => substract(bounds[i + 1], bounds[i]));
19
+ const nodeHeights = nodeWidths.map((nodeWidth, i) => frac(data[i], nodeWidth).simplify());
20
+ nodeHeights.forEach((nodeHeight) => {
21
+ tryToAddWrongProp(propositions, nodeHeight.toTex());
22
+ });
23
+ nodeHeights.forEach((nodeHeight, i) => {
24
+ if (propositions.length < n) {
25
+ tryToAddWrongProp(propositions, round(frac(nodeHeight, nodeWidths[i]).simplify().evaluate(), 0).frenchify());
26
+ }
27
+ });
18
28
  return shuffleProps(propositions, n);
19
29
  };
20
30
  const getAnswer = (identifiers) => {
@@ -63,37 +73,36 @@ const getGGBOptions = (identifiers) => {
63
73
  const offsettedBounds = bounds.map((bound) => bound + offsetX);
64
74
  // const xMin = offsettedBounds[0];
65
75
  const xMax = offsettedBounds[offsettedBounds.length - 1];
66
- const heightMin = 0;
76
+ // const heightMin = 0;
67
77
  const heightMax = Math.max(...heights);
68
78
  const commands = [
69
79
  `B = Histogram({${offsettedBounds}}, {${heights.join(",")}})`,
70
- ...bounds.map((bound, i) => `Text("\\footnotesize ${bound.frenchify()}", (${offsettedBounds[i]}, 50), true, true, 0, -1)`),
71
- `Text("\\footnotesize Diamètre\\ (en \\ cm)", (3, -300), true, true, 0, -1)`,
80
+ ...bounds.map((bound, i) => `XBound_{${i}} = Text("\\footnotesize ${bound.frenchify()}", (${offsettedBounds[i]}, 0), true, true, 0, -1)`),
72
81
  `ShowLabel(B,false)`,
73
- `SetColor(B, "#FE0045AB")`,
82
+ ...heights.map((height, i) => `YBound_{${i}} = Text("\\footnotesize ${round(height, 0).frenchify()}", (0, ${height}), true, true, 0, 0)`),
74
83
  ];
75
84
  const ggb = new GeogebraConstructor({
76
85
  commands,
77
- gridDistance: [10000, 50],
86
+ hideGrid: true,
78
87
  fontSize: 16,
79
88
  lockedAxesRatio: false,
80
89
  xAxis: {
81
90
  hideNumbers: true,
82
91
  showPositive: true,
83
- // hidden: true,
92
+ label: "$\\footnotesize Diamètre (cm)$",
84
93
  },
85
94
  yAxis: {
86
95
  showPositive: true,
87
96
  label: "$\\footnotesize Pommes/cm$",
88
- steps: 100,
97
+ hideNumbers: true,
89
98
  },
90
99
  });
91
100
  return ggb.getOptions({
92
101
  coords: ggb.getAdaptedCoords({
93
- xMin: -1,
94
- xMax: xMax + 1,
95
- yMin: heightMin - 1000,
96
- yMax: heightMax + 300,
102
+ xMin: -xMax * 0.1,
103
+ xMax: xMax * 1.5,
104
+ yMin: -heightMax * 0.25,
105
+ yMax: heightMax * 1.5,
97
106
  }),
98
107
  });
99
108
  };
@@ -104,24 +113,15 @@ const isAnswerValid = (ans, { answer }) => {
104
113
  return numberVEA(ans, answer);
105
114
  };
106
115
  const getHistogramReadingQuestion = () => {
107
- const data = [];
108
- const bounds = [11.5, 12, 13.5, 15, 15.5, 16, 16.2];
109
- for (let i = 0; i < bounds.length - 1; i++) {
116
+ const boundsRaw = [11.5, 12, 13.5, 15, 15.5, 16, 16.2];
117
+ const nbBounds = 3;
118
+ const bounds = random([...Array(boundsRaw.length - nbBounds).keys()].map((i) => boundsRaw.slice(i, i + nbBounds)));
119
+ const heightPool = shuffle([...Array(10).keys()].map((i) => i * 100 + 300));
120
+ const data = [...Array(bounds.length - 1).keys()].map((i) => {
110
121
  const nodeWidth = substract(bounds[i + 1], bounds[i]);
111
- let dataI;
112
- let isHeightAnInteger;
113
- do {
114
- dataI =
115
- 50 *
116
- randint(1, i < 3 ? 18 : 20, //pour ne pas que les 2 premieres barres touchent le label de l'axe
117
- data.map((d) => d / 50));
118
- isHeightAnInteger = !frac(dataI, nodeWidth)
119
- .simplify()
120
- .toTex()
121
- .includes("frac");
122
- } while (!isHeightAnInteger);
123
- data.push(dataI);
124
- }
122
+ const nodeHeight = heightPool[i].toTree();
123
+ return multiply(nodeWidth, nodeHeight).simplify().evaluate();
124
+ });
125
125
  const itemAsked = randint(0, bounds.length - 1);
126
126
  const identifiers = {
127
127
  bounds,
@@ -1 +1 @@
1
- {"version":3,"file":"plausibleGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/plausibleGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,QAAQ,EACT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA4JF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
1
+ {"version":3,"file":"plausibleGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/plausibleGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,QAAQ,EAET,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAyNF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAahD,CAAC"}
@@ -1,7 +1,11 @@
1
1
  import { addValidProp, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { colorWithOpacity, greenDark, orange, pinkDark, purpleDark, red, } from "../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../geogebra/geogebraConstructor.js";
5
+ import { Point } from "../../../math/geometry/point.js";
3
6
  import { randint } from "../../../math/utils/random/randint.js";
4
7
  import { round } from "../../../math/utils/round.js";
8
+ import { add } from "../../../tree/nodes/operators/addNode.js";
5
9
  import { frac } from "../../../tree/nodes/operators/fractionNode.js";
6
10
  import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
7
11
  import { random } from "../../../utils/alea/random.js";
@@ -53,13 +57,13 @@ const getInstruction = (identifiers) => {
53
57
  const total = values.reduce((acc, x) => acc + x, 0);
54
58
  return `Sur $${total.frenchify()}$ personnes, on distingue $3$ groupes :
55
59
 
56
- groupe A : $${values[0].frenchify()}$ personnes
60
+ - groupe $A$ : $${values[0].frenchify()}$ personnes
57
61
 
58
- groupe B : $${values[1].frenchify()}$ personnes
62
+ - groupe $B$ : $${values[1].frenchify()}$ personnes
59
63
 
60
- groupe C : les autres.
64
+ - groupe $C$ : les autres.
61
65
 
62
- Parmi les propositions ci-dessous, laquelle décrit cette situation représentée par un diagramme circulaire ?`;
66
+ Parmi les propositions ci-dessous, laquelle décrit la représentation par un diagramme circulaire de cette situation ?`;
63
67
  };
64
68
  const getPropositions = (_, { ...identifiers }) => {
65
69
  const { indexSituation } = identifiers;
@@ -106,6 +110,50 @@ $$
106
110
  `)
107
111
  .join(``)}`;
108
112
  };
113
+ const getCorrectionGGBOptions = (identifiers) => {
114
+ const { values } = identifiers;
115
+ const proportions = getProportions(values);
116
+ const angles = proportions.map((fractionNode) => -round(multiply(fractionNode, 359.9).evaluate(), 2));
117
+ const anglesCumulated = angles.reduce((acc, x) => [...acc, add(acc[acc.length - 1], x).evaluate()], [0 + 90]);
118
+ const points = anglesCumulated
119
+ .map((angle) => (angle * Math.PI) / 180)
120
+ .map((radAngle) => [
121
+ round(Math.cos(radAngle), 6),
122
+ round(Math.sin(radAngle), 6),
123
+ ]);
124
+ const labels = values.map((value) => value.frenchify());
125
+ const letters = ["A", "B", "C", "D", "E", "F", "G"];
126
+ const colors = [greenDark, orange, pinkDark, purpleDark, red];
127
+ const pointsObj = points.map((p, i) => new Point(letters[i], p[0], p[1]));
128
+ const getMidPoint = (angleA, angleB) => {
129
+ const angleM = (angleA + angleB) / 2.0;
130
+ const angleMInDegrees = (angleM * Math.PI) / 180;
131
+ return [1.2 * Math.cos(angleMInDegrees), 1.2 * Math.sin(angleMInDegrees)];
132
+ };
133
+ const ggb = new GeogebraConstructor({
134
+ commands: [
135
+ `C = Circle((0,0), 1)`,
136
+ `SetFixed(C, true)`,
137
+ `SetLineThickness(C, 1)`,
138
+ // ...pointsObj.flatMap((p) => p.toGGBCommand()),
139
+ ...pointsObj
140
+ .slice(0, -1)
141
+ .flatMap((_, i) => [
142
+ `C_${i} = CircularSector((0,0), ${pointsObj[i].toMathString()}, ${pointsObj[i + 1].toMathString()})`,
143
+ `SetFixed(C_${i}, true)`,
144
+ `SetColor(C_${i}, "${colorWithOpacity(colors[i], 80)}")`,
145
+ `SetLineThickness(C_${i}, 0)`,
146
+ `Text("$\\tiny \\text{${labels[i]}$", (${getMidPoint(anglesCumulated[i], anglesCumulated[i + 1]).join(",")}), true, true, 0, 0)`,
147
+ ]),
148
+ ],
149
+ hideAxes: true,
150
+ hideGrid: true,
151
+ forbidShiftDragZoom: true,
152
+ });
153
+ return ggb.getOptions({
154
+ coords: [-1.4, 1.4, -1.4, 1.4],
155
+ });
156
+ };
109
157
  const getPlausibleGraphQuestion = () => {
110
158
  const indexSituation = randint(0, situations.length);
111
159
  const bigNumber = random([
@@ -127,6 +175,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
127
175
  identifiers,
128
176
  hint: getHint(identifiers),
129
177
  correction: getCorrection(identifiers),
178
+ correctionGgbOptions: getCorrectionGGBOptions(identifiers),
130
179
  };
131
180
  return question;
132
181
  };
@@ -1 +1 @@
1
- {"version":3,"file":"convexityQuadrinomials.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/convexity/convexityQuadrinomials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAwIF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
1
+ {"version":3,"file":"convexityQuadrinomials.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/convexity/convexityQuadrinomials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAwIF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
@@ -96,7 +96,6 @@ export const convexityQuadrinomials = {
96
96
  generator: (nb) => getDistinctQuestions(getConvexityQuadrinomialsQuestion, nb),
97
97
  qcmTimer: 60,
98
98
  freeTimer: 60,
99
- answerType: "QCU",
100
99
  getPropositions,
101
100
  isAnswerValid,
102
101
  subject: "Mathématiques",
@@ -1 +1 @@
1
- {"version":3,"file":"equaDiffCheckSolutionFirstOrder.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAE7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,eAAe,CAAC;IACrC,mBAAmB,EAAE,eAAe,CAAC;IACrC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAiJF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAcjE,CAAC"}
1
+ {"version":3,"file":"equaDiffCheckSolutionFirstOrder.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAcrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAE7C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,eAAe,CAAC;IACrC,mBAAmB,EAAE,eAAe,CAAC;IACrC,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AA8IF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAajE,CAAC"}