math-exercises 3.0.125 → 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/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/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 +5 -6
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts +8 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +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/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/index.d.ts +1 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -0
- package/lib/exercises/math/functions/composition/functionComposition.d.ts +8 -0
- package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -0
- package/lib/exercises/math/functions/composition/functionComposition.js +238 -0
- package/lib/exercises/math/functions/composition/index.d.ts +2 -0
- package/lib/exercises/math/functions/composition/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/composition/index.js +1 -0
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts +23 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +448 -0
- package/lib/exercises/math/geometry/angles/index.js +2 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts +23 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.js +402 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +9 -6
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +140 -60
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +121 -104
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +3 -2
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.js +1 -0
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts +0 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +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/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/pc/electricity/calculateUEqualsRI.d.ts +7 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts.map +1 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.js +73 -0
- package/lib/exercises/pc/electricity/index.d.ts +1 -0
- package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/index.js +1 -0
- package/lib/exercises/pc/index.d.ts +1 -0
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +1 -0
- package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
- package/lib/exercises/pc/moleculeFormula.js +4 -3
- package/lib/exercises/pc/optics/index.d.ts +2 -0
- package/lib/exercises/pc/optics/index.d.ts.map +1 -0
- package/lib/exercises/pc/optics/index.js +1 -0
- package/lib/exercises/pc/optics/lensFormula.d.ts +21 -0
- package/lib/exercises/pc/optics/lensFormula.d.ts.map +1 -0
- package/lib/exercises/pc/optics/lensFormula.js +415 -0
- package/lib/exercises/pc/weight/calculateWeight.d.ts +8 -1
- package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
- package/lib/exercises/pc/weight/calculateWeight.js +113 -38
- package/lib/geogebra/parsers/geogebraParser.d.ts +4 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
- package/lib/geogebra/parsers/geogebraParser.js +17 -0
- package/lib/index.d.ts +346 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +1 -0
- package/lib/math/geometry/CloudPoints.d.ts +10 -0
- package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
- package/lib/math/geometry/CloudPoints.js +119 -0
- package/lib/math/geometry/line.d.ts +1 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +10 -2
- package/lib/math/geometry/vector.d.ts +1 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +12 -0
- package/lib/math/progCalc/progCalc.d.ts +46 -0
- package/lib/math/progCalc/progCalc.d.ts.map +1 -0
- package/lib/math/progCalc/progCalc.js +239 -0
- package/lib/math/utils/latex/realize.d.ts +12 -0
- package/lib/math/utils/latex/realize.d.ts.map +1 -0
- package/lib/math/utils/latex/realize.js +43 -0
- package/lib/pc/constants/molecularChemistry/molecule.d.ts +2 -0
- package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -1
- package/lib/pc/constants/molecularChemistry/molecule.js +52 -0
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +1 -1
- package/lib/tests/singleExo.test.js +3 -3
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts +4 -2
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +8 -17
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +5 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts +4 -2
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +8 -17
- package/lib/tree/nodes/operators/operatorNode.d.ts +3 -3
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/utilities/nodeShuffler.d.ts +12 -0
- package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -0
- package/lib/tree/utilities/nodeShuffler.js +123 -0
- package/lib/utils/arrays/getAllPicks.d.ts +2 -0
- package/lib/utils/arrays/getAllPicks.d.ts.map +1 -0
- package/lib/utils/arrays/getAllPicks.js +17 -0
- package/lib/utils/errors/handleVEAError.d.ts +1 -1
- package/lib/utils/errors/handleVEAError.d.ts.map +1 -1
- package/lib/utils/strings/decapitalize.d.ts +2 -0
- package/lib/utils/strings/decapitalize.d.ts.map +1 -0
- package/lib/utils/strings/decapitalize.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { dividersOf } from "../../../math/utils/arithmetic/dividersOf.js";
|
|
4
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
5
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
6
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
7
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
8
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
9
|
+
import { random } from "../../../utils/alea/random.js";
|
|
10
|
+
const getInstruction = (identifiers) => {
|
|
11
|
+
const { distance, minutes } = identifiers;
|
|
12
|
+
return `Si on parcourt $${distance.frenchify()}$ km en $${minutes.frenchify()}$ min,
|
|
13
|
+
quelle est la vitesse moyenne en km/h ( $km.h^{-1}$ ) ?`;
|
|
14
|
+
};
|
|
15
|
+
const getAnswer = (identifiers) => {
|
|
16
|
+
const { distance, minutes } = identifiers;
|
|
17
|
+
const nodeAnswer = multiply(distance, frac(60, minutes));
|
|
18
|
+
return `${nodeAnswer.simplify().toTex()}km.h^{-1}`;
|
|
19
|
+
};
|
|
20
|
+
const isAnswerValid = (ans, { distance, minutes }) => {
|
|
21
|
+
const nodeAnswer = multiply(distance, frac(60, minutes));
|
|
22
|
+
const nodeAns = parseAlgebraic(ans.replace("$km.h^{-1}$", "").replace("km/h", ""));
|
|
23
|
+
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
24
|
+
};
|
|
25
|
+
const getHint = () => {
|
|
26
|
+
return `Combien de minutes constituent une heure ?`;
|
|
27
|
+
};
|
|
28
|
+
const getCorrection = (identifiers) => {
|
|
29
|
+
const { distance, minutes } = identifiers;
|
|
30
|
+
return `En $60$ minutes, on parcourt $${multiply(distance, frac(60, minutes)).toTex()}$ km
|
|
31
|
+
donc la vitesse est de $${multiply(distance, frac(60, minutes).simplify()).toTex()} = ${multiply(distance, frac(60, minutes))
|
|
32
|
+
.simplify()
|
|
33
|
+
.toTex()}$ $km.h^{-1}$`;
|
|
34
|
+
};
|
|
35
|
+
const getPropositions = (n, { answer, distance, minutes }) => {
|
|
36
|
+
const propositions = [];
|
|
37
|
+
addValidProp(propositions, answer);
|
|
38
|
+
tryToAddWrongProp(propositions, `${multiply(60, minutes).simplify().toTex()}km.h^{-1}`);
|
|
39
|
+
tryToAddWrongProp(propositions, `${frac(distance, minutes).simplify().toTex()}km.h^{-1}`);
|
|
40
|
+
tryToAddWrongProp(propositions, `${multiply(3.6, frac(distance, minutes)).simplify().toTex()}km.h^{-1}`);
|
|
41
|
+
return shuffleProps(propositions, n);
|
|
42
|
+
};
|
|
43
|
+
const getKmPerMinToKmPerHourConversionQuestion = () => {
|
|
44
|
+
const distance = randint(1, 101);
|
|
45
|
+
const minutes = random(dividersOf(60));
|
|
46
|
+
const identifiers = {
|
|
47
|
+
distance,
|
|
48
|
+
minutes,
|
|
49
|
+
};
|
|
50
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
51
|
+
};
|
|
52
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
53
|
+
const question = {
|
|
54
|
+
answer: getAnswer(identifiers),
|
|
55
|
+
instruction: getInstruction(identifiers),
|
|
56
|
+
keys: [
|
|
57
|
+
{
|
|
58
|
+
id: "custom",
|
|
59
|
+
label: "{km}.{h}^{-1}",
|
|
60
|
+
labelType: "tex",
|
|
61
|
+
mathfieldInstructions: {
|
|
62
|
+
method: "write",
|
|
63
|
+
content: "{km}.{h}^{-1}",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "custom",
|
|
68
|
+
label: "km/h",
|
|
69
|
+
labelType: "raw",
|
|
70
|
+
mathfieldInstructions: {
|
|
71
|
+
method: "write",
|
|
72
|
+
content: "km/h",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
answerFormat: "tex",
|
|
77
|
+
identifiers,
|
|
78
|
+
hint: getHint(identifiers),
|
|
79
|
+
correction: getCorrection(identifiers),
|
|
80
|
+
};
|
|
81
|
+
return question;
|
|
82
|
+
};
|
|
83
|
+
export const kmPerMinToKmPerHourConversion = {
|
|
84
|
+
id: "kmPerMinToKmPerHourConversion",
|
|
85
|
+
connector: "=",
|
|
86
|
+
label: "Effectuer des conversions de vitesse ( $x$ km en $y$ min donne une vitesse $V$ en km/h)",
|
|
87
|
+
isSingleStep: true,
|
|
88
|
+
generator: (nb) => getDistinctQuestions(getKmPerMinToKmPerHourConversionQuestion, nb),
|
|
89
|
+
qcmTimer: 60,
|
|
90
|
+
freeTimer: 60,
|
|
91
|
+
getPropositions,
|
|
92
|
+
isAnswerValid,
|
|
93
|
+
subject: "Mathématiques",
|
|
94
|
+
getQuestionFromIdentifiers,
|
|
95
|
+
hasHintAndCorrection: true,
|
|
96
|
+
shouldHaveCalculator: true,
|
|
97
|
+
answerType: "QCU",
|
|
98
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
isMinutesToHours: boolean;
|
|
5
|
+
nodeIdsMinutes: NodeIdentifiers;
|
|
6
|
+
nodeIdsHours: NodeIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
export declare const minutesToHours: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=minutesToHours.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minutesToHours.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/minutesToHours.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,eAAe,CAAC;IAChC,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA2LF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAgBhD,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { dividersOf } from "../../../math/utils/arithmetic/dividersOf.js";
|
|
4
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
5
|
+
import { round } from "../../../math/utils/round.js";
|
|
6
|
+
import { NodeConstructor, } from "../../../tree/nodes/nodeConstructor.js";
|
|
7
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
8
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
10
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
11
|
+
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
12
|
+
import { random } from "../../../utils/alea/random.js";
|
|
13
|
+
const getInstruction = (identifiers) => {
|
|
14
|
+
const { isMinutesToHours, nodeIdsMinutes, nodeIdsHours } = identifiers;
|
|
15
|
+
const minutes = NodeConstructor.fromIdentifiers(nodeIdsMinutes);
|
|
16
|
+
const hours = NodeConstructor.fromIdentifiers(nodeIdsHours);
|
|
17
|
+
return `Convertir ${isMinutesToHours ? `$${minutes.toTex()}$ min` : `$${hours.toTex()}$ h`} en ${isMinutesToHours ? "heures" : "minutes"}.
|
|
18
|
+
|
|
19
|
+
Donner la valeur exacte (et pas la valeur arrondie).`;
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
const { isMinutesToHours, nodeIdsMinutes, nodeIdsHours } = identifiers;
|
|
23
|
+
const minutes = NodeConstructor.fromIdentifiers(nodeIdsMinutes);
|
|
24
|
+
const hours = NodeConstructor.fromIdentifiers(nodeIdsHours);
|
|
25
|
+
const answer = isMinutesToHours
|
|
26
|
+
? `${hours.toTex()}\\text{h}`
|
|
27
|
+
: `${minutes.toTex()}\\text{min}`;
|
|
28
|
+
return answer;
|
|
29
|
+
};
|
|
30
|
+
const isAnswerValid = (ans, { isMinutesToHours, nodeIdsMinutes, nodeIdsHours }) => {
|
|
31
|
+
if (isMinutesToHours) {
|
|
32
|
+
if (ans.includes("\\text{min}"))
|
|
33
|
+
return false;
|
|
34
|
+
const nodeAns = parseAlgebraic(ans.replace("\\text{h}", ""));
|
|
35
|
+
const nodeAnswer = NodeConstructor.fromIdentifiers(nodeIdsHours);
|
|
36
|
+
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (ans.includes("\\text{h}"))
|
|
40
|
+
return false;
|
|
41
|
+
const nodeAns = parseAlgebraic(ans.replace("\\text{min}", ""));
|
|
42
|
+
const nodeAnswer = NodeConstructor.fromIdentifiers(nodeIdsMinutes);
|
|
43
|
+
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const getHint = (identifiers) => {
|
|
47
|
+
const { isMinutesToHours } = identifiers;
|
|
48
|
+
if (isMinutesToHours) {
|
|
49
|
+
return `Combien y-a-t-il d'heures dans $120$ minutes ?`;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return `Combien y-a-t-il de minutes dans une heure ?`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const getCorrection = (identifiers) => {
|
|
56
|
+
const { isMinutesToHours, nodeIdsMinutes, nodeIdsHours } = identifiers;
|
|
57
|
+
const minutes = NodeConstructor.fromIdentifiers(nodeIdsMinutes);
|
|
58
|
+
const hours = NodeConstructor.fromIdentifiers(nodeIdsHours);
|
|
59
|
+
return `
|
|
60
|
+
${(() => {
|
|
61
|
+
if (isMinutesToHours) {
|
|
62
|
+
return `Comme il y a $60$ minutes dans une heure alors $${minutes.toTex()}$ minutes correspondent à $${frac(minutes, 60).toTex()} = ${hours.toTex()} $ ${hours.evaluate() >= 2 ? `heures` : `heure`}.`;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return `Comme il y a $60$ minutes dans une heure alors $${hours.toTex()}$ ${hours.evaluate() >= 2 ? `heures` : `heure`} correspondent à $${hours.toTex()} \\times {60} = ${minutes.toTex()} $ minutes.`;
|
|
66
|
+
}
|
|
67
|
+
})()}
|
|
68
|
+
|
|
69
|
+
Attention, il fallait donner la valeur exacte et pas la valeur approchée.`;
|
|
70
|
+
};
|
|
71
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
72
|
+
const { isMinutesToHours, nodeIdsMinutes, nodeIdsHours } = identifiers;
|
|
73
|
+
const minutes = NodeConstructor.fromIdentifiers(nodeIdsMinutes);
|
|
74
|
+
const hours = NodeConstructor.fromIdentifiers(nodeIdsHours);
|
|
75
|
+
const propositions = [];
|
|
76
|
+
addValidProp(propositions, answer);
|
|
77
|
+
if (isMinutesToHours) {
|
|
78
|
+
const roundedValue = round(hours.evaluate(), 2);
|
|
79
|
+
const texDecimal = roundedValue.frenchify().split(",")[1];
|
|
80
|
+
tryToAddWrongProp(propositions, `${roundedValue.frenchify()}\\text{h}`);
|
|
81
|
+
tryToAddWrongProp(propositions, `${multiply(minutes.evaluate(), 60).simplify().toTex()}\\text{h}`);
|
|
82
|
+
tryToAddWrongProp(propositions, `${frac(60, minutes).toTex()}\\text{h}`);
|
|
83
|
+
propWhile(propositions, n, () => {
|
|
84
|
+
tryToAddWrongProp(propositions, `${0},${texDecimal}\\text{h}`);
|
|
85
|
+
tryToAddWrongProp(propositions, `${1},${texDecimal}\\text{h}`);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
tryToAddWrongProp(propositions, `${round(multiply(hours.evaluate(), 60).evaluate(), 0).frenchify()}\\text{min}`);
|
|
90
|
+
tryToAddWrongProp(propositions, `${round(multiply(round(hours.evaluate(), 0), 60).evaluate(), 0).frenchify()}\\text{min}`);
|
|
91
|
+
tryToAddWrongProp(propositions, `${frac(60, hours).simplify().toTex()}\\text{min}`);
|
|
92
|
+
tryToAddWrongProp(propositions, `${multiply(hours, frac(1, 60)).simplify().toTex()}\\text{min}`);
|
|
93
|
+
tryToAddWrongProp(propositions, `${multiply(hours, frac(1, 60)).toTex()}\\text{min}`);
|
|
94
|
+
tryToAddWrongProp(propositions, `${round(multiply(hours, round(frac(1, 60).evaluate(), 4)).evaluate(), 0).frenchify()}\\text{min}`);
|
|
95
|
+
}
|
|
96
|
+
return shuffleProps(propositions, n);
|
|
97
|
+
};
|
|
98
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
99
|
+
const question = {
|
|
100
|
+
answer: getAnswer(identifiers),
|
|
101
|
+
instruction: getInstruction(identifiers),
|
|
102
|
+
keys: ["hours", "minutes"],
|
|
103
|
+
answerFormat: "tex",
|
|
104
|
+
identifiers,
|
|
105
|
+
hint: getHint(identifiers),
|
|
106
|
+
correction: getCorrection(identifiers),
|
|
107
|
+
};
|
|
108
|
+
return question;
|
|
109
|
+
};
|
|
110
|
+
const getMinutesToHoursQuestion = () => {
|
|
111
|
+
const isMinutesToHours = coinFlip();
|
|
112
|
+
let minutes;
|
|
113
|
+
let hours;
|
|
114
|
+
const dividersOf60 = dividersOf(60);
|
|
115
|
+
if (isMinutesToHours) {
|
|
116
|
+
minutes = coinFlip()
|
|
117
|
+
? randint(1, 18000).toTree()
|
|
118
|
+
: multiply(randint(1, 101), random(dividersOf60)).evaluate().toTree();
|
|
119
|
+
hours = frac(minutes, 60).simplify();
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
const numerator = coinFlip()
|
|
123
|
+
? randint(1, 1800).toTree()
|
|
124
|
+
: multiply(randint(1, 21), random(dividersOf60));
|
|
125
|
+
hours = frac(numerator, random(dividersOf60)).simplify();
|
|
126
|
+
minutes = multiply(hours, 60).simplify();
|
|
127
|
+
}
|
|
128
|
+
const identifiers = {
|
|
129
|
+
isMinutesToHours,
|
|
130
|
+
nodeIdsMinutes: minutes.toIdentifiers(),
|
|
131
|
+
nodeIdsHours: hours.toIdentifiers(),
|
|
132
|
+
};
|
|
133
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
134
|
+
};
|
|
135
|
+
export const minutesToHours = {
|
|
136
|
+
id: "minutesToHours",
|
|
137
|
+
connector: "=",
|
|
138
|
+
label: "Convertir une durée en minutes en une durée en heures et inversement",
|
|
139
|
+
isSingleStep: true,
|
|
140
|
+
generator: (nb) => getDistinctQuestions(getMinutesToHoursQuestion, nb),
|
|
141
|
+
qcmTimer: 60,
|
|
142
|
+
freeTimer: 60,
|
|
143
|
+
getPropositions,
|
|
144
|
+
isAnswerValid,
|
|
145
|
+
subject: "Mathématiques",
|
|
146
|
+
getQuestionFromIdentifiers,
|
|
147
|
+
hasHintAndCorrection: true,
|
|
148
|
+
shouldHaveCalculator: true,
|
|
149
|
+
answerType: "QCU",
|
|
150
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Exercise } from "../../exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
prefixIndexesPool: number[];
|
|
4
|
+
prefixIndex: number;
|
|
5
|
+
isToPow10: boolean;
|
|
6
|
+
isFromSymbol: boolean;
|
|
7
|
+
};
|
|
8
|
+
type Options = {
|
|
9
|
+
prefixPool: string[];
|
|
10
|
+
isToPow10: boolean;
|
|
11
|
+
isFromSymbol: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const prefixToNumber: Exercise<Identifiers, Options>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=prefixToNumber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefixToNumber.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/prefixToNumber.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAG3B,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAsLF,KAAK,OAAO,GAAG;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AA+EF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBzD,CAAC"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { power } from "../../../tree/nodes/operators/powerNode.js";
|
|
2
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
3
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
4
|
+
import { random } from "../../../utils/alea/random.js";
|
|
5
|
+
import { shuffle } from "../../../utils/alea/shuffle.js";
|
|
6
|
+
import { mdTable } from "../../../utils/markdown/mdTable.js";
|
|
7
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, tryToAddWrongProp, } from "../../exercise.js";
|
|
8
|
+
import { getDistinctQuestions } from "../../utils/getDistinctQuestions.js";
|
|
9
|
+
const prefixes = [
|
|
10
|
+
{
|
|
11
|
+
name: "Déca",
|
|
12
|
+
symbol: "da",
|
|
13
|
+
meaning: "dix",
|
|
14
|
+
superscript: 1,
|
|
15
|
+
texPow10: power(10, 1).toTex(),
|
|
16
|
+
texValue: "10",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "Hecto",
|
|
20
|
+
symbol: "h",
|
|
21
|
+
meaning: "cent",
|
|
22
|
+
superscript: 2,
|
|
23
|
+
texPow10: power(10, 2).toTex(),
|
|
24
|
+
texValue: "100",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "Kilo",
|
|
28
|
+
symbol: "k",
|
|
29
|
+
meaning: "mille",
|
|
30
|
+
superscript: 3,
|
|
31
|
+
texPow10: power(10, 3).toTex(),
|
|
32
|
+
texValue: "1 000",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Méga",
|
|
36
|
+
symbol: "M",
|
|
37
|
+
meaning: "million",
|
|
38
|
+
superscript: 6,
|
|
39
|
+
texPow10: power(10, 6).toTex(),
|
|
40
|
+
texValue: "1 000 000",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "Giga",
|
|
44
|
+
symbol: "G",
|
|
45
|
+
meaning: "milliard",
|
|
46
|
+
superscript: 9,
|
|
47
|
+
texPow10: power(10, 9).toTex(),
|
|
48
|
+
texValue: "1 000 000 000",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "Déci",
|
|
52
|
+
symbol: "d",
|
|
53
|
+
meaning: "dixième de",
|
|
54
|
+
superscript: -1,
|
|
55
|
+
texPow10: power(10, -1).toTex(),
|
|
56
|
+
texValue: "0,1",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "Centi",
|
|
60
|
+
symbol: "c",
|
|
61
|
+
meaning: "centième de",
|
|
62
|
+
superscript: -2,
|
|
63
|
+
texPow10: power(10, -2).toTex(),
|
|
64
|
+
texValue: "0,01",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "Milli",
|
|
68
|
+
symbol: "m",
|
|
69
|
+
meaning: "millième de",
|
|
70
|
+
superscript: -3,
|
|
71
|
+
texPow10: power(10, -3).toTex(),
|
|
72
|
+
texValue: "0,001",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "Micro",
|
|
76
|
+
symbol: "\\mu",
|
|
77
|
+
meaning: "millionième de",
|
|
78
|
+
superscript: -6,
|
|
79
|
+
texPow10: power(10, -6).toTex(),
|
|
80
|
+
texValue: "0,000 001",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "Nano",
|
|
84
|
+
symbol: "n",
|
|
85
|
+
meaning: "milliardième de",
|
|
86
|
+
superscript: -9,
|
|
87
|
+
texPow10: power(10, -9).toTex(),
|
|
88
|
+
texValue: "0,000 000 001",
|
|
89
|
+
},
|
|
90
|
+
].toSorted((prefix1, prefix2) => prefix1.superscript - prefix2.superscript);
|
|
91
|
+
const getMdTable = (prefixes, indexBold = -1) => {
|
|
92
|
+
function boldify(str) {
|
|
93
|
+
return `**${str}**`;
|
|
94
|
+
}
|
|
95
|
+
return mdTable([
|
|
96
|
+
["Préfixe", "Symbole", "Signification", "Puissance"],
|
|
97
|
+
...prefixes.map((prefix, i) => [
|
|
98
|
+
prefix.name,
|
|
99
|
+
`$${prefix.symbol}$`,
|
|
100
|
+
prefix.meaning,
|
|
101
|
+
`$${prefix.texPow10}$`,
|
|
102
|
+
].map((str) => (i === indexBold ? boldify(str) : str))),
|
|
103
|
+
]);
|
|
104
|
+
};
|
|
105
|
+
const getInstruction = (identifiers) => {
|
|
106
|
+
const { prefixIndex, isFromSymbol, isToPow10 } = identifiers;
|
|
107
|
+
const prefix = prefixes[prefixIndex];
|
|
108
|
+
return `Quelle est la valeur du préfixe ${isFromSymbol ? `$${prefix.symbol}$` : prefix.name} ?
|
|
109
|
+
|
|
110
|
+
Ecris la réponse sous la forme ${isToPow10 ? `d'une puissance de $10$` : `d'un nombre décimal`}.`;
|
|
111
|
+
};
|
|
112
|
+
const getHint = (identifiers) => {
|
|
113
|
+
const { prefixIndexesPool } = identifiers;
|
|
114
|
+
const prefixPool = prefixIndexesPool.map((i) => prefixes[i]);
|
|
115
|
+
return getMdTable(prefixPool);
|
|
116
|
+
};
|
|
117
|
+
const getCorrection = (identifiers) => {
|
|
118
|
+
const { prefixIndexesPool, prefixIndex } = identifiers;
|
|
119
|
+
const prefixPool = prefixIndexesPool.map((i) => prefixes[i]);
|
|
120
|
+
const indexBold = (() => {
|
|
121
|
+
for (let i = 0; i < prefixIndexesPool.length; i++) {
|
|
122
|
+
if (prefixIndexesPool[i] === prefixIndex)
|
|
123
|
+
return i;
|
|
124
|
+
}
|
|
125
|
+
})();
|
|
126
|
+
return getMdTable(prefixPool, indexBold);
|
|
127
|
+
};
|
|
128
|
+
const getAnswer = (identifiers) => {
|
|
129
|
+
const { prefixIndex, isToPow10 } = identifiers;
|
|
130
|
+
const prefix = prefixes[prefixIndex];
|
|
131
|
+
return isToPow10 ? prefix.texPow10 : prefix.texValue;
|
|
132
|
+
};
|
|
133
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
134
|
+
const { prefixIndexesPool, prefixIndex, isToPow10 } = identifiers;
|
|
135
|
+
const propositions = [];
|
|
136
|
+
addValidProp(propositions, answer);
|
|
137
|
+
const wrongIndexesPool = prefixIndexesPool.filter((i) => i !== prefixIndex);
|
|
138
|
+
let availableWrongPrefixIndexes = wrongIndexesPool.length >= n - 1
|
|
139
|
+
? wrongIndexesPool
|
|
140
|
+
: prefixes.map((_, i) => i).filter((i) => i !== prefixIndex);
|
|
141
|
+
propWhile(propositions, n, () => {
|
|
142
|
+
const wrongPrefixIndex = random(availableWrongPrefixIndexes);
|
|
143
|
+
const wrongPrefix = prefixes[wrongPrefixIndex];
|
|
144
|
+
const wrongTex = isToPow10 ? wrongPrefix.texPow10 : wrongPrefix.texValue;
|
|
145
|
+
tryToAddWrongProp(propositions, wrongTex);
|
|
146
|
+
availableWrongPrefixIndexes = availableWrongPrefixIndexes.filter((i) => i !== wrongPrefixIndex);
|
|
147
|
+
});
|
|
148
|
+
return shuffle(propositions);
|
|
149
|
+
};
|
|
150
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
151
|
+
const nodeAns = parseAlgebraic(ans);
|
|
152
|
+
const nodeAnswer = parseAlgebraic(answer);
|
|
153
|
+
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
154
|
+
};
|
|
155
|
+
const optionsDefault = {
|
|
156
|
+
prefixPool: prefixes.map((prefix) => prefix.name),
|
|
157
|
+
isToPow10: [true, false],
|
|
158
|
+
isFromSymbol: [true, false],
|
|
159
|
+
};
|
|
160
|
+
const options = [
|
|
161
|
+
{
|
|
162
|
+
id: "prefixPool",
|
|
163
|
+
label: "N'utiliser que les préfixes suivants :",
|
|
164
|
+
type: GeneratorOptionType.multiselect,
|
|
165
|
+
target: GeneratorOptionTarget.generation,
|
|
166
|
+
values: prefixes.map((prefix) => prefix.name),
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: "isToPow10",
|
|
170
|
+
label: "Réponse sous forme de puissance de 10 ?",
|
|
171
|
+
type: GeneratorOptionType.checkbox,
|
|
172
|
+
target: GeneratorOptionTarget.generation,
|
|
173
|
+
values: optionsDefault.isToPow10,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: "units",
|
|
177
|
+
label: "Utiliser le symbole pour la question ?",
|
|
178
|
+
type: GeneratorOptionType.checkbox,
|
|
179
|
+
target: GeneratorOptionTarget.generation,
|
|
180
|
+
values: optionsDefault.isFromSymbol,
|
|
181
|
+
},
|
|
182
|
+
];
|
|
183
|
+
const getPrefixToNumberQuestion = (optsIn) => {
|
|
184
|
+
const opts = optsIn ? Object.assign(optionsDefault, optsIn) : optionsDefault;
|
|
185
|
+
const prefixIndexesPool = opts.prefixPool.map((prefixName) => {
|
|
186
|
+
const prefixIndex = (() => {
|
|
187
|
+
for (let i = 0; i < prefixes.length; i++) {
|
|
188
|
+
if (prefixes[i].name === prefixName)
|
|
189
|
+
return i;
|
|
190
|
+
}
|
|
191
|
+
})();
|
|
192
|
+
return prefixIndex;
|
|
193
|
+
}) ?? optionsDefault.prefixPool;
|
|
194
|
+
const prefixIndex = random(prefixIndexesPool);
|
|
195
|
+
const isFromSymbol = optsIn?.isFromSymbol ?? random(optionsDefault.isFromSymbol);
|
|
196
|
+
const isToPow10 = optsIn?.isToPow10 ?? random(optionsDefault.isToPow10);
|
|
197
|
+
const identifiers = {
|
|
198
|
+
prefixIndexesPool,
|
|
199
|
+
prefixIndex,
|
|
200
|
+
isFromSymbol,
|
|
201
|
+
isToPow10,
|
|
202
|
+
};
|
|
203
|
+
return getQuestionFromIdentifiers(identifiers, optsIn);
|
|
204
|
+
};
|
|
205
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
206
|
+
const question = {
|
|
207
|
+
instruction: getInstruction(identifiers, opts),
|
|
208
|
+
answer: getAnswer(identifiers, opts),
|
|
209
|
+
keys: [],
|
|
210
|
+
answerFormat: "tex",
|
|
211
|
+
identifiers,
|
|
212
|
+
hint: getHint(identifiers),
|
|
213
|
+
correction: getCorrection(identifiers),
|
|
214
|
+
};
|
|
215
|
+
return question;
|
|
216
|
+
};
|
|
217
|
+
export const prefixToNumber = {
|
|
218
|
+
id: "prefixToNumber",
|
|
219
|
+
connector: "=",
|
|
220
|
+
label: "Convertir un préfixe en nombre",
|
|
221
|
+
isSingleStep: true,
|
|
222
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPrefixToNumberQuestion(opts), nb),
|
|
223
|
+
qcmTimer: 60,
|
|
224
|
+
freeTimer: 60,
|
|
225
|
+
getPropositions,
|
|
226
|
+
isAnswerValid,
|
|
227
|
+
subject: "Mathématiques",
|
|
228
|
+
getAnswer,
|
|
229
|
+
getInstruction,
|
|
230
|
+
options,
|
|
231
|
+
hasHintAndCorrection: true,
|
|
232
|
+
getQuestionFromIdentifiers,
|
|
233
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
isSecondsToHours: boolean;
|
|
5
|
+
nodeIdsSeconds: NodeIdentifiers;
|
|
6
|
+
nodeIdsHours: NodeIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
export declare const secondsToHours: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=secondsToHours.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secondsToHours.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/secondsToHours.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,eAAe,CAAC;IAChC,YAAY,EAAE,eAAe,CAAC;CAC/B,CAAC;AA2LF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAiBhD,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { dividersOf } from "../../../math/utils/arithmetic/dividersOf.js";
|
|
4
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
5
|
+
import { round } from "../../../math/utils/round.js";
|
|
6
|
+
import { NodeConstructor, } from "../../../tree/nodes/nodeConstructor.js";
|
|
7
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
8
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
10
|
+
import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
|
|
11
|
+
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
12
|
+
import { random } from "../../../utils/alea/random.js";
|
|
13
|
+
const getInstruction = (identifiers) => {
|
|
14
|
+
const { isSecondsToHours, nodeIdsSeconds, nodeIdsHours } = identifiers;
|
|
15
|
+
const seconds = NodeConstructor.fromIdentifiers(nodeIdsSeconds);
|
|
16
|
+
const hours = NodeConstructor.fromIdentifiers(nodeIdsHours);
|
|
17
|
+
return `Convertir ${isSecondsToHours ? `$${seconds.toTex()}$ s` : `$${hours.toTex()}$ h`} en ${isSecondsToHours ? "heures" : "secondes"}.
|
|
18
|
+
|
|
19
|
+
Donner la valeur exacte (et pas la valeur arrondie).`;
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
const { isSecondsToHours, nodeIdsSeconds, nodeIdsHours } = identifiers;
|
|
23
|
+
const seconds = NodeConstructor.fromIdentifiers(nodeIdsSeconds);
|
|
24
|
+
const hours = NodeConstructor.fromIdentifiers(nodeIdsHours);
|
|
25
|
+
const answer = isSecondsToHours
|
|
26
|
+
? `${hours.toTex()}\\text{h}`
|
|
27
|
+
: `${seconds.toTex()}\\text{s}`;
|
|
28
|
+
return answer;
|
|
29
|
+
};
|
|
30
|
+
const isAnswerValid = (ans, { isSecondsToHours, nodeIdsSeconds, nodeIdsHours }) => {
|
|
31
|
+
if (isSecondsToHours) {
|
|
32
|
+
if (ans.includes("\\text{s}"))
|
|
33
|
+
return false;
|
|
34
|
+
const nodeAns = parseAlgebraic(ans.replace("\\text{h}", ""));
|
|
35
|
+
const nodeAnswer = NodeConstructor.fromIdentifiers(nodeIdsHours);
|
|
36
|
+
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (ans.includes("\\text{h}"))
|
|
40
|
+
return false;
|
|
41
|
+
const nodeAns = parseAlgebraic(ans.replace("\\text{s}", ""));
|
|
42
|
+
const nodeAnswer = NodeConstructor.fromIdentifiers(nodeIdsSeconds);
|
|
43
|
+
return substract(nodeAns, nodeAnswer).evaluate() === 0;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const getHint = (identifiers) => {
|
|
47
|
+
const { isSecondsToHours } = identifiers;
|
|
48
|
+
if (isSecondsToHours) {
|
|
49
|
+
return `Combien y-a-t-il d'heures dans $7200$ secondes ?`;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
return `Combien y-a-t-il de secondes dans une heure ?`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const getCorrection = (identifiers) => {
|
|
56
|
+
const { isSecondsToHours, nodeIdsSeconds, nodeIdsHours } = identifiers;
|
|
57
|
+
const seconds = NodeConstructor.fromIdentifiers(nodeIdsSeconds);
|
|
58
|
+
const hours = NodeConstructor.fromIdentifiers(nodeIdsHours);
|
|
59
|
+
return `
|
|
60
|
+
${(() => {
|
|
61
|
+
if (isSecondsToHours) {
|
|
62
|
+
return `Comme il y a $3600$ secondes dans une heure alors $${seconds.toTex()}$ minutes correspondent à $${frac(seconds, 3600).toTex()} = ${hours.toTex()} $ ${hours.evaluate() >= 2 ? `heures` : `heure`}.`;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return `Comme il y a $3600$ secondes dans une heure alors $${hours.toTex()}$ ${hours.evaluate() >= 2 ? `heures` : `heure`} correspondent à $${hours.toTex()} \\times {3600} = ${seconds.toTex()} $ secondes.`;
|
|
66
|
+
}
|
|
67
|
+
})()}
|
|
68
|
+
|
|
69
|
+
Attention, il fallait donner la valeur exacte et pas la valeur approchée.`;
|
|
70
|
+
};
|
|
71
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
72
|
+
const { isSecondsToHours, nodeIdsSeconds, nodeIdsHours } = identifiers;
|
|
73
|
+
const seconds = NodeConstructor.fromIdentifiers(nodeIdsSeconds);
|
|
74
|
+
const hours = NodeConstructor.fromIdentifiers(nodeIdsHours);
|
|
75
|
+
const propositions = [];
|
|
76
|
+
addValidProp(propositions, answer);
|
|
77
|
+
if (isSecondsToHours) {
|
|
78
|
+
const roundedValue = round(hours.evaluate(), 2);
|
|
79
|
+
const texDecimal = roundedValue.frenchify().split(",")[1];
|
|
80
|
+
tryToAddWrongProp(propositions, `${roundedValue.frenchify()}\\text{h}`);
|
|
81
|
+
tryToAddWrongProp(propositions, `${multiply(seconds.evaluate(), 3600).simplify().toTex()}\\text{h}`);
|
|
82
|
+
tryToAddWrongProp(propositions, `${frac(3600, seconds).toTex()}\\text{h}`);
|
|
83
|
+
propWhile(propositions, n, () => {
|
|
84
|
+
tryToAddWrongProp(propositions, `${0},${texDecimal}\\text{h}`);
|
|
85
|
+
tryToAddWrongProp(propositions, `${1},${texDecimal}\\text{h}`);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
tryToAddWrongProp(propositions, `${round(multiply(hours.evaluate(), 3600).evaluate(), 0).frenchify()}\\text{s}`);
|
|
90
|
+
tryToAddWrongProp(propositions, `${round(multiply(round(hours.evaluate(), 0), 3600).evaluate(), 0).frenchify()}\\text{s}`);
|
|
91
|
+
tryToAddWrongProp(propositions, `${frac(3600, hours).simplify().toTex()}\\text{s}`);
|
|
92
|
+
tryToAddWrongProp(propositions, `${multiply(hours, frac(1, 3600)).simplify().toTex()}\\text{s}`);
|
|
93
|
+
tryToAddWrongProp(propositions, `${multiply(hours, frac(1, 3600)).toTex()}\\text{s}`);
|
|
94
|
+
tryToAddWrongProp(propositions, `${round(multiply(hours, round(frac(1, 3600).evaluate(), 4)).evaluate(), 0).frenchify()}\\text{s}`);
|
|
95
|
+
}
|
|
96
|
+
return shuffleProps(propositions, n);
|
|
97
|
+
};
|
|
98
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
99
|
+
const question = {
|
|
100
|
+
answer: getAnswer(identifiers),
|
|
101
|
+
instruction: getInstruction(identifiers),
|
|
102
|
+
keys: ["hours", "minutes"],
|
|
103
|
+
answerFormat: "tex",
|
|
104
|
+
identifiers,
|
|
105
|
+
hint: getHint(identifiers),
|
|
106
|
+
correction: getCorrection(identifiers),
|
|
107
|
+
};
|
|
108
|
+
return question;
|
|
109
|
+
};
|
|
110
|
+
const getMinutesToHoursQuestion = () => {
|
|
111
|
+
const isSecondsToHours = coinFlip();
|
|
112
|
+
let seconds;
|
|
113
|
+
let hours;
|
|
114
|
+
const dividersOf3600 = dividersOf(3600);
|
|
115
|
+
if (isSecondsToHours) {
|
|
116
|
+
seconds = coinFlip()
|
|
117
|
+
? randint(1, 18000).toTree()
|
|
118
|
+
: multiply(randint(1, 101), random(dividersOf3600)).evaluate().toTree();
|
|
119
|
+
hours = frac(seconds, 3600).simplify();
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
const numerator = coinFlip()
|
|
123
|
+
? randint(1, 1800).toTree()
|
|
124
|
+
: multiply(randint(1, 21), random(dividersOf3600));
|
|
125
|
+
hours = frac(numerator, random(dividersOf3600)).simplify();
|
|
126
|
+
seconds = multiply(hours, 3600).simplify();
|
|
127
|
+
}
|
|
128
|
+
const identifiers = {
|
|
129
|
+
isSecondsToHours,
|
|
130
|
+
nodeIdsSeconds: seconds.toIdentifiers(),
|
|
131
|
+
nodeIdsHours: hours.toIdentifiers(),
|
|
132
|
+
};
|
|
133
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
134
|
+
};
|
|
135
|
+
export const secondsToHours = {
|
|
136
|
+
id: "secondsToHours",
|
|
137
|
+
connector: "=",
|
|
138
|
+
label: "Convertir une durée en secondes en une durée en heures et inversement",
|
|
139
|
+
isSingleStep: true,
|
|
140
|
+
generator: (nb) => getDistinctQuestions(getMinutesToHoursQuestion, nb),
|
|
141
|
+
qcmTimer: 60,
|
|
142
|
+
freeTimer: 60,
|
|
143
|
+
getPropositions,
|
|
144
|
+
isAnswerValid,
|
|
145
|
+
subject: "Mathématiques",
|
|
146
|
+
getQuestionFromIdentifiers,
|
|
147
|
+
hasHintAndCorrection: true,
|
|
148
|
+
shouldHaveCalculator: true,
|
|
149
|
+
answerType: "QCU",
|
|
150
|
+
};
|