math-exercises 3.0.150 → 3.0.152

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 (217) hide show
  1. package/lib/exercises/exercise.d.ts +5 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/arithmetics/primeNumbersAffirmations.js +1 -1
  4. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts +5 -1
  5. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +92 -38
  7. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +5 -1
  9. package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/proportionality/isTableProportional.js +7 -1
  11. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +5 -1
  13. package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +5 -1
  15. package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +8 -2
  17. package/lib/exercises/math/calculLitteral/equation/equa1.d.ts +4 -1
  18. package/lib/exercises/math/calculLitteral/equation/equa1.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/equation/equa1.js +27 -7
  20. package/lib/exercises/math/calculLitteral/equation/equa2.d.ts +1 -0
  21. package/lib/exercises/math/calculLitteral/equation/equa2.d.ts.map +1 -1
  22. package/lib/exercises/math/calculLitteral/equation/equa2.js +18 -1
  23. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts +4 -1
  24. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/equation/equa3.js +26 -6
  26. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts +4 -1
  27. package/lib/exercises/math/calculLitteral/equation/equa4.d.ts.map +1 -1
  28. package/lib/exercises/math/calculLitteral/equation/equa4.js +27 -7
  29. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.d.ts +14 -0
  30. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.d.ts.map +1 -0
  31. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.js +129 -0
  32. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.d.ts +18 -0
  33. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.d.ts.map +1 -0
  34. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.js +167 -0
  35. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.d.ts +15 -0
  36. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.d.ts.map +1 -0
  37. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.js +129 -0
  38. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.d.ts +16 -0
  39. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.d.ts.map +1 -0
  40. package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.js +124 -0
  41. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.d.ts +9 -0
  42. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.d.ts.map +1 -0
  43. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.js +107 -0
  44. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.d.ts +10 -0
  45. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.d.ts.map +1 -0
  46. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.js +108 -0
  47. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.d.ts +11 -0
  48. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.d.ts.map +1 -0
  49. package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.js +104 -0
  50. package/lib/exercises/math/calculLitteral/equation/firstDegree/index.d.ts +8 -0
  51. package/lib/exercises/math/calculLitteral/equation/firstDegree/index.d.ts.map +1 -0
  52. package/lib/exercises/math/calculLitteral/equation/firstDegree/index.js +7 -0
  53. package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -7
  54. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  55. package/lib/exercises/math/calculLitteral/equation/index.js +1 -7
  56. package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.d.ts +8 -0
  57. package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.d.ts.map +1 -0
  58. package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.js +175 -0
  59. package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.d.ts +9 -0
  60. package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.d.ts.map +1 -0
  61. package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.js +250 -0
  62. package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.d.ts +9 -0
  63. package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.d.ts.map +1 -0
  64. package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.js +173 -0
  65. package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.d.ts +14 -0
  66. package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.d.ts.map +1 -0
  67. package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.js +239 -0
  68. package/lib/exercises/math/dataRepresentations/histogram/histogramReading.d.ts +9 -0
  69. package/lib/exercises/math/dataRepresentations/histogram/histogramReading.d.ts.map +1 -0
  70. package/lib/exercises/math/dataRepresentations/histogram/histogramReading.js +163 -0
  71. package/lib/exercises/math/dataRepresentations/histogram/index.d.ts +6 -0
  72. package/lib/exercises/math/dataRepresentations/histogram/index.d.ts.map +1 -0
  73. package/lib/exercises/math/dataRepresentations/histogram/index.js +5 -0
  74. package/lib/exercises/math/dataRepresentations/index.d.ts +1 -1
  75. package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
  76. package/lib/exercises/math/dataRepresentations/index.js +1 -1
  77. package/lib/exercises/math/dataRepresentations/tableReading.d.ts.map +1 -1
  78. package/lib/exercises/math/dataRepresentations/tableReading.js +7 -0
  79. package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -1
  80. package/lib/exercises/math/functions/affines/affineAdjustment.js +7 -1
  81. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
  82. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +7 -1
  83. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts.map +1 -1
  84. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +7 -1
  85. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts +4 -1
  86. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts.map +1 -1
  87. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +19 -4
  88. package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts +1 -0
  89. package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
  90. package/lib/exercises/math/functions/affines/leadingCoefficient.js +13 -1
  91. package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts +4 -1
  92. package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts.map +1 -1
  93. package/lib/exercises/math/functions/affines/recognizeAffineGraph.js +19 -4
  94. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
  95. package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +7 -1
  96. package/lib/exercises/math/functions/basics/placePointsFromValueTable.d.ts.map +1 -1
  97. package/lib/exercises/math/functions/basics/placePointsFromValueTable.js +7 -0
  98. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts +4 -1
  99. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
  100. package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +18 -3
  101. package/lib/exercises/math/geometry/triangles/index.d.ts +1 -0
  102. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
  103. package/lib/exercises/math/geometry/triangles/index.js +1 -0
  104. package/lib/exercises/math/geometry/triangles/similar/index.d.ts +4 -0
  105. package/lib/exercises/math/geometry/triangles/similar/index.d.ts.map +1 -0
  106. package/lib/exercises/math/geometry/triangles/similar/index.js +3 -0
  107. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.d.ts +10 -0
  108. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.d.ts.map +1 -0
  109. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.js +122 -0
  110. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.d.ts +15 -0
  111. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.d.ts.map +1 -0
  112. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.js +351 -0
  113. package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.d.ts +11 -0
  114. package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.d.ts.map +1 -0
  115. package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.js +311 -0
  116. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.d.ts +10 -0
  117. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.d.ts.map +1 -0
  118. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.js +135 -0
  119. package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.d.ts +9 -0
  120. package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.d.ts.map +1 -0
  121. package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.js +109 -0
  122. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValue.d.ts.map +1 -1
  123. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValue.js +7 -0
  124. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.d.ts +9 -0
  125. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.d.ts.map +1 -0
  126. package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.js +120 -0
  127. package/lib/exercises/math/probaStat/basicProbas/index.d.ts +4 -0
  128. package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
  129. package/lib/exercises/math/probaStat/basicProbas/index.js +4 -0
  130. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts +12 -0
  131. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts.map +1 -0
  132. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.js +374 -0
  133. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  134. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +7 -0
  135. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  136. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +7 -0
  137. package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
  138. package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +7 -1
  139. package/lib/exercises/math/probaStat/stats1var/calculateMeanFromFrequencies.d.ts.map +1 -1
  140. package/lib/exercises/math/probaStat/stats1var/calculateMeanFromFrequencies.js +7 -0
  141. package/lib/exercises/math/probaStat/stats1var/cumulativeSum.d.ts.map +1 -1
  142. package/lib/exercises/math/probaStat/stats1var/cumulativeSum.js +7 -0
  143. package/lib/exercises/math/probaStat/stats1var/etendueTable.d.ts.map +1 -1
  144. package/lib/exercises/math/probaStat/stats1var/etendueTable.js +7 -1
  145. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts.map +1 -1
  146. package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.js +7 -0
  147. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
  148. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +5 -1
  149. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  150. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +7 -0
  151. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts +2 -0
  152. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
  153. package/lib/exercises/math/probaStat/stats1var/medianWithList.js +67 -14
  154. package/lib/exercises/math/probaStat/stats1var/medianWithTable.d.ts.map +1 -1
  155. package/lib/exercises/math/probaStat/stats1var/medianWithTable.js +7 -1
  156. package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
  157. package/lib/exercises/math/probaStat/stats1var/quartiles.js +7 -1
  158. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
  159. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +5 -1
  160. package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
  161. package/lib/exercises/math/probaStat/stats1var/varianceTable.js +5 -1
  162. package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
  163. package/lib/exercises/math/probaStat/stats2var/averagePoint.js +7 -1
  164. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts +7 -0
  165. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -0
  166. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +171 -0
  167. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts +7 -0
  168. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts.map +1 -0
  169. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.js +155 -0
  170. package/lib/exercises/math/probaStat/twoStepExperiments/index.d.ts +3 -0
  171. package/lib/exercises/math/probaStat/twoStepExperiments/index.d.ts.map +1 -1
  172. package/lib/exercises/math/probaStat/twoStepExperiments/index.js +3 -0
  173. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts +7 -0
  174. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts.map +1 -0
  175. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.js +189 -0
  176. package/lib/exercises/math/spaceGeometry/index.d.ts +1 -0
  177. package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -1
  178. package/lib/exercises/math/spaceGeometry/index.js +1 -0
  179. package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.d.ts +14 -0
  180. package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.d.ts.map +1 -0
  181. package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.js +439 -0
  182. package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.d.ts +14 -0
  183. package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.d.ts.map +1 -0
  184. package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.js +548 -0
  185. package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.d.ts +11 -0
  186. package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.d.ts.map +1 -0
  187. package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.js +360 -0
  188. package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.d.ts +9 -0
  189. package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.d.ts.map +1 -0
  190. package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.js +272 -0
  191. package/lib/exercises/math/spaceGeometry/sections/index.d.ts +9 -0
  192. package/lib/exercises/math/spaceGeometry/sections/index.d.ts.map +1 -0
  193. package/lib/exercises/math/spaceGeometry/sections/index.js +8 -0
  194. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.d.ts +11 -0
  195. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.d.ts.map +1 -0
  196. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.js +266 -0
  197. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.d.ts +11 -0
  198. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.d.ts.map +1 -0
  199. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.js +236 -0
  200. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.d.ts +7 -0
  201. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.d.ts.map +1 -0
  202. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.js +92 -0
  203. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.d.ts +9 -0
  204. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.d.ts.map +1 -0
  205. package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.js +236 -0
  206. package/lib/exercises/pc/mathExosInPC.d.ts +4 -4
  207. package/lib/exercises/pc/mathExosInPC.d.ts.map +1 -1
  208. package/lib/exercises/pc/mathExosInPC.js +4 -4
  209. package/lib/index.d.ts +173 -45
  210. package/lib/index.d.ts.map +1 -1
  211. package/lib/math/geometry/spacePoint.d.ts +10 -0
  212. package/lib/math/geometry/spacePoint.d.ts.map +1 -1
  213. package/lib/math/geometry/spacePoint.js +13 -0
  214. package/lib/tree/nodes/operators/substractNode.d.ts +1 -0
  215. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  216. package/lib/tree/nodes/operators/substractNode.js +6 -0
  217. package/package.json +1 -1
@@ -0,0 +1,239 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
+ import { frenchify } from "../../../../math/utils/latex/frenchify.js";
5
+ import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { round } from "../../../../math/utils/round.js";
7
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
8
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
9
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
10
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
11
+ import { probaFlip } from "../../../../utils/alea/probaFlip.js";
12
+ import { random } from "../../../../utils/alea/random.js";
13
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
14
+ import { mdTable } from "../../../../utils/markdown/mdTable.js";
15
+ const getStrStatClassForIndexCateg = (indexCateg, data, bounds) => {
16
+ const labels = bounds.map(frenchify);
17
+ const isLastCateg = indexCateg == data.length;
18
+ return `[${labels[indexCateg]};${labels[indexCateg + 1]}${isLastCateg ? "]" : "["}`;
19
+ };
20
+ const getStrTableForTableData = (data, bounds) => {
21
+ return `${mdTable([
22
+ [
23
+ "\\text{Diamètre(cm)}",
24
+ ...data.map((_, i) => getStrStatClassForIndexCateg(i, data, bounds)),
25
+ ],
26
+ ["\\text{effectif}", ...data.map((value) => value.frenchify())],
27
+ ], true)}`;
28
+ };
29
+ const getStrTableForHistogramData = (data, bounds) => {
30
+ const arrDict = data.map((_, i) => {
31
+ const upperBound = bounds[i + 1];
32
+ const lowerBound = bounds[i];
33
+ const nodeWidth = substract(upperBound, lowerBound).simplify();
34
+ const nodeHeight = frac(data[i], nodeWidth).simplify();
35
+ return {
36
+ width: nodeWidth.evaluate(),
37
+ height: nodeHeight.evaluate(),
38
+ area: data[i],
39
+ };
40
+ });
41
+ return `${mdTable([
42
+ [
43
+ "\\text{Diamètre(cm)}",
44
+ ...data.map((_, i) => getStrStatClassForIndexCateg(i, data, bounds)),
45
+ ],
46
+ ["\\text{largeur}", ...arrDict.map((dict) => dict["width"].frenchify())],
47
+ ["\\text{hauteur}", ...arrDict.map((dict) => dict["height"].frenchify())],
48
+ ["\\text{effectif}", ...arrDict.map((dict) => dict["area"].frenchify())],
49
+ ], true)}`;
50
+ };
51
+ const getPropositions = (_, { answer }) => {
52
+ const propositions = [];
53
+ ["Oui", "Non"].forEach((str) => {
54
+ if (str === answer) {
55
+ addValidProp(propositions, str, "raw");
56
+ }
57
+ else {
58
+ tryToAddWrongProp(propositions, str, "raw");
59
+ }
60
+ });
61
+ return propositions;
62
+ };
63
+ const getAnswer = (identifiers) => {
64
+ const { table } = identifiers;
65
+ const isSameData = table === undefined;
66
+ return ["Oui", "Non"][isSameData ? 0 : 1];
67
+ };
68
+ const getInstruction = (identifiers) => {
69
+ const { histogram, table } = identifiers;
70
+ const tableData = table ?? histogram;
71
+ return `Ci-dessous un tableau de données et un histogramme.
72
+ Représentent-ils les mêmes données ?
73
+
74
+ ${getStrTableForTableData(tableData.data, tableData.bounds)}
75
+ `;
76
+ };
77
+ const getHint = () => {
78
+ return `Dans un histogramme, l'effectif d'une classe est donné par l'aire du rectangle
79
+ compris entre les deux bornes de la classe.`;
80
+ };
81
+ const getCorrection = (identifiers) => {
82
+ const { histogram, table } = identifiers;
83
+ const isSameData = table === undefined;
84
+ return `On peut représenter l'histogramme par le tableau suivant :
85
+
86
+ ${getStrTableForHistogramData(histogram.data, histogram.bounds)}
87
+
88
+ Le tableau et l'histogramme ${isSameData
89
+ ? "représentent donc les mêmes données"
90
+ : "ne représentent donc pas les mêmes données"}.`;
91
+ };
92
+ const getGGBOptions = (identifiers) => {
93
+ const { histogram } = identifiers;
94
+ const [data, bounds] = [histogram.data, histogram.bounds];
95
+ const heights = [];
96
+ for (let i = 0; i < data.length; i++) {
97
+ const width = bounds[i + 1] - bounds[i];
98
+ const height = data[i] / width;
99
+ heights.push(height);
100
+ }
101
+ const offsetX = -bounds[0] + 1;
102
+ const offsettedBounds = bounds.map((bound) => bound + offsetX);
103
+ // const xMin = offsettedBounds[0];
104
+ const xMax = offsettedBounds[offsettedBounds.length - 1];
105
+ // const heightMin = 0;
106
+ const heightMax = Math.max(...heights);
107
+ const commands = [
108
+ `B = Histogram({${offsettedBounds}}, {${heights.join(",")}})`,
109
+ ...bounds.map((bound, i) => `XBound_{${i}} = Text("\\footnotesize ${bound.frenchify()}", (${offsettedBounds[i]}, 0), true, true, 0, -1)`),
110
+ `ShowLabel(B,false)`,
111
+ ...heights.map((height, i) => `YBound_{${i}} = Text("\\footnotesize ${round(height, 0).frenchify()}", (0, ${height}), true, true, 0, 0)`),
112
+ ];
113
+ const ggb = new GeogebraConstructor({
114
+ commands,
115
+ hideGrid: true,
116
+ fontSize: 16,
117
+ lockedAxesRatio: false,
118
+ xAxis: {
119
+ hideNumbers: true,
120
+ showPositive: true,
121
+ label: "$\\footnotesize Diamètre (cm)$",
122
+ },
123
+ yAxis: {
124
+ showPositive: true,
125
+ label: "$\\footnotesize Pommes/cm$",
126
+ hideNumbers: true,
127
+ },
128
+ });
129
+ return ggb.getOptions({
130
+ coords: ggb.getAdaptedCoords({
131
+ xMin: -xMax * 0.1,
132
+ xMax: xMax * 1.5,
133
+ yMin: -heightMax * 0.25,
134
+ yMax: heightMax * 1.5,
135
+ }),
136
+ });
137
+ };
138
+ const getHistogramIsSameDataQuestion = () => {
139
+ const boundsRaw = [11.5, 12, 13.5, 15, 15.5, 16, 16.2];
140
+ const nbBounds = 3;
141
+ const indexBoundPool = [...Array(boundsRaw.length - nbBounds + 1).keys()];
142
+ const indexBound1 = random(indexBoundPool);
143
+ const bounds = boundsRaw.slice(indexBound1, indexBound1 + nbBounds);
144
+ const heightPool = shuffle([...Array(10).keys()].map((i) => i * 100 + 300));
145
+ const data = [...Array(bounds.length - 1).keys()].map((i) => {
146
+ const nodeWidth = substract(bounds[i + 1], bounds[i]);
147
+ const nodeHeight = heightPool[i].toTree();
148
+ return multiply(nodeWidth, nodeHeight).simplify().evaluate();
149
+ });
150
+ const histogram = { data, bounds };
151
+ const isSameData = coinFlip();
152
+ let table;
153
+ if (isSameData) {
154
+ table = undefined;
155
+ }
156
+ else {
157
+ if (probaFlip(0.3)) {
158
+ //difference: categ
159
+ const indexBound2 = random(indexBoundPool.filter((i) => i !== indexBound1));
160
+ const bounds = boundsRaw.slice(indexBound2, indexBound2 + nbBounds);
161
+ table = {
162
+ bounds,
163
+ data,
164
+ };
165
+ }
166
+ else {
167
+ //difference: data
168
+ let data;
169
+ if (probaFlip(0.68)) {
170
+ //data -> height
171
+ data = [...Array(bounds.length - 1).keys()].map((i) => {
172
+ // const nodeWidth = substract(bounds[i + 1], bounds[i]);
173
+ const nodeHeight = heightPool[i].toTree();
174
+ return nodeHeight.evaluate();
175
+ });
176
+ }
177
+ else {
178
+ //data[i] is height
179
+ const indexWrong = randint(0, bounds.length - 1);
180
+ data = [...Array(bounds.length - 1).keys()].map((i) => {
181
+ const nodeWidth = substract(bounds[i + 1], bounds[i]);
182
+ const nodeHeight = heightPool[i].toTree();
183
+ if (indexWrong) {
184
+ return nodeHeight.evaluate();
185
+ }
186
+ else {
187
+ return multiply(nodeWidth, nodeHeight).simplify().evaluate();
188
+ }
189
+ });
190
+ }
191
+ table = {
192
+ bounds,
193
+ data,
194
+ };
195
+ }
196
+ }
197
+ const identifiers = {
198
+ histogram,
199
+ table,
200
+ };
201
+ return getQuestionFromIdentifiers(identifiers);
202
+ };
203
+ const getQuestionFromIdentifiers = (identifiers) => {
204
+ return {
205
+ answer: getAnswer(identifiers),
206
+ instruction: getInstruction(identifiers),
207
+ answerFormat: "tex",
208
+ identifiers,
209
+ hint: getHint(identifiers),
210
+ correction: getCorrection(identifiers),
211
+ ggbOptions: getGGBOptions(identifiers),
212
+ style: {
213
+ tableOptions: {
214
+ firstCellIsDivided: false,
215
+ firstColumnIsHeader: true,
216
+ firstRowIsHeader: false,
217
+ },
218
+ },
219
+ };
220
+ };
221
+ export const histogramIsSameData = {
222
+ id: "histogramIsSameData",
223
+ label: "Comparer les données d'un tableau et d'un histogramme",
224
+ isSingleStep: true,
225
+ generator: (nb, opts) => getDistinctQuestions(() => getHistogramIsSameDataQuestion(opts), nb),
226
+ qcmTimer: 60,
227
+ freeTimer: 60,
228
+ getPropositions,
229
+ subject: "Mathématiques",
230
+ getHint,
231
+ getCorrection,
232
+ getInstruction,
233
+ getAnswer,
234
+ getGGBOptions,
235
+ hasGeogebra: true,
236
+ getQuestionFromIdentifiers,
237
+ hasHintAndCorrection: true,
238
+ answerType: "QCU",
239
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ bounds: number[];
4
+ data: number[];
5
+ itemAsked: number;
6
+ };
7
+ export declare const histogramReading: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=histogramReading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"histogramReading.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/dataRepresentations/histogram/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"}
@@ -0,0 +1,163 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { frenchify } from "../../../../math/utils/latex/frenchify.js";
6
+ import { randint } from "../../../../math/utils/random/randint.js";
7
+ import { round } from "../../../../math/utils/round.js";
8
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
9
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
10
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
11
+ import { random } from "../../../../utils/alea/random.js";
12
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
13
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
14
+ const getPropositions = (n, { answer, ...identifiers }) => {
15
+ const propositions = [];
16
+ const { data, bounds } = identifiers;
17
+ addValidProp(propositions, answer);
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
+ });
28
+ return shuffleProps(propositions, n);
29
+ };
30
+ const getAnswer = (identifiers) => {
31
+ const { data, itemAsked } = identifiers;
32
+ return data[itemAsked].frenchify();
33
+ };
34
+ const getInstruction = (identifiers) => {
35
+ const { bounds, itemAsked } = identifiers;
36
+ const labels = bounds.map(frenchify);
37
+ return `Un producteur trie sa récolte de pommes selon leur diamètre. L'histogramme ci-dessous représente ses résultats.
38
+
39
+ Combien de pommes de diamètre entre $${labels[itemAsked]}$ et $${labels[itemAsked + 1]}\\ \\textrm{cm}$ le producteur a-t-il récoltées ?
40
+ `;
41
+ };
42
+ const getHint = () => {
43
+ return `Dans un histogramme, l'effectif d'une classe est donné par l'aire du rectangle
44
+ compris entre les deux bornes de la classe.`;
45
+ };
46
+ const getCorrection = (identifiers) => {
47
+ const { bounds, data, itemAsked } = identifiers;
48
+ const labels = bounds.map(frenchify);
49
+ const upperBound = bounds[itemAsked + 1];
50
+ const lowerBound = bounds[itemAsked];
51
+ const nodeWidth = substract(upperBound, lowerBound).simplify();
52
+ const nodeHeight = frac(data[itemAsked], nodeWidth).simplify();
53
+ const isLastClass = itemAsked == data.length;
54
+ return `Ici la classe est [$${labels[itemAsked]}$;$${labels[itemAsked + 1]}$${isLastClass ? "]" : "["}.
55
+ Pour trouver l'effectif, on calcule l'aire du rectangle pour cette classe,
56
+ autrement dit le produit largeur $\\times$ hauteur.
57
+ La largeur est l'étendue de la classe.
58
+ ${alignTex(`${upperBound} - ${lowerBound} = ${nodeWidth.toTex()}`)}
59
+ Pour la hauteur, on lit $${nodeHeight.toTex()}$.
60
+ ${alignTex(`${nodeWidth.toTex()} \\times ${nodeHeight.toTex()} = ${data[itemAsked]}`)}
61
+ Le producteur produit $${data[itemAsked]}$ pommes de diamètre entre $${lowerBound.frenchify()}$ et $${upperBound.frenchify()}\\ \\textrm{cm}$.
62
+ `;
63
+ };
64
+ const getGGBOptions = (identifiers) => {
65
+ const { bounds, data } = identifiers;
66
+ const heights = [];
67
+ for (let i = 0; i < data.length; i++) {
68
+ const width = bounds[i + 1] - bounds[i];
69
+ const height = data[i] / width;
70
+ heights.push(height);
71
+ }
72
+ const offsetX = -bounds[0] + 1;
73
+ const offsettedBounds = bounds.map((bound) => bound + offsetX);
74
+ // const xMin = offsettedBounds[0];
75
+ const xMax = offsettedBounds[offsettedBounds.length - 1];
76
+ // const heightMin = 0;
77
+ const heightMax = Math.max(...heights);
78
+ const commands = [
79
+ `B = Histogram({${offsettedBounds}}, {${heights.join(",")}})`,
80
+ ...bounds.map((bound, i) => `XBound_{${i}} = Text("\\footnotesize ${bound.frenchify()}", (${offsettedBounds[i]}, 0), true, true, 0, -1)`),
81
+ `ShowLabel(B,false)`,
82
+ ...heights.map((height, i) => `YBound_{${i}} = Text("\\footnotesize ${round(height, 0).frenchify()}", (0, ${height}), true, true, 0, 0)`),
83
+ ];
84
+ const ggb = new GeogebraConstructor({
85
+ commands,
86
+ hideGrid: true,
87
+ fontSize: 16,
88
+ lockedAxesRatio: false,
89
+ xAxis: {
90
+ hideNumbers: true,
91
+ showPositive: true,
92
+ label: "$\\footnotesize Diamètre (cm)$",
93
+ },
94
+ yAxis: {
95
+ showPositive: true,
96
+ label: "$\\footnotesize Pommes/cm$",
97
+ hideNumbers: true,
98
+ },
99
+ });
100
+ return ggb.getOptions({
101
+ coords: ggb.getAdaptedCoords({
102
+ xMin: -xMax * 0.1,
103
+ xMax: xMax * 1.5,
104
+ yMin: -heightMax * 0.25,
105
+ yMax: heightMax * 1.5,
106
+ }),
107
+ });
108
+ };
109
+ const getKeys = () => {
110
+ return [];
111
+ };
112
+ const isAnswerValid = (ans, { answer }) => {
113
+ return numberVEA(ans, answer);
114
+ };
115
+ const getHistogramReadingQuestion = () => {
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) => {
121
+ const nodeWidth = substract(bounds[i + 1], bounds[i]);
122
+ const nodeHeight = heightPool[i].toTree();
123
+ return multiply(nodeWidth, nodeHeight).simplify().evaluate();
124
+ });
125
+ const itemAsked = randint(0, bounds.length - 1);
126
+ const identifiers = {
127
+ bounds,
128
+ data,
129
+ itemAsked,
130
+ };
131
+ return getQuestionFromIdentifiers(identifiers);
132
+ };
133
+ const getQuestionFromIdentifiers = (identifiers) => {
134
+ return {
135
+ answer: getAnswer(identifiers),
136
+ instruction: getInstruction(identifiers),
137
+ keys: getKeys(identifiers),
138
+ answerFormat: "tex",
139
+ identifiers,
140
+ hint: getHint(identifiers),
141
+ correction: getCorrection(identifiers),
142
+ ggbOptions: getGGBOptions(identifiers),
143
+ };
144
+ };
145
+ export const histogramReading = {
146
+ id: "histogramReading",
147
+ label: "Lire les effectifs sur un histogramme",
148
+ isSingleStep: true,
149
+ generator: (nb, opts) => getDistinctQuestions(() => getHistogramReadingQuestion(opts), nb),
150
+ qcmTimer: 60,
151
+ freeTimer: 60,
152
+ getPropositions,
153
+ isAnswerValid,
154
+ subject: "Mathématiques",
155
+ getHint,
156
+ getCorrection,
157
+ getInstruction,
158
+ getAnswer,
159
+ getGGBOptions,
160
+ hasGeogebra: true,
161
+ getQuestionFromIdentifiers,
162
+ hasHintAndCorrection: true,
163
+ };
@@ -0,0 +1,6 @@
1
+ export * from "./histogramReading.js";
2
+ export * from "./histogramCommenting.js";
3
+ export * from "./histogramIsSameData.js";
4
+ export * from "./histogramFillDataTableFromHistogramData.js";
5
+ export * from "./etendueHistogram.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/dataRepresentations/histogram/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8CAA8C,CAAC;AAC7D,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./histogramReading.js";
2
+ export * from "./histogramCommenting.js";
3
+ export * from "./histogramIsSameData.js";
4
+ export * from "./histogramFillDataTableFromHistogramData.js";
5
+ export * from "./etendueHistogram.js";
@@ -2,7 +2,6 @@ export * from "./tableReading.js";
2
2
  export * from "./barChartReading.js";
3
3
  export * from "./functionGraphReading.js";
4
4
  export * from "./pieChartReading.js";
5
- export * from "./histogramReading.js";
6
5
  export * from "./boxPlotReadingPercentages.js";
7
6
  export * from "./boxPlotReading.js";
8
7
  export * from "./compareBoxPlot.js";
@@ -15,4 +14,5 @@ export * from "./graphReading.js";
15
14
  export * from "./plausibleGraph.js";
16
15
  export * from "./halfPieChartReading.js";
17
16
  export * from "./halfPieChartCommenting.js";
17
+ export * from "./histogram/index.js";
18
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC"}
@@ -2,7 +2,6 @@ export * from "./tableReading.js";
2
2
  export * from "./barChartReading.js";
3
3
  export * from "./functionGraphReading.js";
4
4
  export * from "./pieChartReading.js";
5
- export * from "./histogramReading.js";
6
5
  export * from "./boxPlotReadingPercentages.js";
7
6
  export * from "./boxPlotReading.js";
8
7
  export * from "./compareBoxPlot.js";
@@ -15,6 +14,7 @@ export * from "./graphReading.js";
15
14
  export * from "./plausibleGraph.js";
16
15
  export * from "./halfPieChartReading.js";
17
16
  export * from "./halfPieChartCommenting.js";
17
+ export * from "./histogram/index.js";
18
18
  // export * from "./placePointsFromDataTable.js";
19
19
  // export * from "./testGen.js";
20
20
  // export * from "./testGenGGB.js";
@@ -1 +1 @@
1
- {"version":3,"file":"tableReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/tableReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IAIjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA+FF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAa9C,CAAC"}
1
+ {"version":3,"file":"tableReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/tableReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IAIjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAsGF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAa9C,CAAC"}
@@ -84,6 +84,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
84
84
  identifiers,
85
85
  // hint: getHint(identifiers),
86
86
  // correction: getCorrection(identifiers),
87
+ style: {
88
+ tableOptions: {
89
+ firstColumnIsHeader: true,
90
+ firstCellIsDivided: false,
91
+ firstRowIsHeader: true,
92
+ },
93
+ },
87
94
  };
88
95
  return question;
89
96
  };
@@ -1 +1 @@
1
- {"version":3,"file":"affineAdjustment.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAwKF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAa1D,CAAC"}
1
+ {"version":3,"file":"affineAdjustment.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA8KF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAa1D,CAAC"}
@@ -73,7 +73,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
73
73
  keys: ["equal", "y", "x", "a", "b"],
74
74
  answerFormat: "tex",
75
75
  identifiers,
76
- style: { tableHasNoHeader: true },
76
+ style: {
77
+ tableOptions: {
78
+ firstCellIsDivided: false,
79
+ firstColumnIsHeader: true,
80
+ firstRowIsHeader: false,
81
+ },
82
+ },
77
83
  };
78
84
  return question;
79
85
  };
@@ -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,CAalE,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;AAgKF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAalE,CAAC"}
@@ -52,7 +52,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
52
52
  keys: [],
53
53
  answerFormat: "tex",
54
54
  identifiers,
55
- style: { tableHasNoHeader: true },
55
+ style: {
56
+ tableOptions: {
57
+ firstCellIsDivided: false,
58
+ firstColumnIsHeader: true,
59
+ firstRowIsHeader: false,
60
+ },
61
+ },
56
62
  };
57
63
  return question;
58
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"affineAdjustmentRsquared.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustmentRsquared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA+GF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAalE,CAAC"}
1
+ {"version":3,"file":"affineAdjustmentRsquared.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineAdjustmentRsquared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAqHF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAalE,CAAC"}
@@ -43,7 +43,13 @@ const getQuestionFromIdentifiers = (identifiers) => {
43
43
  keys: ["R", "equal"],
44
44
  answerFormat: "tex",
45
45
  identifiers,
46
- style: { tableHasNoHeader: true },
46
+ style: {
47
+ tableOptions: {
48
+ firstCellIsDivided: false,
49
+ firstColumnIsHeader: true,
50
+ firstRowIsHeader: false,
51
+ },
52
+ },
47
53
  };
48
54
  return question;
49
55
  };
@@ -4,6 +4,9 @@ type Identifiers = {
4
4
  b: number;
5
5
  isAskingA: boolean;
6
6
  };
7
- export declare const leadingCoeffAndOriginOrdinate: Exercise<Identifiers>;
7
+ type Options = {
8
+ parameter: string;
9
+ };
10
+ export declare const leadingCoeffAndOriginOrdinate: Exercise<Identifiers, Options>;
8
11
  export {};
9
12
  //# sourceMappingURL=leadingCoeffAndOriginOrdinate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"leadingCoeffAndOriginOrdinate.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AA+FF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAkB/D,CAAC"}
1
+ {"version":3,"file":"leadingCoeffAndOriginOrdinate.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAsGF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAWF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAsBxE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
1
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
4
4
  import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
@@ -44,8 +44,12 @@ const getAnswer = (identifiers) => {
44
44
  const correctAnwer = isAskingA ? a : b;
45
45
  return correctAnwer.frenchify();
46
46
  };
47
- const getLeadingCoeffAndOriginOrdinateQuestion = () => {
48
- const isAskingA = coinFlip();
47
+ const getLeadingCoeffAndOriginOrdinateQuestion = (opts) => {
48
+ const isAskingA = opts?.parameter === "Coefficient directeur"
49
+ ? true
50
+ : opts?.parameter === "Ordonnée à l'origine"
51
+ ? false
52
+ : coinFlip();
49
53
  const f = AffineConstructor.random();
50
54
  const identifiers = { a: f.a, b: f.b, isAskingA };
51
55
  return getQuestionFromIdentifiers(identifiers);
@@ -78,11 +82,21 @@ const getPropositions = (n, { answer, a, b, isAskingA }) => {
78
82
  const isAnswerValid = (ans, { answer }) => {
79
83
  return numberVEA(ans, answer);
80
84
  };
85
+ const options = [
86
+ {
87
+ id: "parameter",
88
+ label: "Paramètre demandé",
89
+ target: GeneratorOptionTarget.generation,
90
+ type: GeneratorOptionType.select,
91
+ values: ["Coefficient directeur", "Ordonnée à l'origine", "Les deux"],
92
+ defaultValue: "Les deux",
93
+ },
94
+ ];
81
95
  export const leadingCoeffAndOriginOrdinate = {
82
96
  id: "leadingCoeffAndOriginOrdinate",
83
97
  label: "Identifier le coefficient directeur ou l'ordonnée à l'origine d'une fonction affine",
84
98
  isSingleStep: true,
85
- generator: (nb) => getDistinctQuestions(getLeadingCoeffAndOriginOrdinateQuestion, nb),
99
+ generator: (nb, opts) => getDistinctQuestions(() => getLeadingCoeffAndOriginOrdinateQuestion(opts), nb),
86
100
  qcmTimer: 60,
87
101
  freeTimer: 60,
88
102
  getPropositions,
@@ -94,4 +108,5 @@ export const leadingCoeffAndOriginOrdinate = {
94
108
  getCorrection,
95
109
  hasHintAndCorrection: true,
96
110
  getQuestionFromIdentifiers,
111
+ options,
97
112
  };
@@ -7,6 +7,7 @@ type Identifiers = {
7
7
  };
8
8
  type Options = {
9
9
  functionType?: string;
10
+ coefType?: string;
10
11
  };
11
12
  export declare const leadingCoefficient: Exercise<Identifiers, Options>;
12
13
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AA6HF,KAAK,OAAO,GAAG;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAYF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgB7D,CAAC"}
1
+ {"version":3,"file":"leadingCoefficient.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/leadingCoefficient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAkIF,KAAK,OAAO,GAAG;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAoBF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgB7D,CAAC"}