math-exercises 3.0.124 → 3.0.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +20 -14
- package/lib/exercises/math/calcul/fractions/fractionsMix.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +61 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.js +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +15 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +217 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.d.ts +16 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.js +327 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts +8 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +221 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +135 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +29 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +367 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts +12 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.js +164 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +140 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts +6 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/index.js +6 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts +9 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +84 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts +8 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +90 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts +2 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/index.js +2 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts +13 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +414 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.js +70 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/index.js +2 -0
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts +2 -1
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/isolate/index.js +2 -1
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +107 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts +7 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.js +80 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +182 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +144 -0
- package/lib/exercises/math/calculLitteral/ordering/index.d.ts +3 -0
- package/lib/exercises/math/calculLitteral/ordering/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/index.js +2 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +120 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.js +67 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.js +114 -0
- package/lib/exercises/math/calculLitteral/simplifying/index.d.ts +5 -0
- package/lib/exercises/math/calculLitteral/simplifying/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/index.js +5 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts +13 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.js +125 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts +14 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.js +148 -0
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +5 -27
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +178 -241
- package/lib/exercises/math/conversion/index.d.ts +4 -0
- package/lib/exercises/math/conversion/index.d.ts.map +1 -1
- package/lib/exercises/math/conversion/index.js +4 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +8 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +98 -0
- package/lib/exercises/math/conversion/minutesToHours.d.ts +10 -0
- package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -0
- package/lib/exercises/math/conversion/minutesToHours.js +150 -0
- package/lib/exercises/math/conversion/prefixToNumber.d.ts +15 -0
- package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -0
- package/lib/exercises/math/conversion/prefixToNumber.js +233 -0
- package/lib/exercises/math/conversion/secondsToHours.d.ts +10 -0
- package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -0
- package/lib/exercises/math/conversion/secondsToHours.js +150 -0
- package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/volumeConversion.js +7 -1
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +50 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +517 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts +7 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.js +223 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +139 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +133 -0
- package/lib/exercises/math/dataRepresentations/graphReading.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/graphReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/graphReading.js +136 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts +18 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +228 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.js +213 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.js +163 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/index.js +10 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.js +145 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.js +308 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +10 -5
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts +8 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +103 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts +8 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +100 -0
- package/lib/exercises/math/functions/affines/drawAffineFromLitExp.js +5 -5
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts +16 -0
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +215 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts +13 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +206 -0
- package/lib/exercises/math/functions/affines/index.d.ts +7 -0
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +7 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts +20 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.js +284 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +13 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.js +184 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts +14 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +216 -0
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.js +29 -2
- package/lib/exercises/math/functions/basics/index.d.ts +1 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -0
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +72 -61
- package/lib/exercises/math/functions/composition/functionComposition.d.ts +8 -0
- package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -0
- package/lib/exercises/math/functions/composition/functionComposition.js +238 -0
- package/lib/exercises/math/functions/composition/index.d.ts +2 -0
- package/lib/exercises/math/functions/composition/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/composition/index.js +1 -0
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +41 -16
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +3 -2
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +21 -13
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts +23 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +448 -0
- package/lib/exercises/math/geometry/angles/index.js +2 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts +23 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.js +402 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +9 -6
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +140 -60
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.js +15 -7
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +5 -3
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +121 -104
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +3 -2
- package/lib/exercises/math/percent/evolutions/evolutionToCM.js +2 -2
- package/lib/exercises/math/percent/findProportion.d.ts +6 -1
- package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
- package/lib/exercises/math/percent/findProportion.js +162 -45
- package/lib/exercises/math/powers/calculateNegativePower.d.ts +5 -1
- package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
- package/lib/exercises/math/powers/calculateNegativePower.js +93 -29
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.js +1 -0
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts +0 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +42 -80
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts +9 -0
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +217 -0
- package/lib/exercises/math/probaStat/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +2 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +30 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +548 -0
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +10 -2
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +2 -1
- package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts +9 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +90 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts +10 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +151 -0
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts +4 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.js +46 -27
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +14 -2
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +43 -19
- package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/sequenceEvaluation.js +18 -1
- package/lib/exercises/pc/chemicalReactions/chemicalEquations.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/chemicalEquations.js +17 -2
- package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts +7 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts.map +1 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.js +73 -0
- package/lib/exercises/pc/electricity/index.d.ts +1 -0
- package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/index.js +1 -0
- package/lib/exercises/pc/index.d.ts +1 -0
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +1 -0
- package/lib/exercises/pc/mole/molarMass.d.ts.map +1 -1
- package/lib/exercises/pc/mole/molarMass.js +7 -1
- package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
- package/lib/exercises/pc/moleculeFormula.js +4 -3
- package/lib/exercises/pc/motion/averageSpeed.d.ts +9 -4
- package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
- package/lib/exercises/pc/motion/averageSpeed.js +132 -61
- package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/motion/averageSpeedCalculation.js +10 -4
- package/lib/exercises/pc/optics/index.d.ts +2 -0
- package/lib/exercises/pc/optics/index.d.ts.map +1 -0
- package/lib/exercises/pc/optics/index.js +1 -0
- package/lib/exercises/pc/optics/lensFormula.d.ts +21 -0
- package/lib/exercises/pc/optics/lensFormula.d.ts.map +1 -0
- package/lib/exercises/pc/optics/lensFormula.js +415 -0
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +2 -2
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +15 -15
- package/lib/exercises/pc/weight/calculateWeight.d.ts +8 -1
- package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
- package/lib/exercises/pc/weight/calculateWeight.js +113 -38
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +3 -1
- package/lib/geogebra/parsers/geogebraParser.d.ts +4 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
- package/lib/geogebra/parsers/geogebraParser.js +17 -0
- package/lib/index.d.ts +392 -23
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +1 -0
- package/lib/math/geometry/CloudPoints.d.ts +10 -0
- package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
- package/lib/math/geometry/CloudPoints.js +119 -0
- package/lib/math/geometry/line.d.ts +1 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +10 -2
- package/lib/math/geometry/vector.d.ts +1 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +12 -0
- package/lib/math/progCalc/progCalc.d.ts +46 -0
- package/lib/math/progCalc/progCalc.d.ts.map +1 -0
- package/lib/math/progCalc/progCalc.js +239 -0
- package/lib/math/utils/latex/realize.d.ts +12 -0
- package/lib/math/utils/latex/realize.d.ts.map +1 -0
- package/lib/math/utils/latex/realize.js +43 -0
- package/lib/pc/constants/molecularChemistry/molecule.d.ts +2 -0
- package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -1
- package/lib/pc/constants/molecularChemistry/molecule.js +52 -0
- package/lib/pc/units/timeUnits.d.ts +5 -3
- package/lib/pc/units/timeUnits.d.ts.map +1 -1
- package/lib/pc/units/timeUnits.js +25 -19
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +1 -1
- package/lib/tests/singleExo.test.js +3 -3
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts +4 -2
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +8 -17
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +5 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts +4 -2
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +8 -17
- package/lib/tree/nodes/operators/operatorNode.d.ts +3 -3
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/utilities/nodeShuffler.d.ts +12 -0
- package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -0
- package/lib/tree/utilities/nodeShuffler.js +123 -0
- package/lib/utils/arrays/getAllPicks.d.ts +2 -0
- package/lib/utils/arrays/getAllPicks.d.ts.map +1 -0
- package/lib/utils/arrays/getAllPicks.js +17 -0
- package/lib/utils/errors/handleVEAError.d.ts +1 -1
- package/lib/utils/errors/handleVEAError.d.ts.map +1 -1
- package/lib/utils/strings/decapitalize.d.ts +2 -0
- package/lib/utils/strings/decapitalize.d.ts.map +1 -0
- package/lib/utils/strings/decapitalize.js +3 -0
- package/package.json +1 -1
|
@@ -1,32 +1,56 @@
|
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
1
2
|
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
2
3
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
4
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { GeogebraParser } from "../../../../geogebra/parsers/geogebraParser.js";
|
|
4
6
|
import { ggbPointToCoords } from "../../../../geogebra/parsers/ggbPointToCoords.js";
|
|
5
7
|
import { parseGGBPoints } from "../../../../geogebra/parsers/parseGGBPoints.js";
|
|
6
8
|
import { Point } from "../../../../math/geometry/point.js";
|
|
7
9
|
import { NumberType } from "../../../../math/numbers/nombre.js";
|
|
8
|
-
import {
|
|
10
|
+
import { dividersOf } from "../../../../math/utils/arithmetic/dividersOf.js";
|
|
9
11
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
10
12
|
import { round } from "../../../../math/utils/round.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
14
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
15
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
13
16
|
import { random } from "../../../../utils/alea/random.js";
|
|
14
|
-
const getInstruction = ({
|
|
15
|
-
|
|
17
|
+
const getInstruction = ({ abscissType, absciss2, }) => {
|
|
18
|
+
const absciss2Node = NodeConstructor.fromIdentifiers(absciss2);
|
|
19
|
+
return `Placer le point d'abscisse $${abscissType === NumberType.Decimal
|
|
20
|
+
? round(absciss2Node.evaluate(), 1).frenchify()
|
|
21
|
+
: absciss2Node.toTex()}$ sur la demi-droite graduée ci-dessous :`;
|
|
16
22
|
};
|
|
17
23
|
// const getHint: GetHint<Identifiers> = (identifiers) => {};
|
|
18
24
|
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
|
|
19
|
-
const getGGBAnswer = ({
|
|
20
|
-
|
|
25
|
+
const getGGBAnswer = ({ absciss2 }) => {
|
|
26
|
+
const nodeAbciss2 = NodeConstructor.fromIdentifiers(absciss2);
|
|
27
|
+
return [`(${nodeAbciss2.evaluate()},0)`];
|
|
21
28
|
};
|
|
22
|
-
const getStudentGGBOptions = ({
|
|
29
|
+
const getStudentGGBOptions = ({ abscissType, absciss1, axisUnit, absciss2, }) => {
|
|
30
|
+
const [axisUnitNode, absciss1Node, absciss2Node] = [
|
|
31
|
+
axisUnit,
|
|
32
|
+
absciss1,
|
|
33
|
+
absciss2,
|
|
34
|
+
].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
35
|
+
const [valueAxisUnit, valueAbsciss1, valueAbsciss2] = [
|
|
36
|
+
axisUnitNode,
|
|
37
|
+
absciss1Node,
|
|
38
|
+
absciss2Node,
|
|
39
|
+
].map((node) => node.evaluate());
|
|
40
|
+
const xMin = Math.min(Math.min(0, valueAbsciss1), valueAbsciss2);
|
|
41
|
+
const xMax = Math.max(Math.max(0, valueAbsciss1), valueAbsciss2);
|
|
42
|
+
const yxRatio = 0.5;
|
|
43
|
+
const yMax = yxRatio * (xMax - xMin);
|
|
44
|
+
const yMin = -yMax;
|
|
23
45
|
const O = new Point("O", (0).toTree(), (0).toTree());
|
|
24
|
-
const I = new Point("I",
|
|
46
|
+
const I = new Point("I", absciss1Node, (0).toTree());
|
|
25
47
|
const commands = [
|
|
26
48
|
...O.toGGBCommand(),
|
|
27
|
-
`Text("\\footnotesize 0", (0,
|
|
49
|
+
`Text("\\footnotesize 0", (0, ${yMin / 4}), false, true, 0, 0)`,
|
|
28
50
|
...I.toGGBCommand(),
|
|
29
|
-
`Text("\\footnotesize ${
|
|
51
|
+
`Text("\\footnotesize ${abscissType === NumberType.Decimal
|
|
52
|
+
? round(absciss1Node.evaluate(), 1).frenchify()
|
|
53
|
+
: absciss1Node.toTex()}", (${valueAbsciss1}, ${abscissType === NumberType.Rational ? yMin / 2 : yMin / 4}), false, true, 0, 0)`,
|
|
30
54
|
];
|
|
31
55
|
const ggb = new GeogebraConstructor({
|
|
32
56
|
commands,
|
|
@@ -36,7 +60,7 @@ const getStudentGGBOptions = ({ oneUnitTex, abscissType, }) => {
|
|
|
36
60
|
hideGrid: true,
|
|
37
61
|
xAxis: {
|
|
38
62
|
hideNumbers: true,
|
|
39
|
-
steps:
|
|
63
|
+
steps: valueAxisUnit,
|
|
40
64
|
showPositive: true,
|
|
41
65
|
},
|
|
42
66
|
yAxis: {
|
|
@@ -46,70 +70,102 @@ const getStudentGGBOptions = ({ oneUnitTex, abscissType, }) => {
|
|
|
46
70
|
forbidShiftDragZoom: true,
|
|
47
71
|
});
|
|
48
72
|
return ggb.getOptions({
|
|
49
|
-
coords:
|
|
73
|
+
coords: ggb.getAdaptedCoords({
|
|
74
|
+
xMin,
|
|
75
|
+
xMax,
|
|
76
|
+
yMin,
|
|
77
|
+
yMax,
|
|
78
|
+
}),
|
|
79
|
+
// coords: [xMin, xMax, yMin, yMax],
|
|
50
80
|
});
|
|
51
81
|
};
|
|
52
|
-
const isGGBAnswerValid = (ans, {
|
|
82
|
+
const isGGBAnswerValid = (ans, { absciss2, axisUnit }) => {
|
|
83
|
+
const [absciss2Node, axisUnitNode] = [absciss2, axisUnit].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
|
|
84
|
+
const commands = ans;
|
|
85
|
+
const dictObj = new GeogebraParser(commands).objectDict();
|
|
86
|
+
console.log("dictObj:", dictObj);
|
|
87
|
+
const strPointA = dictObj["A"];
|
|
88
|
+
if (!strPointA) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
const coordsA = ggbPointToCoords(strPointA);
|
|
53
92
|
const points = parseGGBPoints(ans).map((p) => ggbPointToCoords(p));
|
|
54
|
-
return (points.length ===
|
|
55
|
-
Math.abs(
|
|
56
|
-
Math.abs(
|
|
93
|
+
return (points.length === 3 && //O,I,A
|
|
94
|
+
Math.abs(coordsA.y) < 0.5 * axisUnitNode.evaluate() &&
|
|
95
|
+
Math.abs(coordsA.x - absciss2Node.evaluate()) <
|
|
96
|
+
0.1 * axisUnitNode.evaluate());
|
|
57
97
|
};
|
|
58
|
-
const getPlaceAbscissOnSemiLineQuestion = () => {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
98
|
+
const getPlaceAbscissOnSemiLineQuestion = (optsIn) => {
|
|
99
|
+
const arrayedOptions = optsIn ?? optsDefault;
|
|
100
|
+
const opts = {
|
|
101
|
+
questionType: random(arrayedOptions.questionType),
|
|
102
|
+
numberType: random(arrayedOptions.numberType),
|
|
103
|
+
};
|
|
104
|
+
const abscissType = (() => {
|
|
105
|
+
switch (opts.numberType) {
|
|
106
|
+
case "Entiers":
|
|
107
|
+
return NumberType.Integer;
|
|
108
|
+
case "Rationnels":
|
|
109
|
+
return NumberType.Rational;
|
|
110
|
+
case "Décimaux":
|
|
111
|
+
return NumberType.Decimal;
|
|
112
|
+
}
|
|
113
|
+
})();
|
|
114
|
+
//[ [1/2, 2/2, 3/2], [1/3,2/3,3/3,4/3,5/3], ...]
|
|
115
|
+
function fracFamilyList() {
|
|
116
|
+
const maxDen = 5;
|
|
117
|
+
return [...Array(maxDen - 2).keys()]
|
|
118
|
+
.map((index) => index + 2)
|
|
119
|
+
.map((den) => [...Array(den === 2 ? 3 * den - 1 : 2 * den - 1).keys()]
|
|
120
|
+
.map((index) => index + 1)
|
|
121
|
+
.filter((num) => opts.questionType === "éviter le comptage"
|
|
122
|
+
? num !== 1 && num !== den
|
|
123
|
+
: true)
|
|
124
|
+
.map((num) => frac(num, den)));
|
|
125
|
+
}
|
|
126
|
+
const fracList = random(fracFamilyList());
|
|
127
|
+
const den = fracList[0].rightChild;
|
|
128
|
+
const factor1 = random(fracList);
|
|
129
|
+
const factor2 = random(fracList, [factor1]);
|
|
130
|
+
let referenceNum;
|
|
131
|
+
let absciss1Node;
|
|
132
|
+
let absciss2Node;
|
|
65
133
|
switch (abscissType) {
|
|
66
134
|
case NumberType.Integer:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
135
|
+
{
|
|
136
|
+
referenceNum = multiply(randint(1, 13), den);
|
|
137
|
+
absciss1Node = multiply(referenceNum, factor1).simplify();
|
|
138
|
+
absciss2Node = multiply(referenceNum, factor2).simplify();
|
|
139
|
+
}
|
|
72
140
|
break;
|
|
73
|
-
case NumberType.Rational:
|
|
74
|
-
|
|
75
|
-
[
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
[2, 5],
|
|
82
|
-
[3, 5],
|
|
83
|
-
[4, 5],
|
|
84
|
-
]);
|
|
85
|
-
axisUnit = randomFrac[0] / randomFrac[1];
|
|
86
|
-
const oneUnit = new FractionNode(randomFrac[0].toTree(), randomFrac[1].toTree());
|
|
87
|
-
oneUnitTex = oneUnit.toTex();
|
|
88
|
-
coeff = randint(2, 10);
|
|
89
|
-
absciss = axisUnit * coeff;
|
|
90
|
-
abscissTex = new MultiplyNode(oneUnit, coeff.toTree()).simplify().toTex();
|
|
141
|
+
case NumberType.Rational:
|
|
142
|
+
{
|
|
143
|
+
referenceNum = random([...Array(19).keys()]
|
|
144
|
+
.map((index) => index + 1)
|
|
145
|
+
.filter((num) => !dividersOf(num).includes(den.evaluate()))).toTree();
|
|
146
|
+
absciss1Node = frac(multiply(referenceNum, factor1.leftChild).simplify(), factor1.rightChild);
|
|
147
|
+
absciss2Node = frac(multiply(referenceNum, factor2.leftChild).simplify(), factor2.rightChild);
|
|
148
|
+
}
|
|
91
149
|
break;
|
|
92
|
-
}
|
|
93
150
|
case NumberType.Decimal:
|
|
94
151
|
default:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
152
|
+
{
|
|
153
|
+
referenceNum = frac(multiply(randint(1, 13 * 10), den), 10);
|
|
154
|
+
absciss1Node = multiply(referenceNum, factor1).simplify();
|
|
155
|
+
absciss2Node = multiply(referenceNum, factor2).simplify();
|
|
156
|
+
}
|
|
100
157
|
break;
|
|
101
158
|
}
|
|
159
|
+
const axisUnitNode = frac(referenceNum, den).simplify();
|
|
102
160
|
const identifiers = {
|
|
103
|
-
absciss,
|
|
104
|
-
abscissTex,
|
|
105
161
|
abscissType,
|
|
106
|
-
axisUnit,
|
|
107
|
-
|
|
108
|
-
|
|
162
|
+
axisUnit: axisUnitNode.toIdentifiers(),
|
|
163
|
+
absciss1: absciss1Node.toIdentifiers(),
|
|
164
|
+
absciss2: absciss2Node.toIdentifiers(),
|
|
109
165
|
};
|
|
110
166
|
return getQuestionFromIdentifiers(identifiers);
|
|
111
167
|
};
|
|
112
|
-
const getQuestionFromIdentifiers = (identifiers) => {
|
|
168
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
113
169
|
const question = {
|
|
114
170
|
ggbAnswer: getGGBAnswer(identifiers),
|
|
115
171
|
instruction: getInstruction(identifiers),
|
|
@@ -117,14 +173,38 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
117
173
|
identifiers,
|
|
118
174
|
// hint: getHint(identifiers),
|
|
119
175
|
// correction: getCorrection(identifiers),
|
|
176
|
+
options: opts,
|
|
120
177
|
};
|
|
121
178
|
return question;
|
|
122
179
|
};
|
|
180
|
+
const optsDefault = {
|
|
181
|
+
questionType: ["standard", "éviter le comptage"],
|
|
182
|
+
numberType: ["Entiers", "Rationnels", "Décimaux"],
|
|
183
|
+
};
|
|
184
|
+
const options = [
|
|
185
|
+
{
|
|
186
|
+
id: "questionType",
|
|
187
|
+
label: "Type de question",
|
|
188
|
+
target: GeneratorOptionTarget.generation,
|
|
189
|
+
type: GeneratorOptionType.multiselect,
|
|
190
|
+
values: ["standard", "éviter le comptage"],
|
|
191
|
+
defaultValue: optsDefault.questionType,
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "numberType",
|
|
195
|
+
label: "Type de nombres",
|
|
196
|
+
target: GeneratorOptionTarget.generation,
|
|
197
|
+
type: GeneratorOptionType.multiselect,
|
|
198
|
+
values: ["Entiers", "Rationnels", "Décimaux"],
|
|
199
|
+
defaultValue: optsDefault.numberType,
|
|
200
|
+
},
|
|
201
|
+
];
|
|
123
202
|
export const placeAbscissOnSemiLine = {
|
|
124
203
|
id: "placeAbscissOnSemiLine",
|
|
125
204
|
label: "Placer un point d'abscisse donnée sur une demi-droite graduée",
|
|
126
205
|
isSingleStep: true,
|
|
127
|
-
generator: (nb) => getDistinctQuestions(getPlaceAbscissOnSemiLineQuestion, nb),
|
|
206
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPlaceAbscissOnSemiLineQuestion(opts), nb),
|
|
207
|
+
options,
|
|
128
208
|
ggbTimer: 60,
|
|
129
209
|
isGGBAnswerValid,
|
|
130
210
|
subject: "Mathématiques",
|
|
@@ -43,7 +43,7 @@ function generateEvenInflexionPoint() {
|
|
|
43
43
|
const getInstruction = (identifiers) => {
|
|
44
44
|
const { askConvex } = identifiers;
|
|
45
45
|
const questionType = askConvex ? "convexe" : "concave";
|
|
46
|
-
const instruction = `Ci-dessous est tracée la courbe représentative $\\mathcal C_f$ d'une fonction $f$. Sur quel intervalle $f$ est-elle ${questionType} ?`;
|
|
46
|
+
const instruction = `Ci-dessous est tracée la courbe représentative $\\mathcal C_f$ d'une fonction $f$. Sur quel intervalle $f$ est-elle strictement ${questionType} ?`;
|
|
47
47
|
return instruction;
|
|
48
48
|
};
|
|
49
49
|
const getAnswer = (identifiers) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circleCircumference.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/circleCircumference.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"circleCircumference.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/perimeters/circleCircumference.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA2GF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
|
|
@@ -2,6 +2,8 @@ import { addValidProp, tryToAddWrongProp, propWhile, } from "../../../../exercis
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
4
|
import { round } from "../../../../math/utils/round.js";
|
|
5
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
6
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
5
7
|
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
6
8
|
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
7
9
|
const getInstruction = (identifiers) => {
|
|
@@ -10,14 +12,15 @@ const getInstruction = (identifiers) => {
|
|
|
10
12
|
? "rayon " + `$${radius}\\ \\textrm{cm}$`
|
|
11
13
|
: "diamètre " + `$${diametre} \\ \\textrm{cm}$`} (arrondir au centième de $\\textrm{cm}$).`;
|
|
12
14
|
};
|
|
13
|
-
const
|
|
15
|
+
const getAnswerNode = (identifiers) => {
|
|
14
16
|
const { coin, radius, diametre } = identifiers;
|
|
15
17
|
const answerNb = coin
|
|
16
18
|
? round(2 * Math.PI * radius, 2)
|
|
17
19
|
: round(Math.PI * diametre, 2);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
return answerNb.toTree();
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
return `${getAnswerNode(identifiers).toTex()} \\text{cm}`;
|
|
21
24
|
};
|
|
22
25
|
const getHint = () => {
|
|
23
26
|
return `Le périmètre d'un cercle de rayon $r$ est donné par :
|
|
@@ -79,9 +82,14 @@ const getPropositions = (n, { answer }) => {
|
|
|
79
82
|
});
|
|
80
83
|
return shuffle(propositions);
|
|
81
84
|
};
|
|
82
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
86
|
+
if (ans.includes("\\text{cm}^2")) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const refinedAns = ans.replace("\\text{cm}", "");
|
|
90
|
+
const ansNode = parseAlgebraic(refinedAns);
|
|
91
|
+
const answerNode = getAnswerNode(identifiers);
|
|
92
|
+
return substract(ansNode, answerNode).evaluate() === 0;
|
|
85
93
|
};
|
|
86
94
|
export const circleCircumference = {
|
|
87
95
|
id: "circleCircumference",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basicShapesNaming.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/shapes/basicShapesNaming.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,cAAc,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AAKxC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,kBAAkB,GAAG,cAAc,GAAG,eAAe,CAAC;CAC/D,CAAC;
|
|
1
|
+
{"version":3,"file":"basicShapesNaming.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/shapes/basicShapesNaming.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,eAAe,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,cAAc,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AAKxC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,kBAAkB,GAAG,cAAc,GAAG,eAAe,CAAC;CAC/D,CAAC;AAmKF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAenD,CAAC"}
|
|
@@ -31,7 +31,7 @@ const getAnswer = (identifiers) => {
|
|
|
31
31
|
break;
|
|
32
32
|
case 3: //droite
|
|
33
33
|
default:
|
|
34
|
-
return obj.toTexNoLeftRight()
|
|
34
|
+
return `(${obj.toTexNoLeftRight()})`;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
37
|
};
|
|
@@ -105,12 +105,14 @@ const getBasicShapesNamingQuestion = () => {
|
|
|
105
105
|
const type = randint(1, 4);
|
|
106
106
|
let objIds;
|
|
107
107
|
switch (type) {
|
|
108
|
-
case 1: {
|
|
108
|
+
case 1: {
|
|
109
|
+
//segment
|
|
109
110
|
const segment = SegmentConstructor.random();
|
|
110
111
|
objIds = segment.toIdentifiers();
|
|
111
112
|
break;
|
|
112
113
|
}
|
|
113
|
-
case 2: {
|
|
114
|
+
case 2: {
|
|
115
|
+
//demi-droite
|
|
114
116
|
const ray = RayConstructor.random();
|
|
115
117
|
objIds = ray.toIdentifiers();
|
|
116
118
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colinearityFromPicture.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,EAAE,gBAAgB,EAAE,CAAC;CAC/B,CAAC;AA+
|
|
1
|
+
{"version":3,"file":"colinearityFromPicture.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,EAAE,gBAAgB,EAAE,CAAC;CAC/B,CAAC;AA+OF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAkBxD,CAAC"}
|
|
@@ -60,126 +60,143 @@ const isAnswerValid = () => {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
const getColinearityFromPictureQuestion = () => {
|
|
63
|
-
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
let firstVec, secondVec;
|
|
64
|
+
let isGenerationOk = false;
|
|
65
|
+
const generate = () => {
|
|
66
|
+
const points = [];
|
|
67
|
+
let letterIndex = 65; //"A"
|
|
68
|
+
for (let j = 0; j < 4; j++) {
|
|
69
|
+
for (let i = 0; i < 3; i++) {
|
|
70
|
+
points.push(new Point(String.fromCharCode(letterIndex), i, j));
|
|
71
|
+
letterIndex++;
|
|
72
|
+
}
|
|
69
73
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
100
|
-
|
|
74
|
+
//!mama mia
|
|
75
|
+
//pardon au moi du futur
|
|
76
|
+
//en gros l'idée est qu'on construit deux paires de coordonnées de vecteurs colinéaires (ou non colinéaires) puis on boucle à l'infini sur les points pour trouver des points correspondants aux coordonnées des vecteurs choisis
|
|
77
|
+
let firstVecCoords, secondVecCoords;
|
|
78
|
+
const isColinear = coinFlip();
|
|
79
|
+
if (isColinear) {
|
|
80
|
+
const choices = [
|
|
81
|
+
[
|
|
82
|
+
[1, 0],
|
|
83
|
+
[2, 0],
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
[0, 1],
|
|
87
|
+
[0, 2],
|
|
88
|
+
[0, 3],
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
[1, 1],
|
|
92
|
+
[2, 2],
|
|
93
|
+
],
|
|
94
|
+
[[2, 1]],
|
|
95
|
+
[[1, 2]],
|
|
96
|
+
[[1, 3]],
|
|
97
|
+
];
|
|
98
|
+
const choice = random(choices);
|
|
99
|
+
const firstVecIndex = randint(0, choice.length);
|
|
100
|
+
firstVecCoords = choice[firstVecIndex];
|
|
101
|
+
if (choice.length === 1) {
|
|
102
|
+
firstVecCoords = choice[0];
|
|
103
|
+
secondVecCoords = choice[0];
|
|
104
|
+
const reverseFirst = coinFlip();
|
|
105
|
+
if (reverseFirst)
|
|
106
|
+
firstVecCoords = firstVecCoords.map((e) => -e);
|
|
107
|
+
else
|
|
108
|
+
secondVecCoords = secondVecCoords.map((e) => -e);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
const secondVecIndex = randint(0, choice.length);
|
|
112
|
+
secondVecCoords = choice[secondVecIndex];
|
|
113
|
+
const mustReverseOne = secondVecIndex === firstVecIndex;
|
|
114
|
+
const willReverse = mustReverseOne || coinFlip();
|
|
115
|
+
if (willReverse) {
|
|
116
|
+
const reverseFirst = coinFlip();
|
|
117
|
+
if (reverseFirst)
|
|
118
|
+
firstVecCoords = firstVecCoords.map((e) => -e);
|
|
119
|
+
else
|
|
120
|
+
secondVecCoords = secondVecCoords.map((e) => -e);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
//choix précédents + (2,3)
|
|
126
|
+
const choices = [
|
|
127
|
+
[
|
|
128
|
+
[1, 0],
|
|
129
|
+
[2, 0],
|
|
130
|
+
],
|
|
131
|
+
[
|
|
132
|
+
[0, 1],
|
|
133
|
+
[0, 2],
|
|
134
|
+
[0, 3],
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
[1, 1],
|
|
138
|
+
[2, 2],
|
|
139
|
+
],
|
|
140
|
+
[[2, 1]],
|
|
141
|
+
[[1, 2]],
|
|
142
|
+
[[1, 3]],
|
|
143
|
+
[[2, 3]],
|
|
144
|
+
];
|
|
145
|
+
const firstChoiceIndex = randint(0, choices.length);
|
|
146
|
+
const secondChoiceIndex = randint(0, choices.length, [firstChoiceIndex]);
|
|
147
|
+
firstVecCoords = random(choices[firstChoiceIndex]);
|
|
148
|
+
secondVecCoords = random(choices[secondChoiceIndex]);
|
|
101
149
|
const reverseFirst = coinFlip();
|
|
102
150
|
if (reverseFirst)
|
|
103
151
|
firstVecCoords = firstVecCoords.map((e) => -e);
|
|
104
152
|
else
|
|
105
153
|
secondVecCoords = secondVecCoords.map((e) => -e);
|
|
106
154
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
155
|
+
// let firstVec, secondVec;
|
|
156
|
+
let counter = 0;
|
|
157
|
+
while (true) {
|
|
158
|
+
counter++;
|
|
159
|
+
if (counter > 1000)
|
|
160
|
+
throw new Error("Too many iterations in colFromPic");
|
|
161
|
+
const A = random(points);
|
|
162
|
+
const B = random(points);
|
|
163
|
+
if (B.x.evaluate() - A.x.evaluate() === firstVecCoords[0] &&
|
|
164
|
+
B.y.evaluate() - A.y.evaluate() === firstVecCoords[1]) {
|
|
165
|
+
firstVec = [A.toIdentifiers(), B.toIdentifiers()];
|
|
166
|
+
break;
|
|
118
167
|
}
|
|
119
168
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
[
|
|
129
|
-
[
|
|
130
|
-
[
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
[2, 2],
|
|
136
|
-
],
|
|
137
|
-
[[2, 1]],
|
|
138
|
-
[[1, 2]],
|
|
139
|
-
[[1, 3]],
|
|
140
|
-
[[2, 3]],
|
|
141
|
-
];
|
|
142
|
-
const firstChoiceIndex = randint(0, choices.length);
|
|
143
|
-
const secondChoiceIndex = randint(0, choices.length, [firstChoiceIndex]);
|
|
144
|
-
firstVecCoords = random(choices[firstChoiceIndex]);
|
|
145
|
-
secondVecCoords = random(choices[secondChoiceIndex]);
|
|
146
|
-
const reverseFirst = coinFlip();
|
|
147
|
-
if (reverseFirst)
|
|
148
|
-
firstVecCoords = firstVecCoords.map((e) => -e);
|
|
149
|
-
else
|
|
150
|
-
secondVecCoords = secondVecCoords.map((e) => -e);
|
|
151
|
-
}
|
|
152
|
-
let firstVec, secondVec;
|
|
169
|
+
let cnt = 0;
|
|
170
|
+
while (true) {
|
|
171
|
+
//!FIIIX
|
|
172
|
+
cnt++;
|
|
173
|
+
if (cnt > 1000)
|
|
174
|
+
throw new Error("Too many iterations in colFromPic");
|
|
175
|
+
const C = random(points);
|
|
176
|
+
const D = random(points);
|
|
177
|
+
if (D.x.evaluate() - C.x.evaluate() === secondVecCoords[0] &&
|
|
178
|
+
D.y.evaluate() - C.y.evaluate() === secondVecCoords[1]) {
|
|
179
|
+
secondVec = [C.toIdentifiers(), D.toIdentifiers()];
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
153
184
|
let counter = 0;
|
|
154
|
-
while (
|
|
185
|
+
while (!isGenerationOk) {
|
|
155
186
|
counter++;
|
|
156
|
-
if (counter >
|
|
187
|
+
if (counter > 100)
|
|
157
188
|
throw new Error("Too many iterations in colFromPic");
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
B.y.evaluate() - A.y.evaluate() === firstVecCoords[1]) {
|
|
162
|
-
firstVec = [A.toIdentifiers(), B.toIdentifiers()];
|
|
163
|
-
break;
|
|
189
|
+
try {
|
|
190
|
+
generate();
|
|
191
|
+
isGenerationOk = true;
|
|
164
192
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
while (true) {
|
|
168
|
-
//!FIIIX
|
|
169
|
-
cnt++;
|
|
170
|
-
if (cnt > 1000)
|
|
171
|
-
throw new Error("Too many iterations in colFromPic");
|
|
172
|
-
const C = random(points);
|
|
173
|
-
const D = random(points);
|
|
174
|
-
if (D.x.evaluate() - C.x.evaluate() === secondVecCoords[0] &&
|
|
175
|
-
D.y.evaluate() - C.y.evaluate() === secondVecCoords[1]) {
|
|
176
|
-
secondVec = [C.toIdentifiers(), D.toIdentifiers()];
|
|
177
|
-
break;
|
|
193
|
+
catch (_err) {
|
|
194
|
+
isGenerationOk = false;
|
|
178
195
|
}
|
|
179
196
|
}
|
|
180
197
|
const identifiers = {
|
|
181
|
-
firstVec,
|
|
182
|
-
secondVec,
|
|
198
|
+
firstVec: firstVec,
|
|
199
|
+
secondVec: secondVec,
|
|
183
200
|
};
|
|
184
201
|
return getQuestionFromIdentifiers(identifiers);
|
|
185
202
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorRepresentative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorRepresentative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"vectorRepresentative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorRepresentative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAkMF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAiBtD,CAAC"}
|
|
@@ -24,11 +24,12 @@ const getPropositions = (_n, { vec, vecsProposed }) => {
|
|
|
24
24
|
const vector = VectorConstructor.fromPoints(points.find((p) => p.name === vec[0]), points.find((p) => p.name === vec[1]));
|
|
25
25
|
for (let i = 0; i < vecsProposed.length; i++) {
|
|
26
26
|
const vecProp = VectorConstructor.fromPoints(points.find((p) => p.name === vecsProposed[i][0]), points.find((p) => p.name === vecsProposed[i][1]));
|
|
27
|
+
const tex = `\\overrightarrow{${vecsProposed[i]}}`;
|
|
27
28
|
if (vector.equals(vecProp)) {
|
|
28
|
-
addValidProp(propositions,
|
|
29
|
+
addValidProp(propositions, tex);
|
|
29
30
|
}
|
|
30
31
|
else {
|
|
31
|
-
addWrongProp(propositions,
|
|
32
|
+
addWrongProp(propositions, tex);
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
return propositions;
|