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.
- package/lib/exercises/exercise.d.ts +5 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbersAffirmations.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts +5 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionToPercentToDecimal.js +92 -38
- package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/findCoeffInProportionalTableNonIntegers.js +5 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportional.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportional.js +7 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/isTableProportionalNonInteger.js +5 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTable.js +5 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +8 -2
- package/lib/exercises/math/calculLitteral/equation/equa1.d.ts +4 -1
- package/lib/exercises/math/calculLitteral/equation/equa1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equa1.js +27 -7
- package/lib/exercises/math/calculLitteral/equation/equa2.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/equa2.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equa2.js +18 -1
- package/lib/exercises/math/calculLitteral/equation/equa3.d.ts +4 -1
- package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equa3.js +26 -6
- package/lib/exercises/math/calculLitteral/equation/equa4.d.ts +4 -1
- package/lib/exercises/math/calculLitteral/equation/equa4.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equa4.js +27 -7
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.d.ts +14 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa1.js +129 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.d.ts +18 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa2.js +167 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.d.ts +15 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa3.js +129 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.d.ts +16 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/equa4.js +124 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType1.js +107 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType2.js +108 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/firstDegreeEquationIntType3.js +104 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/index.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/firstDegree/index.js +7 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -7
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -7
- package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/histogram/etendueHistogram.js +175 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramCommenting.js +250 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramFillDataTableFromHistogramData.js +173 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.d.ts +14 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramIsSameData.js +239 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramReading.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/histogram/histogramReading.js +163 -0
- package/lib/exercises/math/dataRepresentations/histogram/index.d.ts +6 -0
- package/lib/exercises/math/dataRepresentations/histogram/index.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/histogram/index.js +5 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts +1 -1
- package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/index.js +1 -1
- package/lib/exercises/math/dataRepresentations/tableReading.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/tableReading.js +7 -0
- package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustment.js +7 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +7 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +7 -1
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts +4 -1
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +19 -4
- package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts +1 -0
- package/lib/exercises/math/functions/affines/leadingCoefficient.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/leadingCoefficient.js +13 -1
- package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts +4 -1
- package/lib/exercises/math/functions/affines/recognizeAffineGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/recognizeAffineGraph.js +19 -4
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionTable.js +7 -1
- package/lib/exercises/math/functions/basics/placePointsFromValueTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/placePointsFromValueTable.js +7 -0
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts +4 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pythagoreOrThales.js +18 -3
- package/lib/exercises/math/geometry/triangles/index.d.ts +1 -0
- package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/triangles/index.js +1 -0
- package/lib/exercises/math/geometry/triangles/similar/index.d.ts +4 -0
- package/lib/exercises/math/geometry/triangles/similar/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/similar/index.js +3 -0
- package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.d.ts +10 -0
- package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.js +122 -0
- package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.d.ts +15 -0
- package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWrtSideLengths.js +351 -0
- package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.d.ts +11 -0
- package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/triangles/similar/placeSegmentsOfSimilarTriangle.js +311 -0
- package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.d.ts +10 -0
- package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.js +135 -0
- package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.d.ts +9 -0
- package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/basicProbas/findEffectifFromProba.js +109 -0
- package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValue.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValue.js +7 -0
- package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.d.ts +9 -0
- package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/basicProbas/getMissingProbabilityValueMiddleSchool.js +120 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts +4 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.js +4 -0
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts +12 -0
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.js +374 -0
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +7 -0
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +7 -0
- package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +7 -1
- package/lib/exercises/math/probaStat/stats1var/calculateMeanFromFrequencies.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/calculateMeanFromFrequencies.js +7 -0
- package/lib/exercises/math/probaStat/stats1var/cumulativeSum.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/cumulativeSum.js +7 -0
- package/lib/exercises/math/probaStat/stats1var/etendueTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/etendueTable.js +7 -1
- package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/getQuartileProportionQuestion.js +7 -0
- package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +5 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +7 -0
- package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithList.js +67 -14
- package/lib/exercises/math/probaStat/stats1var/medianWithTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithTable.js +7 -1
- package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartiles.js +7 -1
- package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +5 -1
- package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/varianceTable.js +5 -1
- package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/averagePoint.js +7 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts +7 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +171 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts +7 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.js +155 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/index.d.ts +3 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/index.js +3 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts +7 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.js +189 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts +1 -0
- package/lib/exercises/math/spaceGeometry/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/index.js +1 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.d.ts +14 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfConeSection.js +439 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.d.ts +14 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfCylinderSection.js +548 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.d.ts +11 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfRectangularPrismSection.js +360 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.d.ts +9 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sections/areaOfSphereSection.js +272 -0
- package/lib/exercises/math/spaceGeometry/sections/index.d.ts +9 -0
- package/lib/exercises/math/spaceGeometry/sections/index.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sections/index.js +8 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.d.ts +11 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCone.js +266 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.d.ts +11 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfCylinder.js +236 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.d.ts +7 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfRectangularPrism.js +92 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.d.ts +9 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sections/recognizeSectionsOfSphereOrBall.js +236 -0
- package/lib/exercises/pc/mathExosInPC.d.ts +4 -4
- package/lib/exercises/pc/mathExosInPC.d.ts.map +1 -1
- package/lib/exercises/pc/mathExosInPC.js +4 -4
- package/lib/index.d.ts +173 -45
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/spacePoint.d.ts +10 -0
- package/lib/math/geometry/spacePoint.d.ts.map +1 -1
- package/lib/math/geometry/spacePoint.js +13 -0
- package/lib/tree/nodes/operators/substractNode.d.ts +1 -0
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +6 -0
- 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 @@
|
|
|
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"}
|
|
@@ -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,
|
|
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;
|
|
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;
|
|
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: {
|
|
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;
|
|
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: {
|
|
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;
|
|
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: {
|
|
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
|
-
|
|
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,
|
|
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 =
|
|
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
|
};
|
|
@@ -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;
|
|
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"}
|