math-exercises 3.0.124 → 3.0.126
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/arithmetics/primeNumbers.d.ts +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +20 -14
- package/lib/exercises/math/calcul/fractions/fractionsMix.js +1 -1
- 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 +217 -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 +221 -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 +135 -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 +367 -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 +414 -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 +107 -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 +182 -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 +178 -241
- 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 +8 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +98 -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 +233 -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/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/volumeConversion.js +7 -1
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +50 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +517 -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 +139 -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 +145 -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 +10 -5
- 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 +103 -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 +100 -0
- package/lib/exercises/math/functions/affines/drawAffineFromLitExp.js +5 -5
- 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 +206 -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 +13 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.js +184 -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 +216 -0
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.js +29 -2
- 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/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +72 -61
- 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/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +41 -16
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +3 -2
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +21 -13
- 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/perimeters/circleCircumference.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.js +15 -7
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +5 -3
- 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/percent/evolutions/evolutionToCM.js +2 -2
- package/lib/exercises/math/percent/findProportion.d.ts +6 -1
- package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
- package/lib/exercises/math/percent/findProportion.js +162 -45
- package/lib/exercises/math/powers/calculateNegativePower.d.ts +5 -1
- package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
- package/lib/exercises/math/powers/calculateNegativePower.js +93 -29
- 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 +42 -80
- 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 +217 -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 +30 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +548 -0
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +10 -2
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +2 -1
- 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 +90 -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 +151 -0
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts +4 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.js +46 -27
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +14 -2
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +43 -19
- package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/sequenceEvaluation.js +18 -1
- package/lib/exercises/pc/chemicalReactions/chemicalEquations.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/chemicalEquations.js +17 -2
- 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/mole/molarMass.d.ts.map +1 -1
- package/lib/exercises/pc/mole/molarMass.js +7 -1
- package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
- package/lib/exercises/pc/moleculeFormula.js +4 -3
- package/lib/exercises/pc/motion/averageSpeed.d.ts +9 -4
- package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
- package/lib/exercises/pc/motion/averageSpeed.js +132 -61
- package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/motion/averageSpeedCalculation.js +10 -4
- 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/recognizeRefractionOrReflectionAngles.d.ts +2 -2
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +15 -15
- 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/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +3 -1
- 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 +392 -23
- 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/pc/units/timeUnits.d.ts +5 -3
- package/lib/pc/units/timeUnits.d.ts.map +1 -1
- package/lib/pc/units/timeUnits.js +25 -19
- 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
|
@@ -32,7 +32,7 @@ $$
|
|
|
32
32
|
1${isHausse ? "+" : "-"}\\frac{${Math.abs(evolution)}}{100} = ${CM}
|
|
33
33
|
$$
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
`;
|
|
36
36
|
};
|
|
37
37
|
const getEvolutionToCmQuestion = () => {
|
|
38
38
|
const evolution = randint(-99, 101, [0]);
|
|
@@ -43,7 +43,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
43
43
|
const question = {
|
|
44
44
|
answer: getAnswer(identifiers),
|
|
45
45
|
instruction: getInstruction(identifiers),
|
|
46
|
-
keys: [
|
|
46
|
+
keys: [],
|
|
47
47
|
answerFormat: "tex",
|
|
48
48
|
identifiers,
|
|
49
49
|
hint: getHint(identifiers),
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
2
|
type Identifiers = {
|
|
3
|
+
indexSituation: number;
|
|
3
4
|
total: number;
|
|
4
5
|
lefties: number;
|
|
6
|
+
opts: Options;
|
|
5
7
|
};
|
|
6
|
-
|
|
8
|
+
type Options = {
|
|
9
|
+
isPercentSymbolRequired: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const findProportion: Exercise<Identifiers, Options>;
|
|
7
12
|
export {};
|
|
8
13
|
//# sourceMappingURL=findProportion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findProportion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findProportion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"findProportion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findProportion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAwNF,KAAK,OAAO,GAAG;IACb,uBAAuB,EAAE,OAAO,CAAC;CAClC,CAAC;AAeF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBzD,CAAC"}
|
|
@@ -1,60 +1,143 @@
|
|
|
1
|
-
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
-
import { rationalVEA } from "../../../exercises/vea/rationalVEA.js";
|
|
4
3
|
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
5
4
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
5
|
import { round } from "../../../math/utils/round.js";
|
|
7
|
-
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
8
6
|
import { percentParser } from "../../../tree/parsers/percentParser.js";
|
|
7
|
+
import { random } from "../../../utils/alea/random.js";
|
|
9
8
|
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
10
9
|
import { approxOrEqual } from "../../../utils/latex/approxOrEqual.js";
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const situations = [
|
|
11
|
+
{
|
|
12
|
+
instruction: (total, lefties) => `${random([
|
|
13
|
+
`Dans un lycée de $${total}$ élèves, $${lefties}$ sont gauchers.`,
|
|
14
|
+
`Dans un lycée, $${lefties}$ élèves sont gauchers sur un total de $${total}$ élèves.`,
|
|
15
|
+
])}
|
|
16
|
+
Quelle est la proportion de gauchers dans ce lycée, en pourcentage ?`,
|
|
17
|
+
hint: `La proportion de gauchers en pourcents s'obtient par la formule :
|
|
18
|
+
|
|
19
|
+
$$
|
|
20
|
+
\\frac{\\text{nombre de gauchers}}{\\text{nombre total d'élèves}}\\times 100
|
|
21
|
+
$$
|
|
22
|
+
`,
|
|
23
|
+
correction: `La proportion de gauchers en pourcentage dans ce lycée est de`,
|
|
24
|
+
randTotal: () => randint(500, 2000),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
instruction: (total, lefties) => `${random([
|
|
28
|
+
`Dans une casse automobile, il y a $${total}$ voitures dont $${lefties}$ ont le volant à gauche.`,
|
|
29
|
+
`Dans une casse automobile, $${lefties}$ voitures ont le volant à gauche. Il y a au total $${total}$ voitures.`,
|
|
30
|
+
])}
|
|
31
|
+
Quelle est la proportion de voitures avec le volant à gauche dans cette casse, en pourcentage ?`,
|
|
32
|
+
hint: `La proportion, en pourcents, de voitures avec le volant à gauche s'obtient par la formule :
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
\\frac{\\text{nombre de voitures avec volant à gauche}}{\\text{nombre total de voitures}}\\times 100
|
|
36
|
+
$$
|
|
37
|
+
`,
|
|
38
|
+
correction: `La proportion, en pourcentage, de voitures avec le volant à gauche est de`,
|
|
39
|
+
randTotal: () => randint(100, 500),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
instruction: (total, lefties) => `${random([
|
|
43
|
+
`Dans un restaurant italien, sur un total de $${total}$ clients, $${lefties}$ ont commandé des pâtes.`,
|
|
44
|
+
`Dans un restaurant italien, $${lefties}$ clients ont commandé des pâtes. Il y a au total $${total}$ clients.`,
|
|
45
|
+
])}
|
|
46
|
+
Quelle est la proportion de clients qui ont commandé des pâtes, en pourcentage ?`,
|
|
47
|
+
hint: `La proportion en pourcents de clients qui ont commandé des pâtes s'obtient par la formule :
|
|
48
|
+
|
|
49
|
+
$$
|
|
50
|
+
\\frac{\\text{nombre de clients ayant commandé des pâtes}}{\\text{nombre total de clients}}\\times 100
|
|
51
|
+
$$
|
|
52
|
+
`,
|
|
53
|
+
correction: `La proportion en pourcentage de clients ayant commandé des pâtes est de`,
|
|
54
|
+
randTotal: () => randint(30, 200),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
instruction: (total, lefties) => `${random([
|
|
58
|
+
`Dans une cagette de $${total}$ pommes, $${lefties}$ sont véreuses.`,
|
|
59
|
+
`Dans une cagette de pommes, $${lefties}$ sont véreuses. Il y a au total $${total}$ pommes.`,
|
|
60
|
+
])}
|
|
61
|
+
Quelle est la proportion de pommes véreuses dans la cagette, en pourcentage ?`,
|
|
62
|
+
hint: `La proportion, en pourcents, de pommes véreuses s'obtient par la formule :
|
|
17
63
|
|
|
18
64
|
$$
|
|
19
|
-
\\frac{\\text{nombre de
|
|
65
|
+
\\frac{\\text{nombre de pommes véreuses}}{\\text{nombre total de pommes}}\\times 100
|
|
20
66
|
$$
|
|
21
|
-
|
|
67
|
+
`,
|
|
68
|
+
correction: `La proportion, en pourcentage, de pommes véreuses est de`,
|
|
69
|
+
randTotal: () => randint(30, 100),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
instruction: (total, lefties) => `${random([
|
|
73
|
+
`Dans un car scolaire transportant $${total}$ élèves, $${lefties}$ sont du côté gauche.`,
|
|
74
|
+
`Dans un car scolaire, $${lefties}$ élèves sont du côté gauche. Le car transporte $${total}$ élèves.`,
|
|
75
|
+
])}
|
|
76
|
+
Quelle est la proportion d'élèves du côté gauche du car, en pourcentage ?`,
|
|
77
|
+
hint: `La proportion en pourcents d'élèves du gauche du car s'obtient par la formule :
|
|
78
|
+
|
|
79
|
+
$$
|
|
80
|
+
\\frac{\\text{nombre d'élèves du côté gauche}}{\\text{nombre d'élèves dans le car}}\\times 100
|
|
81
|
+
$$
|
|
82
|
+
`,
|
|
83
|
+
correction: `La proportion en pourcentage d'élèves du côté gauche est de`,
|
|
84
|
+
randTotal: () => randint(20, 40),
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
instruction: (total, lefties) => `${random([
|
|
88
|
+
`Dans un champ, au mois de septembre, sur $${total}$ champignons, $${lefties}$ sont vénéneux.`,
|
|
89
|
+
`Dans un champ, au mois de septembre, $${lefties}$ champignons sont vénéneux sur un total de $${total}$ champignons.`,
|
|
90
|
+
])}
|
|
91
|
+
Quelle est la proportion de champignons vénéneux dans ce champ, en pourcentage ?`,
|
|
92
|
+
hint: `La proportion de champignons vénéneux dans ce champ, en pourcents, s'obtient par la formule :
|
|
93
|
+
|
|
94
|
+
$$
|
|
95
|
+
\\frac{\\text{nombre de champignons vénéneux}}{\\text{nombre total de champignons}}\\times 100
|
|
96
|
+
$$
|
|
97
|
+
`,
|
|
98
|
+
correction: `La proportion en pourcentage de champignons vénéneux dans ce champ est de`,
|
|
99
|
+
randTotal: () => randint(20, 400),
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
const getInstruction = (identifiers) => {
|
|
103
|
+
const { indexSituation, total, lefties, opts } = identifiers;
|
|
104
|
+
const situation = situations[indexSituation];
|
|
105
|
+
return `${situation.instruction(total, lefties)}
|
|
106
|
+
|
|
107
|
+
Arrondir au centième de pourcent.
|
|
108
|
+
${opts.isPercentSymbolRequired
|
|
109
|
+
? `
|
|
110
|
+
|
|
111
|
+
Ne pas oublier le symbole $\\%$ à la fin.`
|
|
112
|
+
: ``}`;
|
|
113
|
+
};
|
|
114
|
+
const getHint = (identifiers) => {
|
|
115
|
+
const { indexSituation } = identifiers;
|
|
116
|
+
const situation = situations[indexSituation];
|
|
117
|
+
return situation.hint;
|
|
22
118
|
};
|
|
23
119
|
const getCorrection = (identifiers) => {
|
|
24
|
-
const { total, lefties } = identifiers;
|
|
120
|
+
const { indexSituation, total, lefties, opts } = identifiers;
|
|
121
|
+
const situation = situations[indexSituation];
|
|
25
122
|
const frac = (100 * lefties) / total;
|
|
26
|
-
return `
|
|
123
|
+
return `On a :
|
|
27
124
|
|
|
28
125
|
$$
|
|
29
126
|
\\frac{${lefties}}{${total}}\\times 100 ${approxOrEqual(frac, 2).join("")}
|
|
30
127
|
$$
|
|
31
128
|
|
|
32
|
-
|
|
33
|
-
|
|
129
|
+
${situation.correction} $${getAnswer(identifiers)}$.
|
|
130
|
+
${opts.isPercentSymbolRequired
|
|
131
|
+
? `
|
|
132
|
+
|
|
133
|
+
Attention, ici le symbole "$\\%$" est requis à la fin.`
|
|
134
|
+
: ``}`;
|
|
34
135
|
};
|
|
35
136
|
const getAnswer = (identifiers) => {
|
|
36
137
|
const { total, lefties } = identifiers;
|
|
37
138
|
const answer = round((lefties / total) * 100, 2).frenchify() + "\\%";
|
|
38
139
|
return answer;
|
|
39
140
|
};
|
|
40
|
-
const getFindProportionQuestion = () => {
|
|
41
|
-
const total = randint(120, 200);
|
|
42
|
-
const lefties = randint(30, 120);
|
|
43
|
-
const identifiers = { total, lefties };
|
|
44
|
-
return getQuestionFromIdentifiers(identifiers);
|
|
45
|
-
};
|
|
46
|
-
const getQuestionFromIdentifiers = (identifiers) => {
|
|
47
|
-
const question = {
|
|
48
|
-
answer: getAnswer(identifiers),
|
|
49
|
-
instruction: getInstruction(identifiers),
|
|
50
|
-
keys: ["percent"],
|
|
51
|
-
answerFormat: "tex",
|
|
52
|
-
identifiers,
|
|
53
|
-
hint: getHint(identifiers),
|
|
54
|
-
correction: getCorrection(identifiers),
|
|
55
|
-
};
|
|
56
|
-
return question;
|
|
57
|
-
};
|
|
58
141
|
const getPropositions = (n, { answer, total, lefties }) => {
|
|
59
142
|
const propositions = [];
|
|
60
143
|
addValidProp(propositions, answer);
|
|
@@ -64,32 +147,66 @@ const getPropositions = (n, { answer, total, lefties }) => {
|
|
|
64
147
|
});
|
|
65
148
|
return shuffleProps(propositions, n);
|
|
66
149
|
};
|
|
67
|
-
const isAnswerValid = (ans, { answer,
|
|
150
|
+
const isAnswerValid = (ans, { answer, opts }) => {
|
|
68
151
|
try {
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
152
|
+
if (opts.isPercentSymbolRequired) {
|
|
153
|
+
if (!ans.includes("\\%")) {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
return percentParser(ans) === answer;
|
|
158
|
+
}
|
|
76
159
|
}
|
|
77
160
|
else {
|
|
78
|
-
|
|
161
|
+
const texs = [answer, answer.replace("\\%", "")];
|
|
162
|
+
return texs.includes(ans);
|
|
79
163
|
}
|
|
80
164
|
}
|
|
81
165
|
catch (err) {
|
|
82
166
|
return handleVEAError(err);
|
|
83
167
|
}
|
|
84
|
-
const texs = [answer, answer.replace("\\%", "")];
|
|
85
|
-
return texs.includes(ans);
|
|
86
168
|
};
|
|
169
|
+
const getFindProportionQuestion = (optsIn) => {
|
|
170
|
+
const opts = optsIn ?? optsDefault;
|
|
171
|
+
const indexSituation = randint(0, situations.length);
|
|
172
|
+
const situation = situations[indexSituation];
|
|
173
|
+
const total = situation.randTotal();
|
|
174
|
+
const lefties = round(randfloat(0.1, 0.9) * total, 0);
|
|
175
|
+
return getQuestionFromIdentifiers({ indexSituation, total, lefties, opts });
|
|
176
|
+
};
|
|
177
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
178
|
+
const question = {
|
|
179
|
+
answer: getAnswer(identifiers),
|
|
180
|
+
instruction: getInstruction(identifiers),
|
|
181
|
+
keys: ["percent"],
|
|
182
|
+
answerFormat: "tex",
|
|
183
|
+
identifiers,
|
|
184
|
+
hint: getHint(identifiers),
|
|
185
|
+
correction: getCorrection(identifiers),
|
|
186
|
+
options: opts,
|
|
187
|
+
};
|
|
188
|
+
return question;
|
|
189
|
+
};
|
|
190
|
+
const optsDefault = {
|
|
191
|
+
isPercentSymbolRequired: false,
|
|
192
|
+
};
|
|
193
|
+
const options = [
|
|
194
|
+
{
|
|
195
|
+
id: "isPercentSymbolRequired",
|
|
196
|
+
label: "Symbole pourcent requis",
|
|
197
|
+
target: GeneratorOptionTarget.generation,
|
|
198
|
+
type: GeneratorOptionType.checkbox,
|
|
199
|
+
values: [false, true],
|
|
200
|
+
defaultValue: optsDefault.isPercentSymbolRequired,
|
|
201
|
+
},
|
|
202
|
+
];
|
|
87
203
|
export const findProportion = {
|
|
88
204
|
id: "findProportion",
|
|
89
205
|
connector: "=",
|
|
90
206
|
label: "Calculer une proportion en pourcentage",
|
|
91
207
|
isSingleStep: true,
|
|
92
|
-
generator: (nb) => getDistinctQuestions(getFindProportionQuestion, nb),
|
|
208
|
+
generator: (nb, opts) => getDistinctQuestions(() => getFindProportionQuestion(opts), nb),
|
|
209
|
+
options,
|
|
93
210
|
qcmTimer: 60,
|
|
94
211
|
freeTimer: 60,
|
|
95
212
|
getPropositions,
|
|
@@ -2,7 +2,11 @@ import { Exercise } from "../../../exercises/exercise.js";
|
|
|
2
2
|
type Identifiers = {
|
|
3
3
|
int: number;
|
|
4
4
|
power: number;
|
|
5
|
+
opts: Options;
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
+
type Options = {
|
|
8
|
+
isPowerAllowed: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const calculateNegativePower: Exercise<Identifiers, Options>;
|
|
7
11
|
export {};
|
|
8
12
|
//# sourceMappingURL=calculateNegativePower.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateNegativePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculateNegativePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"calculateNegativePower.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/calculateNegativePower.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AA0CrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AA4JF,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAeF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjE,CAAC"}
|
|
@@ -1,23 +1,47 @@
|
|
|
1
|
-
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
4
|
+
import { isFunctionNode } from "../../../tree/nodes/functions/functionNode.js";
|
|
4
5
|
import { isNumberNode, NumberNode, } from "../../../tree/nodes/numbers/numberNode.js";
|
|
5
6
|
import { frac, isFractionNode, } from "../../../tree/nodes/operators/fractionNode.js";
|
|
7
|
+
import { isOperatorNode, OperatorIds, } from "../../../tree/nodes/operators/operatorNode.js";
|
|
6
8
|
import { PowerNode } from "../../../tree/nodes/operators/powerNode.js";
|
|
7
9
|
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
8
10
|
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
11
|
+
const isNodeContainingOperatorId = (node, opId) => {
|
|
12
|
+
if (isFunctionNode(node)) {
|
|
13
|
+
return isNodeContainingOperatorId(node.child, opId);
|
|
14
|
+
}
|
|
15
|
+
else if (isOperatorNode(node)) {
|
|
16
|
+
if (node.id === opId) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return (isNodeContainingOperatorId(node.leftChild, opId) ||
|
|
21
|
+
isNodeContainingOperatorId(node.rightChild, opId));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
9
28
|
const getInstruction = (identifiers) => {
|
|
10
|
-
const { int, power } = identifiers;
|
|
29
|
+
const { int, power, opts } = identifiers;
|
|
11
30
|
const statement = new PowerNode(new NumberNode(int), new NumberNode(power)).toTex();
|
|
12
31
|
return `Calculer et donner le résultat sous la forme d'une fraction ou d'un entier :
|
|
13
32
|
|
|
14
33
|
$$
|
|
15
34
|
${statement}
|
|
16
|
-
|
|
35
|
+
$$
|
|
36
|
+
|
|
37
|
+
${opts.isPowerAllowed
|
|
38
|
+
? `La réponse pourra comporter un exposant.`
|
|
39
|
+
: `La réponse ne devra comporter aucun exposant.`}`;
|
|
17
40
|
};
|
|
18
41
|
const getAnswer = (identifiers) => {
|
|
19
|
-
const { int, power } = identifiers;
|
|
20
|
-
const
|
|
42
|
+
const { int, power, opts } = identifiers;
|
|
43
|
+
const powerNode = new PowerNode(int.toTree(), Math.abs(power).toTree());
|
|
44
|
+
const fraction = frac(1, opts.isPowerAllowed ? powerNode : powerNode.evaluate().toTree());
|
|
21
45
|
const answer = fraction.simplify();
|
|
22
46
|
return answer.toTex();
|
|
23
47
|
};
|
|
@@ -29,32 +53,35 @@ a^{-x} = \\frac{1}{a^x}
|
|
|
29
53
|
$$`;
|
|
30
54
|
};
|
|
31
55
|
const getCorrection = (identifiers) => {
|
|
32
|
-
const { int, power } = identifiers;
|
|
56
|
+
const { int, power, opts } = identifiers;
|
|
33
57
|
const statement = new PowerNode(new NumberNode(int), new NumberNode(power)).toTex();
|
|
34
58
|
const fraction = frac(1, new PowerNode(int.toTree(), Math.abs(power).toTree()));
|
|
59
|
+
const simplificationTex = fraction.toSimplificationTex();
|
|
35
60
|
return `Puisque $a^{-x} = \\frac{1}{a^x}$, on a :
|
|
36
61
|
|
|
37
62
|
$$
|
|
38
|
-
${statement} = ${
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
${statement} = ${simplificationTex}
|
|
64
|
+
$$
|
|
65
|
+
|
|
66
|
+
${(() => {
|
|
67
|
+
if (!opts.isPowerAllowed) {
|
|
68
|
+
const fractionNoPower = frac(1, new PowerNode(int.toTree(), Math.abs(power).toTree()).evaluate().toTree());
|
|
69
|
+
const texNoPower = fractionNoPower.toTex();
|
|
70
|
+
return !simplificationTex.includes(texNoPower)
|
|
71
|
+
? `
|
|
72
|
+
|
|
73
|
+
$$
|
|
74
|
+
${statement} = ${texNoPower}
|
|
75
|
+
$$
|
|
76
|
+
|
|
77
|
+
`
|
|
78
|
+
: ``;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
return ``;
|
|
82
|
+
}
|
|
83
|
+
})()}
|
|
84
|
+
`;
|
|
58
85
|
};
|
|
59
86
|
const getPropositions = (n, { answer, int, power }) => {
|
|
60
87
|
const propositions = [];
|
|
@@ -78,10 +105,13 @@ const getPropositions = (n, { answer, int, power }) => {
|
|
|
78
105
|
});
|
|
79
106
|
return shuffleProps(propositions, n);
|
|
80
107
|
};
|
|
81
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
108
|
+
const isAnswerValid = (ans, { answer, opts }) => {
|
|
82
109
|
try {
|
|
83
110
|
const parsed = parseAlgebraic(ans);
|
|
84
|
-
if (!isNumberNode(parsed) &&
|
|
111
|
+
if (!isNumberNode(parsed) &&
|
|
112
|
+
!(isFractionNode(parsed) &&
|
|
113
|
+
(opts.isPowerAllowed ||
|
|
114
|
+
!isNodeContainingOperatorId(parsed, OperatorIds.power)))) {
|
|
85
115
|
return false;
|
|
86
116
|
}
|
|
87
117
|
return parsed.simplify().toTex() === answer;
|
|
@@ -90,12 +120,46 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
90
120
|
return handleVEAError(err);
|
|
91
121
|
}
|
|
92
122
|
};
|
|
123
|
+
const getCalculatePowerQuestion = (optsIn) => {
|
|
124
|
+
const opts = optsIn ?? optsDefault;
|
|
125
|
+
const int = randint(1, 11);
|
|
126
|
+
const power = randint(-5, 0);
|
|
127
|
+
const identifiers = { int, power, opts };
|
|
128
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
129
|
+
};
|
|
130
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
131
|
+
const question = {
|
|
132
|
+
answer: getAnswer(identifiers),
|
|
133
|
+
instruction: getInstruction(identifiers),
|
|
134
|
+
keys: [],
|
|
135
|
+
answerFormat: "tex",
|
|
136
|
+
identifiers,
|
|
137
|
+
hint: getHint(identifiers),
|
|
138
|
+
correction: getCorrection(identifiers),
|
|
139
|
+
options: opts,
|
|
140
|
+
};
|
|
141
|
+
return question;
|
|
142
|
+
};
|
|
143
|
+
const optsDefault = {
|
|
144
|
+
isPowerAllowed: true,
|
|
145
|
+
};
|
|
146
|
+
const options = [
|
|
147
|
+
{
|
|
148
|
+
id: "isPowerAllowed",
|
|
149
|
+
label: "Exposant accepté dans la réponse",
|
|
150
|
+
target: GeneratorOptionTarget.generation,
|
|
151
|
+
type: GeneratorOptionType.checkbox,
|
|
152
|
+
values: [true, false],
|
|
153
|
+
defaultValue: optsDefault.isPowerAllowed,
|
|
154
|
+
},
|
|
155
|
+
];
|
|
93
156
|
export const calculateNegativePower = {
|
|
94
157
|
id: "calculateNegativePower",
|
|
95
158
|
connector: "=",
|
|
96
159
|
label: "Calculer une puissance négative",
|
|
97
160
|
isSingleStep: true,
|
|
98
|
-
generator: (nb) => getDistinctQuestions(getCalculatePowerQuestion, nb),
|
|
161
|
+
generator: (nb, opts) => getDistinctQuestions(() => getCalculatePowerQuestion(opts), nb),
|
|
162
|
+
options,
|
|
99
163
|
qcmTimer: 60,
|
|
100
164
|
freeTimer: 60,
|
|
101
165
|
getPropositions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"possibleValuesForProba.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/possibleValuesForProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"possibleValuesForProba.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/possibleValuesForProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAW7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,eAAe,EAAE,CAAC;IAClC,qBAAqB,EAAE,OAAO,CAAC;CAChC,CAAC;AA2EF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAwMF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBjE,CAAC"}
|