math-exercises 3.0.125 → 3.0.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +61 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.js +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +15 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +231 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.d.ts +16 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.js +327 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts +8 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +123 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +149 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +29 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +368 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts +12 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.js +164 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +140 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts +6 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/index.js +6 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts +9 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +84 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts +8 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +90 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts +2 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/index.js +2 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts +13 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +454 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.js +70 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/index.js +2 -0
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts +2 -1
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/isolate/index.js +2 -1
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +86 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts +7 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.js +80 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +180 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +144 -0
- package/lib/exercises/math/calculLitteral/ordering/index.d.ts +3 -0
- package/lib/exercises/math/calculLitteral/ordering/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/index.js +2 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +120 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.js +67 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.js +114 -0
- package/lib/exercises/math/calculLitteral/simplifying/index.d.ts +5 -0
- package/lib/exercises/math/calculLitteral/simplifying/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/index.js +5 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts +13 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.js +125 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts +14 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.js +148 -0
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +5 -27
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +231 -248
- package/lib/exercises/math/conversion/index.d.ts +4 -0
- package/lib/exercises/math/conversion/index.d.ts.map +1 -1
- package/lib/exercises/math/conversion/index.js +4 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +11 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +116 -0
- package/lib/exercises/math/conversion/minutesToHours.d.ts +10 -0
- package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -0
- package/lib/exercises/math/conversion/minutesToHours.js +150 -0
- package/lib/exercises/math/conversion/prefixToNumber.d.ts +15 -0
- package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -0
- package/lib/exercises/math/conversion/prefixToNumber.js +243 -0
- package/lib/exercises/math/conversion/secondsToHours.d.ts +10 -0
- package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -0
- package/lib/exercises/math/conversion/secondsToHours.js +150 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +53 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +533 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts +7 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.js +223 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +140 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +133 -0
- package/lib/exercises/math/dataRepresentations/graphReading.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/graphReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/graphReading.js +136 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts +18 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +228 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.js +213 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.js +163 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/index.js +10 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.js +194 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.js +308 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +5 -6
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts +8 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +117 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts +8 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +118 -0
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts +16 -0
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +215 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts +13 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +223 -0
- package/lib/exercises/math/functions/affines/index.d.ts +7 -0
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +7 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts +20 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.js +284 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +16 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.js +275 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts +14 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +235 -0
- package/lib/exercises/math/functions/basics/index.d.ts +1 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -0
- package/lib/exercises/math/functions/composition/functionComposition.d.ts +8 -0
- package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -0
- package/lib/exercises/math/functions/composition/functionComposition.js +238 -0
- package/lib/exercises/math/functions/composition/index.d.ts +2 -0
- package/lib/exercises/math/functions/composition/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/composition/index.js +1 -0
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts +23 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +448 -0
- package/lib/exercises/math/geometry/angles/index.js +2 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts +23 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.js +402 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +9 -6
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +140 -60
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +121 -104
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +3 -2
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.js +1 -0
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts +0 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +65 -88
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts +9 -0
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +221 -0
- package/lib/exercises/math/probaStat/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +2 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +29 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +547 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts +9 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +89 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts +10 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +152 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts +7 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts.map +1 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.js +73 -0
- package/lib/exercises/pc/electricity/index.d.ts +1 -0
- package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/index.js +1 -0
- package/lib/exercises/pc/index.d.ts +1 -0
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +1 -0
- package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
- package/lib/exercises/pc/moleculeFormula.js +4 -3
- package/lib/exercises/pc/optics/index.d.ts +2 -0
- package/lib/exercises/pc/optics/index.d.ts.map +1 -0
- package/lib/exercises/pc/optics/index.js +1 -0
- package/lib/exercises/pc/optics/lensFormula.d.ts +21 -0
- package/lib/exercises/pc/optics/lensFormula.d.ts.map +1 -0
- package/lib/exercises/pc/optics/lensFormula.js +415 -0
- package/lib/exercises/pc/weight/calculateWeight.d.ts +8 -1
- package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
- package/lib/exercises/pc/weight/calculateWeight.js +113 -38
- package/lib/geogebra/parsers/geogebraParser.d.ts +4 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
- package/lib/geogebra/parsers/geogebraParser.js +17 -0
- package/lib/index.d.ts +351 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +1 -0
- package/lib/math/geometry/CloudPoints.d.ts +10 -0
- package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
- package/lib/math/geometry/CloudPoints.js +119 -0
- package/lib/math/geometry/line.d.ts +1 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +10 -2
- package/lib/math/geometry/vector.d.ts +1 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +12 -0
- package/lib/math/progCalc/progCalc.d.ts +46 -0
- package/lib/math/progCalc/progCalc.d.ts.map +1 -0
- package/lib/math/progCalc/progCalc.js +239 -0
- package/lib/math/utils/latex/realize.d.ts +12 -0
- package/lib/math/utils/latex/realize.d.ts.map +1 -0
- package/lib/math/utils/latex/realize.js +43 -0
- package/lib/pc/constants/molecularChemistry/molecule.d.ts +2 -0
- package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -1
- package/lib/pc/constants/molecularChemistry/molecule.js +52 -0
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +1 -1
- package/lib/tests/singleExo.test.js +3 -3
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts +4 -2
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +8 -17
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +5 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts +4 -2
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +8 -17
- package/lib/tree/nodes/operators/operatorNode.d.ts +3 -3
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/utilities/nodeShuffler.d.ts +12 -0
- package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -0
- package/lib/tree/utilities/nodeShuffler.js +123 -0
- package/lib/utils/arrays/getAllPicks.d.ts +2 -0
- package/lib/utils/arrays/getAllPicks.d.ts.map +1 -0
- package/lib/utils/arrays/getAllPicks.js +17 -0
- package/lib/utils/errors/handleVEAError.d.ts +1 -1
- package/lib/utils/errors/handleVEAError.d.ts.map +1 -1
- package/lib/utils/strings/decapitalize.d.ts +2 -0
- package/lib/utils/strings/decapitalize.d.ts.map +1 -0
- package/lib/utils/strings/decapitalize.js +3 -0
- package/package.json +1 -1
|
@@ -1,62 +1,18 @@
|
|
|
1
|
-
import { addValidProp, shuffleProps, tryToAddWrongProp, } from
|
|
2
|
-
import { getDistinctQuestions } from
|
|
3
|
-
import { randint } from
|
|
4
|
-
import { opposite } from
|
|
5
|
-
import { add } from
|
|
6
|
-
import { divide } from
|
|
7
|
-
import { frac } from
|
|
8
|
-
import { multiply } from
|
|
9
|
-
import { substract } from
|
|
10
|
-
import { parseAlgebraic } from
|
|
11
|
-
import { coinFlip } from
|
|
12
|
-
import { random } from
|
|
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 { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
|
|
5
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
6
|
+
import { divide } from "../../../../tree/nodes/operators/divideNode.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
13
|
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return ''; // Handle empty strings
|
|
17
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
18
|
-
};
|
|
19
|
-
const arr_operator = [
|
|
20
|
-
{ outputName: "Opposite", arity: 1 },
|
|
21
|
-
{ outputName: "Inverse", arity: 1 },
|
|
22
|
-
{ outputName: "Sum", arity: 2 },
|
|
23
|
-
{ outputName: "Difference", arity: 2 },
|
|
24
|
-
{ outputName: "Product", arity: 2 },
|
|
25
|
-
{ outputName: "Quotient", arity: 2 },
|
|
26
|
-
];
|
|
27
|
-
const getNodeFromOperation = (operation) => {
|
|
28
|
-
let outNode;
|
|
29
|
-
if (!("b" in operation.operands)) {
|
|
30
|
-
const { a } = operation.operands;
|
|
31
|
-
switch (operation.operator.outputName) {
|
|
32
|
-
case "Opposite":
|
|
33
|
-
outNode = opposite(a);
|
|
34
|
-
break;
|
|
35
|
-
case "Inverse":
|
|
36
|
-
outNode = frac(1, a);
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
const { a, b } = operation.operands;
|
|
42
|
-
switch (operation.operator.outputName) {
|
|
43
|
-
case "Sum":
|
|
44
|
-
outNode = add(a, b);
|
|
45
|
-
break;
|
|
46
|
-
case "Difference":
|
|
47
|
-
outNode = substract(a, b);
|
|
48
|
-
break;
|
|
49
|
-
case "Product":
|
|
50
|
-
outNode = multiply(a, b);
|
|
51
|
-
break;
|
|
52
|
-
case "Quotient":
|
|
53
|
-
outNode = frac(a, b);
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return outNode;
|
|
58
|
-
};
|
|
59
|
-
const dict_texFactor_to_frenchFactor = {
|
|
14
|
+
import { capitalize } from "../../../../utils/strings/capitalize.js";
|
|
15
|
+
const dictTexFactorToFrenchFactor = {
|
|
60
16
|
[frac(1, 2).toTex()]: "la moitié",
|
|
61
17
|
[frac(1, 3).toTex()]: "le tiers",
|
|
62
18
|
[frac(1, 4).toTex()]: "le quart",
|
|
@@ -69,253 +25,279 @@ const dict_texFactor_to_frenchFactor = {
|
|
|
69
25
|
[(4).frenchify()]: "le quadruple",
|
|
70
26
|
[(5).frenchify()]: "le quintuple",
|
|
71
27
|
};
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
case "
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
break;
|
|
28
|
+
const arrOperator = [
|
|
29
|
+
"opposite",
|
|
30
|
+
"inverse",
|
|
31
|
+
"add",
|
|
32
|
+
"subtract",
|
|
33
|
+
"multiply",
|
|
34
|
+
"divide",
|
|
35
|
+
];
|
|
36
|
+
class ExpressionConstructor {
|
|
37
|
+
static fromIdentifiers(identifiers) {
|
|
38
|
+
const { operatorName, a, b, isUsingFrenchFactorNouns } = identifiers;
|
|
39
|
+
switch (operatorName) {
|
|
40
|
+
case "opposite":
|
|
41
|
+
return {
|
|
42
|
+
node: opposite(a),
|
|
43
|
+
strFrench: `L'opposé de $ ${a} $`,
|
|
44
|
+
};
|
|
45
|
+
case "inverse":
|
|
46
|
+
return {
|
|
47
|
+
node: frac(1, a),
|
|
48
|
+
strFrench: `L'inverse de $ ${a} $`,
|
|
49
|
+
};
|
|
50
|
+
case "add":
|
|
51
|
+
return {
|
|
52
|
+
node: add(a, b),
|
|
53
|
+
strFrench: `La somme de $ ${a} $ et de $ ${b} $`,
|
|
54
|
+
};
|
|
55
|
+
case "subtract":
|
|
56
|
+
return {
|
|
57
|
+
node: substract(a, b),
|
|
58
|
+
strFrench: `La différence entre $ ${a} $ et $ ${b} $`,
|
|
59
|
+
};
|
|
60
|
+
case "multiply":
|
|
61
|
+
return {
|
|
62
|
+
node: multiply(a, b),
|
|
63
|
+
strFrench: typeof b === "string" && isUsingFrenchFactorNouns
|
|
64
|
+
? dictTexFactorToFrenchFactor[a.frenchify()]
|
|
65
|
+
? `${dictTexFactorToFrenchFactor[a.frenchify()]} de $ ${b} $`
|
|
66
|
+
: `Le produit de $ ${a} $ par $ ${b} $`
|
|
67
|
+
: `Le produit de $ ${a} $ par $ ${b} $`,
|
|
68
|
+
};
|
|
69
|
+
case "divide":
|
|
70
|
+
return {
|
|
71
|
+
node: frac(a, b),
|
|
72
|
+
strFrench: typeof a === "string" && isUsingFrenchFactorNouns
|
|
73
|
+
? dictTexFactorToFrenchFactor[frac(1, b).toTex()]
|
|
74
|
+
? `${dictTexFactorToFrenchFactor[frac(1, b).toTex()]} de $ ${a} $`
|
|
75
|
+
: `Le quotient de $ ${a} $ par $ ${b} $`
|
|
76
|
+
: `Le quotient de $ ${a} $ par $ ${b} $`,
|
|
77
|
+
};
|
|
124
78
|
}
|
|
125
79
|
}
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
const getPropositions = (n, { answer, operation, isUsingFrenchFactorNouns }) => {
|
|
80
|
+
}
|
|
81
|
+
const getPropositions = (n, { answer, operatorName, a, b }) => {
|
|
129
82
|
const propositions = [];
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
83
|
+
switch (operatorName) {
|
|
84
|
+
case "opposite":
|
|
85
|
+
addValidProp(propositions, answer);
|
|
86
|
+
tryToAddWrongProp(propositions, add(a, 1).toTex());
|
|
87
|
+
tryToAddWrongProp(propositions, frac(1, a).toTex());
|
|
88
|
+
tryToAddWrongProp(propositions, substract(1, a).toTex());
|
|
89
|
+
break;
|
|
90
|
+
case "inverse":
|
|
91
|
+
if (coinFlip()) {
|
|
134
92
|
addValidProp(propositions, answer);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
tryToAddWrongProp(propositions, add(a, 1).toTex());
|
|
147
|
-
tryToAddWrongProp(propositions, opposite(a).toTex());
|
|
148
|
-
tryToAddWrongProp(propositions, frac(0, a).toTex());
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
const { a, b } = operation.operands;
|
|
154
|
-
switch (operation.operator.outputName) {
|
|
155
|
-
case "Sum":
|
|
156
|
-
if (coinFlip()) {
|
|
157
|
-
addValidProp(propositions, answer);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
addValidProp(propositions, add(b, a).toTex());
|
|
161
|
-
}
|
|
162
|
-
tryToAddWrongProp(propositions, multiply(a, b).toTex());
|
|
163
|
-
tryToAddWrongProp(propositions, substract(a, b).toTex());
|
|
164
|
-
tryToAddWrongProp(propositions, frac(a, b).toTex());
|
|
165
|
-
break;
|
|
166
|
-
case "Difference":
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
addValidProp(propositions, divide(1, a).toTex());
|
|
96
|
+
}
|
|
97
|
+
tryToAddWrongProp(propositions, add(a, 1).toTex());
|
|
98
|
+
tryToAddWrongProp(propositions, opposite(a).toTex());
|
|
99
|
+
tryToAddWrongProp(propositions, frac(0, a).toTex());
|
|
100
|
+
break;
|
|
101
|
+
case "add":
|
|
102
|
+
if (coinFlip()) {
|
|
167
103
|
addValidProp(propositions, answer);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
addValidProp(propositions, add(b, a).toTex());
|
|
107
|
+
}
|
|
108
|
+
tryToAddWrongProp(propositions, multiply(a, b).toTex());
|
|
109
|
+
tryToAddWrongProp(propositions, substract(a, b).toTex());
|
|
110
|
+
tryToAddWrongProp(propositions, frac(a, b).toTex());
|
|
111
|
+
break;
|
|
112
|
+
case "subtract":
|
|
113
|
+
addValidProp(propositions, answer);
|
|
114
|
+
tryToAddWrongProp(propositions, substract(b, a).toTex());
|
|
115
|
+
tryToAddWrongProp(propositions, frac(a, b).toTex());
|
|
116
|
+
tryToAddWrongProp(propositions, frac(b, a).toTex());
|
|
117
|
+
break;
|
|
118
|
+
case "multiply":
|
|
119
|
+
if (coinFlip()) {
|
|
120
|
+
addValidProp(propositions, answer);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
addValidProp(propositions, multiply(b, a).toTex());
|
|
124
|
+
}
|
|
125
|
+
tryToAddWrongProp(propositions, frac(a, b).toTex());
|
|
126
|
+
tryToAddWrongProp(propositions, substract(a, b).toTex());
|
|
127
|
+
tryToAddWrongProp(propositions, add(a, b).toTex());
|
|
128
|
+
break;
|
|
129
|
+
case "divide":
|
|
130
|
+
if (coinFlip()) {
|
|
131
|
+
addValidProp(propositions, answer);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
addValidProp(propositions, divide(a, b).toTex());
|
|
135
|
+
}
|
|
136
|
+
tryToAddWrongProp(propositions, frac(b, a).toTex());
|
|
137
|
+
tryToAddWrongProp(propositions, substract(a, b).toTex());
|
|
138
|
+
tryToAddWrongProp(propositions, multiply(a, b).toTex());
|
|
139
|
+
break;
|
|
195
140
|
}
|
|
196
141
|
return shuffleProps(propositions, n);
|
|
197
142
|
};
|
|
198
143
|
const getAnswer = (identifiers) => {
|
|
199
|
-
const
|
|
200
|
-
const node = getNodeFromOperation(operation).simplify();
|
|
144
|
+
const node = ExpressionConstructor.fromIdentifiers(identifiers).node.simplify();
|
|
201
145
|
return node.toTex();
|
|
202
146
|
};
|
|
203
147
|
const getInstruction = (identifiers) => {
|
|
204
|
-
const statementString =
|
|
148
|
+
const statementString = ExpressionConstructor.fromIdentifiers(identifiers).strFrench;
|
|
205
149
|
return `Écrire l'expression littérale pour :
|
|
206
150
|
|
|
207
151
|
${statementString}
|
|
208
152
|
`;
|
|
209
153
|
};
|
|
210
154
|
const getHint = (identifiers) => {
|
|
211
|
-
const {
|
|
212
|
-
switch (
|
|
213
|
-
case "
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return `
|
|
219
|
-
case "
|
|
220
|
-
return `La
|
|
221
|
-
case "
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
155
|
+
const { operatorName } = identifiers;
|
|
156
|
+
switch (operatorName) {
|
|
157
|
+
case "opposite":
|
|
158
|
+
return `La somme d'un nombre et de son opposé donne $0$.`;
|
|
159
|
+
case "inverse":
|
|
160
|
+
return `L'inverse de $8$ est $0,25$.`;
|
|
161
|
+
case "add":
|
|
162
|
+
return `La somme de $8$ et de $6$ est $14$.`;
|
|
163
|
+
case "subtract":
|
|
164
|
+
return `La différence entre $8$ et $6$ est $2$.`;
|
|
165
|
+
case "multiply": {
|
|
166
|
+
const statementString = ExpressionConstructor.fromIdentifiers(identifiers).strFrench;
|
|
167
|
+
if (!statementString.includes("produit")) {
|
|
168
|
+
const bHint = randint(2, 10, typeof identifiers.b === "number" ? [identifiers.b] : []);
|
|
169
|
+
const exprHint1 = ExpressionConstructor.fromIdentifiers(Object.assign({}, identifiers, {
|
|
170
|
+
b: "" + bHint,
|
|
171
|
+
}));
|
|
172
|
+
const exprHint2 = ExpressionConstructor.fromIdentifiers(Object.assign({}, identifiers, {
|
|
173
|
+
b: bHint,
|
|
174
|
+
}));
|
|
175
|
+
return `${capitalize(exprHint1.strFrench)} est $${exprHint2.node
|
|
176
|
+
.simplify()
|
|
177
|
+
.toTex()}$.`;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
return `Le produit de $8$ par $6$ est $48$.`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
case "divide": {
|
|
184
|
+
const statementString = ExpressionConstructor.fromIdentifiers(identifiers).strFrench;
|
|
185
|
+
if (!statementString.includes("quotient")) {
|
|
186
|
+
const aHint = randint(2, 10, typeof identifiers.a === "number" ? [identifiers.a] : []);
|
|
187
|
+
const exprHint1 = ExpressionConstructor.fromIdentifiers(Object.assign({}, identifiers, {
|
|
188
|
+
a: "" + aHint,
|
|
189
|
+
}));
|
|
190
|
+
const exprHint2 = ExpressionConstructor.fromIdentifiers(Object.assign({}, identifiers, {
|
|
191
|
+
a: aHint,
|
|
192
|
+
}));
|
|
193
|
+
return `${capitalize(exprHint1.strFrench)} est $${exprHint2.node.toTex()}$.`;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
return `Le quotient de $200$ par $8$ est $25$.`;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
227
199
|
}
|
|
228
200
|
};
|
|
229
201
|
const getCorrection = (identifiers) => {
|
|
230
|
-
const
|
|
231
|
-
|
|
202
|
+
const { a, operatorName, b } = identifiers;
|
|
203
|
+
const expression = ExpressionConstructor.fromIdentifiers(identifiers);
|
|
204
|
+
const statementString = expression.strFrench;
|
|
232
205
|
//explain rewriting if needed
|
|
233
|
-
const
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
206
|
+
const nodeRaw = expression.node;
|
|
207
|
+
const nodeRefined = nodeRaw.simplify();
|
|
208
|
+
let texRaw;
|
|
209
|
+
switch (operatorName) {
|
|
210
|
+
case "add":
|
|
211
|
+
{
|
|
212
|
+
const [texA, texB] = [a, b].map((c) => parseAlgebraic("" + c).toTex());
|
|
213
|
+
const isWrapWithParenthesis = ("" + b).startsWith("-");
|
|
214
|
+
texRaw = `${texA}+${isWrapWithParenthesis ? `(${texB})` : `${texB}`}`;
|
|
215
|
+
}
|
|
216
|
+
break;
|
|
217
|
+
default:
|
|
218
|
+
{
|
|
219
|
+
texRaw = nodeRaw.toTex({
|
|
220
|
+
allowDoubleMinus: true,
|
|
221
|
+
forceTimesSign: true,
|
|
222
|
+
forceParenthesis: true,
|
|
223
|
+
forceNoSimplification: true,
|
|
224
|
+
allowMinusAnywhereInFraction: true,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
const texRefined = nodeRefined.toTex();
|
|
230
|
+
let outString = `${capitalize(statementString)} est $ ${texRefined} $.`;
|
|
231
|
+
if (texRaw !== texRefined) {
|
|
245
232
|
outString += `
|
|
246
233
|
|
|
247
234
|
En effet,
|
|
235
|
+
|
|
248
236
|
$$
|
|
249
|
-
${
|
|
237
|
+
${texRaw}
|
|
250
238
|
$$
|
|
239
|
+
|
|
251
240
|
peut se réécrire :
|
|
241
|
+
|
|
252
242
|
$$
|
|
253
|
-
${
|
|
243
|
+
${texRefined}
|
|
254
244
|
$$
|
|
255
245
|
`;
|
|
256
246
|
}
|
|
257
247
|
return outString;
|
|
258
248
|
};
|
|
259
249
|
const getKeys = (identifiers) => {
|
|
260
|
-
const {
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
263
|
-
|
|
250
|
+
const { a, b } = identifiers;
|
|
251
|
+
const operands = [a];
|
|
252
|
+
if (b) {
|
|
253
|
+
operands.push(b);
|
|
264
254
|
}
|
|
265
|
-
return
|
|
255
|
+
return operands
|
|
256
|
+
.filter((elt) => typeof elt === "string")
|
|
257
|
+
.map((elt) => elt);
|
|
266
258
|
};
|
|
267
259
|
const isAnswerValid = (ans, { answer }) => {
|
|
268
260
|
//return LitExpVEA(ans, answer);
|
|
269
261
|
try {
|
|
270
262
|
const parsed = parseAlgebraic(ans);
|
|
271
|
-
return (
|
|
272
|
-
.simplify()
|
|
273
|
-
.toTex() === answer);
|
|
263
|
+
return parsed.simplify().toTex() === answer;
|
|
274
264
|
}
|
|
275
265
|
catch (err) {
|
|
276
266
|
return handleVEAError(err);
|
|
277
267
|
}
|
|
278
268
|
};
|
|
279
|
-
const getWriteLitExprFromFrenchQuestion = (
|
|
280
|
-
const
|
|
269
|
+
const getWriteLitExprFromFrenchQuestion = () => {
|
|
270
|
+
const operatorName = random(arrOperator);
|
|
281
271
|
const isUsingFrenchFactorNouns = coinFlip();
|
|
282
|
-
const
|
|
272
|
+
const strVar = random(["x", "y", "z", "t"]);
|
|
283
273
|
let a = "";
|
|
284
274
|
let b = undefined;
|
|
285
275
|
if (coinFlip()) {
|
|
286
|
-
a =
|
|
287
|
-
if (
|
|
288
|
-
const
|
|
289
|
-
b = random(
|
|
276
|
+
a = strVar;
|
|
277
|
+
if (operatorName === "divide" && isUsingFrenchFactorNouns) {
|
|
278
|
+
const arrFr = [2, 3, 4, 5, 10, 100, 1_000];
|
|
279
|
+
b = random(arrFr);
|
|
290
280
|
}
|
|
291
281
|
else {
|
|
292
282
|
b = randint(-10, 11, [-1, 0, 1]);
|
|
293
283
|
}
|
|
294
284
|
}
|
|
295
285
|
else {
|
|
296
|
-
b =
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
a = random(
|
|
286
|
+
b = strVar;
|
|
287
|
+
if (operatorName === "multiply" && isUsingFrenchFactorNouns) {
|
|
288
|
+
const arrFr = [2, 3, 4, 5];
|
|
289
|
+
a = random(arrFr);
|
|
300
290
|
}
|
|
301
291
|
else {
|
|
302
292
|
a = randint(-10, 11, [-1, 0, 1]);
|
|
303
293
|
}
|
|
304
294
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
case 2:
|
|
311
|
-
operands = { a, b };
|
|
312
|
-
break;
|
|
313
|
-
}
|
|
314
|
-
const operation = {
|
|
315
|
-
operator: operator,
|
|
316
|
-
operands: operands,
|
|
295
|
+
const identifiers = {
|
|
296
|
+
operatorName,
|
|
297
|
+
a,
|
|
298
|
+
b,
|
|
299
|
+
isUsingFrenchFactorNouns,
|
|
317
300
|
};
|
|
318
|
-
const identifiers = { operation, isUsingFrenchFactorNouns };
|
|
319
301
|
return getQuestionFromIdentifiers(identifiers);
|
|
320
302
|
};
|
|
321
303
|
const getQuestionFromIdentifiers = (identifiers) => {
|
|
@@ -323,15 +305,15 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
323
305
|
answer: getAnswer(identifiers),
|
|
324
306
|
instruction: getInstruction(identifiers),
|
|
325
307
|
keys: getKeys(identifiers),
|
|
326
|
-
answerFormat:
|
|
308
|
+
answerFormat: "tex",
|
|
327
309
|
identifiers,
|
|
328
310
|
hint: getHint(identifiers),
|
|
329
|
-
correction: getCorrection(identifiers)
|
|
311
|
+
correction: getCorrection(identifiers),
|
|
330
312
|
};
|
|
331
313
|
};
|
|
332
314
|
export const writeLitExprFromFrench = {
|
|
333
|
-
id:
|
|
334
|
-
label: "
|
|
315
|
+
id: "writeLitExprFromFrench",
|
|
316
|
+
label: "Écrire une expression littérale à partir d'une expression en français",
|
|
335
317
|
isSingleStep: true,
|
|
336
318
|
generator: (nb, opts) => getDistinctQuestions(() => getWriteLitExprFromFrenchQuestion(opts), nb),
|
|
337
319
|
qcmTimer: 60,
|
|
@@ -344,5 +326,6 @@ export const writeLitExprFromFrench = {
|
|
|
344
326
|
getCorrection,
|
|
345
327
|
getAnswer,
|
|
346
328
|
getQuestionFromIdentifiers,
|
|
347
|
-
hasHintAndCorrection: true
|
|
329
|
+
hasHintAndCorrection: true,
|
|
330
|
+
answerType: "QCU",
|
|
348
331
|
};
|
|
@@ -6,4 +6,8 @@ export * from "./volumeCapacityConversion.js";
|
|
|
6
6
|
export * from "./volumeConversion.js";
|
|
7
7
|
export * from "./hoursToDecimal.js";
|
|
8
8
|
export * from "./hoursToSecond.js";
|
|
9
|
+
export * from "./minutesToHours.js";
|
|
10
|
+
export * from "./kmPerMinToKmPerHourConversion.js";
|
|
11
|
+
export * from "./secondsToHours.js";
|
|
12
|
+
export * from "./prefixToNumber.js";
|
|
9
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
|
|
@@ -6,3 +6,7 @@ export * from "./volumeCapacityConversion.js";
|
|
|
6
6
|
export * from "./volumeConversion.js";
|
|
7
7
|
export * from "./hoursToDecimal.js";
|
|
8
8
|
export * from "./hoursToSecond.js";
|
|
9
|
+
export * from "./minutesToHours.js";
|
|
10
|
+
export * from "./kmPerMinToKmPerHourConversion.js";
|
|
11
|
+
export * from "./secondsToHours.js";
|
|
12
|
+
export * from "./prefixToNumber.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
distance: number;
|
|
4
|
+
minutes: number;
|
|
5
|
+
};
|
|
6
|
+
type Options = {
|
|
7
|
+
unitTex: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const kmPerMinToKmPerHourConversion: Exercise<Identifiers, Options>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=kmPerMinToKmPerHourConversion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kmPerMinToKmPerHourConversion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/conversion/kmPerMinToKmPerHourConversion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA2IF,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAgBF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqBxE,CAAC"}
|