math-exercises 3.0.125 → 3.0.127
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/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +61 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.js +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +15 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +231 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.d.ts +16 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.js +327 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts +8 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +123 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +149 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +29 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +368 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts +12 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.js +164 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +140 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts +6 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/index.js +6 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts +9 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +84 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts +8 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +90 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts +2 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/index.js +2 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts +13 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +454 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.js +70 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/index.js +2 -0
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts +2 -1
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/isolate/index.js +2 -1
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +86 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts +7 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.js +80 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +180 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +144 -0
- package/lib/exercises/math/calculLitteral/ordering/index.d.ts +3 -0
- package/lib/exercises/math/calculLitteral/ordering/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/index.js +2 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +120 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.js +67 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.js +114 -0
- package/lib/exercises/math/calculLitteral/simplifying/index.d.ts +5 -0
- package/lib/exercises/math/calculLitteral/simplifying/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/index.js +5 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts +13 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.js +125 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts +14 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.js +148 -0
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +5 -27
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +231 -248
- package/lib/exercises/math/conversion/index.d.ts +4 -0
- package/lib/exercises/math/conversion/index.d.ts.map +1 -1
- package/lib/exercises/math/conversion/index.js +4 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +11 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +116 -0
- package/lib/exercises/math/conversion/minutesToHours.d.ts +10 -0
- package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -0
- package/lib/exercises/math/conversion/minutesToHours.js +150 -0
- package/lib/exercises/math/conversion/prefixToNumber.d.ts +15 -0
- package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -0
- package/lib/exercises/math/conversion/prefixToNumber.js +243 -0
- package/lib/exercises/math/conversion/secondsToHours.d.ts +10 -0
- package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -0
- package/lib/exercises/math/conversion/secondsToHours.js +150 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +53 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +533 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts +7 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.js +223 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +140 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +133 -0
- package/lib/exercises/math/dataRepresentations/graphReading.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/graphReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/graphReading.js +136 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts +18 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +228 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.js +213 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.js +163 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/index.js +10 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.js +194 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.js +308 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +5 -6
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts +8 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +117 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts +8 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +118 -0
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts +16 -0
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +215 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts +13 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +223 -0
- package/lib/exercises/math/functions/affines/index.d.ts +7 -0
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +7 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts +20 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.js +284 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +16 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.js +275 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts +14 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +235 -0
- package/lib/exercises/math/functions/basics/index.d.ts +1 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -0
- package/lib/exercises/math/functions/composition/functionComposition.d.ts +8 -0
- package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -0
- package/lib/exercises/math/functions/composition/functionComposition.js +238 -0
- package/lib/exercises/math/functions/composition/index.d.ts +2 -0
- package/lib/exercises/math/functions/composition/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/composition/index.js +1 -0
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts +23 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +448 -0
- package/lib/exercises/math/geometry/angles/index.js +2 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts +23 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.js +402 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +9 -6
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +140 -60
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +121 -104
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +3 -2
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.js +1 -0
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts +0 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +65 -88
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts +9 -0
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +221 -0
- package/lib/exercises/math/probaStat/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +2 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +29 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +547 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts +9 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +89 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts +10 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +152 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts +7 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts.map +1 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.js +73 -0
- package/lib/exercises/pc/electricity/index.d.ts +1 -0
- package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/index.js +1 -0
- package/lib/exercises/pc/index.d.ts +1 -0
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +1 -0
- package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
- package/lib/exercises/pc/moleculeFormula.js +4 -3
- package/lib/exercises/pc/optics/index.d.ts +2 -0
- package/lib/exercises/pc/optics/index.d.ts.map +1 -0
- package/lib/exercises/pc/optics/index.js +1 -0
- package/lib/exercises/pc/optics/lensFormula.d.ts +21 -0
- package/lib/exercises/pc/optics/lensFormula.d.ts.map +1 -0
- package/lib/exercises/pc/optics/lensFormula.js +415 -0
- package/lib/exercises/pc/weight/calculateWeight.d.ts +8 -1
- package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
- package/lib/exercises/pc/weight/calculateWeight.js +113 -38
- package/lib/geogebra/parsers/geogebraParser.d.ts +4 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
- package/lib/geogebra/parsers/geogebraParser.js +17 -0
- package/lib/index.d.ts +351 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +1 -0
- package/lib/math/geometry/CloudPoints.d.ts +10 -0
- package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
- package/lib/math/geometry/CloudPoints.js +119 -0
- package/lib/math/geometry/line.d.ts +1 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +10 -2
- package/lib/math/geometry/vector.d.ts +1 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +12 -0
- package/lib/math/progCalc/progCalc.d.ts +46 -0
- package/lib/math/progCalc/progCalc.d.ts.map +1 -0
- package/lib/math/progCalc/progCalc.js +239 -0
- package/lib/math/utils/latex/realize.d.ts +12 -0
- package/lib/math/utils/latex/realize.d.ts.map +1 -0
- package/lib/math/utils/latex/realize.js +43 -0
- package/lib/pc/constants/molecularChemistry/molecule.d.ts +2 -0
- package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -1
- package/lib/pc/constants/molecularChemistry/molecule.js +52 -0
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +1 -1
- package/lib/tests/singleExo.test.js +3 -3
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts +4 -2
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +8 -17
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +5 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts +4 -2
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +8 -17
- package/lib/tree/nodes/operators/operatorNode.d.ts +3 -3
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/utilities/nodeShuffler.d.ts +12 -0
- package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -0
- package/lib/tree/utilities/nodeShuffler.js +123 -0
- package/lib/utils/arrays/getAllPicks.d.ts +2 -0
- package/lib/utils/arrays/getAllPicks.d.ts.map +1 -0
- package/lib/utils/arrays/getAllPicks.js +17 -0
- package/lib/utils/errors/handleVEAError.d.ts +1 -1
- package/lib/utils/errors/handleVEAError.d.ts.map +1 -1
- package/lib/utils/strings/decapitalize.d.ts +2 -0
- package/lib/utils/strings/decapitalize.d.ts.map +1 -0
- package/lib/utils/strings/decapitalize.js +3 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp,
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
4
4
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
@@ -13,93 +13,70 @@ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
|
13
13
|
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
14
14
|
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
15
15
|
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
16
|
-
import { parseLatex } from "../../../../tree/parsers/latexParser.js";
|
|
17
16
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
18
17
|
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
19
18
|
import { random } from "../../../../utils/alea/random.js";
|
|
20
19
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
21
|
-
const getAnswer = (identifiers) => {
|
|
22
|
-
const { arrayOfNodeIds, isFilterPossibleProba } = identifiers;
|
|
23
|
-
const arrayOfPossibleProbas = arrayOfNodeIds
|
|
24
|
-
.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds))
|
|
25
|
-
.filter((node) => {
|
|
26
|
-
return isFilterPossibleProba
|
|
27
|
-
? node.evaluate() >= 0 && substract(node, 1).evaluate() <= 0
|
|
28
|
-
: node.evaluate() < 0 || substract(node, 1).evaluate() > 0;
|
|
29
|
-
})
|
|
30
|
-
.toSorted((nodeA, nodeB) => substract(nodeA, nodeB).evaluate());
|
|
31
|
-
const answer = arrayOfPossibleProbas.map((node) => node.toTex()).join(";");
|
|
32
|
-
return answer;
|
|
33
|
-
};
|
|
34
20
|
const getInstruction = (identifiers) => {
|
|
35
|
-
const {
|
|
36
|
-
|
|
37
|
-
return `Parmi les valeurs de la liste ci-dessous, donner celles qui sont des valeurs ${isFilterPossibleProba ? "possibles" : "impossibles"} pour une probabilité
|
|
38
|
-
(séparer les valeurs par des points-virgules) :
|
|
39
|
-
$$
|
|
40
|
-
${arrNode.map((node) => node.toTex()).join(" \\hspace{2mm} ; \\hspace{2mm} ")}
|
|
41
|
-
$$
|
|
42
|
-
`;
|
|
21
|
+
const { isFilterPossibleProba } = identifiers;
|
|
22
|
+
return `Parmi les valeurs de la liste ci-dessous, donner celles qui sont des valeurs ${isFilterPossibleProba ? "**possibles**" : "**impossibles**"} pour une probabilité.`;
|
|
43
23
|
};
|
|
44
24
|
const getHint = () => {
|
|
45
|
-
return "Une probabilité est
|
|
25
|
+
return "Une probabilité est un nombre compris entre $0$ et $1$.";
|
|
46
26
|
};
|
|
47
27
|
const getCorrection = (identifiers) => {
|
|
28
|
+
const { arrayOfNodeIds, isFilterPossibleProba } = identifiers;
|
|
29
|
+
const allAnswerTexs = arrayOfNodeIds
|
|
30
|
+
.map((nodeIds) => {
|
|
31
|
+
const node = NodeConstructor.fromIdentifiers(nodeIds);
|
|
32
|
+
const isPossibleProba = node.evaluate() >= 0 && substract(node, 1).evaluate() <= 0;
|
|
33
|
+
return { tex: node.toTex(), isPossibleProba };
|
|
34
|
+
})
|
|
35
|
+
.filter(({ isPossibleProba }) => isPossibleProba === isFilterPossibleProba)
|
|
36
|
+
.map(({ tex }) => tex);
|
|
48
37
|
return `Les valeurs possibles pour une probabilité sont comprises entre $0$ inclus et $1$ inclus.
|
|
49
|
-
|
|
38
|
+
${allAnswerTexs.length > 1
|
|
39
|
+
? `Les réponses attendues (valeurs ${isFilterPossibleProba ? `possibles` : `impossibles`}) étaient`
|
|
40
|
+
: `La réponse attendue (valeur ${isFilterPossibleProba ? `possible` : `impossible`}) était`} donc :
|
|
50
41
|
|
|
42
|
+
${allAnswerTexs
|
|
43
|
+
.map((tex) => `
|
|
44
|
+
|
|
51
45
|
$$
|
|
52
|
-
${
|
|
46
|
+
${tex}
|
|
53
47
|
$$
|
|
54
|
-
|
|
48
|
+
|
|
49
|
+
`)
|
|
50
|
+
.join("")}`;
|
|
55
51
|
};
|
|
56
|
-
const getPropositions = (
|
|
52
|
+
const getPropositions = (_, { answer, ...identifiers }) => {
|
|
57
53
|
const { arrayOfNodeIds, isFilterPossibleProba } = identifiers;
|
|
58
54
|
const propositions = [];
|
|
59
55
|
// addValidProp(propositions, answer);
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const arrTex = ansWithoutTrailingSemicolon.split(";");
|
|
75
|
-
const arrNode = arrTex
|
|
76
|
-
.map((tex) => parseLatex(tex))
|
|
77
|
-
.toSorted((nodeA, nodeB) => substract(nodeA, nodeB).evaluate());
|
|
78
|
-
const arrTexSorted = arrNode.map((node) => node.toTex());
|
|
79
|
-
const ansRefined = arrTexSorted.join(";");
|
|
80
|
-
return ansRefined === answer;
|
|
81
|
-
};
|
|
82
|
-
const getKeys = (identifiers) => {
|
|
83
|
-
const { arrayOfNodeIds } = identifiers;
|
|
84
|
-
const arrNode = arrayOfNodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
85
|
-
return [
|
|
86
|
-
"semicolon",
|
|
87
|
-
...arrNode.map((node) => {
|
|
88
|
-
return {
|
|
89
|
-
id: "custom",
|
|
90
|
-
label: node.toTex(),
|
|
91
|
-
labelType: "tex",
|
|
92
|
-
mathfieldInstructions: {
|
|
93
|
-
method: "write",
|
|
94
|
-
content: node.toTex(),
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
}),
|
|
98
|
-
];
|
|
56
|
+
const allProbasObj = arrayOfNodeIds.map((nodeIds) => {
|
|
57
|
+
const node = NodeConstructor.fromIdentifiers(nodeIds);
|
|
58
|
+
const isPossibleProba = node.evaluate() >= 0 && substract(node, 1).evaluate() <= 0;
|
|
59
|
+
return { tex: node.toTex(), isPossibleProba };
|
|
60
|
+
});
|
|
61
|
+
allProbasObj.forEach(({ tex, isPossibleProba }) => {
|
|
62
|
+
if (isPossibleProba === isFilterPossibleProba) {
|
|
63
|
+
addValidProp(propositions, tex);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
tryToAddWrongProp(propositions, tex);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return propositions;
|
|
99
70
|
};
|
|
100
71
|
const optsDefault = {
|
|
101
|
-
numberTypes: [
|
|
102
|
-
|
|
72
|
+
numberTypes: [
|
|
73
|
+
"Entier",
|
|
74
|
+
"Décimal",
|
|
75
|
+
"Fraction",
|
|
76
|
+
"Puissance de 10",
|
|
77
|
+
"Écriture scientifique",
|
|
78
|
+
"Réel",
|
|
79
|
+
],
|
|
103
80
|
};
|
|
104
81
|
const options = [
|
|
105
82
|
{
|
|
@@ -107,17 +84,16 @@ const options = [
|
|
|
107
84
|
label: "Types de nombres",
|
|
108
85
|
type: GeneratorOptionType.multiselect,
|
|
109
86
|
target: GeneratorOptionTarget.generation,
|
|
110
|
-
values: [
|
|
87
|
+
values: [
|
|
88
|
+
"Entier",
|
|
89
|
+
"Décimal",
|
|
90
|
+
"Fraction",
|
|
91
|
+
"Puissance de 10",
|
|
92
|
+
"Écriture scientifique",
|
|
93
|
+
"Réel",
|
|
94
|
+
],
|
|
111
95
|
defaultValue: optsDefault.numberTypes,
|
|
112
96
|
},
|
|
113
|
-
{
|
|
114
|
-
id: "nbValues",
|
|
115
|
-
label: "Longueur de la liste",
|
|
116
|
-
type: GeneratorOptionType.select,
|
|
117
|
-
target: GeneratorOptionTarget.generation,
|
|
118
|
-
values: [5, 6, 7, 8, 9, 10],
|
|
119
|
-
defaultValue: optsDefault.nbValues,
|
|
120
|
-
},
|
|
121
97
|
];
|
|
122
98
|
const createRandomNode = (numberType, isPossibleProba) => {
|
|
123
99
|
if (isPossibleProba) {
|
|
@@ -136,9 +112,9 @@ const createRandomNode = (numberType, isPossibleProba) => {
|
|
|
136
112
|
return frac(num, den);
|
|
137
113
|
}
|
|
138
114
|
}
|
|
139
|
-
case "
|
|
115
|
+
case "Puissance de 10":
|
|
140
116
|
return power(10, randint(-15, 1));
|
|
141
|
-
case "
|
|
117
|
+
case "Écriture scientifique":
|
|
142
118
|
if (probaFlip(0.7)) {
|
|
143
119
|
return multiply(randfloat(1, 10, randint(1, 5)), power(10, randint(-15, 0)));
|
|
144
120
|
}
|
|
@@ -180,9 +156,9 @@ const createRandomNode = (numberType, isPossibleProba) => {
|
|
|
180
156
|
return frac(num, den);
|
|
181
157
|
}
|
|
182
158
|
}
|
|
183
|
-
case "
|
|
159
|
+
case "Puissance de 10":
|
|
184
160
|
return power(10, randint(1, 15));
|
|
185
|
-
case "
|
|
161
|
+
case "Écriture scientifique":
|
|
186
162
|
if (probaFlip(0.7)) {
|
|
187
163
|
return coinFlip()
|
|
188
164
|
? multiply(randfloat(1, 10, randint(1, 5), [1]), power(10, randint(0, 15)))
|
|
@@ -208,22 +184,24 @@ const createRandomNode = (numberType, isPossibleProba) => {
|
|
|
208
184
|
};
|
|
209
185
|
const getPossibleValuesForProbaQuestion = (optsIn) => {
|
|
210
186
|
const opts = Object.assign(optsDefault, optsIn) ?? optsDefault;
|
|
187
|
+
const nbPropositions = 4;
|
|
211
188
|
const isFilterPossibleProba = coinFlip();
|
|
212
189
|
//create numberType list
|
|
213
190
|
const dictNumberTypeToPriority = {
|
|
214
191
|
Entier: 1,
|
|
215
|
-
|
|
192
|
+
"Puissance de 10": 2,
|
|
216
193
|
Décimal: 3,
|
|
217
194
|
Fraction: 4,
|
|
218
195
|
Réel: 5,
|
|
196
|
+
"Écriture scientifique": 6,
|
|
219
197
|
};
|
|
220
198
|
let arrNumberType = [...opts.numberTypes];
|
|
221
199
|
//filler
|
|
222
|
-
while (arrNumberType.length <
|
|
200
|
+
while (arrNumberType.length < nbPropositions) {
|
|
223
201
|
arrNumberType.push(...shuffle(opts.numberTypes));
|
|
224
202
|
}
|
|
225
203
|
arrNumberType = arrNumberType
|
|
226
|
-
.slice(0,
|
|
204
|
+
.slice(0, nbPropositions)
|
|
227
205
|
.toSorted((numberType1, numberType2) => dictNumberTypeToPriority[numberType1] -
|
|
228
206
|
dictNumberTypeToPriority[numberType2]);
|
|
229
207
|
//create list
|
|
@@ -265,9 +243,8 @@ const getPossibleValuesForProbaQuestion = (optsIn) => {
|
|
|
265
243
|
};
|
|
266
244
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
267
245
|
const question = {
|
|
268
|
-
answer: getAnswer(identifiers),
|
|
269
246
|
instruction: getInstruction(identifiers),
|
|
270
|
-
keys:
|
|
247
|
+
keys: [],
|
|
271
248
|
answerFormat: "tex",
|
|
272
249
|
identifiers,
|
|
273
250
|
hint: getHint(identifiers),
|
|
@@ -284,10 +261,10 @@ export const possibleValuesForProba = {
|
|
|
284
261
|
qcmTimer: 60,
|
|
285
262
|
freeTimer: 60,
|
|
286
263
|
getPropositions,
|
|
287
|
-
isAnswerValid,
|
|
288
264
|
subject: "Mathématiques",
|
|
289
265
|
maxAllowedQuestions: 30,
|
|
290
266
|
getQuestionFromIdentifiers,
|
|
291
267
|
answerType: "QCM",
|
|
268
|
+
isQCM: true,
|
|
292
269
|
hasHintAndCorrection: true,
|
|
293
270
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
situationIndex: number;
|
|
4
|
+
dictShuffle: Record<string, string>;
|
|
5
|
+
pType: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const conditionalProbaWriteFromFrench: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=conditionalProbaWriteFromFrench.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionalProbaWriteFromFrench.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/conditionalProbaWriteFromFrench.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAcT,MAAM,mBAAmB,CAAC;AAK3B,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA8QF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAejE,CAAC"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
2
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../exercise.js";
|
|
3
|
+
import { getDistinctQuestions } from "../../utils/getDistinctQuestions.js";
|
|
4
|
+
import { shuffle } from "../../../utils/alea/shuffle.js";
|
|
5
|
+
import { random } from "../../../utils/alea/random.js";
|
|
6
|
+
const situations = [
|
|
7
|
+
{
|
|
8
|
+
context: "Martine est à la plage pour faire de la pêche à pied. Elle ramasse un coquillage.",
|
|
9
|
+
strA: "C'est une moule.",
|
|
10
|
+
strB: "Il y a un petit crabe à l'intérieur.",
|
|
11
|
+
"(A)": "que ce soit une moule",
|
|
12
|
+
"(B)": "qu'il y ait un petit crabe à l'intérieur",
|
|
13
|
+
"(A \\cap B)": "que ce soit une moule avec un petit crabe à l'intérieur",
|
|
14
|
+
"_A(B)": "qu'il y ait un petit crabe à l'intérieur, sachant que c'est une moule",
|
|
15
|
+
"_B(A)": "que ce soit une moule, sachant qu'il y a un petit crabe à l'intérieur",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
context: "Pour payer sa baguette multi-graines, Ahmed prend un billet au hasard dans son portefeuille.",
|
|
19
|
+
strA: "C'est un billet de $10$ euros.",
|
|
20
|
+
strB: "Il est froissé.",
|
|
21
|
+
"(A)": "que ce soit un billet de $10$ euros",
|
|
22
|
+
"(B)": "qu'il soit froissé",
|
|
23
|
+
"(A \\cap B)": "que ce soit un billet froissé de $10$ euros",
|
|
24
|
+
"_A(B)": "qu'il soit froissé, sachant que c'est un billet de $10$ euros",
|
|
25
|
+
"_B(A)": "que ce soit un billet de $10$ euros, sachant qu'il est froissé",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
context: "Cynthia change de station de radio. Elle tombe sur un morceau de musique.",
|
|
29
|
+
strA: "C'est de la pop.",
|
|
30
|
+
strB: "Les paroles sont en anglais.",
|
|
31
|
+
"(A)": "que ce soit de la pop",
|
|
32
|
+
"(B)": "que les paroles soient en anglais",
|
|
33
|
+
"(A \\cap B)": "que ce soit un morceau de pop en anglais",
|
|
34
|
+
"_A(B)": "que les paroles soient en anglais, sachant que c'est de la pop",
|
|
35
|
+
"_B(A)": "que ce soit de la pop, sachant que les paroles sont en anglais",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
context: "À la maison, Henri et Raphaël jouent au Monopoly. Raphaël lance les dés.",
|
|
39
|
+
strA: "Le résultat du lancer est un double $6$.",
|
|
40
|
+
strB: "Les dés sont tombés par terre.",
|
|
41
|
+
"(A)": "que le résulat du lancer soit un double $6$",
|
|
42
|
+
"(B)": "que les dés soient tombés par terre",
|
|
43
|
+
"(A \\cap B)": "que les dés soient tombés par terre et aient donné un double $6$",
|
|
44
|
+
"_A(B)": "que les dés soient tombés par terre, sachant que le résultat du lancer est un double $6$",
|
|
45
|
+
"_B(A)": "que ce soit un double $6$, sachant que les dés sont tombés par terre",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
context: "Au hasard, la maîtresse ouvre le dictionnaire et pose son doigt sur un mot.",
|
|
49
|
+
strA: "C'est un mot de $7$ lettres.",
|
|
50
|
+
strB: 'Le mot se termine par la lettre "e".',
|
|
51
|
+
"(A)": "que ce soit un mot de $7$ lettres",
|
|
52
|
+
"(B)": 'que le mot se termine par un "e"',
|
|
53
|
+
"(A \\cap B)": 'que ce soit un mot de $7$ lettres qui se termine par un "e"',
|
|
54
|
+
"_A(B)": 'que ce soit un mot qui se termine par un "e", sachant que c\'est un mot de $7$ lettres',
|
|
55
|
+
"_B(A)": 'que ce soit un mot de $7$ lettres sachant qu\'il se termine par un "e"',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
context: "Dans une émission TV, le présentateur demande son prénom à quelqu'un dans le public.",
|
|
59
|
+
strA: "Le prénom est Jean-Michel.",
|
|
60
|
+
strB: 'Le prénom commence par la lettre "A".',
|
|
61
|
+
"(A)": "que le prénom soit Jean-Michel",
|
|
62
|
+
"(B)": 'que le prénom commence par la lettre "J"',
|
|
63
|
+
"(A \\cap B)": 'que le prénom soit Jean-Michel et qu\'il commence par un "A"',
|
|
64
|
+
"_A(B)": 'que le prénom commence par un "A", sachant que c\'est Jean-Michel',
|
|
65
|
+
"_B(A)": 'que le prénom soit Jean-Michel, sachant qu\'il commence par un "A"',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
context: "Il est $14$h$37$. Yohann et Sarah sont assis en classe. C'est un cours sur les probabilités.",
|
|
69
|
+
strA: "Yohann dort.",
|
|
70
|
+
strB: "Sarah est attentive.",
|
|
71
|
+
"(A)": "que Yohann dorme",
|
|
72
|
+
"(B)": "que Sarah soit attentive",
|
|
73
|
+
"(A \\cap B)": "que Yohann dorme tandis que Sarah est attentive",
|
|
74
|
+
"_A(B)": "que Sarah soit attentive, sachant que Yohann dort",
|
|
75
|
+
"_B(A)": "que Yohann dorme, sachant que Sarah est attentive",
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
const shuffleSituation = (situation, dictShuffle) => {
|
|
79
|
+
function replaceKey(strSrc, dictReplacement) {
|
|
80
|
+
return Object.keys(dictReplacement).reduce((acc, x) => {
|
|
81
|
+
return acc.replace(x, dictReplacement[x]);
|
|
82
|
+
}, strSrc);
|
|
83
|
+
}
|
|
84
|
+
const arrayOfTemporaryKeys = [
|
|
85
|
+
...Array(Object.keys(dictShuffle).length).keys(),
|
|
86
|
+
].map((i) => {
|
|
87
|
+
return `temporaryKey{${i}}`;
|
|
88
|
+
});
|
|
89
|
+
const dictReplacementOriginaltoTemporary = Object.fromEntries(Object.keys(dictShuffle).map((originalKey, i) => {
|
|
90
|
+
return [originalKey, arrayOfTemporaryKeys[i]];
|
|
91
|
+
}));
|
|
92
|
+
const dictReplacementTemporaryToShuffledOriginal = Object.fromEntries(Object.keys(dictShuffle).map((originalKey) => {
|
|
93
|
+
return [
|
|
94
|
+
dictReplacementOriginaltoTemporary[originalKey],
|
|
95
|
+
dictShuffle[originalKey],
|
|
96
|
+
];
|
|
97
|
+
}));
|
|
98
|
+
return Object.fromEntries(Object.entries(situation).map(([k, v]) => [
|
|
99
|
+
k === "(A \\cap B)"
|
|
100
|
+
? k
|
|
101
|
+
: replaceKey(replaceKey(k, dictReplacementOriginaltoTemporary), dictReplacementTemporaryToShuffledOriginal),
|
|
102
|
+
v,
|
|
103
|
+
]));
|
|
104
|
+
};
|
|
105
|
+
const getInstruction = (identifiers) => {
|
|
106
|
+
const { situationIndex, dictShuffle, pType } = identifiers;
|
|
107
|
+
const situation = shuffleSituation(situations[situationIndex], dictShuffle);
|
|
108
|
+
let instruction = `${situation.context}`;
|
|
109
|
+
instruction += `
|
|
110
|
+
|
|
111
|
+
Soit $A$ l'évenement :
|
|
112
|
+
|
|
113
|
+
> ${situation.strA}
|
|
114
|
+
|
|
115
|
+
Soit $B$ l'évenement :
|
|
116
|
+
|
|
117
|
+
> ${situation.strB}`;
|
|
118
|
+
instruction += `
|
|
119
|
+
|
|
120
|
+
Écris en langage mathématique :
|
|
121
|
+
|
|
122
|
+
La probabilité ${situation[pType]}.`;
|
|
123
|
+
return instruction;
|
|
124
|
+
};
|
|
125
|
+
const getAnswer = (identifiers) => {
|
|
126
|
+
const { pType } = identifiers;
|
|
127
|
+
switch (pType) {
|
|
128
|
+
case "(A \\cap B)":
|
|
129
|
+
return `P\\left(A\\cap B\\right)`;
|
|
130
|
+
case "_A(B)":
|
|
131
|
+
return `P_A\\left(B\\right)`;
|
|
132
|
+
case "_B(A)":
|
|
133
|
+
return `P_B\\left(A\\right)`;
|
|
134
|
+
default:
|
|
135
|
+
return "";
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const getHint = () => {
|
|
139
|
+
return `Si $M$ et $N$ sont deux évenements, alors
|
|
140
|
+
|
|
141
|
+
$P(M \\cap N)$ est la probabilité de l'évènement "$M$ et $N$".
|
|
142
|
+
|
|
143
|
+
$P_M(N)$ est la probabilité de l'évènement $N$, sachant que l'évènement $M$ est réalisé.
|
|
144
|
+
|
|
145
|
+
$P_N(M)$ est la probabilité de l'évènement $M$, sachant que l'évènement $N$ est réalisé.`;
|
|
146
|
+
};
|
|
147
|
+
const getCorrection = (identifiers) => {
|
|
148
|
+
const { situationIndex, dictShuffle, pType } = identifiers;
|
|
149
|
+
const situation = shuffleSituation(situations[situationIndex], dictShuffle);
|
|
150
|
+
return `La probabilité ${situation[pType]}${pType === "_A(B)" || pType === "_B(A)" ? ", est" : " n'est pas"} une probabilité conditionnelle.
|
|
151
|
+
${(() => {
|
|
152
|
+
switch (pType) {
|
|
153
|
+
case "(A \\cap B)":
|
|
154
|
+
return `C'est la probabilité de l'évènement "$A$ et $B$", sans condition particulière.`;
|
|
155
|
+
case "_A(B)":
|
|
156
|
+
return `C'est la probabilité sachant A (donc conditionnelle), $P_A$, de l'évènement "$B$".`;
|
|
157
|
+
case "_B(A)":
|
|
158
|
+
return `C'est la probabilité sachant B (donc conditionnelle), $P_B$, de l'évènement "$A$".`;
|
|
159
|
+
}
|
|
160
|
+
})()}
|
|
161
|
+
Elle se note $P${pType}$.`;
|
|
162
|
+
};
|
|
163
|
+
const getConditionalProbaWriteFromFrenchQuestion = () => {
|
|
164
|
+
const pType = random(["(A \\cap B)", "_A(B)", "_B(A)"]);
|
|
165
|
+
const situationIndex = randint(0, situations.length);
|
|
166
|
+
const arrABShuffled = shuffle(["A", "B"]);
|
|
167
|
+
const dictShuffle = Object.fromEntries(["A", "B"].map((c, i) => [c, arrABShuffled[i]]));
|
|
168
|
+
const identifiers = { situationIndex, dictShuffle, pType };
|
|
169
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
170
|
+
};
|
|
171
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
172
|
+
const question = {
|
|
173
|
+
instruction: getInstruction(identifiers),
|
|
174
|
+
answer: getAnswer(identifiers),
|
|
175
|
+
keys: ["P", "cap", "underscore", "A", "B"],
|
|
176
|
+
answerFormat: "tex",
|
|
177
|
+
identifiers,
|
|
178
|
+
hint: getHint(identifiers),
|
|
179
|
+
correction: getCorrection(identifiers),
|
|
180
|
+
};
|
|
181
|
+
return question;
|
|
182
|
+
};
|
|
183
|
+
const getPropositions = (n, { answer }) => {
|
|
184
|
+
const propositions = [];
|
|
185
|
+
addValidProp(propositions, answer);
|
|
186
|
+
tryToAddWrongProp(propositions, `P\\left(A\\cap B\\right)`, "tex");
|
|
187
|
+
tryToAddWrongProp(propositions, `P_A\\left(B\\right)`, "tex");
|
|
188
|
+
tryToAddWrongProp(propositions, `P_B\\left(A\\right)`, "tex");
|
|
189
|
+
tryToAddWrongProp(propositions, `P(A)`, "tex");
|
|
190
|
+
tryToAddWrongProp(propositions, `P(B)`, "tex");
|
|
191
|
+
return shuffleProps(propositions, n);
|
|
192
|
+
};
|
|
193
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
194
|
+
const { pType } = identifiers;
|
|
195
|
+
switch (pType) {
|
|
196
|
+
case "(A \\cap B)":
|
|
197
|
+
return (`P\\left(A\\cap B\\right)`.trim() === ans ||
|
|
198
|
+
`P\\left(B\\cap A\\right)`.trim() === ans);
|
|
199
|
+
case "_A(B)":
|
|
200
|
+
return `P_A\\left(B\\right)`.trim() === ans.trim();
|
|
201
|
+
case "_B(A)":
|
|
202
|
+
return `P_B\\left(A\\right)`.trim() === ans.trim();
|
|
203
|
+
default:
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
export const conditionalProbaWriteFromFrench = {
|
|
208
|
+
id: "conditionalProbaWriteFromFrench",
|
|
209
|
+
connector: "=",
|
|
210
|
+
label: "Ecrire une probabilité en langage mathématique",
|
|
211
|
+
isSingleStep: false,
|
|
212
|
+
generator: (nb) => getDistinctQuestions(getConditionalProbaWriteFromFrenchQuestion, nb),
|
|
213
|
+
qcmTimer: 60,
|
|
214
|
+
freeTimer: 60,
|
|
215
|
+
getPropositions,
|
|
216
|
+
isAnswerValid,
|
|
217
|
+
subject: "Mathématiques",
|
|
218
|
+
hasHintAndCorrection: true,
|
|
219
|
+
getQuestionFromIdentifiers,
|
|
220
|
+
answerType: "QCU",
|
|
221
|
+
};
|
|
@@ -13,4 +13,6 @@ export * from "./unionIntersectionProba.js";
|
|
|
13
13
|
export * from "./checkEquiprobability.js";
|
|
14
14
|
export * from "./events/index.js";
|
|
15
15
|
export * from "./basicProbas/index.js";
|
|
16
|
+
export * from "./probaAsSumOfProbas.js";
|
|
17
|
+
export * from "./conditionalProbaWriteFromFrench.js";
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC"}
|
|
@@ -13,3 +13,5 @@ export * from "./unionIntersectionProba.js";
|
|
|
13
13
|
export * from "./checkEquiprobability.js";
|
|
14
14
|
export * from "./events/index.js";
|
|
15
15
|
export * from "./basicProbas/index.js";
|
|
16
|
+
export * from "./probaAsSumOfProbas.js";
|
|
17
|
+
export * from "./conditionalProbaWriteFromFrench.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Exercise } from "../../exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
indexSituation: number;
|
|
5
|
+
eventIds: EventIdentifiers;
|
|
6
|
+
arrProba: NodeIdentifiers[];
|
|
7
|
+
};
|
|
8
|
+
type EventIdentifiers = {
|
|
9
|
+
type: "elementary";
|
|
10
|
+
index: number;
|
|
11
|
+
id: string;
|
|
12
|
+
str: string;
|
|
13
|
+
p: NodeIdentifiers;
|
|
14
|
+
} | {
|
|
15
|
+
type: "union";
|
|
16
|
+
id: string;
|
|
17
|
+
str: string;
|
|
18
|
+
p: NodeIdentifiers;
|
|
19
|
+
arrSubEvent: EventIdentifiers[];
|
|
20
|
+
isTailoredStr: boolean;
|
|
21
|
+
};
|
|
22
|
+
type Options = {
|
|
23
|
+
nbElem: number[];
|
|
24
|
+
unionLength: number[];
|
|
25
|
+
isProbasAreNumbers: boolean[];
|
|
26
|
+
};
|
|
27
|
+
export declare const probaAsSumOfProbas: Exercise<Identifiers, Options>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=probaAsSumOfProbas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probaAsSumOfProbas.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaAsSumOfProbas.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAkBT,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,gBAAgB,GACjB;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,eAAe,CAAC;CACpB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,eAAe,CAAC;IACnB,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AA4eN,KAAK,OAAO,GAAG;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,kBAAkB,EAAE,OAAO,EAAE,CAAC;CAC/B,CAAC;AAyTF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe7D,CAAC"}
|