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
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
|
|
4
|
+
import { AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
7
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
8
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
9
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
10
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
11
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
12
|
+
const primordialRightsAndWrongs = {
|
|
13
|
+
rights: [`une droite`],
|
|
14
|
+
wrongs: [
|
|
15
|
+
`une parabole`,
|
|
16
|
+
`un demi-cercle`,
|
|
17
|
+
`une succession de deux segments`,
|
|
18
|
+
`un cercle`,
|
|
19
|
+
`une ellipse`,
|
|
20
|
+
`une fonction affine`,
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
const createRightsAndWrongs = (validSuffixObj, invalidSuffixObjs) => {
|
|
24
|
+
return {
|
|
25
|
+
rights: primordialRightsAndWrongs.rights.map((rightStr) => (pointName) => {
|
|
26
|
+
const point = validSuffixObj.nodeX &&
|
|
27
|
+
validSuffixObj.nodeY &&
|
|
28
|
+
new Point(pointName, validSuffixObj.nodeX, validSuffixObj.nodeY);
|
|
29
|
+
return {
|
|
30
|
+
str: validSuffixObj.suffixFunc(rightStr, pointName),
|
|
31
|
+
point,
|
|
32
|
+
isPointValid: point ? true : undefined,
|
|
33
|
+
};
|
|
34
|
+
}),
|
|
35
|
+
wrongs: [
|
|
36
|
+
...primordialRightsAndWrongs.wrongs.map((wrongStr) => (pointName) => {
|
|
37
|
+
const point = validSuffixObj.nodeX &&
|
|
38
|
+
validSuffixObj.nodeY &&
|
|
39
|
+
new Point(pointName, validSuffixObj.nodeX, validSuffixObj.nodeY);
|
|
40
|
+
return {
|
|
41
|
+
str: validSuffixObj.suffixFunc(wrongStr, pointName),
|
|
42
|
+
point,
|
|
43
|
+
isPointValid: point ? true : undefined,
|
|
44
|
+
};
|
|
45
|
+
}),
|
|
46
|
+
...invalidSuffixObjs.flatMap((invalidSuffixObj) => primordialRightsAndWrongs.rights.map((rightStr) => (pointName) => {
|
|
47
|
+
const point = invalidSuffixObj.nodeX &&
|
|
48
|
+
invalidSuffixObj.nodeY &&
|
|
49
|
+
new Point(pointName, invalidSuffixObj.nodeX, invalidSuffixObj.nodeY);
|
|
50
|
+
return {
|
|
51
|
+
str: invalidSuffixObj.suffixFunc(rightStr, pointName),
|
|
52
|
+
point,
|
|
53
|
+
isPointValid: point ? false : undefined,
|
|
54
|
+
};
|
|
55
|
+
})),
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const nodeBySubstitutingX = (node, strVar) => {
|
|
60
|
+
return parseAlgebraic(node.toTex().replaceAll("x", `({${strVar}})`));
|
|
61
|
+
};
|
|
62
|
+
const calculateWithNode = (f, nodeX) => {
|
|
63
|
+
return nodeBySubstitutingX(f.toTree(), nodeX.toTex()).simplify();
|
|
64
|
+
};
|
|
65
|
+
const createArrayOfRightsAndWrongs = (f) => {
|
|
66
|
+
function createRightAndWrongsCoords(f, nodeX) {
|
|
67
|
+
const nodeYR = calculateWithNode(f, nodeX);
|
|
68
|
+
const nodeYWs = [
|
|
69
|
+
f.a.toTree(),
|
|
70
|
+
f.b.toTree(),
|
|
71
|
+
add(f.a, f.b),
|
|
72
|
+
substract(f.a, f.b),
|
|
73
|
+
].filter((yW) => substract(yW, nodeYR).evaluate() !== 0);
|
|
74
|
+
return {
|
|
75
|
+
right: [nodeX, nodeYR],
|
|
76
|
+
wrongs: nodeYWs.map((nodeYW) => [nodeX, nodeYW]),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const coordObjects = [-1, 0, 1]
|
|
80
|
+
.map((x) => x.toTree())
|
|
81
|
+
.map((nodeX) => createRightAndWrongsCoords(f, nodeX));
|
|
82
|
+
const strFunc = (str, pointName, nodeX, nodeY) => `${str} qui passe par $${pointName}(${nodeX.simplify().toTex()};${nodeY
|
|
83
|
+
.simplify()
|
|
84
|
+
.toTex()})$`;
|
|
85
|
+
return [
|
|
86
|
+
createRightsAndWrongs({
|
|
87
|
+
suffixFunc: (str) => `${str}`,
|
|
88
|
+
}, []),
|
|
89
|
+
...coordObjects.flatMap((coordObject) => createRightsAndWrongs({
|
|
90
|
+
suffixFunc: (str, pointName) => strFunc(str, pointName, coordObject.right[0], coordObject.right[1]),
|
|
91
|
+
nodeX: coordObject.right[0],
|
|
92
|
+
nodeY: coordObject.right[1],
|
|
93
|
+
}, coordObject.wrongs.map(([nodeX, nodeY]) => {
|
|
94
|
+
return {
|
|
95
|
+
suffixFunc: (str, pointName) => strFunc(str, pointName, nodeX, nodeY),
|
|
96
|
+
nodeX,
|
|
97
|
+
nodeY,
|
|
98
|
+
};
|
|
99
|
+
}))),
|
|
100
|
+
];
|
|
101
|
+
};
|
|
102
|
+
const getInstruction = (identifiers) => {
|
|
103
|
+
const { fName, coeffs } = identifiers;
|
|
104
|
+
const affine = AffineConstructor.fromCoeffs(coeffs);
|
|
105
|
+
return `La représentation graphique de
|
|
106
|
+
|
|
107
|
+
$$
|
|
108
|
+
${fName}(x)=${affine.toTex()}
|
|
109
|
+
$$
|
|
110
|
+
|
|
111
|
+
est :`;
|
|
112
|
+
};
|
|
113
|
+
const getHint = () => {
|
|
114
|
+
return `Les fonctions affines et linéaires sont représentées par des droites.`;
|
|
115
|
+
};
|
|
116
|
+
const getCorrection = (identifiers) => {
|
|
117
|
+
const { fName, items, coeffs } = identifiers;
|
|
118
|
+
const affine = AffineConstructor.fromCoeffs(coeffs);
|
|
119
|
+
const abstractFName = ["f", "g", "h"].find((letter) => letter !== fName);
|
|
120
|
+
return `Une fonction affine $${abstractFName}$ est de la forme
|
|
121
|
+
|
|
122
|
+
$$
|
|
123
|
+
${abstractFName}(x)=mx+p
|
|
124
|
+
$$
|
|
125
|
+
|
|
126
|
+
Sa représentation graphique est une droite.
|
|
127
|
+
|
|
128
|
+
$\\ $
|
|
129
|
+
|
|
130
|
+
${items
|
|
131
|
+
.filter((item) => item.isValid && item.point && item.isPointValid)
|
|
132
|
+
.map((item) => {
|
|
133
|
+
const point = PointConstructor.fromIdentifiers(item.point);
|
|
134
|
+
const applyNode = nodeBySubstitutingX(affine.toTree(), point.x.toTex());
|
|
135
|
+
const texRaw = applyNode.toTex();
|
|
136
|
+
const texSimplified = applyNode.simplify().toTex();
|
|
137
|
+
return `On a :
|
|
138
|
+
|
|
139
|
+
$$
|
|
140
|
+
${fName}(${point.x.toTex()}) = ${texRaw} = ${texSimplified}
|
|
141
|
+
$$
|
|
142
|
+
|
|
143
|
+
Donc elle passe par le point $${point.name}(${point.x.toTex()},${point.y.toTex()})$.`;
|
|
144
|
+
}).join(`
|
|
145
|
+
|
|
146
|
+
$\\ $
|
|
147
|
+
|
|
148
|
+
`)}
|
|
149
|
+
|
|
150
|
+
$\\ $
|
|
151
|
+
|
|
152
|
+
${items
|
|
153
|
+
.filter((item) => !item.isValid && item.point && !item.isPointValid)
|
|
154
|
+
.map((item) => {
|
|
155
|
+
const point = PointConstructor.fromIdentifiers(item.point);
|
|
156
|
+
const applyNode = nodeBySubstitutingX(affine.toTree(), point.x.toTex());
|
|
157
|
+
const texRaw = applyNode.toTex();
|
|
158
|
+
const texSimplified = applyNode.simplify().toTex();
|
|
159
|
+
return `On a :
|
|
160
|
+
|
|
161
|
+
$$
|
|
162
|
+
${fName}(${point.x.toTex()}) = ${texRaw} = ${texSimplified} \\neq ${point.y.toTex()}
|
|
163
|
+
$$
|
|
164
|
+
|
|
165
|
+
Donc le point $${point.name}(${point.x.toTex()},${point.y.toTex()})$ n'appartient pas à la droite représentant $${fName}$.`;
|
|
166
|
+
}).join(`
|
|
167
|
+
|
|
168
|
+
$\\ $
|
|
169
|
+
|
|
170
|
+
`)}`;
|
|
171
|
+
};
|
|
172
|
+
const getPropositions = (_, { answer, ...idenfitiers }) => {
|
|
173
|
+
const { items } = idenfitiers;
|
|
174
|
+
const propositions = [];
|
|
175
|
+
//keep same order on each question
|
|
176
|
+
items.forEach((item) => {
|
|
177
|
+
if (item.isValid) {
|
|
178
|
+
addValidProp(propositions, item.tex, "raw");
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
tryToAddWrongProp(propositions, item.tex, "raw");
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
return propositions;
|
|
185
|
+
};
|
|
186
|
+
const getRepresentationOfAffineQuestion = () => {
|
|
187
|
+
const fName = random(["f", "g", "h"]);
|
|
188
|
+
const coeffs = [0, 1].map(() => randint(-10, 10, [0]));
|
|
189
|
+
const f = AffineConstructor.fromCoeffs(coeffs);
|
|
190
|
+
const nbPropositions = 4;
|
|
191
|
+
const nbValid = randint(1, nbPropositions);
|
|
192
|
+
const nbInvalid = nbPropositions - nbValid;
|
|
193
|
+
const arrayOfIsValid = shuffle([
|
|
194
|
+
...[...Array(nbValid).keys()].map(() => true),
|
|
195
|
+
...[...Array(nbInvalid).keys()].map(() => false),
|
|
196
|
+
]);
|
|
197
|
+
const pointNames = ["A", "B", "C", "D"];
|
|
198
|
+
const rightsAndWrongs = createArrayOfRightsAndWrongs(f);
|
|
199
|
+
const allIndexes = [...Array(rightsAndWrongs.length).keys()];
|
|
200
|
+
function getRightTexFunc(previouslyPickedIndexes) {
|
|
201
|
+
const index = random(allIndexes.filter((index) => !previouslyPickedIndexes.includes(index)));
|
|
202
|
+
if (rightsAndWrongs[index].rights.length > 0) {
|
|
203
|
+
return {
|
|
204
|
+
objFunc: random(rightsAndWrongs[index].rights),
|
|
205
|
+
index,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
return undefined;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function getWrongTexFunc(previouslyPickedIndexes) {
|
|
213
|
+
const indexArray = previouslyPickedIndexes.length > 0
|
|
214
|
+
? coinFlip()
|
|
215
|
+
? previouslyPickedIndexes
|
|
216
|
+
: allIndexes
|
|
217
|
+
: allIndexes;
|
|
218
|
+
const index = random(indexArray);
|
|
219
|
+
if (rightsAndWrongs[index].wrongs.length > 0) {
|
|
220
|
+
return {
|
|
221
|
+
objFunc: random(rightsAndWrongs[index].wrongs),
|
|
222
|
+
index,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
const previouslyPickedIndexes = [];
|
|
230
|
+
const items = shuffle(arrayOfIsValid.map((isValid, i) => {
|
|
231
|
+
const pointName = pointNames[i];
|
|
232
|
+
let pick;
|
|
233
|
+
do {
|
|
234
|
+
pick = isValid
|
|
235
|
+
? getRightTexFunc(previouslyPickedIndexes)
|
|
236
|
+
: getWrongTexFunc(previouslyPickedIndexes);
|
|
237
|
+
} while (!pick);
|
|
238
|
+
const obj = pick.objFunc(pointName);
|
|
239
|
+
previouslyPickedIndexes.push(pick.index);
|
|
240
|
+
const item = {
|
|
241
|
+
tex: obj.str,
|
|
242
|
+
isValid,
|
|
243
|
+
point: obj.point?.toIdentifiers(),
|
|
244
|
+
isPointValid: obj.isPointValid,
|
|
245
|
+
};
|
|
246
|
+
return item;
|
|
247
|
+
}));
|
|
248
|
+
const identifiers = { fName, coeffs, items };
|
|
249
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
250
|
+
};
|
|
251
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
252
|
+
const question = {
|
|
253
|
+
instruction: getInstruction(identifiers),
|
|
254
|
+
keys: [],
|
|
255
|
+
answerFormat: "tex",
|
|
256
|
+
identifiers,
|
|
257
|
+
hint: getHint(identifiers),
|
|
258
|
+
correction: getCorrection(identifiers),
|
|
259
|
+
};
|
|
260
|
+
return question;
|
|
261
|
+
};
|
|
262
|
+
export const representationOfAffine = {
|
|
263
|
+
id: "representationOfAffine",
|
|
264
|
+
label: "Savoir que la représentation graphique d'une fonction affine est une droite",
|
|
265
|
+
isSingleStep: true,
|
|
266
|
+
generator: (nb) => getDistinctQuestions(getRepresentationOfAffineQuestion, nb),
|
|
267
|
+
qcmTimer: 60,
|
|
268
|
+
freeTimer: 60,
|
|
269
|
+
getPropositions,
|
|
270
|
+
subject: "Mathématiques",
|
|
271
|
+
getQuestionFromIdentifiers,
|
|
272
|
+
hasHintAndCorrection: true,
|
|
273
|
+
answerType: "QCM",
|
|
274
|
+
isQCM: true,
|
|
275
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type QuestionFuncType = "...x^2" | "...x^3" | "(x-...)(x-...)" | "(x+...)(x-...)" | "(x+...)(x+...)" | "a/(x+...)" | "(x+...)/(x+...)";
|
|
4
|
+
type QuestionFunc = {
|
|
5
|
+
type: QuestionFuncType;
|
|
6
|
+
nodeIds: NodeIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
type Identifiers = {
|
|
9
|
+
questionFunc: QuestionFunc;
|
|
10
|
+
xValue: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const coordsOfPointOnCurveFindY: Exercise<Identifiers>;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=coordsOfPointOnCurveFindY.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordsOfPointOnCurveFindY.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/coordsOfPointOnCurveFindY.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAe7C,KAAK,gBAAgB,GACjB,QAAQ,GACR,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,WAAW,GACX,iBAAiB,CAAC;AAEtB,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA0SF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAe3D,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Point } from "../../../../math/geometry/point.js";
|
|
4
|
+
import { Polynomial } from "../../../../math/polynomials/polynomial.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
7
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
8
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
9
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
10
|
+
import { isOperatorNode, OperatorIds, } from "../../../../tree/nodes/operators/operatorNode.js";
|
|
11
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
12
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
13
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
14
|
+
import { pointParser } from "../../../../tree/parsers/pointParser.js";
|
|
15
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
16
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
17
|
+
const nodeByReplacingOperations = (node, replacementDict) => {
|
|
18
|
+
if (isOperatorNode(node)) {
|
|
19
|
+
const leftChild = nodeByReplacingOperations(node.leftChild, replacementDict);
|
|
20
|
+
const rightChild = nodeByReplacingOperations(node.rightChild, replacementDict);
|
|
21
|
+
const targetOperatorId = replacementDict[+node.id] ?? node.id;
|
|
22
|
+
switch (+targetOperatorId) {
|
|
23
|
+
case OperatorIds.add:
|
|
24
|
+
return add(leftChild, rightChild);
|
|
25
|
+
case OperatorIds.substract:
|
|
26
|
+
return substract(leftChild, rightChild);
|
|
27
|
+
case OperatorIds.multiply:
|
|
28
|
+
return multiply(leftChild, rightChild);
|
|
29
|
+
case OperatorIds.divide:
|
|
30
|
+
return frac(leftChild, rightChild);
|
|
31
|
+
case OperatorIds.power:
|
|
32
|
+
return power(leftChild, rightChild);
|
|
33
|
+
default:
|
|
34
|
+
return add(leftChild, rightChild);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return node;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const nodeBySubstitutingX = (node, strVar) => {
|
|
42
|
+
return parseAlgebraic(node.toTex().replaceAll("x", `"${strVar}"`));
|
|
43
|
+
};
|
|
44
|
+
const getInstruction = (identifiers) => {
|
|
45
|
+
const { xValue, questionFunc } = identifiers;
|
|
46
|
+
const node = NodeConstructor.fromIdentifiers(questionFunc.nodeIds);
|
|
47
|
+
return `Le point $M$ d'abscisse $${xValue}$ appartient à la courbe d'équation
|
|
48
|
+
|
|
49
|
+
$$
|
|
50
|
+
y=${node.toTex()}
|
|
51
|
+
$$
|
|
52
|
+
|
|
53
|
+
Quelles sont les coordonnées de $M$ ?`;
|
|
54
|
+
};
|
|
55
|
+
const getAnswerPoint = (identifiers) => {
|
|
56
|
+
const { xValue, questionFunc } = identifiers;
|
|
57
|
+
const node = NodeConstructor.fromIdentifiers(questionFunc.nodeIds);
|
|
58
|
+
const nodeWithXValue = nodeBySubstitutingX(node, `(${xValue})`);
|
|
59
|
+
return new Point("A", xValue.toTree(), nodeWithXValue.simplify({ calculatePowers: true }));
|
|
60
|
+
};
|
|
61
|
+
const getAnswer = (identifiers) => {
|
|
62
|
+
const answerPoint = getAnswerPoint(identifiers);
|
|
63
|
+
const answer = `(${answerPoint.x.toTex()};${answerPoint.y.toTex()})`;
|
|
64
|
+
return answer;
|
|
65
|
+
};
|
|
66
|
+
const getHint = (identifiers) => {
|
|
67
|
+
const { xValue, questionFunc } = identifiers;
|
|
68
|
+
const node = NodeConstructor.fromIdentifiers(questionFunc.nodeIds);
|
|
69
|
+
const texWithXM = node.toTex().replaceAll("x", "x_M");
|
|
70
|
+
const nodeWithXValue = nodeBySubstitutingX(node, `(${xValue})`);
|
|
71
|
+
return `Les coordonnées $(x_M;y_M)$ de $M$ vérifient:
|
|
72
|
+
|
|
73
|
+
$$
|
|
74
|
+
${texWithXM} = y_M
|
|
75
|
+
$$
|
|
76
|
+
|
|
77
|
+
On doit calculer :
|
|
78
|
+
|
|
79
|
+
$$
|
|
80
|
+
y_M = ${nodeWithXValue.toTex()}
|
|
81
|
+
$$`;
|
|
82
|
+
};
|
|
83
|
+
const getCorrection = (identifiers) => {
|
|
84
|
+
const { xValue, questionFunc } = identifiers;
|
|
85
|
+
const node = NodeConstructor.fromIdentifiers(questionFunc.nodeIds);
|
|
86
|
+
const texWithXM = node.toTex().replaceAll("x", "x_M");
|
|
87
|
+
const nodeWithXValue = nodeBySubstitutingX(node, `(${xValue})`);
|
|
88
|
+
const answer = getAnswer(identifiers);
|
|
89
|
+
return `Les coordonnées $(x_M;y_M)$ de $M$ vérifient:
|
|
90
|
+
|
|
91
|
+
$$
|
|
92
|
+
${texWithXM} = y_M
|
|
93
|
+
$$
|
|
94
|
+
|
|
95
|
+
On calcule :
|
|
96
|
+
|
|
97
|
+
$$
|
|
98
|
+
y_M = ${nodeWithXValue.toTex()}
|
|
99
|
+
$$
|
|
100
|
+
|
|
101
|
+
$$
|
|
102
|
+
y_M = ${answer.slice(1, -1).split(";")[1]}
|
|
103
|
+
$$
|
|
104
|
+
|
|
105
|
+
Les coordonnées de $M$ sont donc $${answer}$.`;
|
|
106
|
+
};
|
|
107
|
+
const getPropositions = (n, { answer, questionFunc, xValue }) => {
|
|
108
|
+
const node = NodeConstructor.fromIdentifiers(questionFunc.nodeIds);
|
|
109
|
+
const propositions = [];
|
|
110
|
+
addValidProp(propositions, answer);
|
|
111
|
+
//power becomes multiply
|
|
112
|
+
tryToAddWrongProp(propositions, `(${xValue.frenchify()};${nodeBySubstitutingX(nodeByReplacingOperations(node, {
|
|
113
|
+
[OperatorIds.power]: OperatorIds.multiply,
|
|
114
|
+
}), `(${xValue})`)
|
|
115
|
+
.simplify({ calculatePowers: true })
|
|
116
|
+
.toTex()})`);
|
|
117
|
+
//sign mistake
|
|
118
|
+
tryToAddWrongProp(propositions, `(${xValue.frenchify()};${nodeBySubstitutingX(nodeByReplacingOperations(node, {
|
|
119
|
+
[OperatorIds.add]: OperatorIds.substract,
|
|
120
|
+
[OperatorIds.substract]: coinFlip()
|
|
121
|
+
? OperatorIds.add
|
|
122
|
+
: OperatorIds.substract,
|
|
123
|
+
}), `(${xValue})`)
|
|
124
|
+
.simplify({ calculatePowers: true })
|
|
125
|
+
.toTex()})`);
|
|
126
|
+
//multiply becomes add
|
|
127
|
+
tryToAddWrongProp(propositions, `(${xValue.frenchify()};${nodeBySubstitutingX(nodeByReplacingOperations(node, {
|
|
128
|
+
[OperatorIds.multiply]: OperatorIds.add,
|
|
129
|
+
}), `(${xValue})`)
|
|
130
|
+
.simplify({ calculatePowers: true })
|
|
131
|
+
.toTex()})`);
|
|
132
|
+
//let's try 0
|
|
133
|
+
tryToAddWrongProp(propositions, `(${xValue.frenchify()};0)`);
|
|
134
|
+
//(x,y) becomes (y,x)
|
|
135
|
+
if (propositions.length < n) {
|
|
136
|
+
const [x, y] = answer.slice(1, -1).split(";");
|
|
137
|
+
tryToAddWrongProp(propositions, `(${y};${x})`);
|
|
138
|
+
}
|
|
139
|
+
while (propositions.length < n) {
|
|
140
|
+
tryToAddWrongProp(propositions, `(${xValue.frenchify()};${randint(-50, 50, [0])})`);
|
|
141
|
+
tryToAddWrongProp(propositions, `(${randint(-50, 50, [0])};${xValue.frenchify()})`);
|
|
142
|
+
}
|
|
143
|
+
return shuffleProps(propositions, n);
|
|
144
|
+
};
|
|
145
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
146
|
+
const pointAns = pointParser(ans);
|
|
147
|
+
if (!pointAns)
|
|
148
|
+
return false;
|
|
149
|
+
const pointAnswer = getAnswerPoint(identifiers);
|
|
150
|
+
return [
|
|
151
|
+
[pointAns.x, pointAnswer.x],
|
|
152
|
+
[pointAns.y, pointAnswer.y],
|
|
153
|
+
].every(([ansNode, answerNode]) => substract(ansNode, answerNode).simplify().evaluate() === 0);
|
|
154
|
+
};
|
|
155
|
+
const getCoordsOfPointOnAffineFindYQuestion = () => {
|
|
156
|
+
const xValue = randint(-9, 10);
|
|
157
|
+
const questionFunc = random([
|
|
158
|
+
{
|
|
159
|
+
type: "...x^2",
|
|
160
|
+
nodeIds: new Polynomial([
|
|
161
|
+
randint(-9, 10),
|
|
162
|
+
randint(-5, 6),
|
|
163
|
+
randint(-2, 3, [0]),
|
|
164
|
+
])
|
|
165
|
+
.toTree()
|
|
166
|
+
.toIdentifiers(),
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: "...x^3",
|
|
170
|
+
nodeIds: new Polynomial([
|
|
171
|
+
randint(-9, 10),
|
|
172
|
+
randint(-5, 6),
|
|
173
|
+
0,
|
|
174
|
+
randint(-1, 2, [0]),
|
|
175
|
+
])
|
|
176
|
+
.toTree()
|
|
177
|
+
.toIdentifiers(),
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
type: "(x-...)(x-...)",
|
|
181
|
+
nodeIds: multiply(substract("x", randint(-3, 4, [0, xValue])), substract("x", randint(-3, 4, [0, xValue]))).toIdentifiers(),
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: "(x+...)(x-...)",
|
|
185
|
+
nodeIds: multiply(add("x", randint(-3, 4, [0, -xValue])), substract("x", randint(-3, 4, [0, xValue]))).toIdentifiers(),
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
type: "(x+...)(x+...)",
|
|
189
|
+
nodeIds: multiply(add("x", randint(-3, 4, [0, -xValue])), add("x", randint(-3, 4, [0, -xValue]))).toIdentifiers(),
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
type: "a/(x+...)",
|
|
193
|
+
nodeIds: frac(randint(-3, 4, [0]), add("x", randint(-3, 4, [0, -xValue]))).toIdentifiers(),
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
type: "(x+...)/(x+...)",
|
|
197
|
+
nodeIds: (() => {
|
|
198
|
+
const a = randint(-3, 4, [0]);
|
|
199
|
+
const b = randint(-3, 4, [0, -xValue, a]);
|
|
200
|
+
return frac(add("x", a), add("x", b)).toIdentifiers();
|
|
201
|
+
})(),
|
|
202
|
+
},
|
|
203
|
+
]);
|
|
204
|
+
const identifiers = {
|
|
205
|
+
questionFunc,
|
|
206
|
+
xValue,
|
|
207
|
+
};
|
|
208
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
209
|
+
};
|
|
210
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
211
|
+
const question = {
|
|
212
|
+
instruction: getInstruction(identifiers),
|
|
213
|
+
answer: getAnswer(identifiers),
|
|
214
|
+
keys: ["semicolon"],
|
|
215
|
+
answerFormat: "tex",
|
|
216
|
+
identifiers,
|
|
217
|
+
hint: getHint(identifiers),
|
|
218
|
+
correction: getCorrection(identifiers),
|
|
219
|
+
};
|
|
220
|
+
return question;
|
|
221
|
+
};
|
|
222
|
+
export const coordsOfPointOnCurveFindY = {
|
|
223
|
+
id: "coordsOfPointOnCurveFindY",
|
|
224
|
+
label: "Déterminer les coordonnées d'un point appartenant à une courbe et dont on connaît l'abscisse",
|
|
225
|
+
isSingleStep: true,
|
|
226
|
+
generator: (nb) => getDistinctQuestions(getCoordsOfPointOnAffineFindYQuestion, nb),
|
|
227
|
+
getPropositions,
|
|
228
|
+
isAnswerValid,
|
|
229
|
+
qcmTimer: 60,
|
|
230
|
+
freeTimer: 60,
|
|
231
|
+
subject: "Mathématiques",
|
|
232
|
+
getQuestionFromIdentifiers,
|
|
233
|
+
hasHintAndCorrection: true,
|
|
234
|
+
answerType: "QCU",
|
|
235
|
+
};
|
|
@@ -15,4 +15,5 @@ export * from "./valueTableFromGraph.js";
|
|
|
15
15
|
export * from "./isPointOnFunction.js";
|
|
16
16
|
export * from "./countFunctionZeroes.js";
|
|
17
17
|
export * from "./findZeroesProductQuotient.js";
|
|
18
|
+
export * from "./coordsOfPointOnCurveFindY.js";
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/basics/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
nodeIds: NodeIdentifiers[];
|
|
5
|
+
};
|
|
6
|
+
export declare const functionComposition: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=functionComposition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functionComposition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/composition/functionComposition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA+D7C,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAAC;AA8NF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAiBrD,CAAC"}
|