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,189 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercise.js";
|
|
2
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
3
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
4
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
5
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
6
|
+
import { getCartesiansProducts } from "../../../../utils/arrays/cartesianProducts.js";
|
|
7
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
8
|
+
import { joinanded } from "../../../../utils/strings/joinanded.js";
|
|
9
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
10
|
+
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
11
|
+
function highlighted(str) {
|
|
12
|
+
return `{ \\color{green} ${str} }`;
|
|
13
|
+
}
|
|
14
|
+
const numberPool = [1, 2, 3, 4];
|
|
15
|
+
const events = [
|
|
16
|
+
//elem
|
|
17
|
+
...getCartesiansProducts([numberPool, numberPool]).flatMap(([i1, i2]) => {
|
|
18
|
+
return {
|
|
19
|
+
str: `On obtient $${i1}$ puis $${i2}$`,
|
|
20
|
+
isRealizingEvent: (v1, v2) => v1 === i1 && v2 === i2,
|
|
21
|
+
};
|
|
22
|
+
}),
|
|
23
|
+
//at least one
|
|
24
|
+
...numberPool.map((i) => {
|
|
25
|
+
return {
|
|
26
|
+
str: `On obtient au moins un $${i}$`,
|
|
27
|
+
isRealizingEvent: (v1, v2) => v1 === i || v2 === i,
|
|
28
|
+
};
|
|
29
|
+
}),
|
|
30
|
+
//none
|
|
31
|
+
...numberPool.map((i) => {
|
|
32
|
+
return {
|
|
33
|
+
str: `On obtient aucun $${i}$`,
|
|
34
|
+
isRealizingEvent: (v1, v2) => v1 !== i && v2 !== i,
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
//exactly one
|
|
38
|
+
...numberPool.map((i) => {
|
|
39
|
+
return {
|
|
40
|
+
str: `On obtient exactement un $${i}$`,
|
|
41
|
+
isRealizingEvent: (v1, v2) => (v1 === i && v2 !== i) || (v1 !== i && v2 === i),
|
|
42
|
+
};
|
|
43
|
+
}),
|
|
44
|
+
//same twice
|
|
45
|
+
{
|
|
46
|
+
str: `On obtient deux fois le même numéro`,
|
|
47
|
+
isRealizingEvent: (v1, v2) => v1 === v2,
|
|
48
|
+
},
|
|
49
|
+
//or
|
|
50
|
+
{
|
|
51
|
+
str: `On obtient au moins un numéro pair`,
|
|
52
|
+
isRealizingEvent: (v1, v2) => v1 % 2 === 0 || v2 % 2 === 0,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
str: `On obtient au moins un numéro impair`,
|
|
56
|
+
isRealizingEvent: (v1, v2) => v1 % 2 === 1 || v2 % 2 === 1,
|
|
57
|
+
},
|
|
58
|
+
//and
|
|
59
|
+
{
|
|
60
|
+
str: `On obtient un numéro impair puis un numéro pair`,
|
|
61
|
+
isRealizingEvent: (v1, v2) => v1 % 2 === 1 && v2 % 2 === 0,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
str: `On obtient un numéro impair puis un numéro impair`,
|
|
65
|
+
isRealizingEvent: (v1, v2) => v1 % 2 === 0 && v2 % 2 === 1,
|
|
66
|
+
},
|
|
67
|
+
//sum=5
|
|
68
|
+
{
|
|
69
|
+
str: `On obtient deux numéros dont la somme vaut $5$`,
|
|
70
|
+
isRealizingEvent: (v1, v2) => v1 + v2 === 5,
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
const getInstruction = (identifiers) => {
|
|
74
|
+
const { indexEvent } = identifiers;
|
|
75
|
+
const event = events[indexEvent];
|
|
76
|
+
return `À deux reprises, on tire un numéro parmi ${joinanded(numberPool.map((i) => `$${i}$`), ", ", " et ")}.
|
|
77
|
+
Quelle est la probabilité de l'évènement "${event.str}" ?`;
|
|
78
|
+
};
|
|
79
|
+
const getAnswerNode = (identifiers) => {
|
|
80
|
+
const { indexEvent } = identifiers;
|
|
81
|
+
const event = events[indexEvent];
|
|
82
|
+
const arrOutcome = getCartesiansProducts([numberPool, numberPool]);
|
|
83
|
+
const arrRealized = arrOutcome.filter(([v1, v2]) => event.isRealizingEvent(v1, v2));
|
|
84
|
+
return frac(arrRealized.length, arrOutcome.length);
|
|
85
|
+
};
|
|
86
|
+
const getAnswer = (identifiers) => {
|
|
87
|
+
return getAnswerNode(identifiers).simplify().toTex();
|
|
88
|
+
};
|
|
89
|
+
const getHint = () => {
|
|
90
|
+
return `Tu peux dresser un tableau à deux entrées avec les différentes issues et compter combien réalisent l'évènement demandé.`;
|
|
91
|
+
};
|
|
92
|
+
const getCorrection = (identifiers) => {
|
|
93
|
+
const { indexEvent } = identifiers;
|
|
94
|
+
const event = events[indexEvent];
|
|
95
|
+
const fractionNode = getAnswerNode(identifiers);
|
|
96
|
+
const nbRealized = fractionNode.leftChild.evaluate();
|
|
97
|
+
const nbOutcomes = fractionNode.rightChild.evaluate();
|
|
98
|
+
const arrOutcome = getCartesiansProducts([numberPool, numberPool]);
|
|
99
|
+
const arrArrStr = arrOutcome.reduce((acc, [v1, v2]) => {
|
|
100
|
+
if (!acc[v1]) {
|
|
101
|
+
acc[v1] = {};
|
|
102
|
+
}
|
|
103
|
+
const strEventSmall = `\\left(${v1},${v2}\\right)`;
|
|
104
|
+
acc[v1][v2] = event.isRealizingEvent(v1, v2)
|
|
105
|
+
? highlighted(strEventSmall)
|
|
106
|
+
: strEventSmall;
|
|
107
|
+
return acc;
|
|
108
|
+
}, {});
|
|
109
|
+
return `Dans le tableau ci-dessous, on a indiqué en vert les issues qui réalisent l'évènement "${event.str}" :
|
|
110
|
+
|
|
111
|
+
${mdTable([
|
|
112
|
+
["\\text{}", ...numberPool.map((i) => `n_2 : ${i}`)],
|
|
113
|
+
...Object.entries(arrArrStr).map(([s, arrStr]) => [
|
|
114
|
+
`n_1 : ${+s}`,
|
|
115
|
+
...Object.values(arrStr),
|
|
116
|
+
]),
|
|
117
|
+
], true)}
|
|
118
|
+
|
|
119
|
+
Sur les $${nbOutcomes.frenchify()}$ issues possibles, ${nbRealized === 1 ? "une seule réalise" : `$${nbRealized}$ réalisent`} l'évènement "${event.str}".
|
|
120
|
+
|
|
121
|
+
La probabilité de l'évènement "${event.str}" est donc $${fractionNode.toTex()}$.
|
|
122
|
+
`;
|
|
123
|
+
};
|
|
124
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
125
|
+
const propositions = [];
|
|
126
|
+
addValidProp(propositions, answer);
|
|
127
|
+
[...Array(events.length).keys()].map((indexEvent) => {
|
|
128
|
+
const identifiersWrong = Object.assign({}, identifiers, { indexEvent });
|
|
129
|
+
const tex = getAnswer(identifiersWrong);
|
|
130
|
+
tryToAddWrongProp(propositions, tex);
|
|
131
|
+
});
|
|
132
|
+
//P=0 and P=1
|
|
133
|
+
[0, 1]
|
|
134
|
+
.map((i) => i.toTree())
|
|
135
|
+
.map((nodeProba) => {
|
|
136
|
+
tryToAddWrongProp(propositions, nodeProba.toTex());
|
|
137
|
+
});
|
|
138
|
+
return shuffleProps(propositions, n);
|
|
139
|
+
};
|
|
140
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
141
|
+
try {
|
|
142
|
+
const nodeAns = parseAlgebraic(ans);
|
|
143
|
+
const nodeAnswer = getAnswerNode(identifiers);
|
|
144
|
+
return (substract(nodeAns.simplify(), nodeAnswer.simplify())
|
|
145
|
+
.simplify()
|
|
146
|
+
.evaluate() === 0);
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
return handleVEAError(err);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const getNumberPoolTwiceProbasQuestion = () => {
|
|
153
|
+
const nbEventElem = numberPool.length * numberPool.length;
|
|
154
|
+
const arrIndexEvent = events.map((_, i) => i);
|
|
155
|
+
const arrIndexEventElem = arrIndexEvent.slice(0, nbEventElem);
|
|
156
|
+
const arrIndexEventAdvanced = arrIndexEvent.slice(nbEventElem);
|
|
157
|
+
//avoid asking easy questions too much
|
|
158
|
+
const arrIndexEventUsed = probaFlip(0.38)
|
|
159
|
+
? arrIndexEventElem
|
|
160
|
+
: arrIndexEventAdvanced;
|
|
161
|
+
const indexEvent = random(arrIndexEventUsed);
|
|
162
|
+
const identifiers = { indexEvent };
|
|
163
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
164
|
+
};
|
|
165
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
166
|
+
const question = {
|
|
167
|
+
instruction: getInstruction(identifiers),
|
|
168
|
+
answer: getAnswer(identifiers),
|
|
169
|
+
keys: [],
|
|
170
|
+
answerFormat: "tex",
|
|
171
|
+
identifiers,
|
|
172
|
+
hint: getHint(identifiers),
|
|
173
|
+
correction: getCorrection(identifiers),
|
|
174
|
+
};
|
|
175
|
+
return question;
|
|
176
|
+
};
|
|
177
|
+
export const numberPoolTwiceProbas = {
|
|
178
|
+
id: "numberPoolTwiceProbas",
|
|
179
|
+
label: "Calculer la probabilité d'un évènement dans une expérience à deux épreuves (numéros)",
|
|
180
|
+
isSingleStep: true,
|
|
181
|
+
generator: (nb) => [...Array(nb).keys()].map(() => getNumberPoolTwiceProbasQuestion()),
|
|
182
|
+
qcmTimer: 60,
|
|
183
|
+
freeTimer: 60,
|
|
184
|
+
getPropositions,
|
|
185
|
+
isAnswerValid,
|
|
186
|
+
subject: "Mathématiques",
|
|
187
|
+
hasHintAndCorrection: true,
|
|
188
|
+
getQuestionFromIdentifiers,
|
|
189
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/spaceGeometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/spaceGeometry/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
isDiameterGiven: boolean;
|
|
4
|
+
radius: number;
|
|
5
|
+
height: number;
|
|
6
|
+
offset: number;
|
|
7
|
+
planeType: string;
|
|
8
|
+
};
|
|
9
|
+
type Options = {
|
|
10
|
+
planeTypes: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare const areaOfConeSection: Exercise<Identifiers, Options>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=areaOfConeSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"areaOfConeSection.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/sections/areaOfConeSection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AA8GrC,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAkXF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAuBF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwB5D,CAAC"}
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
import { shuffleProps, addValidProp, tryToAddWrongProp, GeneratorOptionType, GeneratorOptionTarget, propWhile, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { blueLight, red } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { round } from "../../../../math/utils/round.js";
|
|
7
|
+
import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
8
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
9
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
10
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
11
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
12
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
13
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
14
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
15
|
+
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
16
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
17
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
18
|
+
const cylinderSectionGGBCommands = (radius, height, offset, isShowSectionPlane, planeType) => {
|
|
19
|
+
return [
|
|
20
|
+
//hide xOyPlane
|
|
21
|
+
`SetFilling(xOyPlane, 0)`,
|
|
22
|
+
//cone
|
|
23
|
+
`Con = Cone((0,0,0), (0,0,${height}), ${radius})`,
|
|
24
|
+
`SetColor(Con, "#d3dde6ff")`,
|
|
25
|
+
`SetFilling(Con, 0.36)`,
|
|
26
|
+
`SetLineThickness(Con, 1)`,
|
|
27
|
+
//plane
|
|
28
|
+
...(isShowSectionPlane
|
|
29
|
+
? (() => {
|
|
30
|
+
switch (planeType) {
|
|
31
|
+
case "contenant l'axe de révolution":
|
|
32
|
+
{
|
|
33
|
+
return [
|
|
34
|
+
`Pl = Plane((0,0,0), (0,1,0), (0,1,1))`,
|
|
35
|
+
`SetColor(Pl, "${blueLight}")`,
|
|
36
|
+
`SetFilling(Pl, 0.23)`,
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
case "perpendiculaire à l'axe de révolution":
|
|
41
|
+
{
|
|
42
|
+
return [
|
|
43
|
+
`Pl = Plane((${1}, 0, ${offset}), (0, ${1}, ${offset}), (${-1}, 0, ${offset}))`,
|
|
44
|
+
`SetColor(Pl, "${blueLight}")`,
|
|
45
|
+
`SetFilling(Pl, 0.23)`,
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
throw new Error("unsupported planeType: " + planeType);
|
|
51
|
+
}
|
|
52
|
+
})()
|
|
53
|
+
: []),
|
|
54
|
+
//section
|
|
55
|
+
...(() => {
|
|
56
|
+
switch (planeType) {
|
|
57
|
+
case "contenant l'axe de révolution":
|
|
58
|
+
{
|
|
59
|
+
return [
|
|
60
|
+
`s = Polygon((0, ${-radius}, 0), (0, ${radius}, 0), (0, 0, ${height}))`,
|
|
61
|
+
`SetColor(s, "${red}")`,
|
|
62
|
+
// `SetFilling(s, 0.36)`,
|
|
63
|
+
`SetLineThickness(s, 3)`,
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case "perpendiculaire à l'axe de révolution":
|
|
68
|
+
{
|
|
69
|
+
const nodeHalfWidth = multiply(radius, substract(1, frac(offset, height)));
|
|
70
|
+
const width = nodeHalfWidth.evaluate();
|
|
71
|
+
return [
|
|
72
|
+
`s = Circle((${width}, 0, ${offset}), (0, ${width}, ${offset}), (${-width}, 0, ${offset}))`,
|
|
73
|
+
`SetColor(s, "${red}")`,
|
|
74
|
+
// `SetFilling(s, 0.36)`,
|
|
75
|
+
`SetLineThickness(s, 3)`,
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
throw new Error("unsupported planeType: " + planeType);
|
|
81
|
+
}
|
|
82
|
+
})(),
|
|
83
|
+
//points
|
|
84
|
+
`O = Point({0,0,0})`,
|
|
85
|
+
`ShowLabel(O,true)`,
|
|
86
|
+
`I = Point({0,0,${offset}})`,
|
|
87
|
+
`ShowLabel(I,true)`,
|
|
88
|
+
`H = Point({0,0,${height}})`,
|
|
89
|
+
`ShowLabel(H,true)`,
|
|
90
|
+
//center view
|
|
91
|
+
`CenterView(Point({0,0,0}))`,
|
|
92
|
+
];
|
|
93
|
+
};
|
|
94
|
+
const getInstruction = (identifiers) => {
|
|
95
|
+
const { radius, height, isDiameterGiven, offset, planeType } = identifiers;
|
|
96
|
+
return `Soit $\\mathcal{K}$ un cône ayant pour base le cercle $\\mathcal{C}$ de centre $O$ et de ${isDiameterGiven ? "diamètre" : "rayon"} $${isDiameterGiven ? 2 * radius : radius} \\ \\textrm{cm}$ et pour hauteur $${height.frenchify()} \\ \\textrm{cm}$.
|
|
97
|
+
|
|
98
|
+
${(() => {
|
|
99
|
+
switch (planeType) {
|
|
100
|
+
case "contenant l'axe de révolution":
|
|
101
|
+
{
|
|
102
|
+
return `Un plan contenant l'axe de révolution coupe $\\mathcal{K}$ en une section telle que $OI = ${offset.frenchify()}\\ \\textrm{cm}$.`;
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case "perpendiculaire à l'axe de révolution":
|
|
106
|
+
{
|
|
107
|
+
return `Un plan perpendiculaire à l'axe de révolution coupe $\\mathcal{K}$ en une section telle que $OI = ${offset.frenchify()}\\ \\textrm{cm}$.`;
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
default:
|
|
111
|
+
throw new Error("unsupported planeType: " + planeType);
|
|
112
|
+
}
|
|
113
|
+
})()}
|
|
114
|
+
|
|
115
|
+
Quelle est l'aire de la section plane en $\\textrm{cm}^2$ ?
|
|
116
|
+
On donnera le résultat sous forme arrondie à deux décimales.`;
|
|
117
|
+
};
|
|
118
|
+
const getAnswerNode = (identifiers) => {
|
|
119
|
+
const { radius, height, offset, planeType } = identifiers;
|
|
120
|
+
const nodeArea = (() => {
|
|
121
|
+
switch (planeType) {
|
|
122
|
+
case "contenant l'axe de révolution":
|
|
123
|
+
{
|
|
124
|
+
return frac(multiply(radius, height), 2);
|
|
125
|
+
}
|
|
126
|
+
break;
|
|
127
|
+
case "perpendiculaire à l'axe de révolution":
|
|
128
|
+
{
|
|
129
|
+
const nodeHalfWidth = multiply(radius, substract(1, frac(offset, height)));
|
|
130
|
+
return multiply(PiNode, power(nodeHalfWidth, 2));
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
default:
|
|
134
|
+
throw new Error("unsupported planeType: " + planeType);
|
|
135
|
+
}
|
|
136
|
+
})();
|
|
137
|
+
const nodeAreaRounded = round(nodeArea.evaluate(), 2).toTree();
|
|
138
|
+
return nodeAreaRounded;
|
|
139
|
+
};
|
|
140
|
+
const getAnswer = (identifiers) => {
|
|
141
|
+
return getAnswerNode(identifiers).toTex();
|
|
142
|
+
};
|
|
143
|
+
const getHint = (identifiers) => {
|
|
144
|
+
const { planeType } = identifiers;
|
|
145
|
+
switch (planeType) {
|
|
146
|
+
case "contenant l'axe de révolution":
|
|
147
|
+
{
|
|
148
|
+
return `Utilise la formule qui donne l'aire d'un triangle.`;
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
case "perpendiculaire à l'axe de révolution":
|
|
152
|
+
{
|
|
153
|
+
return `Trouve un moyen de calculer le rayon du cercle section puis utilise la formule qui donne l'aire d'un cercle.`;
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
default:
|
|
157
|
+
throw new Error("unsupported planeType: " + planeType);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const getCorrection = (identifiers) => {
|
|
161
|
+
const { radius, height, planeType, offset } = identifiers;
|
|
162
|
+
switch (planeType) {
|
|
163
|
+
case "contenant l'axe de révolution":
|
|
164
|
+
{
|
|
165
|
+
return `La section est un triangle de hauteur $${height} \\ \\textrm{cm}$ et de base $${2 * radius} \\ \\textrm{cm}$.
|
|
166
|
+
Son aire vaut :
|
|
167
|
+
|
|
168
|
+
$$
|
|
169
|
+
\\mathcal{A}_{\\text{triangle}} = \\frac{${height} \\times ${2 * radius}}{2} = ${getAnswer(identifiers)} \\ \\textrm{cm}^2
|
|
170
|
+
$$
|
|
171
|
+
|
|
172
|
+
`;
|
|
173
|
+
}
|
|
174
|
+
break;
|
|
175
|
+
case "perpendiculaire à l'axe de révolution":
|
|
176
|
+
{
|
|
177
|
+
return `La section est un cercle dont on peut calculer le rayon.
|
|
178
|
+
|
|
179
|
+
En effet, on peut exhiber une configuration de Thalès en plaçant le point $P$, sur la section,
|
|
180
|
+
et le point $B$ sur la base du cône $\\mathcal{K}$ de manière à ce que $H$, $P$ et $B$ soient alignés.
|
|
181
|
+
D'après le théorème de Thalès, on a :
|
|
182
|
+
|
|
183
|
+
$$
|
|
184
|
+
\\frac{PI}{BO} = \\frac{HI}{HO}
|
|
185
|
+
$$
|
|
186
|
+
|
|
187
|
+
$$
|
|
188
|
+
\\frac{PI}{BO} = \\frac{HO - OI}{HO}
|
|
189
|
+
$$
|
|
190
|
+
|
|
191
|
+
$$
|
|
192
|
+
PI = BO \\times \\frac{HO - OI}{HO}
|
|
193
|
+
$$
|
|
194
|
+
|
|
195
|
+
$$
|
|
196
|
+
PI = ${radius} \\times \\frac{${height} - ${offset}}{${height}}
|
|
197
|
+
$$
|
|
198
|
+
|
|
199
|
+
L'aire du cercle section vaut donc :
|
|
200
|
+
|
|
201
|
+
$$
|
|
202
|
+
\\mathcal{A}_{\\text{cercle}} = \\pi \\times {PI}^2 \\approx ${getAnswer(identifiers)} \\ \\textrm{cm}^2
|
|
203
|
+
$$
|
|
204
|
+
|
|
205
|
+
`;
|
|
206
|
+
}
|
|
207
|
+
break;
|
|
208
|
+
default:
|
|
209
|
+
throw new Error("unsupported planeType: " + planeType);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
213
|
+
const { radius, height, offset, planeType } = identifiers;
|
|
214
|
+
const commands = [
|
|
215
|
+
...cylinderSectionGGBCommands(radius, height, offset, false, planeType),
|
|
216
|
+
`SetFilling(s, 0.36)`,
|
|
217
|
+
...(() => {
|
|
218
|
+
switch (planeType) {
|
|
219
|
+
case "contenant l'axe de révolution":
|
|
220
|
+
{
|
|
221
|
+
return [];
|
|
222
|
+
}
|
|
223
|
+
break;
|
|
224
|
+
case "perpendiculaire à l'axe de révolution":
|
|
225
|
+
{
|
|
226
|
+
const nodeHalfWidth = multiply(radius, substract(1, frac(offset, height)));
|
|
227
|
+
const width = nodeHalfWidth.evaluate();
|
|
228
|
+
return [
|
|
229
|
+
`P = Point({0,${-width},${offset}})`,
|
|
230
|
+
`ShowLabel(P, true)`,
|
|
231
|
+
`B = Point({0,${-radius},0})`,
|
|
232
|
+
`ShowLabel(B, true)`,
|
|
233
|
+
];
|
|
234
|
+
}
|
|
235
|
+
break;
|
|
236
|
+
default:
|
|
237
|
+
throw new Error("unsupported planeType: " + planeType);
|
|
238
|
+
}
|
|
239
|
+
})(),
|
|
240
|
+
];
|
|
241
|
+
const ggb = new GeogebraConstructor({
|
|
242
|
+
commands,
|
|
243
|
+
is3D: true,
|
|
244
|
+
xAxis: {
|
|
245
|
+
hidden: true,
|
|
246
|
+
},
|
|
247
|
+
yAxis: {
|
|
248
|
+
hidden: true,
|
|
249
|
+
},
|
|
250
|
+
zAxis: {
|
|
251
|
+
hidden: false,
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
const xMax = radius;
|
|
255
|
+
const xMin = -xMax;
|
|
256
|
+
const yMax = radius;
|
|
257
|
+
const yMin = -yMax;
|
|
258
|
+
const zMax = radius;
|
|
259
|
+
const zMin = -zMax;
|
|
260
|
+
return ggb.getOptions({
|
|
261
|
+
coords: [xMin, xMax, yMin, yMax, zMin, zMax],
|
|
262
|
+
});
|
|
263
|
+
};
|
|
264
|
+
const getGGBOptions = (identifiers) => {
|
|
265
|
+
const { radius, height, offset, planeType } = identifiers;
|
|
266
|
+
const commands = [
|
|
267
|
+
...cylinderSectionGGBCommands(radius, height, offset, true, planeType),
|
|
268
|
+
];
|
|
269
|
+
const ggb = new GeogebraConstructor({
|
|
270
|
+
commands,
|
|
271
|
+
is3D: true,
|
|
272
|
+
xAxis: {
|
|
273
|
+
hidden: true,
|
|
274
|
+
},
|
|
275
|
+
yAxis: {
|
|
276
|
+
hidden: true,
|
|
277
|
+
},
|
|
278
|
+
zAxis: {
|
|
279
|
+
hidden: false,
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
const xMax = radius;
|
|
283
|
+
const xMin = -xMax;
|
|
284
|
+
const yMax = radius;
|
|
285
|
+
const yMin = -yMax;
|
|
286
|
+
const zMax = radius;
|
|
287
|
+
const zMin = -zMax;
|
|
288
|
+
return ggb.getOptions({
|
|
289
|
+
coords: [xMin, xMax, yMin, yMax, zMin, zMax],
|
|
290
|
+
});
|
|
291
|
+
};
|
|
292
|
+
const getKeys = () => {
|
|
293
|
+
return [];
|
|
294
|
+
};
|
|
295
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
296
|
+
try {
|
|
297
|
+
const nodeAns = parseAlgebraic(ans);
|
|
298
|
+
const nodeAnswer = parseAlgebraic(answer);
|
|
299
|
+
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
300
|
+
}
|
|
301
|
+
catch (e) {
|
|
302
|
+
return handleVEAError(e);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
306
|
+
const { radius, height, offset, planeType } = identifiers;
|
|
307
|
+
const propositions = [];
|
|
308
|
+
addValidProp(propositions, answer);
|
|
309
|
+
switch (planeType) {
|
|
310
|
+
case "contenant l'axe de révolution":
|
|
311
|
+
{
|
|
312
|
+
//wrong formula: height * base instead of (height * base)/2
|
|
313
|
+
{
|
|
314
|
+
const nodeArea = multiply(height, 2 * radius);
|
|
315
|
+
const nodeAreaRounded = round(nodeArea.evaluate(), 2).toTree();
|
|
316
|
+
tryToAddWrongProp(propositions, nodeAreaRounded.toTex());
|
|
317
|
+
}
|
|
318
|
+
//wrong formula: perimeter
|
|
319
|
+
{
|
|
320
|
+
const nodeLength = sqrt(add(power(height, 2), power(radius, 2)));
|
|
321
|
+
const nodePerimeter = add(2 * radius, multiply(2, nodeLength));
|
|
322
|
+
const nodePerimeterRounded = round(nodePerimeter.evaluate(), 2).toTree();
|
|
323
|
+
tryToAddWrongProp(propositions, nodePerimeterRounded.toTex());
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
break;
|
|
327
|
+
case "perpendiculaire à l'axe de révolution":
|
|
328
|
+
{
|
|
329
|
+
const nodeHalfWidth = multiply(radius, substract(1, frac(offset, height)));
|
|
330
|
+
//wrong formula: circumference
|
|
331
|
+
{
|
|
332
|
+
const nodeCircumference = multiply(multiply(2, PiNode), nodeHalfWidth);
|
|
333
|
+
const nodeCircumferenceRounded = round(nodeCircumference.evaluate(), 2).toTree();
|
|
334
|
+
tryToAddWrongProp(propositions, nodeCircumferenceRounded.toTex());
|
|
335
|
+
}
|
|
336
|
+
//wrong formula: 2*radius instead of radius
|
|
337
|
+
{
|
|
338
|
+
const nodeArea = multiply(PiNode, power(multiply(2, nodeHalfWidth), 2));
|
|
339
|
+
const nodeAreaRounded = round(nodeArea.evaluate(), 2).toTree();
|
|
340
|
+
tryToAddWrongProp(propositions, nodeAreaRounded.toTex());
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
break;
|
|
344
|
+
default:
|
|
345
|
+
throw new Error("unsupported planeType: " + planeType);
|
|
346
|
+
}
|
|
347
|
+
propWhile(propositions, n, () => {
|
|
348
|
+
const identifiersWrong = (() => {
|
|
349
|
+
const isDiameterGiven = probaFlip(0.23);
|
|
350
|
+
const radius = randint(5, 21);
|
|
351
|
+
const height = randint(5, 21);
|
|
352
|
+
const offset = randint(2, Math.min(radius, height / 2.0));
|
|
353
|
+
const identifiers = {
|
|
354
|
+
radius,
|
|
355
|
+
height,
|
|
356
|
+
isDiameterGiven,
|
|
357
|
+
offset,
|
|
358
|
+
planeType,
|
|
359
|
+
};
|
|
360
|
+
return {
|
|
361
|
+
planeType: identifiers.planeType,
|
|
362
|
+
isDiameterGiven,
|
|
363
|
+
radius,
|
|
364
|
+
height,
|
|
365
|
+
offset,
|
|
366
|
+
};
|
|
367
|
+
})();
|
|
368
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
369
|
+
});
|
|
370
|
+
return shuffleProps(propositions, n);
|
|
371
|
+
};
|
|
372
|
+
const getAreaOfConeSectionQuestion = (optsIn) => {
|
|
373
|
+
const opts = optsIn ?? optsDefault;
|
|
374
|
+
const planeType = random(opts.planeTypes);
|
|
375
|
+
const isDiameterGiven = probaFlip(0.23);
|
|
376
|
+
const radius = randint(5, 21);
|
|
377
|
+
const height = randint(5, 21);
|
|
378
|
+
const offset = randint(2, Math.min(radius, height / 2.0));
|
|
379
|
+
const identifiers = { radius, height, isDiameterGiven, offset, planeType };
|
|
380
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
381
|
+
};
|
|
382
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
383
|
+
const question = {
|
|
384
|
+
instruction: getInstruction(identifiers),
|
|
385
|
+
answer: getAnswer(identifiers),
|
|
386
|
+
hint: getHint(identifiers),
|
|
387
|
+
keys: getKeys(identifiers),
|
|
388
|
+
correction: getCorrection(identifiers),
|
|
389
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
390
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers),
|
|
391
|
+
answerFormat: "tex",
|
|
392
|
+
identifiers,
|
|
393
|
+
options: opts,
|
|
394
|
+
};
|
|
395
|
+
return question;
|
|
396
|
+
};
|
|
397
|
+
const optsDefault = {
|
|
398
|
+
planeTypes: [
|
|
399
|
+
"contenant l'axe de révolution",
|
|
400
|
+
"perpendiculaire à l'axe de révolution",
|
|
401
|
+
],
|
|
402
|
+
};
|
|
403
|
+
const options = [
|
|
404
|
+
{
|
|
405
|
+
id: "planeTypes",
|
|
406
|
+
label: "Type de plan pour la section",
|
|
407
|
+
type: GeneratorOptionType.multiselect,
|
|
408
|
+
target: GeneratorOptionTarget.generation,
|
|
409
|
+
values: [
|
|
410
|
+
"contenant l'axe de révolution",
|
|
411
|
+
"perpendiculaire à l'axe de révolution",
|
|
412
|
+
],
|
|
413
|
+
defaultValue: optsDefault.planeTypes,
|
|
414
|
+
},
|
|
415
|
+
];
|
|
416
|
+
export const areaOfConeSection = {
|
|
417
|
+
id: "areaOfConeSection",
|
|
418
|
+
connector: "=",
|
|
419
|
+
label: "Calculer l'aire d'une section plane de cône",
|
|
420
|
+
isSingleStep: true,
|
|
421
|
+
generator: (nb, opts) => getDistinctQuestions(() => getAreaOfConeSectionQuestion(opts), nb),
|
|
422
|
+
options,
|
|
423
|
+
validateOptions: (opts) => {
|
|
424
|
+
return {
|
|
425
|
+
valid: opts?.planeTypes.length > 0,
|
|
426
|
+
message: "Veuillez choisir un type de section.",
|
|
427
|
+
};
|
|
428
|
+
},
|
|
429
|
+
qcmTimer: 60,
|
|
430
|
+
freeTimer: 60,
|
|
431
|
+
isAnswerValid,
|
|
432
|
+
getPropositions,
|
|
433
|
+
subject: "Mathématiques",
|
|
434
|
+
getQuestionFromIdentifiers,
|
|
435
|
+
getHint,
|
|
436
|
+
getCorrection,
|
|
437
|
+
hasHintAndCorrection: true,
|
|
438
|
+
hasGeogebra: true,
|
|
439
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
isDiameterGiven: boolean;
|
|
4
|
+
radius: number;
|
|
5
|
+
height: number;
|
|
6
|
+
offset: number;
|
|
7
|
+
planeType: string;
|
|
8
|
+
};
|
|
9
|
+
type Options = {
|
|
10
|
+
planeTypes: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare const areaOfCylinderSection: Exercise<Identifiers, Options>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=areaOfCylinderSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"areaOfCylinderSection.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/spaceGeometry/sections/areaOfCylinderSection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AA4JrC,KAAK,WAAW,GAAG;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqcF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAwBF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBhE,CAAC"}
|