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,73 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
4
|
+
import { round } from "../../../math/utils/round.js";
|
|
5
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
6
|
+
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
7
|
+
const getInstruction = (identifiers) => {
|
|
8
|
+
const { I } = identifiers;
|
|
9
|
+
const texImA = (I * 1000).frenchify();
|
|
10
|
+
return `Dans un circuit électrique, on a $U=RI$.
|
|
11
|
+
|
|
12
|
+
Calculer $U$ (en Volts) sachant que $R = 10\\Omega$ et $I = ${texImA}mA$.`;
|
|
13
|
+
};
|
|
14
|
+
const getHint = () => {
|
|
15
|
+
return `Attention aux unités !`;
|
|
16
|
+
};
|
|
17
|
+
const getCorrection = (identifiers) => {
|
|
18
|
+
const { I } = identifiers;
|
|
19
|
+
const texImA = (I * 1000).frenchify();
|
|
20
|
+
return `Comme $I=${texImA} mA$ alors
|
|
21
|
+
|
|
22
|
+
$$
|
|
23
|
+
I = ${texImA} \\times 10^{-3} A
|
|
24
|
+
$$
|
|
25
|
+
|
|
26
|
+
ainsi
|
|
27
|
+
|
|
28
|
+
${alignTex([
|
|
29
|
+
["U", "=", "RI"],
|
|
30
|
+
["", "=", `(10) \\times (${texImA} \\times 10^{-3}) V`],
|
|
31
|
+
["", "=", `${texImA} \\times 10^{-2} V`],
|
|
32
|
+
["", "=", `${(10 * I).frenchify()} V`],
|
|
33
|
+
])}`;
|
|
34
|
+
};
|
|
35
|
+
const getPropositions = (n, { I }) => {
|
|
36
|
+
const propositions = [];
|
|
37
|
+
addValidProp(propositions, `${round(10 * I, 2).frenchify()}V`);
|
|
38
|
+
tryToAddWrongProp(propositions, `${round(I * 1000, 2).frenchify()}V`);
|
|
39
|
+
tryToAddWrongProp(propositions, `${round(I * 100, 2).frenchify()}V`);
|
|
40
|
+
tryToAddWrongProp(propositions, `${frac(10, round(I * 100, 2)).toTex()}V`);
|
|
41
|
+
return shuffleProps(propositions, n);
|
|
42
|
+
};
|
|
43
|
+
const getCalculateUEqualsRIQuestion = () => {
|
|
44
|
+
const I = (randint(101, 998) * 1.0) / 1000;
|
|
45
|
+
const identifiers = {
|
|
46
|
+
I,
|
|
47
|
+
};
|
|
48
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
49
|
+
};
|
|
50
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
51
|
+
const question = {
|
|
52
|
+
instruction: getInstruction(identifiers),
|
|
53
|
+
keys: [],
|
|
54
|
+
correction: getCorrection(identifiers),
|
|
55
|
+
hint: getHint(identifiers),
|
|
56
|
+
answerFormat: "tex",
|
|
57
|
+
identifiers,
|
|
58
|
+
};
|
|
59
|
+
return question;
|
|
60
|
+
};
|
|
61
|
+
export const calculateUEqualsRI = {
|
|
62
|
+
id: "calculateUEqualsRI",
|
|
63
|
+
label: "Calculer $U$ (en $V$) sachant que $U=RI$ avec $I$ en mA et $R$ en ohms",
|
|
64
|
+
isSingleStep: true,
|
|
65
|
+
generator: (nb) => getDistinctQuestions(getCalculateUEqualsRIQuestion, nb),
|
|
66
|
+
qcmTimer: 60,
|
|
67
|
+
freeTimer: 60,
|
|
68
|
+
getPropositions,
|
|
69
|
+
subject: "Physique",
|
|
70
|
+
hasHintAndCorrection: true,
|
|
71
|
+
getQuestionFromIdentifiers,
|
|
72
|
+
answerType: "QCU",
|
|
73
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/electricity/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0CAA0C,CAAC;AACzD,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/electricity/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0CAA0C,CAAC;AACzD,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,uCAAuC,CAAC;AACtD,cAAc,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uBAAuB,CAAC;AAEtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uBAAuB,CAAC;AAEtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"molarMass.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/mole/molarMass.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"molarMass.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/mole/molarMass.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAgEF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAY3C,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuesti
|
|
|
3
3
|
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
4
4
|
import { round, roundSignificant } from "../../../math/utils/round.js";
|
|
5
5
|
import { molecules } from "../../../pc/constants/molecularChemistry/molecule.js";
|
|
6
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
7
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
6
8
|
import { random } from "../../../utils/alea/random.js";
|
|
7
9
|
import { requiresApostropheBefore } from "../../../utils/strings/requiresApostropheBefore.js";
|
|
8
10
|
const getInstruction = (identifiers) => {
|
|
@@ -41,7 +43,11 @@ const getPropositions = (n, { answer }) => {
|
|
|
41
43
|
return shuffleProps(propositions, n);
|
|
42
44
|
};
|
|
43
45
|
const isAnswerValid = (ans, { answer }) => {
|
|
44
|
-
return ans === answer
|
|
46
|
+
return (ans === answer ||
|
|
47
|
+
(() => {
|
|
48
|
+
const [nodeAns, nodeAnswer] = [ans, answer].map((tex) => parseAlgebraic(tex));
|
|
49
|
+
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
50
|
+
})());
|
|
45
51
|
};
|
|
46
52
|
export const molarMass = {
|
|
47
53
|
id: "molarMass",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moleculeFormula.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/moleculeFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,QAAQ,EAMT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;
|
|
1
|
+
{"version":3,"file":"moleculeFormula.d.ts","sourceRoot":"","sources":["../../../src/exercises/pc/moleculeFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,QAAQ,EAMT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAmFF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
|
|
@@ -15,7 +15,7 @@ const getAnswer = (identifiers) => {
|
|
|
15
15
|
const { randomMoleculeIndex } = identifiers;
|
|
16
16
|
const organicMolecule = molecules.filter((molecule) => molecule.isOrganic && molecule.iupact);
|
|
17
17
|
const myRandomMolecule = organicMolecule[randomMoleculeIndex];
|
|
18
|
-
const answer = myRandomMolecule.
|
|
18
|
+
const answer = myRandomMolecule.getRawFormula();
|
|
19
19
|
return answer;
|
|
20
20
|
};
|
|
21
21
|
const getKeys = (identifiers) => {
|
|
@@ -47,12 +47,13 @@ const getPropositions = (n, { answer }) => {
|
|
|
47
47
|
propWhile(propositions, n, () => {
|
|
48
48
|
const randomMoleculeIndex = Math.floor(Math.random() * organicMolecule.length);
|
|
49
49
|
const myRandomMolecule = organicMolecule[randomMoleculeIndex];
|
|
50
|
-
tryToAddWrongProp(propositions, myRandomMolecule.
|
|
50
|
+
tryToAddWrongProp(propositions, myRandomMolecule.getRawFormula());
|
|
51
51
|
});
|
|
52
52
|
return shuffle(propositions);
|
|
53
53
|
};
|
|
54
54
|
const isAnswerValid = (ans, { answer }) => {
|
|
55
|
-
|
|
55
|
+
const [refinedAns, refinedAnswer] = [ans, answer].map((str) => str.replaceAll("\\text", "").replaceAll("{", "").replaceAll("}", ""));
|
|
56
|
+
return refinedAns === refinedAnswer;
|
|
56
57
|
};
|
|
57
58
|
export const moleculeFormula = {
|
|
58
59
|
id: "moleculeFormula",
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
type Msr = {
|
|
3
|
+
value: number;
|
|
4
|
+
unitIndex: number;
|
|
5
|
+
};
|
|
2
6
|
type Identifiers = {
|
|
3
7
|
distance: Msr;
|
|
4
8
|
time: Msr;
|
|
9
|
+
opts: Options;
|
|
5
10
|
};
|
|
6
|
-
type
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
type Options = {
|
|
12
|
+
acceptedInputType: string;
|
|
13
|
+
unitTex: string;
|
|
9
14
|
};
|
|
10
|
-
export declare const averageSpeed: Exercise<Identifiers>;
|
|
15
|
+
export declare const averageSpeed: Exercise<Identifiers, Options>;
|
|
11
16
|
export {};
|
|
12
17
|
//# sourceMappingURL=averageSpeed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"averageSpeed.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/motion/averageSpeed.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"averageSpeed.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/motion/averageSpeed.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAerC,KAAK,GAAG,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AA0NF,KAAK,OAAO,GAAG;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsBF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAcvD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
4
4
|
import { randint } from "../../../math/utils/random/randint.js";
|
|
@@ -6,9 +6,25 @@ import { Measure } from "../../../pc/measure/measure.js";
|
|
|
6
6
|
import { DistanceUnit } from "../../../pc/units/distanceUnits.js";
|
|
7
7
|
import { TimeUnit } from "../../../pc/units/timeUnits.js";
|
|
8
8
|
import { FractionNode } from "../../../tree/nodes/operators/fractionNode.js";
|
|
9
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
9
10
|
import { VariableNode } from "../../../tree/nodes/variables/variableNode.js";
|
|
11
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
12
|
+
const timeUnits = [TimeUnit.h, TimeUnit.min];
|
|
13
|
+
const distanceUnitValues = [DistanceUnit.km, DistanceUnit.m];
|
|
14
|
+
const getAcceptedInputTypesSentence = (identifiers) => {
|
|
15
|
+
const { opts } = identifiers;
|
|
16
|
+
return `Donner le résultat
|
|
17
|
+
${(() => {
|
|
18
|
+
switch (opts.acceptedInputType) {
|
|
19
|
+
case "exact":
|
|
20
|
+
return "sous forme exacte";
|
|
21
|
+
case "significant(3)":
|
|
22
|
+
return "approché avec $3$ chiffres significatifs";
|
|
23
|
+
}
|
|
24
|
+
})()}.`;
|
|
25
|
+
};
|
|
10
26
|
const getInstruction = (identifiers) => {
|
|
11
|
-
const { distance, time } = identifiers;
|
|
27
|
+
const { distance, time, opts } = identifiers;
|
|
12
28
|
const distanceMeasure = new Measure(distance.value, 0, distanceUnitValues[distance.unitIndex]);
|
|
13
29
|
const timeMeasure = new Measure(time.value, 0, timeUnits[time.unitIndex]);
|
|
14
30
|
const instruction = `Soit un objet parcourant $${distanceMeasure.toTex({
|
|
@@ -16,111 +32,166 @@ const getInstruction = (identifiers) => {
|
|
|
16
32
|
})}$ en $${timeMeasure.toTex({ notScientific: true })}$.
|
|
17
33
|
|
|
18
34
|
|
|
19
|
-
|
|
35
|
+
Calculer la vitesse moyenne de cet objet en $${opts.unitTex}$.
|
|
36
|
+
|
|
37
|
+
${getAcceptedInputTypesSentence(identifiers)}
|
|
20
38
|
`;
|
|
21
39
|
return instruction;
|
|
22
40
|
};
|
|
23
|
-
const
|
|
24
|
-
const { distance, time } = identifiers;
|
|
25
|
-
const distanceMeasure = new Measure(distance.value, 0, distanceUnitValues[distance.unitIndex]);
|
|
26
|
-
const timeMeasure = new Measure(time.value, 0, timeUnits[time.unitIndex]);
|
|
27
|
-
const answer = distanceMeasure
|
|
28
|
-
.convert("m")
|
|
29
|
-
.divide(timeMeasure.convert("s"))
|
|
30
|
-
.toSignificant(2);
|
|
31
|
-
return answer.toTex();
|
|
32
|
-
};
|
|
33
|
-
const getHint = () => {
|
|
41
|
+
const getHint = ({ opts }) => {
|
|
34
42
|
return `La vitesse moyenne est donnée par :
|
|
35
43
|
|
|
36
44
|
$$
|
|
37
|
-
\\frac{\\text{distance}}{\\text{temps}} \\
|
|
45
|
+
\\frac{\\text{distance}}{\\text{temps}} \\ ${opts.unitTex}
|
|
38
46
|
$$`;
|
|
39
47
|
};
|
|
40
48
|
const getCorrection = (identifiers) => {
|
|
41
|
-
const { distance, time } = identifiers;
|
|
49
|
+
const { distance, time, opts } = identifiers;
|
|
42
50
|
let correction = ``;
|
|
43
51
|
const distanceMeasure = new Measure(distance.value, 0, distanceUnitValues[distance.unitIndex]).convert("m");
|
|
44
52
|
const timeMeasure = new Measure(time.value, 0, timeUnits[time.unitIndex]).convert("s");
|
|
45
|
-
const calcul = new FractionNode(new VariableNode(distanceMeasure.
|
|
46
|
-
const answer =
|
|
53
|
+
const calcul = new FractionNode(new VariableNode(distanceMeasure.toTex()), new VariableNode(timeMeasure.toTex()));
|
|
54
|
+
const answer = getAnswer(identifiers);
|
|
47
55
|
if (distance.unitIndex === 0)
|
|
48
|
-
correction = `- On convertit les $\\textrm{km}$ en $\\textrm{m}$ : $1\\ \\textrm{km}=1000\\ \\textrm{m}
|
|
56
|
+
correction = `- On convertit les $\\textrm{km}$ en $\\textrm{m}$ : $1\\ \\textrm{km}=1000\\ \\textrm{m}$.
|
|
57
|
+
|
|
58
|
+
$$
|
|
59
|
+
${distance.value.frenchify()} \\textrm{km} = ${distance.value.frenchify()} \\times 1000 = ${distanceMeasure.toTex()}
|
|
60
|
+
$$
|
|
61
|
+
|
|
62
|
+
`;
|
|
49
63
|
switch (time.unitIndex) {
|
|
50
64
|
case 0:
|
|
51
65
|
correction = `${correction}
|
|
52
|
-
- On convertit les heures en secondes : $1\\ \\textrm{h} = 3600\\ \\textrm{s}
|
|
66
|
+
- On convertit les heures en secondes : $1\\ \\textrm{h} = 3600\\ \\textrm{s}$.
|
|
67
|
+
|
|
68
|
+
$$
|
|
69
|
+
${time.value.frenchify()} \\textrm{h} = ${time.value.frenchify()} \\times 3600 = ${timeMeasure.toTex()}
|
|
70
|
+
$$
|
|
71
|
+
|
|
72
|
+
`;
|
|
53
73
|
break;
|
|
54
74
|
case 1:
|
|
55
75
|
default:
|
|
56
76
|
correction = `${correction}
|
|
57
|
-
- On convertit les minutes en secondes : $1\\ \\textrm{
|
|
77
|
+
- On convertit les minutes en secondes : $1\\ \\textrm{min} = 60\\ \\textrm{s}$.
|
|
78
|
+
|
|
79
|
+
$$
|
|
80
|
+
${time.value.frenchify()} \\textrm{min} = ${time.value.frenchify()} \\times 60 = ${timeMeasure.toTex()}
|
|
81
|
+
$$
|
|
82
|
+
|
|
83
|
+
`;
|
|
58
84
|
}
|
|
59
85
|
return `${correction}
|
|
60
|
-
- On applique la règle de calcul pour la vitesse moyenne : $${calcul.toTex()}
|
|
86
|
+
- On applique la règle de calcul pour la vitesse moyenne : $${calcul.toTex()}$
|
|
87
|
+
- On arrondit à la toute fin : $${calcul.toTex()} \\approx ${answer} \\ ${opts.unitTex}$`;
|
|
61
88
|
};
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
answer: getAnswer(identifiers),
|
|
65
|
-
instruction: getInstruction(identifiers),
|
|
66
|
-
keys: [],
|
|
67
|
-
hint: getHint(identifiers),
|
|
68
|
-
correction: getCorrection(identifiers),
|
|
69
|
-
answerFormat: "tex",
|
|
70
|
-
identifiers,
|
|
71
|
-
};
|
|
72
|
-
return question;
|
|
89
|
+
const getAnswer = (identifiers) => {
|
|
90
|
+
return getAnswerMeasure(identifiers).toTex({ hideUnit: true });
|
|
73
91
|
};
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
92
|
+
const getAnswerMeasure = (identifiers) => {
|
|
93
|
+
const { distance, time } = identifiers;
|
|
94
|
+
const distanceMeasure = new Measure(distance.value, 0, distanceUnitValues[distance.unitIndex]);
|
|
95
|
+
const timeMeasure = new Measure(time.value, 0, timeUnits[time.unitIndex]);
|
|
96
|
+
return distanceMeasure
|
|
97
|
+
.convert("m")
|
|
98
|
+
.divide(timeMeasure.convert("s"))
|
|
99
|
+
.toSignificant(2);
|
|
100
|
+
};
|
|
101
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
102
|
+
const ansNode = parseAlgebraic(ans);
|
|
103
|
+
const answerNode = parseAlgebraic(getAnswerMeasure(identifiers).toTex({ hideUnit: true }));
|
|
104
|
+
return substract(ansNode, answerNode).simplify().evaluate() === 0;
|
|
81
105
|
};
|
|
82
|
-
const getPropositions = (n, { answer, distance, time }) => {
|
|
106
|
+
const getPropositions = (n, { answer, distance, time, opts }) => {
|
|
83
107
|
const propositions = [];
|
|
84
|
-
addValidProp(propositions, answer);
|
|
108
|
+
addValidProp(propositions, `${answer} \\ ${opts.unitTex}`);
|
|
85
109
|
const distanceMeasure = new Measure(distance.value, 0, distanceUnitValues[distance.unitIndex]);
|
|
86
110
|
const timeMeasure = new Measure(time.value, 0, timeUnits[time.unitIndex]);
|
|
87
|
-
|
|
111
|
+
generatePropositions(distanceMeasure, timeMeasure).forEach((value) => tryToAddWrongProp(propositions, `${value} \\ ${opts.unitTex}`));
|
|
88
112
|
const division = distanceMeasure
|
|
89
113
|
.convert("m")
|
|
90
114
|
.divide(timeMeasure.convert("s"));
|
|
91
115
|
const divisionValue = division.significantPart * division.exponent;
|
|
92
116
|
propWhile(propositions, n, () => {
|
|
93
117
|
const random = randfloat(divisionValue - 10, divisionValue + 11);
|
|
94
|
-
|
|
118
|
+
const valueTex = new Measure(random, 0, division.getUnit())
|
|
119
|
+
.toSignificant(2)
|
|
120
|
+
.toTex({ hideUnit: true });
|
|
121
|
+
tryToAddWrongProp(propositions, `${valueTex} \\ ${opts.unitTex}`);
|
|
95
122
|
});
|
|
96
123
|
return shuffleProps(propositions, n);
|
|
97
124
|
};
|
|
98
|
-
const
|
|
125
|
+
const generatePropositions = (distance, time) => {
|
|
99
126
|
const distanceInMeter = distance.convert("m");
|
|
100
127
|
const timeInSeconds = time.convert("s");
|
|
101
128
|
return [
|
|
102
|
-
distanceInMeter
|
|
103
|
-
|
|
104
|
-
distance.divide(timeInSeconds).toSignificant(2).toTex(),
|
|
105
|
-
distance.divide(time).toSignificant(2).toTex(),
|
|
106
|
-
];
|
|
107
|
-
};
|
|
108
|
-
const isAnswerValid = (ans, { answer, distance, time }) => {
|
|
109
|
-
const distanceMeasure = new Measure(distance.value, 0, distanceUnitValues[distance.unitIndex]).convert("m");
|
|
110
|
-
const timeMeasure = new Measure(time.value, 0, timeUnits[time.unitIndex]).convert("s");
|
|
111
|
-
return [
|
|
112
|
-
answer,
|
|
113
|
-
distanceMeasure
|
|
114
|
-
.divide(timeMeasure)
|
|
129
|
+
distanceInMeter
|
|
130
|
+
.times(timeInSeconds)
|
|
115
131
|
.toSignificant(2)
|
|
116
132
|
.toTex({ hideUnit: true }),
|
|
117
|
-
|
|
133
|
+
distanceInMeter.divide(time).toSignificant(2).toTex({ hideUnit: true }),
|
|
134
|
+
distance.divide(timeInSeconds).toSignificant(2).toTex({ hideUnit: true }),
|
|
135
|
+
distance.divide(time).toSignificant(2).toTex({ hideUnit: true }),
|
|
136
|
+
];
|
|
137
|
+
};
|
|
138
|
+
const getKeys = () => {
|
|
139
|
+
return [];
|
|
140
|
+
// return [`\\text{m} \\cdot \\text{s}^{-1}`].map((tex) => {
|
|
141
|
+
// return {
|
|
142
|
+
// id: "custom",
|
|
143
|
+
// label: tex,
|
|
144
|
+
// labelType: "raw",
|
|
145
|
+
// mathfieldInstructions: {
|
|
146
|
+
// method: "write",
|
|
147
|
+
// content: tex,
|
|
148
|
+
// },
|
|
149
|
+
// } as KeyProps;
|
|
150
|
+
// });
|
|
151
|
+
};
|
|
152
|
+
const getAverageSpeedQuestion = (optsIn) => {
|
|
153
|
+
const opts = Object.assign(optsDefault, optsIn) ?? optsDefault;
|
|
154
|
+
const distance = { value: randint(70, 151), unitIndex: randint(0, 2) };
|
|
155
|
+
const time = { value: randint(10, 61), unitIndex: randint(0, 2) };
|
|
156
|
+
const identifiers = { distance, time, opts };
|
|
157
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
158
|
+
};
|
|
159
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
160
|
+
const question = {
|
|
161
|
+
answer: getAnswer(identifiers),
|
|
162
|
+
instruction: getInstruction(identifiers),
|
|
163
|
+
keys: getKeys(identifiers),
|
|
164
|
+
hint: getHint(identifiers),
|
|
165
|
+
correction: getCorrection(identifiers),
|
|
166
|
+
answerFormat: "tex",
|
|
167
|
+
identifiers,
|
|
168
|
+
};
|
|
169
|
+
return question;
|
|
170
|
+
};
|
|
171
|
+
const optsDefault = {
|
|
172
|
+
acceptedInputType: "significant(3)",
|
|
173
|
+
unitTex: "\\text{m} \\cdot \\text{s}^{-1}",
|
|
118
174
|
};
|
|
175
|
+
const options = [
|
|
176
|
+
{
|
|
177
|
+
id: "unitTex",
|
|
178
|
+
label: "Unité utilisée",
|
|
179
|
+
target: GeneratorOptionTarget.generation,
|
|
180
|
+
type: GeneratorOptionType.select,
|
|
181
|
+
values: [
|
|
182
|
+
"\\text{m} \\cdot \\text{s}^{-1}",
|
|
183
|
+
"\\text{m/s}",
|
|
184
|
+
"\\text{s} \\cdot \\text{m}^{-1}",
|
|
185
|
+
],
|
|
186
|
+
defaultValue: optsDefault.unitTex,
|
|
187
|
+
},
|
|
188
|
+
];
|
|
119
189
|
export const averageSpeed = {
|
|
120
190
|
id: "averageSpeed",
|
|
121
|
-
label: "
|
|
191
|
+
label: "Calcul de vitesse moyenne",
|
|
122
192
|
isSingleStep: true,
|
|
123
|
-
generator: (nb) => getDistinctQuestions(getAverageSpeedQuestion, nb),
|
|
193
|
+
generator: (nb, opts) => getDistinctQuestions(() => getAverageSpeedQuestion(opts), nb),
|
|
194
|
+
options,
|
|
124
195
|
qcmTimer: 60,
|
|
125
196
|
freeTimer: 60,
|
|
126
197
|
getPropositions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"averageSpeedCalculation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/motion/averageSpeedCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,iBAAiB,GAAG,UAAU,GAAG,OAAO,CAAC;CAClD,CAAC;
|
|
1
|
+
{"version":3,"file":"averageSpeedCalculation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/motion/averageSpeedCalculation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,iBAAiB,GAAG,UAAU,GAAG,OAAO,CAAC;CAClD,CAAC;AAmQF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAajE,CAAC"}
|
|
@@ -42,7 +42,9 @@ const getInstruction = (identifiers) => {
|
|
|
42
42
|
Utiliser ces informations pour calculer ${targetVariable.name === "distance" ||
|
|
43
43
|
targetVariable.name === "vitesse moyenne"
|
|
44
44
|
? "la"
|
|
45
|
-
: "le"} ${targetVariable.name} en $${targetVariable.value.getUnit().toTex()}
|
|
45
|
+
: "le"} ${targetVariable.name} en $${targetVariable.value.getUnit().toTex()}$.
|
|
46
|
+
|
|
47
|
+
Donner la réponse sous forme arrondie à $2$ décimales.`;
|
|
46
48
|
return instruction;
|
|
47
49
|
};
|
|
48
50
|
const getAnswer = (identifiers) => {
|
|
@@ -83,16 +85,20 @@ const getCorrection = (identifiers) => {
|
|
|
83
85
|
const correction = targetVariable.name === "vitesse moyenne"
|
|
84
86
|
? `La vitesse moyenne est calculée en utilisant la formule $v = \\frac{d}{\\Delta t}$. Donc, $v = \\frac{${round(distance, 2)
|
|
85
87
|
.toTree()
|
|
86
|
-
.toTex()}}{${round(deltaTime, 2)
|
|
88
|
+
.toTex()}}{${round(deltaTime, 2)
|
|
89
|
+
.toTree()
|
|
90
|
+
.toTex()}} \\approx ${new Measure(round(distance / deltaTime, 2), 0, targetVariable.value.getUnit()).toTex({ notScientific: true })}$.`
|
|
87
91
|
: targetVariable.name === "distance"
|
|
88
92
|
? `La distance est calculée en utilisant la formule $d = v \\times \\Delta t$. Donc, $d = ${round(speed, 2)
|
|
89
93
|
.toTree()
|
|
90
94
|
.toTex()} \\times ${round(deltaTime, 2)
|
|
91
95
|
.toTree()
|
|
92
|
-
.toTex()}
|
|
96
|
+
.toTex()} \\approx ${new Measure(round(speed * deltaTime, 2), 0, DistanceUnit.km).toTex({ notScientific: true })}$.`
|
|
93
97
|
: `Le temps est calculé en utilisant la formule $\\Delta t = \\frac{d}{v}$. Donc, $t = \\frac{${round(distance, 2)
|
|
94
98
|
.toTree()
|
|
95
|
-
.toTex()}}{${round(speed, 2)
|
|
99
|
+
.toTex()}}{${round(speed, 2)
|
|
100
|
+
.toTree()
|
|
101
|
+
.toTex()}} \\approx ${new Measure(round(distance / speed, 2), 0, TimeUnit.h).toTex({ notScientific: true })}$.`;
|
|
96
102
|
return correction;
|
|
97
103
|
};
|
|
98
104
|
const getAnswerNode = (identifiers) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/optics/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./lensFormula.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
OFPrime: NodeIdentifiers;
|
|
5
|
+
OA: NodeIdentifiers;
|
|
6
|
+
OAPrime: NodeIdentifiers;
|
|
7
|
+
opts: Options;
|
|
8
|
+
};
|
|
9
|
+
type DistanceType = "distance focale" | "distance image" | "distance objet";
|
|
10
|
+
type ImageType = "réelle finie" | "réelle infinie" | "imaginaire finie" | "imaginaire infinie";
|
|
11
|
+
type UnitType = "cm" | "m";
|
|
12
|
+
type RoundToType = 0 | 1 | 2;
|
|
13
|
+
type Options = {
|
|
14
|
+
typeDistance: DistanceType;
|
|
15
|
+
typeImage: ImageType;
|
|
16
|
+
unit: UnitType;
|
|
17
|
+
roundTo: RoundToType;
|
|
18
|
+
};
|
|
19
|
+
export declare const lensFormula: Exercise<Identifiers, Options>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=lensFormula.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lensFormula.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/optics/lensFormula.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAY7C,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,eAAe,CAAC;IACzB,EAAE,EAAE,eAAe,CAAC;IACpB,OAAO,EAAE,eAAe,CAAC;IACzB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,KAAK,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAC5E,KAAK,SAAS,GACV,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,oBAAoB,CAAC;AACzB,KAAK,QAAQ,GAAG,IAAI,GAAG,GAAG,CAAC;AAC3B,KAAK,WAAW,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7B,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,WAAW,CAAC;CACtB,CAAC;AAwiBF,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqBtD,CAAC"}
|