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
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { realize } from "../../../../math/utils/latex/realize.js";
|
|
4
|
+
import { isFunctionNode, } from "../../../../tree/nodes/functions/functionNode.js";
|
|
5
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
6
|
+
// import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
7
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
|
+
import { isOperatorNode } from "../../../../tree/nodes/operators/operatorNode.js";
|
|
9
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
10
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
11
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
12
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
13
|
+
const nodeBySubstitutingX = (node, strVar) => {
|
|
14
|
+
return parseAlgebraic(node.toTex({ forceParenthesis: true }).replaceAll("x", `("${strVar}")`));
|
|
15
|
+
};
|
|
16
|
+
const functionNameForFunctionId = (functionId) => {
|
|
17
|
+
return [
|
|
18
|
+
"opposite",
|
|
19
|
+
"sqrt",
|
|
20
|
+
"cos",
|
|
21
|
+
"sin",
|
|
22
|
+
"tan",
|
|
23
|
+
"log",
|
|
24
|
+
"log10",
|
|
25
|
+
"exp",
|
|
26
|
+
"abs",
|
|
27
|
+
"arcsin",
|
|
28
|
+
"arccos",
|
|
29
|
+
"arctan",
|
|
30
|
+
][functionId];
|
|
31
|
+
};
|
|
32
|
+
const extractElementaryFunctionNamesDict = (nodes, functionNamesDictIn = {}) => {
|
|
33
|
+
let functionNamesDict = functionNamesDictIn;
|
|
34
|
+
nodes.forEach((node) => {
|
|
35
|
+
if (isFunctionNode(node)) {
|
|
36
|
+
const functionId = node.id;
|
|
37
|
+
const functionName = functionNameForFunctionId(functionId);
|
|
38
|
+
if (!(functionName in functionNamesDict)) {
|
|
39
|
+
functionNamesDict[functionName] = functionName;
|
|
40
|
+
}
|
|
41
|
+
functionNamesDict = Object.assign(functionNamesDict, extractElementaryFunctionNamesDict([node.child], functionNamesDict));
|
|
42
|
+
}
|
|
43
|
+
else if (isOperatorNode(node)) {
|
|
44
|
+
functionNamesDict = Object.assign(functionNamesDict, extractElementaryFunctionNamesDict([node.leftChild, node.rightChild], functionNamesDict));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return functionNamesDict;
|
|
48
|
+
};
|
|
49
|
+
const getInstruction = (identifiers) => {
|
|
50
|
+
const { nodeIds } = identifiers;
|
|
51
|
+
const [nodeU, nodeV] = nodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
52
|
+
return `Soient $u$ et $v$ deux fonctions telles que, pour tout $x$ réel :
|
|
53
|
+
|
|
54
|
+
$$
|
|
55
|
+
u(x)=${nodeU.toTex()}
|
|
56
|
+
$$
|
|
57
|
+
|
|
58
|
+
$$
|
|
59
|
+
v(x)=${nodeV.toTex()}
|
|
60
|
+
$$
|
|
61
|
+
|
|
62
|
+
Pour tout $x$ réel, donner l'expression de $u \\circ v(x)$.`;
|
|
63
|
+
};
|
|
64
|
+
const getHint = () => {
|
|
65
|
+
return `Pour tout $x$ réel on a:
|
|
66
|
+
|
|
67
|
+
$$
|
|
68
|
+
u \\circ v(x) = u(v(x))
|
|
69
|
+
$$
|
|
70
|
+
|
|
71
|
+
`;
|
|
72
|
+
};
|
|
73
|
+
const getCorrection = (identifiers) => {
|
|
74
|
+
const { nodeIds } = identifiers;
|
|
75
|
+
const [nodeU, nodeV] = nodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
76
|
+
const arrayRHS = [
|
|
77
|
+
...new Set([
|
|
78
|
+
...(isOperatorNode(nodeV)
|
|
79
|
+
? [`${nodeU.toTex().replaceAll("x", `(${nodeV.toTex()})`)}`]
|
|
80
|
+
: []),
|
|
81
|
+
getAnswer(identifiers),
|
|
82
|
+
]).values(),
|
|
83
|
+
];
|
|
84
|
+
return `Pour tout réel $x$, on a :
|
|
85
|
+
|
|
86
|
+
${alignTex([
|
|
87
|
+
[`u \\circ v(x)`, `=`, `u(v(x))`],
|
|
88
|
+
[``, `=`, `${nodeU.toTex().replaceAll("x", "v(x)")}`],
|
|
89
|
+
...arrayRHS.map((rhs) => [``, `=`, rhs]),
|
|
90
|
+
])}`;
|
|
91
|
+
};
|
|
92
|
+
const getAnswer = (identifiers) => {
|
|
93
|
+
const { nodeIds } = identifiers;
|
|
94
|
+
const [nodeU, nodeV] = nodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
95
|
+
return `${nodeBySubstitutingX(nodeU.simplify(), nodeV.simplify().toTex())
|
|
96
|
+
.simplify()
|
|
97
|
+
.toTex()}`;
|
|
98
|
+
};
|
|
99
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
100
|
+
const nodeAns = parseAlgebraic(ans);
|
|
101
|
+
const nodeAnswer = parseAlgebraic(answer);
|
|
102
|
+
// return (
|
|
103
|
+
// substract(nodeAns.simplify(), nodeAnswer.simplify())
|
|
104
|
+
// .simplify()
|
|
105
|
+
// .evaluate() === 0
|
|
106
|
+
// );
|
|
107
|
+
// return (
|
|
108
|
+
// nodeAns.simplify().toMathString() === nodeAnswer.simplify().toMathString()
|
|
109
|
+
// );
|
|
110
|
+
//
|
|
111
|
+
// Une façon de savoir que expr1(x) et expr2(x) sont équivalentes:
|
|
112
|
+
// x|->expr1(expr2(x)) doit être la même fonction que x|->expr2(expr1(x))
|
|
113
|
+
const nodeAnsOfAnswer = nodeBySubstitutingX(nodeAns.simplify(), nodeAnswer.simplify().toTex()).simplify();
|
|
114
|
+
const nodeAnswerOfAns = nodeBySubstitutingX(nodeAnswer.simplify(), nodeAns.simplify().toTex()).simplify();
|
|
115
|
+
return [0, 1, 1000].every((x) => {
|
|
116
|
+
return (substract(nodeAnsOfAnswer.evaluate({ x }), nodeAnswerOfAns.evaluate({ x })).evaluate() === 0);
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
120
|
+
const { nodeIds } = identifiers;
|
|
121
|
+
const [nodeU, nodeV] = nodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
122
|
+
const propositions = [];
|
|
123
|
+
addValidProp(propositions, answer);
|
|
124
|
+
const wrongTexs = [
|
|
125
|
+
//mauvais ordre
|
|
126
|
+
`${nodeBySubstitutingX(nodeV, nodeU.toTex()).toTex({
|
|
127
|
+
forceParenthesis: true,
|
|
128
|
+
})}`,
|
|
129
|
+
`${nodeBySubstitutingX(nodeV, nodeU.toTex()).simplify().toTex()}`,
|
|
130
|
+
//multiplication
|
|
131
|
+
`${multiply(nodeU, nodeV).toTex({
|
|
132
|
+
forceParenthesis: true,
|
|
133
|
+
})}`,
|
|
134
|
+
//\\circ is 0
|
|
135
|
+
`${multiply(nodeU, multiply(0, nodeV)).toTex({
|
|
136
|
+
forceTimesSign: true,
|
|
137
|
+
forceParenthesis: true,
|
|
138
|
+
})}`,
|
|
139
|
+
//substitution littéraire
|
|
140
|
+
`${nodeU
|
|
141
|
+
.toTex({ forceParenthesis: true })
|
|
142
|
+
.replaceAll("x", `${nodeV.toTex()}`)}`,
|
|
143
|
+
`${nodeU
|
|
144
|
+
.toTex({ forceParenthesis: true })
|
|
145
|
+
.replaceAll("x", `${nodeV.toTex()}`)}`,
|
|
146
|
+
];
|
|
147
|
+
wrongTexs.forEach((wrongTex) => {
|
|
148
|
+
tryToAddWrongProp(propositions, wrongTex);
|
|
149
|
+
});
|
|
150
|
+
if (propositions.length < n) {
|
|
151
|
+
[
|
|
152
|
+
`${nodeBySubstitutingX(nodeU, nodeU.toTex()).toTex({
|
|
153
|
+
forceParenthesis: true,
|
|
154
|
+
})}`,
|
|
155
|
+
`${nodeBySubstitutingX(nodeU, nodeU.toTex()).simplify().toTex()}`,
|
|
156
|
+
`${nodeBySubstitutingX(nodeV, nodeV.toTex()).toTex({
|
|
157
|
+
forceParenthesis: true,
|
|
158
|
+
})}`,
|
|
159
|
+
`${nodeBySubstitutingX(nodeV, nodeV.toTex()).simplify().toTex()}`,
|
|
160
|
+
].forEach((wrongTex) => {
|
|
161
|
+
tryToAddWrongProp(propositions, wrongTex);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
return shuffleProps(propositions, n);
|
|
165
|
+
};
|
|
166
|
+
const getKeys = (identifiers) => {
|
|
167
|
+
const { nodeIds } = identifiers;
|
|
168
|
+
const nodes = nodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
169
|
+
const functionNamesDict = extractElementaryFunctionNamesDict(nodes);
|
|
170
|
+
return [
|
|
171
|
+
"x",
|
|
172
|
+
...Object.values(functionNamesDict).map((functionName) => {
|
|
173
|
+
return {
|
|
174
|
+
id: "custom",
|
|
175
|
+
label: functionName,
|
|
176
|
+
labelType: "tex",
|
|
177
|
+
mathfieldInstructions: {
|
|
178
|
+
method: "write",
|
|
179
|
+
content: functionName,
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}),
|
|
183
|
+
];
|
|
184
|
+
};
|
|
185
|
+
const getFunctionCompositionQuestion = (_) => {
|
|
186
|
+
function getRandomNode() {
|
|
187
|
+
return random([
|
|
188
|
+
...[
|
|
189
|
+
`x`,
|
|
190
|
+
realize({ a: "I" })(`x+a`),
|
|
191
|
+
realize({ a: "I" })(`ax`),
|
|
192
|
+
realize({ a: "I", b: "I" })(`ax+b`),
|
|
193
|
+
realize({ a: "I", b: "I" })(`(ax+b)^2`),
|
|
194
|
+
realize({ a: "RI", b: "RI" })(`(x+a)(x+b)`),
|
|
195
|
+
`\\sin(x)`,
|
|
196
|
+
realize({ a: "I" })(`\\sin(ax)`),
|
|
197
|
+
`\\cos(x)`,
|
|
198
|
+
realize({ a: "I" })(`\\sin(ax)`),
|
|
199
|
+
].map((tex) => parseAlgebraic(tex)),
|
|
200
|
+
//! TODO: simplify({maxSimplificationSteps: 100}) to allow using fracs
|
|
201
|
+
// frac(randomNodeWithType("I"), "x"),
|
|
202
|
+
// frac(1, "x"),
|
|
203
|
+
]);
|
|
204
|
+
}
|
|
205
|
+
const [nodeU, nodeV] = [0, 1].map(() => getRandomNode());
|
|
206
|
+
const identifiers = {
|
|
207
|
+
nodeIds: [nodeU, nodeV].map((node) => node.toIdentifiers()),
|
|
208
|
+
};
|
|
209
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
210
|
+
};
|
|
211
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
212
|
+
return {
|
|
213
|
+
answer: getAnswer(identifiers),
|
|
214
|
+
instruction: getInstruction(identifiers),
|
|
215
|
+
keys: getKeys(identifiers),
|
|
216
|
+
answerFormat: "tex",
|
|
217
|
+
identifiers,
|
|
218
|
+
hint: getHint(identifiers),
|
|
219
|
+
correction: getCorrection(identifiers),
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
export const functionComposition = {
|
|
223
|
+
id: "functionComposition",
|
|
224
|
+
label: "Déterminer l'expression d'une fonction composée",
|
|
225
|
+
isSingleStep: true,
|
|
226
|
+
generator: (nb, opts) => getDistinctQuestions(() => getFunctionCompositionQuestion(opts), nb),
|
|
227
|
+
qcmTimer: 60,
|
|
228
|
+
freeTimer: 60,
|
|
229
|
+
getPropositions,
|
|
230
|
+
isAnswerValid,
|
|
231
|
+
subject: "Mathématiques",
|
|
232
|
+
getInstruction,
|
|
233
|
+
getHint,
|
|
234
|
+
getCorrection,
|
|
235
|
+
getAnswer,
|
|
236
|
+
getQuestionFromIdentifiers,
|
|
237
|
+
hasHintAndCorrection: true,
|
|
238
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/composition/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./functionComposition.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"rootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA4GF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}
|
|
@@ -2,9 +2,11 @@ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../../exer
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
|
|
4
4
|
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
6
|
+
import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
|
|
7
|
+
import { discreteSetParser } from "../../../../../tree/parsers/discreteSetParser.js";
|
|
7
8
|
import { shuffle } from "../../../../../utils/alea/shuffle.js";
|
|
9
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
8
10
|
const getInstruction = (identifiers) => {
|
|
9
11
|
const { a, b, c } = identifiers;
|
|
10
12
|
const trinom = new Trinom(a, b, c);
|
|
@@ -49,20 +51,43 @@ const getPropositions = (n, { answer }) => {
|
|
|
49
51
|
return shuffle(propositions);
|
|
50
52
|
};
|
|
51
53
|
const isAnswerValid = (ans, { a, b, c }) => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
try {
|
|
55
|
+
const parsed = discreteSetParser(ans);
|
|
56
|
+
if (!parsed)
|
|
57
|
+
return false;
|
|
58
|
+
const trinom = new Trinom(a, b, c);
|
|
59
|
+
const roots = trinom.getRootsNode();
|
|
60
|
+
return isArrayOfNodesValid(parsed.elements, roots);
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
return handleVEAError(err);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
const isArrayOfNodesValid = (arrAns, arrAnswer) => {
|
|
67
|
+
//tried with toAllValidTexs() but there is always an unhandled case
|
|
68
|
+
function isNodesEqual(node1, node2) {
|
|
69
|
+
return [1, 1_000, 1_000_000].every((factor) => substract(multiply(factor, node1), multiply(factor, node2)).evaluate() === 0);
|
|
70
|
+
}
|
|
71
|
+
const dictAnswer = Object.fromEntries(arrAnswer.map((node, i) => [i, node]));
|
|
72
|
+
let isValid = true;
|
|
73
|
+
for (let i = 0; i < arrAns.length; i++) {
|
|
74
|
+
const nodeAns = arrAns[i];
|
|
75
|
+
let isFound = false;
|
|
76
|
+
const keys = Object.keys(dictAnswer);
|
|
77
|
+
for (let j = 0; j < keys.length; j++) {
|
|
78
|
+
const key = keys[j];
|
|
79
|
+
const answerNode = dictAnswer[key];
|
|
80
|
+
if (isNodesEqual(nodeAns, answerNode)) {
|
|
81
|
+
isFound = true;
|
|
82
|
+
delete dictAnswer[key]; //one-to-one correspondence
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
isValid = isValid && isFound;
|
|
87
|
+
if (!isValid)
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
return isValid;
|
|
66
91
|
};
|
|
67
92
|
export const rootsFromDevForm = {
|
|
68
93
|
id: "rootsFromDevForm",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"rootsReading.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoGF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAY9C,CAAC"}
|
|
@@ -80,8 +80,9 @@ const isAnswerValid = (ans, { a, b, c }) => {
|
|
|
80
80
|
return ans === "\\text{Aucun}";
|
|
81
81
|
}
|
|
82
82
|
const studentNumbers = ans
|
|
83
|
-
.replaceAll("\\text{
|
|
84
|
-
.
|
|
83
|
+
.replaceAll("\\text{", "")
|
|
84
|
+
.replaceAll("}", "") //as long as there's no \\frac{}{} involved, it's ok
|
|
85
|
+
.split("et")
|
|
85
86
|
.map((n) => Number(n.replace(",", ".")))
|
|
86
87
|
.filter((n) => !isNaN(n))
|
|
87
88
|
.sort((a, b) => a - b);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trinomSignFromFacto.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/sign/trinomSignFromFacto.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"trinomSignFromFacto.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/sign/trinomSignFromFacto.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAgJF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAqBrD,CAAC"}
|
|
@@ -8,11 +8,12 @@ import { UnionIntervalNode } from "../../../../../tree/nodes/sets/unionIntervalN
|
|
|
8
8
|
import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
|
|
9
9
|
import { unionIntervalParser } from "../../../../../tree/parsers/unionIntervalParser.js";
|
|
10
10
|
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
11
|
-
const getPropositions = (n, { answer, trinomCoeffs, isAskingPositive }) => {
|
|
11
|
+
const getPropositions = (n, { answer, trinomCoeffs, isAskingPositive, isStrict }) => {
|
|
12
12
|
const propositions = [];
|
|
13
13
|
addValidProp(propositions, answer);
|
|
14
14
|
const trinom = TrinomNodeConstructor.fromCoeffs(trinomCoeffs);
|
|
15
|
-
tryToAddWrongProp(propositions, getAnswer({ trinomCoeffs, isAskingPositive: !isAskingPositive }));
|
|
15
|
+
tryToAddWrongProp(propositions, getAnswer({ trinomCoeffs, isAskingPositive: !isAskingPositive, isStrict }));
|
|
16
|
+
tryToAddWrongProp(propositions, getAnswer({ trinomCoeffs, isAskingPositive, isStrict: !isStrict }));
|
|
16
17
|
tryToAddWrongProp(propositions, new IntervalNode(trinom.a, trinom.b, ClosureType.FF).toTex());
|
|
17
18
|
propWhile(propositions, n, () => {
|
|
18
19
|
const interval = IntervalNodeConstructor.random();
|
|
@@ -21,36 +22,41 @@ const getPropositions = (n, { answer, trinomCoeffs, isAskingPositive }) => {
|
|
|
21
22
|
return shuffleProps(propositions, n);
|
|
22
23
|
};
|
|
23
24
|
const getAnswerNode = (identifiers) => {
|
|
24
|
-
const
|
|
25
|
+
const { trinomCoeffs, isAskingPositive, isStrict } = identifiers;
|
|
26
|
+
const trinom = TrinomNodeConstructor.fromCoeffs(trinomCoeffs);
|
|
25
27
|
const roots = trinom.getRoots();
|
|
26
|
-
const a =
|
|
27
|
-
return a > 0 ===
|
|
28
|
+
const a = trinomCoeffs[2];
|
|
29
|
+
return a > 0 === isAskingPositive
|
|
28
30
|
? new UnionIntervalNode([
|
|
29
|
-
new IntervalNode(MinusInfinityNode, roots[0], ClosureType.OF),
|
|
30
|
-
new IntervalNode(roots[1], PlusInfinityNode, ClosureType.FO),
|
|
31
|
+
new IntervalNode(MinusInfinityNode, roots[0], isStrict ? ClosureType.OO : ClosureType.OF),
|
|
32
|
+
new IntervalNode(roots[1], PlusInfinityNode, isStrict ? ClosureType.OO : ClosureType.FO),
|
|
31
33
|
])
|
|
32
|
-
: new IntervalNode(roots[0], roots[1], ClosureType.FF);
|
|
34
|
+
: new IntervalNode(roots[0], roots[1], isStrict ? ClosureType.OO : ClosureType.FF);
|
|
33
35
|
};
|
|
34
36
|
const getAnswer = (identifiers) => {
|
|
35
37
|
return getAnswerNode(identifiers).toTex();
|
|
36
38
|
};
|
|
37
39
|
const getInstruction = (identifiers) => {
|
|
38
|
-
const
|
|
40
|
+
const { trinomCoeffs, isAskingPositive, isStrict } = identifiers;
|
|
41
|
+
const trinom = TrinomNodeConstructor.fromCoeffs(trinomCoeffs);
|
|
39
42
|
return `Soit $f$ une fonction polynôme de degré $2$ définie sur $\\mathbb{R}$ par :
|
|
40
43
|
|
|
41
44
|
$$
|
|
42
45
|
f(x) = ${trinom.toFactorized().toTex()}
|
|
43
46
|
$$
|
|
44
47
|
|
|
45
|
-
Sur quel(s) intervalle(s) les valeurs de la fonction $f$ sont-elles
|
|
48
|
+
Sur quel(s) intervalle(s) les valeurs de la fonction $f$ sont-elles
|
|
49
|
+
${isStrict ? "strictement" : ""} ${isAskingPositive ? "positives" : "négatives"}
|
|
50
|
+
?`;
|
|
46
51
|
};
|
|
47
52
|
const getHint = () => {
|
|
48
53
|
return `Une fonction polynôme de degré $2$ est du signe de son coefficient $a$, sauf entre ses racines.`;
|
|
49
54
|
};
|
|
50
55
|
const getCorrection = (identifiers) => {
|
|
51
|
-
const
|
|
56
|
+
const { trinomCoeffs, isAskingPositive, isStrict } = identifiers;
|
|
57
|
+
const trinom = TrinomNodeConstructor.fromCoeffs(trinomCoeffs);
|
|
52
58
|
const roots = trinom.getRoots();
|
|
53
|
-
const a =
|
|
59
|
+
const a = trinomCoeffs[2];
|
|
54
60
|
const answer = getAnswer(identifiers);
|
|
55
61
|
const ineqSign = a > 0 ? ">" : "<";
|
|
56
62
|
const sign = a > 0 ? "positive" : "négative";
|
|
@@ -60,7 +66,7 @@ Ici, $a = ${a}${ineqSign}0$, et les racines de $f$ sont $${roots[0].toTex()}$ et
|
|
|
60
66
|
|
|
61
67
|
$f$ est donc ${sign} sauf sur l'intervalle $${new IntervalNode(roots[0], roots[1], ClosureType.FF).toTex()}$.
|
|
62
68
|
|
|
63
|
-
On en déduit que $f$ est ${
|
|
69
|
+
On en déduit que $f$ est ${isStrict ? "strictement" : ""} ${isAskingPositive ? "positive" : "négative"} sur :
|
|
64
70
|
|
|
65
71
|
$$
|
|
66
72
|
${answer}
|
|
@@ -83,8 +89,10 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
83
89
|
const getTrinomSignFromFactoQuestion = () => {
|
|
84
90
|
const trinom = TrinomNodeConstructor.randomNiceRoots(2);
|
|
85
91
|
const isAskingPositive = coinFlip();
|
|
92
|
+
const isStrict = coinFlip();
|
|
86
93
|
const identifiers = {
|
|
87
94
|
isAskingPositive,
|
|
95
|
+
isStrict,
|
|
88
96
|
trinomCoeffs: trinom.getCoeffs(),
|
|
89
97
|
};
|
|
90
98
|
return getQuestionFromIdentifiers(identifiers);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { LineIdentifiers } from "../../../../math/geometry/line.js";
|
|
3
|
+
import { PointIdentifiers } from "../../../../math/geometry/point.js";
|
|
4
|
+
type IntersectionIds = {
|
|
5
|
+
center: PointIdentifiers;
|
|
6
|
+
lineH: LineIdentifiers;
|
|
7
|
+
lineV: LineIdentifiers;
|
|
8
|
+
};
|
|
9
|
+
type Identifiers = {
|
|
10
|
+
isParallel: boolean;
|
|
11
|
+
angleType: "alternes-internes" | "correspondants" | "alternes-externes" | "autres";
|
|
12
|
+
arrIntersectionIds: IntersectionIds[];
|
|
13
|
+
arrAngleIndex: number[];
|
|
14
|
+
arrAngleForLabel: number[] | undefined;
|
|
15
|
+
};
|
|
16
|
+
type Options = {
|
|
17
|
+
angleTypes: ("alternes-internes" | "correspondants" | "alternes-externes" | "autres")[];
|
|
18
|
+
isFakeDisplay: boolean;
|
|
19
|
+
nbDigits: 0 | 1 | 2;
|
|
20
|
+
};
|
|
21
|
+
export declare const anglesUsingIsParallel: Exercise<Identifiers, Options>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=anglesUsingIsParallel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anglesUsingIsParallel.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/angles/anglesUsingIsParallel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAuItC,KAAK,eAAe,GAAG;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AA6HF,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EACL,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CAAC;IAGb,kBAAkB,EAAE,eAAe,EAAE,CAAC;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IAGxB,gBAAgB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACxC,CAAC;AAwMF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,CACR,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,QAAQ,CACX,EAAE,CAAC;IACJ,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACrB,CAAC;AA2NF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBhE,CAAC"}
|