math-exercises 3.0.124 → 3.0.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +20 -14
- package/lib/exercises/math/calcul/fractions/fractionsMix.js +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +61 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.js +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +15 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +217 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.d.ts +16 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareA10N.js +327 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts +8 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +221 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +135 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +29 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +367 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts +12 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.js +164 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +140 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts +6 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/ordering/index.js +6 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts +9 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -0
- package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +84 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts +8 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -0
- package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +90 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts +2 -0
- package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/rounding/index.js +2 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts +13 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +414 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.js +70 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/index.js +2 -0
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts +2 -1
- package/lib/exercises/math/calculLitteral/isolate/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/isolate/index.js +2 -1
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +107 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts +7 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.js +80 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +182 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts +9 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +144 -0
- package/lib/exercises/math/calculLitteral/ordering/index.d.ts +3 -0
- package/lib/exercises/math/calculLitteral/ordering/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/ordering/index.js +2 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +120 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts +8 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.js +67 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts +11 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.js +114 -0
- package/lib/exercises/math/calculLitteral/simplifying/index.d.ts +5 -0
- package/lib/exercises/math/calculLitteral/simplifying/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/simplifying/index.js +5 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts +13 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.js +125 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts +14 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.js +148 -0
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +5 -27
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +178 -241
- package/lib/exercises/math/conversion/index.d.ts +4 -0
- package/lib/exercises/math/conversion/index.d.ts.map +1 -1
- package/lib/exercises/math/conversion/index.js +4 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +8 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -0
- package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +98 -0
- package/lib/exercises/math/conversion/minutesToHours.d.ts +10 -0
- package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -0
- package/lib/exercises/math/conversion/minutesToHours.js +150 -0
- package/lib/exercises/math/conversion/prefixToNumber.d.ts +15 -0
- package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -0
- package/lib/exercises/math/conversion/prefixToNumber.js +233 -0
- package/lib/exercises/math/conversion/secondsToHours.d.ts +10 -0
- package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -0
- package/lib/exercises/math/conversion/secondsToHours.js +150 -0
- package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
- package/lib/exercises/math/conversion/volumeConversion.js +7 -1
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +50 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +517 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts +7 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.js +223 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +139 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +133 -0
- package/lib/exercises/math/dataRepresentations/graphReading.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/graphReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/graphReading.js +136 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts +18 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +228 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts +8 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartReading.js +213 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/histogramReading.js +163 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/index.js +10 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/plausibleGraph.js +145 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.js +308 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +10 -5
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts +8 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +103 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts +8 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +100 -0
- package/lib/exercises/math/functions/affines/drawAffineFromLitExp.js +5 -5
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts +16 -0
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +215 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts +13 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +206 -0
- package/lib/exercises/math/functions/affines/index.d.ts +7 -0
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +7 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts +20 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/recognizeExprAffine.js +284 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +13 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/representationOfAffine.js +184 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts +14 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -0
- package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +216 -0
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/findZeroesProductQuotient.js +29 -2
- package/lib/exercises/math/functions/basics/index.d.ts +1 -0
- package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/index.js +1 -0
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +72 -61
- package/lib/exercises/math/functions/composition/functionComposition.d.ts +8 -0
- package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -0
- package/lib/exercises/math/functions/composition/functionComposition.js +238 -0
- package/lib/exercises/math/functions/composition/index.d.ts +2 -0
- package/lib/exercises/math/functions/composition/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/composition/index.js +1 -0
- package/lib/exercises/math/functions/index.d.ts +1 -0
- package/lib/exercises/math/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/index.js +1 -0
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +41 -16
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +3 -2
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts +1 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/trinomSignFromFacto.js +21 -13
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts +23 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +448 -0
- package/lib/exercises/math/geometry/angles/index.js +2 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts +23 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts.map +1 -0
- package/lib/exercises/math/geometry/angles/isParallelUsingAngles.js +402 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +9 -6
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +140 -60
- package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.js +15 -7
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.d.ts.map +1 -1
- package/lib/exercises/math/geometry/shapes/basicShapesNaming.js +5 -3
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +121 -104
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +3 -2
- package/lib/exercises/math/percent/evolutions/evolutionToCM.js +2 -2
- package/lib/exercises/math/percent/findProportion.d.ts +6 -1
- package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
- package/lib/exercises/math/percent/findProportion.js +162 -45
- package/lib/exercises/math/powers/calculateNegativePower.d.ts +5 -1
- package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
- package/lib/exercises/math/powers/calculateNegativePower.js +93 -29
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.js +1 -0
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts +0 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +42 -80
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts +9 -0
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +217 -0
- package/lib/exercises/math/probaStat/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +2 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +30 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +548 -0
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +10 -2
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +2 -1
- package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts +9 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +90 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts +10 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +151 -0
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts +4 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.js +46 -27
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +14 -2
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +43 -19
- package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/sequenceEvaluation.js +18 -1
- package/lib/exercises/pc/chemicalReactions/chemicalEquations.d.ts.map +1 -1
- package/lib/exercises/pc/chemicalReactions/chemicalEquations.js +17 -2
- package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts +7 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts.map +1 -0
- package/lib/exercises/pc/electricity/calculateUEqualsRI.js +73 -0
- package/lib/exercises/pc/electricity/index.d.ts +1 -0
- package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
- package/lib/exercises/pc/electricity/index.js +1 -0
- package/lib/exercises/pc/index.d.ts +1 -0
- package/lib/exercises/pc/index.d.ts.map +1 -1
- package/lib/exercises/pc/index.js +1 -0
- package/lib/exercises/pc/mole/molarMass.d.ts.map +1 -1
- package/lib/exercises/pc/mole/molarMass.js +7 -1
- package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
- package/lib/exercises/pc/moleculeFormula.js +4 -3
- package/lib/exercises/pc/motion/averageSpeed.d.ts +9 -4
- package/lib/exercises/pc/motion/averageSpeed.d.ts.map +1 -1
- package/lib/exercises/pc/motion/averageSpeed.js +132 -61
- package/lib/exercises/pc/motion/averageSpeedCalculation.d.ts.map +1 -1
- package/lib/exercises/pc/motion/averageSpeedCalculation.js +10 -4
- package/lib/exercises/pc/optics/index.d.ts +2 -0
- package/lib/exercises/pc/optics/index.d.ts.map +1 -0
- package/lib/exercises/pc/optics/index.js +1 -0
- package/lib/exercises/pc/optics/lensFormula.d.ts +21 -0
- package/lib/exercises/pc/optics/lensFormula.d.ts.map +1 -0
- package/lib/exercises/pc/optics/lensFormula.js +415 -0
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.d.ts +2 -2
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +15 -15
- package/lib/exercises/pc/weight/calculateWeight.d.ts +8 -1
- package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
- package/lib/exercises/pc/weight/calculateWeight.js +113 -38
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
- package/lib/exercises/utils/geogebra/toolBarConstructor.js +3 -1
- package/lib/geogebra/parsers/geogebraParser.d.ts +4 -0
- package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
- package/lib/geogebra/parsers/geogebraParser.js +17 -0
- package/lib/index.d.ts +392 -23
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +1 -0
- package/lib/math/geometry/CloudPoints.d.ts +10 -0
- package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
- package/lib/math/geometry/CloudPoints.js +119 -0
- package/lib/math/geometry/line.d.ts +1 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +10 -2
- package/lib/math/geometry/vector.d.ts +1 -0
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +12 -0
- package/lib/math/progCalc/progCalc.d.ts +46 -0
- package/lib/math/progCalc/progCalc.d.ts.map +1 -0
- package/lib/math/progCalc/progCalc.js +239 -0
- package/lib/math/utils/latex/realize.d.ts +12 -0
- package/lib/math/utils/latex/realize.d.ts.map +1 -0
- package/lib/math/utils/latex/realize.js +43 -0
- package/lib/pc/constants/molecularChemistry/molecule.d.ts +2 -0
- package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -1
- package/lib/pc/constants/molecularChemistry/molecule.js +52 -0
- package/lib/pc/units/timeUnits.d.ts +5 -3
- package/lib/pc/units/timeUnits.d.ts.map +1 -1
- package/lib/pc/units/timeUnits.js +25 -19
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +1 -1
- package/lib/tests/singleExo.test.js +3 -3
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts +4 -2
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +8 -17
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +5 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts +4 -2
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +8 -17
- package/lib/tree/nodes/operators/operatorNode.d.ts +3 -3
- package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/utilities/nodeShuffler.d.ts +12 -0
- package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -0
- package/lib/tree/utilities/nodeShuffler.js +123 -0
- package/lib/utils/arrays/getAllPicks.d.ts +2 -0
- package/lib/utils/arrays/getAllPicks.d.ts.map +1 -0
- package/lib/utils/arrays/getAllPicks.js +17 -0
- package/lib/utils/errors/handleVEAError.d.ts +1 -1
- package/lib/utils/errors/handleVEAError.d.ts.map +1 -1
- package/lib/utils/strings/decapitalize.d.ts +2 -0
- package/lib/utils/strings/decapitalize.d.ts.map +1 -0
- package/lib/utils/strings/decapitalize.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
4
|
+
import { round } from "../../../math/utils/round.js";
|
|
5
|
+
import { EqualNode } from "../../../tree/nodes/equations/equalNode.js";
|
|
6
|
+
import { NodeConstructor, } from "../../../tree/nodes/nodeConstructor.js";
|
|
7
|
+
import { InfinityNode, MinusInfinityNode, } from "../../../tree/nodes/numbers/infiniteNode.js";
|
|
8
|
+
import { add } from "../../../tree/nodes/operators/addNode.js";
|
|
9
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
10
|
+
import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
|
|
11
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
12
|
+
import { random } from "../../../utils/alea/random.js";
|
|
13
|
+
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
14
|
+
const optsDefault = {
|
|
15
|
+
typeDistance: [
|
|
16
|
+
"distance focale",
|
|
17
|
+
"distance objet",
|
|
18
|
+
"distance image",
|
|
19
|
+
],
|
|
20
|
+
typeImage: [
|
|
21
|
+
"réelle finie",
|
|
22
|
+
"réelle infinie",
|
|
23
|
+
"imaginaire finie",
|
|
24
|
+
"imaginaire infinie",
|
|
25
|
+
],
|
|
26
|
+
unit: ["cm", "m"],
|
|
27
|
+
roundTo: [0, 1, 2],
|
|
28
|
+
};
|
|
29
|
+
const options = [
|
|
30
|
+
{
|
|
31
|
+
id: "typeDistance",
|
|
32
|
+
label: "Distance à calculer",
|
|
33
|
+
target: GeneratorOptionTarget.generation,
|
|
34
|
+
type: GeneratorOptionType.multiselect,
|
|
35
|
+
defaultValue: optsDefault.typeDistance,
|
|
36
|
+
values: ["distance focale", "distance objet", "distance image"],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "typeImage",
|
|
40
|
+
label: "Type d'image",
|
|
41
|
+
target: GeneratorOptionTarget.generation,
|
|
42
|
+
type: GeneratorOptionType.multiselect,
|
|
43
|
+
defaultValue: optsDefault.typeImage,
|
|
44
|
+
values: [
|
|
45
|
+
"réelle finie",
|
|
46
|
+
"réelle infinie",
|
|
47
|
+
"imaginaire finie",
|
|
48
|
+
"imaginaire infinie",
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: "unit",
|
|
53
|
+
label: "unité de mesure",
|
|
54
|
+
target: GeneratorOptionTarget.generation,
|
|
55
|
+
type: GeneratorOptionType.multiselect,
|
|
56
|
+
defaultValue: optsDefault.unit,
|
|
57
|
+
values: ["cm", "m"],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "roundTo",
|
|
61
|
+
label: "Arrondir à (nombre de décimales)",
|
|
62
|
+
target: GeneratorOptionTarget.generation,
|
|
63
|
+
type: GeneratorOptionType.multiselect,
|
|
64
|
+
defaultValue: optsDefault.roundTo,
|
|
65
|
+
values: [0, 1, 2],
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
const getLensFormulaEqualNode = () => {
|
|
69
|
+
const equation = new EqualNode(frac(1, "\\overline {OA'}"), add(frac(1, "\\overline {OF'}"), frac(1, "\\overline {OA}")));
|
|
70
|
+
return equation;
|
|
71
|
+
};
|
|
72
|
+
const getInstruction = (identifiers) => {
|
|
73
|
+
const { OFPrime, OA, OAPrime, opts } = identifiers;
|
|
74
|
+
const nodeOFPrime = NodeConstructor.fromIdentifiers(OFPrime);
|
|
75
|
+
const nodeOA = NodeConstructor.fromIdentifiers(OA);
|
|
76
|
+
const nodeOAPrime = NodeConstructor.fromIdentifiers(OAPrime);
|
|
77
|
+
const strRounTo = (() => {
|
|
78
|
+
switch (opts.roundTo) {
|
|
79
|
+
case 0:
|
|
80
|
+
return "à l'unité";
|
|
81
|
+
case 1:
|
|
82
|
+
return "au dixième";
|
|
83
|
+
case 2:
|
|
84
|
+
return "au centième";
|
|
85
|
+
}
|
|
86
|
+
})();
|
|
87
|
+
let strOAPrime = `$${nodeOAPrime.simplify().toTex()}${opts.unit}$`;
|
|
88
|
+
let strOA = `$${nodeOA.simplify().toTex()}${opts.unit}$`;
|
|
89
|
+
const strOFPrime = `$${nodeOFPrime.simplify().toTex()}${opts.unit}$`;
|
|
90
|
+
if (strOAPrime.includes("\\infty")) {
|
|
91
|
+
strOAPrime = "à l'infini";
|
|
92
|
+
}
|
|
93
|
+
if (strOA.includes("\\infty")) {
|
|
94
|
+
strOA = "à l'infini";
|
|
95
|
+
}
|
|
96
|
+
const strLensType = nodeOFPrime.evaluate() >= 0 ? "convergente" : "divergente";
|
|
97
|
+
switch (opts.typeDistance) {
|
|
98
|
+
case "distance focale": {
|
|
99
|
+
return `Calculer la distance focale algébrique de la lentille, en $${opts.unit}$, arrondie ${strRounTo},
|
|
100
|
+
sachant que la position algébrique de l'objet de l'objet $AB$ est ${strOA},
|
|
101
|
+
et que la position algébrique de l'image $A'$ est ${strOAPrime}.`;
|
|
102
|
+
}
|
|
103
|
+
case "distance image": {
|
|
104
|
+
return `Calculer la position algébrique de l'image $A'$ de l'objet $AB$, en $${opts.unit}$, arrondie ${strRounTo},
|
|
105
|
+
situé algébriquement à ${strOA}
|
|
106
|
+
d'une lentille ${strLensType} ayant une distance focale de ${strOFPrime}.`;
|
|
107
|
+
}
|
|
108
|
+
case "distance objet": {
|
|
109
|
+
return `Calculer la position algébrique $A$ de l'objet $AB$, en $${opts.unit}$, arrondie ${strRounTo},
|
|
110
|
+
sachant que la position algébrique de l'image $A'$ est ${strOAPrime},
|
|
111
|
+
et que la distance focale algébrique est ${strOFPrime}.`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const getHint = () => {
|
|
116
|
+
return `Relation de conjugaison de Descartes :
|
|
117
|
+
|
|
118
|
+
$$
|
|
119
|
+
${getLensFormulaEqualNode().toTex()}
|
|
120
|
+
$$
|
|
121
|
+
|
|
122
|
+
`;
|
|
123
|
+
};
|
|
124
|
+
const getCorrection = (identifiers) => {
|
|
125
|
+
const { OFPrime, OA, OAPrime, opts } = identifiers;
|
|
126
|
+
const nodeOFPrime = NodeConstructor.fromIdentifiers(OFPrime);
|
|
127
|
+
const nodeOA = NodeConstructor.fromIdentifiers(OA);
|
|
128
|
+
const nodeOAPrime = NodeConstructor.fromIdentifiers(OAPrime);
|
|
129
|
+
const answer = getAnswer(identifiers);
|
|
130
|
+
return `La relation de conjugaison de Descartes s'écrit :
|
|
131
|
+
|
|
132
|
+
$$
|
|
133
|
+
${getLensFormulaEqualNode().toTex()}
|
|
134
|
+
$$
|
|
135
|
+
|
|
136
|
+
Dans notre cas :
|
|
137
|
+
|
|
138
|
+
${(() => {
|
|
139
|
+
switch (opts.typeDistance) {
|
|
140
|
+
case "distance focale":
|
|
141
|
+
return alignTex([
|
|
142
|
+
[
|
|
143
|
+
`\\frac{1}{\\overline {OF'}}`,
|
|
144
|
+
`=`,
|
|
145
|
+
`\\frac{1}{\\overline {OA'}} - \\frac{1}{\\overline {OA}}`,
|
|
146
|
+
],
|
|
147
|
+
[
|
|
148
|
+
`\\overline {OF'}`,
|
|
149
|
+
`=`,
|
|
150
|
+
`\\frac{1} {\\frac{1}{\\overline {OA'}} - \\frac{1}{\\overline {OA}}}`,
|
|
151
|
+
],
|
|
152
|
+
[
|
|
153
|
+
`\\overline {OF'}`,
|
|
154
|
+
`=`,
|
|
155
|
+
`\\frac{1} {\\frac{1}{${nodeOAPrime.toTex()}} - \\frac{1}{${nodeOA.toTex()}}}`,
|
|
156
|
+
],
|
|
157
|
+
[`\\overline {OF'}`, `=`, answer.replaceAll("$", "")],
|
|
158
|
+
]);
|
|
159
|
+
case "distance image":
|
|
160
|
+
return alignTex([
|
|
161
|
+
[
|
|
162
|
+
`\\overline {OA'}`,
|
|
163
|
+
`=`,
|
|
164
|
+
`\\frac{1} {\\frac{1}{\\overline {OF'}} + \\frac{1}{\\overline {OA}}}`,
|
|
165
|
+
],
|
|
166
|
+
[
|
|
167
|
+
`\\overline {OA'}`,
|
|
168
|
+
`=`,
|
|
169
|
+
`\\frac{1} {\\frac{1}{${nodeOFPrime.toTex()}} + \\frac{1}{${nodeOA.toTex()}}}`,
|
|
170
|
+
],
|
|
171
|
+
[`\\overline {OA'}`, `=`, answer.replaceAll("$", "")],
|
|
172
|
+
]);
|
|
173
|
+
case "distance objet":
|
|
174
|
+
return alignTex([
|
|
175
|
+
[
|
|
176
|
+
`\\frac{1}{\\overline {OA}}`,
|
|
177
|
+
`=`,
|
|
178
|
+
`\\frac{1}{\\overline {OA'}} - \\frac{1}{\\overline {OF'}}`,
|
|
179
|
+
],
|
|
180
|
+
[
|
|
181
|
+
`\\overline {OA}`,
|
|
182
|
+
`=`,
|
|
183
|
+
`\\frac{1} {\\frac{1}{\\overline {OA'}} - \\frac{1}{\\overline {OF'}}}`,
|
|
184
|
+
],
|
|
185
|
+
[
|
|
186
|
+
`\\overline {OA}`,
|
|
187
|
+
`=`,
|
|
188
|
+
`\\frac{1} {\\frac{1}{${nodeOAPrime.toTex()}} - \\frac{1}{${nodeOFPrime.toTex()}}}`,
|
|
189
|
+
],
|
|
190
|
+
[`\\overline {OA}`, `=`, answer.replaceAll("$", "")],
|
|
191
|
+
]);
|
|
192
|
+
}
|
|
193
|
+
})()}`;
|
|
194
|
+
};
|
|
195
|
+
const getAnswer = (identifiers) => {
|
|
196
|
+
const { OFPrime, OA, OAPrime, opts } = identifiers;
|
|
197
|
+
const nodeOFPrime = NodeConstructor.fromIdentifiers(OFPrime);
|
|
198
|
+
const nodeOA = NodeConstructor.fromIdentifiers(OA);
|
|
199
|
+
const nodeOAPrime = NodeConstructor.fromIdentifiers(OAPrime);
|
|
200
|
+
return `${round((() => {
|
|
201
|
+
switch (opts.typeDistance) {
|
|
202
|
+
case "distance focale":
|
|
203
|
+
return nodeOFPrime;
|
|
204
|
+
case "distance image":
|
|
205
|
+
return nodeOAPrime;
|
|
206
|
+
case "distance objet":
|
|
207
|
+
return nodeOA;
|
|
208
|
+
}
|
|
209
|
+
})().evaluate(), opts.roundTo).frenchify()}${opts.unit}`;
|
|
210
|
+
};
|
|
211
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
212
|
+
const { opts } = identifiers;
|
|
213
|
+
if (!ans.endsWith(opts.unit))
|
|
214
|
+
return false;
|
|
215
|
+
const ansNumber = parseFloat(ans.replace(opts.unit, ""));
|
|
216
|
+
const answerNumber = parseFloat(answer.replace(opts.unit, ""));
|
|
217
|
+
return ansNumber === answerNumber;
|
|
218
|
+
};
|
|
219
|
+
const getPropositions = (nbProps, { answer, ...identifiers }) => {
|
|
220
|
+
const { OFPrime, OA, OAPrime, opts } = identifiers;
|
|
221
|
+
const nodeOFPrime = NodeConstructor.fromIdentifiers(OFPrime);
|
|
222
|
+
const nodeOA = NodeConstructor.fromIdentifiers(OA);
|
|
223
|
+
const nodeOAPrime = NodeConstructor.fromIdentifiers(OAPrime);
|
|
224
|
+
let propositions = [];
|
|
225
|
+
function toUnitedTex(tex) {
|
|
226
|
+
return `${tex}${opts.unit}`;
|
|
227
|
+
}
|
|
228
|
+
addValidProp(propositions, answer, "tex");
|
|
229
|
+
switch (opts.typeDistance) {
|
|
230
|
+
case "distance focale":
|
|
231
|
+
{
|
|
232
|
+
function tryToAddWrongProps(roundTo) {
|
|
233
|
+
//x = A + B
|
|
234
|
+
tryToAddWrongProp(propositions, toUnitedTex(round(add(nodeOAPrime, nodeOA).evaluate(), roundTo).frenchify()));
|
|
235
|
+
//erreur d'inverse
|
|
236
|
+
tryToAddWrongProp(propositions, toUnitedTex(round(nodeOFPrime.rightChild.evaluate(), roundTo).frenchify()));
|
|
237
|
+
//erreur de signe
|
|
238
|
+
tryToAddWrongProp(propositions, toUnitedTex(round(frac(1, add(frac(1, nodeOAPrime.evaluate()), frac(1, nodeOA.evaluate()))).evaluate(), roundTo).frenchify()));
|
|
239
|
+
}
|
|
240
|
+
//erreurs d'arrondis
|
|
241
|
+
[0, 1, 2].forEach((roundTo) => {
|
|
242
|
+
tryToAddWrongProps(roundTo);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
break;
|
|
246
|
+
case "distance image":
|
|
247
|
+
{
|
|
248
|
+
function tryToAddWrongProps(roundTo) {
|
|
249
|
+
//x = A + B
|
|
250
|
+
tryToAddWrongProp(propositions, toUnitedTex(round(add(nodeOFPrime, nodeOA).evaluate(), roundTo).frenchify()));
|
|
251
|
+
//erreur d'inverse
|
|
252
|
+
tryToAddWrongProp(propositions, toUnitedTex(round(frac(1, nodeOAPrime).evaluate(), roundTo).frenchify()));
|
|
253
|
+
//erreur de signe
|
|
254
|
+
tryToAddWrongProp(propositions, toUnitedTex(round(substract(frac(1, nodeOFPrime.evaluate()), frac(1, nodeOA.evaluate())).evaluate(), roundTo).frenchify()));
|
|
255
|
+
}
|
|
256
|
+
//erreurs d'arrondis
|
|
257
|
+
[0, 1, 2].forEach((roundTo) => {
|
|
258
|
+
tryToAddWrongProps(roundTo);
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
break;
|
|
262
|
+
case "distance objet":
|
|
263
|
+
{
|
|
264
|
+
function tryToAddWrongProps(roundTo) {
|
|
265
|
+
//x = A + B
|
|
266
|
+
tryToAddWrongProp(propositions, toUnitedTex(round(add(nodeOAPrime, nodeOFPrime).evaluate(), roundTo).frenchify()));
|
|
267
|
+
//erreur d'inverse
|
|
268
|
+
tryToAddWrongProp(propositions, toUnitedTex(round(nodeOA.rightChild.evaluate(), roundTo).frenchify()));
|
|
269
|
+
//erreur de signe
|
|
270
|
+
tryToAddWrongProp(propositions, toUnitedTex(round(frac(1, add(frac(1, nodeOAPrime.evaluate()), frac(1, nodeOFPrime.evaluate()))).evaluate(), roundTo).frenchify()));
|
|
271
|
+
}
|
|
272
|
+
//erreurs d'arrondis
|
|
273
|
+
[0, 1, 2].forEach((roundTo) => {
|
|
274
|
+
tryToAddWrongProps(roundTo);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
propositions = propositions.filter((proposition) => !proposition.statement.includes("NaN"));
|
|
280
|
+
return shuffleProps(propositions, nbProps);
|
|
281
|
+
};
|
|
282
|
+
const getLensFormulaQuestion = (optsIn) => {
|
|
283
|
+
const optsInRetyped = optsIn
|
|
284
|
+
? {
|
|
285
|
+
typeDistance: optsIn?.typeDistance,
|
|
286
|
+
typeImage: optsIn?.typeImage,
|
|
287
|
+
unit: optsIn?.unit,
|
|
288
|
+
roundTo: (optsIn?.roundTo)
|
|
289
|
+
.filter((a) => typeof a === "string")
|
|
290
|
+
.map((str) => +str),
|
|
291
|
+
}
|
|
292
|
+
: undefined;
|
|
293
|
+
console.log("optsIn", optsIn);
|
|
294
|
+
console.log("optsInRetyped", optsInRetyped);
|
|
295
|
+
let nodeOFPrime = NaN.toTree();
|
|
296
|
+
let nodeOA = NaN.toTree();
|
|
297
|
+
let nodeOAPrime = NaN.toTree();
|
|
298
|
+
let opts;
|
|
299
|
+
function getRandomNodes() {
|
|
300
|
+
opts = optsInRetyped
|
|
301
|
+
? {
|
|
302
|
+
typeDistance: random(optsInRetyped.typeDistance),
|
|
303
|
+
typeImage: random(optsInRetyped.typeImage),
|
|
304
|
+
unit: random(optsInRetyped.unit),
|
|
305
|
+
roundTo: random(optsInRetyped.roundTo),
|
|
306
|
+
}
|
|
307
|
+
: {
|
|
308
|
+
typeDistance: random(optsDefault.typeDistance),
|
|
309
|
+
typeImage: random(optsDefault.typeImage),
|
|
310
|
+
unit: random(optsDefault.unit),
|
|
311
|
+
roundTo: random(optsDefault.roundTo),
|
|
312
|
+
};
|
|
313
|
+
console.log("opts", opts);
|
|
314
|
+
//objet réel: \\overline {OA} < 0
|
|
315
|
+
//image réelle : \\overline {OA'} > 0
|
|
316
|
+
function factorNodeForTypeImage(typeImage) {
|
|
317
|
+
let factorNode;
|
|
318
|
+
switch (typeImage) {
|
|
319
|
+
case "réelle finie":
|
|
320
|
+
factorNode = (+1).toTree();
|
|
321
|
+
break;
|
|
322
|
+
case "réelle infinie":
|
|
323
|
+
factorNode = (-1).toTree();
|
|
324
|
+
break;
|
|
325
|
+
case "imaginaire finie":
|
|
326
|
+
factorNode = InfinityNode;
|
|
327
|
+
break;
|
|
328
|
+
case "imaginaire infinie":
|
|
329
|
+
factorNode = MinusInfinityNode;
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
return factorNode;
|
|
333
|
+
}
|
|
334
|
+
switch (opts.typeDistance) {
|
|
335
|
+
case "distance focale":
|
|
336
|
+
{
|
|
337
|
+
nodeOA = (-randint(1, 10)).toTree();
|
|
338
|
+
nodeOAPrime = multiply(factorNodeForTypeImage(opts.typeImage), randint(1, 10, [-nodeOA.evaluate()]).toTree()).simplify();
|
|
339
|
+
const equalNode = getLensFormulaEqualNode();
|
|
340
|
+
nodeOFPrime = frac(1, substract(equalNode.leftChild.evaluate({
|
|
341
|
+
"\\overline {OA'}": nodeOA.evaluate(),
|
|
342
|
+
}), equalNode.rightChild.rightChild.evaluate({
|
|
343
|
+
"\\overline {OA}": nodeOAPrime.evaluate(),
|
|
344
|
+
})));
|
|
345
|
+
}
|
|
346
|
+
break;
|
|
347
|
+
case "distance image":
|
|
348
|
+
{
|
|
349
|
+
nodeOA = (-randint(1, 10)).toTree();
|
|
350
|
+
nodeOFPrime = multiply(factorNodeForTypeImage(opts.typeImage), randint(1, 10, [-nodeOA.evaluate()]).toTree()).simplify();
|
|
351
|
+
const equalNode = getLensFormulaEqualNode();
|
|
352
|
+
nodeOAPrime = frac(1, equalNode.rightChild.evaluate({
|
|
353
|
+
"\\overline {OA}": nodeOA.evaluate(),
|
|
354
|
+
"\\overline {OF'}": nodeOFPrime.evaluate(),
|
|
355
|
+
}));
|
|
356
|
+
}
|
|
357
|
+
break;
|
|
358
|
+
case "distance objet":
|
|
359
|
+
{
|
|
360
|
+
nodeOAPrime = multiply(factorNodeForTypeImage(opts.typeImage), randint(1, 10).toTree()).simplify();
|
|
361
|
+
nodeOFPrime = randint(1, 10, [-nodeOAPrime.evaluate()]).toTree();
|
|
362
|
+
const equalNode = getLensFormulaEqualNode();
|
|
363
|
+
nodeOA = frac(1, substract(equalNode.leftChild.evaluate({
|
|
364
|
+
"\\overline {OA'}": nodeOAPrime.evaluate(),
|
|
365
|
+
}), equalNode.rightChild.leftChild.evaluate({
|
|
366
|
+
"\\overline {OF'}": nodeOFPrime.evaluate(),
|
|
367
|
+
})));
|
|
368
|
+
}
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
function checkValidNodes() {
|
|
373
|
+
const isContainingNaN = [nodeOA, nodeOAPrime, nodeOFPrime].some((node) => isNaN(node.evaluate()));
|
|
374
|
+
const valueOFPrime = nodeOFPrime.evaluate();
|
|
375
|
+
const isFocalInfinite = valueOFPrime === -Infinity || valueOFPrime == Infinity;
|
|
376
|
+
return !isContainingNaN && !isFocalInfinite;
|
|
377
|
+
}
|
|
378
|
+
do {
|
|
379
|
+
getRandomNodes();
|
|
380
|
+
} while (!checkValidNodes());
|
|
381
|
+
return getQuestionFromIdentifiers({
|
|
382
|
+
OFPrime: nodeOFPrime.toIdentifiers(),
|
|
383
|
+
OA: nodeOA.toIdentifiers(),
|
|
384
|
+
OAPrime: nodeOAPrime.toIdentifiers(),
|
|
385
|
+
opts: opts,
|
|
386
|
+
}, opts);
|
|
387
|
+
};
|
|
388
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
389
|
+
const question = {
|
|
390
|
+
instruction: getInstruction(identifiers, opts),
|
|
391
|
+
keys: [],
|
|
392
|
+
answerFormat: "tex",
|
|
393
|
+
identifiers,
|
|
394
|
+
hint: getHint(identifiers, opts),
|
|
395
|
+
correction: getCorrection(identifiers, opts),
|
|
396
|
+
answer: getAnswer(identifiers),
|
|
397
|
+
};
|
|
398
|
+
return question;
|
|
399
|
+
};
|
|
400
|
+
export const lensFormula = {
|
|
401
|
+
id: "lensFormula",
|
|
402
|
+
label: "Exploiter la relation de conjugaison de Descartes",
|
|
403
|
+
isSingleStep: true,
|
|
404
|
+
generator: (nb, opts) => getDistinctQuestions(() => getLensFormulaQuestion(opts), nb, 30, () => false),
|
|
405
|
+
options,
|
|
406
|
+
qcmTimer: 60,
|
|
407
|
+
freeTimer: 60,
|
|
408
|
+
getPropositions,
|
|
409
|
+
isAnswerValid,
|
|
410
|
+
subject: "Physique",
|
|
411
|
+
maxAllowedQuestions: 30,
|
|
412
|
+
getQuestionFromIdentifiers,
|
|
413
|
+
answerType: "QCU",
|
|
414
|
+
hasHintAndCorrection: true,
|
|
415
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Exercise } from "../../exercises/exercise.js";
|
|
2
2
|
type Identifiers = {
|
|
3
3
|
isAsking: string;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
enteringLightX: number;
|
|
5
|
+
enteringLightY: number;
|
|
6
6
|
};
|
|
7
7
|
export declare const recognizeRefractionOrReflectionAngles: Exercise<Identifiers>;
|
|
8
8
|
export {};
|
|
@@ -22,7 +22,7 @@ const getAnswer = (identifiers) => {
|
|
|
22
22
|
return isAsking;
|
|
23
23
|
};
|
|
24
24
|
const getGGBOptions = (identifiers) => {
|
|
25
|
-
const { isAsking,
|
|
25
|
+
const { isAsking, enteringLightX, enteringLightY } = identifiers;
|
|
26
26
|
let angle = "";
|
|
27
27
|
switch (isAsking) {
|
|
28
28
|
case IsAsking.RefractionAngle:
|
|
@@ -33,24 +33,24 @@ const getGGBOptions = (identifiers) => {
|
|
|
33
33
|
break;
|
|
34
34
|
case IsAsking.IncidenceAngle:
|
|
35
35
|
default:
|
|
36
|
-
angle = `Ang = Angle(Line((0,0), (0,5)),Line((0,0),(${
|
|
36
|
+
angle = `Ang = Angle(Line((0,0), (0,5)),Line((0,0),(${enteringLightX},${enteringLightY})))`;
|
|
37
37
|
}
|
|
38
|
-
const reflectionLight = { x2: -
|
|
38
|
+
const reflectionLight = { x2: -enteringLightX, y2: enteringLightY };
|
|
39
39
|
const refractingLight = {
|
|
40
40
|
x2: reflectionLight.x2 - randint(5, 10),
|
|
41
41
|
y2: -reflectionLight.y2,
|
|
42
42
|
};
|
|
43
43
|
const commands = [
|
|
44
|
-
`E = Vector((${
|
|
44
|
+
`E = Vector((${enteringLightX},${enteringLightY}), (0,0))`,
|
|
45
45
|
`R = Vector((0,0), (${reflectionLight.x2},${reflectionLight.y2}))`,
|
|
46
46
|
`I = Vector((0,0), (${refractingLight.x2},${refractingLight.y2}))`,
|
|
47
47
|
angle,
|
|
48
48
|
`DashedLine = Line((0,0),(0,5))`,
|
|
49
49
|
`Y = Line((0,0),(5,0))`,
|
|
50
|
-
`Text("\\tiny \\text{Surface de séparation}", (-12,0),false,true)`,
|
|
51
|
-
`Text("\\tiny \\text{Milieu 1}", (9,2.5),false,true)`,
|
|
52
|
-
`Text("\\tiny \\text{Milieu 2}", (9,0),false,true)`,
|
|
53
|
-
`YText = Text(RotateText("\\tiny \\text{Rayon incident}",-90
|
|
50
|
+
`SSurfaceText = Text("\\tiny \\text{Surface de séparation}", (-12,0),false,true)`,
|
|
51
|
+
`M1Text = Text("\\tiny \\text{Milieu 1}", (9,2.5),false,true)`,
|
|
52
|
+
`M2Text= Text("\\tiny \\text{Milieu 2}", (9,0),false,true)`,
|
|
53
|
+
`YText = Text(RotateText("\\tiny \\text{Rayon incident}",-90°+Ang), (${enteringLightX / 2 - 1.5},${enteringLightY / 2}),false,true)`,
|
|
54
54
|
`SetLineStyle(DashedLine,2)`,
|
|
55
55
|
`ShowLabel(Ang,false)`,
|
|
56
56
|
`SetColor(E,"#F78D04")`,
|
|
@@ -62,10 +62,10 @@ const getGGBOptions = (identifiers) => {
|
|
|
62
62
|
`SetFixed(I,true)`,
|
|
63
63
|
`SetFixed(DashedLine,true)`,
|
|
64
64
|
`SetFixed(Y,true)`,
|
|
65
|
-
`
|
|
66
|
-
`
|
|
67
|
-
`SetColor(
|
|
68
|
-
`SetColor(
|
|
65
|
+
`FirstPolygon = Polygon((15, 0), (15,12), (-15, 12), (-15, 0))`,
|
|
66
|
+
`SecondPolygon = Polygon((15, 0), (15,-12), (-15, -12), (-15, 0))`,
|
|
67
|
+
`SetColor(FirstPolygon,"${blueMain}")`,
|
|
68
|
+
`SetColor(SecondPolygon,"#0a6a01")`,
|
|
69
69
|
`SetColor(Ang,"#6a0101")`,
|
|
70
70
|
];
|
|
71
71
|
const ggb = new GeogebraConstructor({
|
|
@@ -90,10 +90,10 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
90
90
|
return question;
|
|
91
91
|
};
|
|
92
92
|
const getRecognizeRefractionOrReflectionAnglesQuestion = () => {
|
|
93
|
-
const
|
|
94
|
-
const
|
|
93
|
+
const enteringLightX = randint(-20, -10);
|
|
94
|
+
const enteringLightY = randint(15, 21);
|
|
95
95
|
const isAsking = random(questionAngle);
|
|
96
|
-
const identifiers = { isAsking,
|
|
96
|
+
const identifiers = { isAsking, enteringLightX, enteringLightY };
|
|
97
97
|
return getQuestionFromIdentifiers(identifiers);
|
|
98
98
|
};
|
|
99
99
|
const getPropositions = (n, { answer }) => {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
2
|
type Identifiers = {
|
|
3
3
|
mass: number;
|
|
4
|
+
optsIdent: Options;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
+
type InputType = "decimal" | "sci";
|
|
7
|
+
type NbDigitsType = 0 | 1 | 2;
|
|
8
|
+
type Options = {
|
|
9
|
+
inputType: InputType;
|
|
10
|
+
nbDigits: NbDigitsType;
|
|
11
|
+
};
|
|
12
|
+
export declare const calculateWeight: Exercise<Identifiers, Options>;
|
|
6
13
|
export {};
|
|
7
14
|
//# sourceMappingURL=calculateWeight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateWeight.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/weight/calculateWeight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"calculateWeight.d.ts","sourceRoot":"","sources":["../../../../src/exercises/pc/weight/calculateWeight.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC;AACnC,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE9B,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC;AAuMF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAc1D,CAAC"}
|